The objective of this project is to build a digital weighing scale using the ESP8266 NodeMCU microcontroller and the HX711 Load Cell Amplifier module. The system is designed to measure the weight of objects accurately using a load cell sensor and display the measured value on an LCD screen. This project also aims to demonstrate how to interface a sensitive weight sensor with a microcontroller and how to process and display measurement data in real time.
Functioning of the Project:
The project works by using a load cell sensor that detects the force applied when an object is placed on the scale platform. This force produces a very small electrical signal proportional to the weight. The HX711 module amplifies this signal and converts it into digital data that can be read by the ESP8266 NodeMCU. The microcontroller processes these readings, applies a calibration factor to convert the raw values into weight units (usually grams), and then sends the result to an LCD display. The screen continuously shows the measured weight, allowing the user to easily read the value in real time.
1. ESP8266 NodeMCU board

The ESP8266 NodeMCU board is the main microcontroller of the system. It reads digital data from the HX711 module, processes the values, applies calibration, and controls the LCD display. The ESP32 is powerful, fast, and suitable for real-time sensor applications.
2. Load cell sensor

The load cell sensor is the component responsible for measuring weight. It works using strain gauges that change resistance when pressure or weight is applied. When an object is placed on the platform, the load cell slightly deforms and produces a very small analog voltage proportional to the weight.
3. HX711 amplifier module

The HX711 module is a precision 24-bit analog-to-digital converter (ADC) specially designed for weight measurement systems. Since the signal generated by the load cell is extremely small (in millivolts), the HX711 amplifies this weak signal and converts it into digital data that the ESP8266 NodeMCU can read accurately.
4. LCD Display with I2C Module

The LCD I2C display is used to show the measured weight. It receives data from the ESP8266 NodeMCU board and displays the weight value in real time.
5. Breadboard

A breadboard is used to assemble the circuit without soldering. It makes it easy to connect and modify the components during testing and development.
6. Jumper Wires

Jumper wires are used to connect the ESP8266 NodeMCU board, HX711 module, load cell, and LCD display together. They ensure proper electrical connections between all components.


1- Connection of Load cell sensor to HX711 module
| Load cell sensor | HX711 module |
|---|---|
| Red | E+ |
| Black | E- |
| White | A- |
| Green | A+ |
2- Connection of HX711 module to ESP8266 NodeMCU
| HX711 module | ESP8266 NodeMCU |
|---|---|
| VCC | 3V |
| GND | GND |
| DT | D6 |
| SCK | D5 |
3- Connection of LCD I2C display to ESP8266 NodeMCU
| LCD I2C display | ESP8266 NodeMCU |
|---|---|
| VCC | 5V |
| GND | GND |
| SDA | D2 |
| SCL | D1 |
This MicroPython program implements a digital weight scale system using an ESP8266 NodeMCU, an HX711 load cell amplifier, and an LCD I2C display. The program reads weight data from a load cell sensor, processes it using calibration values, and displays the measured weight in grams on the LCD screen.
You need to install this libraries :
i2c_lcd et lcd_api for I2C LCD screen
hx711 for HX711 module
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# Import Pin class to control GPIO pins # Import I2C and SoftI2C classes for I2C communication from machine import Pin, I2C, SoftI2C # Import the library used to control the I2C LCD display from i2c_lcd import I2cLcd # Import time module (used for delays if needed) import time # Import the HX711 library used with the load cell amplifier from hx711 import HX711 # I2C address of the LCD module (commonly 0x27 or 0x3F) I2C_ADDR = 0x27 # Number of rows and columns of the LCD display totalRows = 4 totalColumns = 20 # === Initialize the I2C LCD === # Create a software I2C interface for the ESP8266 # SCL connected to GPIO5 # SDA connected to GPIO4 i2c = SoftI2C(scl=Pin(5), sda=Pin(4), freq=10000) # Create the LCD object using the I2C interface lcd = I2cLcd(i2c, I2C_ADDR, totalRows, totalColumns) # Clear the LCD screen at startup lcd.clear() # Display a startup message on the LCD lcd.putstr("ESP8266 Scale") # Initialize the HX711 module # d_out connected to GPIO12 # pd_sck connected to GPIO14 driver = HX711(d_out=12, pd_sck=14) # Main program loop (runs continuously) while True: # Read the raw value from the HX711 # Apply calibration formula to convert the value to weight weight = abs(183200 - driver.read()) / 238 - 45 # Move the cursor to the beginning of the second line lcd.move_to(0, 1) # Clear the second line to avoid leftover characters lcd.putstr(" ") # Move the cursor again to the beginning of the second line lcd.move_to(0, 1) # Display the measured weight with two decimal places and unit grams lcd.putstr("Weight= " + str(round(weight, 2)) + " g") |
Educational robotics refers to the use of robots and robotics technology to promote learning in educational settings. It involves the integration of technology, engineering, and computer science into the classroom, allowing students to engage in hands-on, project-based learning experiences.
In this context, our website represents an excellent resource for parents, teachers and children who wish to discover robotics.
Zaouiet Kontech-Jemmel-Monastir-Tunisia
Robotic site created by Mohamed Ali Haj Salah - Teacher info