Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino UNO-Based Smart Weight and Motion Sensor with Bluetooth Connectivity

View and Edit Project In Cirkit DesignerImage of Arduino UNO-Based Smart Weight and Motion Sensor with Bluetooth Connectivity

Circuit Documentation

Summary

This circuit integrates an Arduino UNO microcontroller with various sensors and modules, including an HX711 load cell amplifier, an MPU6050 accelerometer and gyroscope, an HC-SR04 ultrasonic sensor, an HC-05 Bluetooth module, and several LEDs. The circuit is designed to measure weight, detect orientation, measure distance, and communicate wirelessly via Bluetooth. Additionally, it includes a buzzer for alerting based on specific conditions.

Component List

  1. Arduino UNO

    • Description: Microcontroller board based on the ATmega328P.
    • Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0, A1, A2, A3, A4, A5, SCL, SDA, AREF, D13, D12, D11, D10, D9, D8, D7, D6, D5, D4, D3, D2, D1, D0
  2. HX711 - Bridge Sensor Interface

    • Description: Load cell amplifier for weight measurement.
    • Pins: E+, E-, A-, A+, B-, B+, GND - GROUND, DATA (OUT), SCK - CLOCK (IN), 3.3/3.5V Supply
  3. MPU6050

    • Description: Accelerometer and gyroscope sensor.
    • Pins: vcc, gnd, scl, sda, xda, xcl, AD0, int, 3.3v
  4. Load Sensor - 50kg

    • Description: Load cell for weight measurement.
    • Pins: W, R, B
  5. HC-SR04 Ultrasonic Sensor

    • Description: Ultrasonic distance sensor.
    • Pins: VCC, TRIG, ECHO, GND
  6. LED: Two Pin (red)

    • Description: Red LED.
    • Pins: cathode, anode
  7. LED: Two Pin (green)

    • Description: Green LED.
    • Pins: cathode, anode
  8. LED: Two Pin (blue)

    • Description: Blue LED.
    • Pins: cathode, anode
  9. Resistor (1k Ohms)

    • Description: Resistor with 1k Ohms resistance.
    • Pins: pin1, pin2
  10. HC-05 Bluetooth Module

    • Description: Bluetooth module for wireless communication.
    • Pins: Key, VCC, TXD, RXD, State, GND
  11. 7.4v Battery

    • Description: Power supply.
    • Pins: +, -

Wiring Details

Arduino UNO

HX711 - Bridge Sensor Interface

MPU6050

Load Sensor - 50kg

HC-SR04 Ultrasonic Sensor

LED: Two Pin (red)

LED: Two Pin (green)

LED: Two Pin (blue)

Resistor (1k Ohms)

HC-05 Bluetooth Module

7.4v Battery

Documented Code

#include <Wire.h>
#include <Adafruit_MPU6050.h>
#include <Adafruit_Sensor.h>
#include <HX711_ADC.h>
#if defined(ESP8266) || defined(ESP32) || defined(AVR)
#include <EEPROM.h>
#endif

// Pins for HX711
const int HX711_dout = 4; // HX711 DOUT
const int HX711_sck = 5;  // HX711 SCK

// HX711 Object
HX711_ADC LoadCell(HX711_dout, HX711_sck);

// MPU6050
Adafruit_MPU6050 mpu;

// Ultrasonic sensor
const int trigPin = 9;
const int echoPin = 10;
long duration;
int distanceCm;
int oldValue = 0, newValue = 0;

// Buzzer
#define BUZZER_PIN 7
#define ANGLE_THRESHOLD 60.0 // Threshold in degrees

// EEPROM Address for HX711 Calibration
const int calVal_eepromAdress = 0;

// Timing variables
unsigned long t = 0;

void setup() {
  // Serial Communication
  Serial.begin(115200);
  Wire.begin();

  // HX711 Initialization
  LoadCell.begin();
  unsigned long stabilizingtime = 2000; 
  boolean _tare = true;
  LoadCell.start(stabilizingtime, _tare);
  if (LoadCell.getTare