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

ESP32-Based Smart Weighing Scale with LCD Display

View and Edit Project In Cirkit DesignerImage of ESP32-Based Smart Weighing Scale with LCD Display

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

Sensors

Power Supply

Display

Passive Components

Switch

Comments

Wiring Details

ESP32-WROOM-32UE

Load Sensor - 50kg

HX711 Weighing Sensor Module

18650 in holder

Resistor (200 Ohms)

Rocker Switch

LCD Display 16x4 I2C

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.