Circuit Documentation
Summary
This circuit is designed to measure weight using a Load Sensor (50kg) interfaced with an HX711 Weighing Sensor Module. The data from the HX711 is processed by an ESP32-WROOM-32UE microcontroller and displayed on an LCD Display (16x4 I2C). The circuit is powered by an 18650 battery in a holder, and a Rocker Switch is used to control the power supply to the ESP32 microcontroller. The circuit also includes two 200 Ohm resistors for signal conditioning or pull-up/pull-down purposes.
Component List
Microcontroller
- ESP32-WROOM-32UE: A powerful microcontroller with Wi-Fi and Bluetooth capabilities, featuring a wide range of GPIO pins for interfacing with various sensors and peripherals.
Sensors
- Load Sensor - 50kg: A strain gauge-based sensor used for measuring weight up to 50 kilograms.
- HX711 Weighing Sensor Module: A precision 24-bit analog-to-digital converter (ADC) designed for weigh scales and industrial control applications to interface directly with a bridge sensor.
Power Supply
- 18650 in holder: A rechargeable lithium-ion battery used to power the circuit.
Display
- LCD Display 16x4 I2C: A liquid crystal display with an I2C interface used to show the weight measured by the Load Sensor.
Passive Components
- Resistor (200 Ohms): Two resistors, possibly used for signal conditioning or as pull-up/pull-down resistors.
Switch
- Rocker Switch: A switch to control the power supply to the ESP32 microcontroller.
Comments
- Comment: Placeholder components that may represent annotations or notes in the circuit design.
Wiring Details
ESP32-WROOM-32UE
3v3connected to HX711 VCC and LCD Display VCCGNDconnected to HX711 GND, LCD Display GND, and 18650 battery holder GND5Vconnected to Rocker Switch18(SCK) connected to HX711 CK/TX19(DOUT) connected to HX711 DO/RX21(SDA) connected to LCD Display SDA22(SCL) connected to LCD Display SCL
Load Sensor - 50kg
Wconnected to HX711 A-Rconnected to HX711 E+ and one end of a 200 Ohm ResistorBconnected to HX711 E- and one end of a 200 Ohm Resistor
HX711 Weighing Sensor Module
A-connected to Load Sensor WE+connected to Load Sensor R and one end of a 200 Ohm ResistorE-connected to Load Sensor B and one end of a 200 Ohm ResistorA+connected to the other ends of both 200 Ohm ResistorsVCCconnected to ESP32 3v3CK/TXconnected to ESP32 GPIO 18DO/RXconnected to ESP32 GPIO 19GNDconnected to ESP32 GND
18650 in holder
GNDconnected to ESP32 GNDVCCconnected to one side of the Rocker Switch
Resistor (200 Ohms)
- Two resistors with one end connected to HX711 E+ and E-, and the other ends connected to HX711 A+
Rocker Switch
- One side connected to 18650 battery holder VCC
- The other side connected to ESP32 5V
LCD Display 16x4 I2C
SCLconnected to ESP32 GPIO 22SDAconnected to ESP32 GPIO 21VCCconnected to ESP32 3v3GNDconnected to ESP32 GND
Documented Code
ESP32-WROOM-32UE Code
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include "HX711.h"
// HX711 circuit wiring
const int LOADCELL_DOUT_PIN = 19;
const int LOADCELL_SCK_PIN = 18;
HX711 scale;
LiquidCrystal_I2C lcd(0x27, 16, 2); // Set the LCD address to 0x27 for a 16 chars and 2 line display
void setup() {
Serial.begin(115200);
lcd.begin();
lcd.backlight();
scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN);
scale.set_scale(); // Adjust to this calibration factor
scale.tare(); // Reset the scale to 0
lcd.setCursor(0, 0);
lcd.print("Weight:");
}
void loop() {
if (scale.is_ready()) {
float weight = scale.get_units(10); // Get the average of 10 readings
Serial.print("Weight: ");
Serial.print(weight);
Serial.println(" kg");
lcd.setCursor(0, 1);
lcd.print(weight);
lcd.print(" kg "); // Clear any extra characters
} else {
Serial.println("HX711 not found.");
}
delay(1000);
}
This code initializes the HX711 and LCD display, then continuously reads the weight from the HX711 and displays it on the LCD and the serial monitor. The scale.set_scale() function needs to be adjusted with the correct calibration factor for accurate readings. The scale.tare() function resets the scale to zero. The weight is displayed on the LCD and printed to the serial monitor every second.
