Learn how to build a weight measuring system with an Arduino, HX711, and a load cell.
In this tutorial, I will explain how to build a weighing scale with an Arduino, an HX711, and a load cell.
Electronic weighing machines use load cells to calculate the load or the actual pressure produced by the load. There are many types of load cells and each follows the method of strain gauge, which converts the pressure (force) into an electrical signal in real time. These load cells consist of four strain gauges hooked up in a Wheatstone bridge formation.
Wheatstone Bridge Formation of the Load Cell
Whenever we apply the load, the resistance of the strain gauge in the load cell will change. Hence, the output voltage from the load cell changes allowing us to measure the load value.
The Wheatstone bridge formation of a load cell.
The HX711 is a precision 24-bit analog to digital converter (ADC) designed for weigh scales and industrial control applications to interface directly with a bridge sensor.
It is specially designed for high precision electronic scale design, with two analog input channels, and a programmable gain amplifier. The input circuit can be configured to provide a bridge type configuration. It is very precise, affordable, and works well for sampling a front-end module.
- Load cell
- HX711 module
- Some jumper wires
- Character LCD 16X2
- Cardboard, bottle caps, and some bolts
The project's required materials.
A load cellâs range can vary greatly. In the project, we use a load cell that can weigh up to 20kg. We will also be using a character LCD to display the load cellâs reading.
Wire everything as listed in the table below.
GND Arduino Pin*
+ 5V Arduino Pin
Resistor or potentiometer to ground
Arduino pin 12
Arduino pin 11
Arduino pin 10
7 No connection
8 No connection
9 No connection
10 No connection
11 (Data 4)
Arduino pin 5
12 (Data 5)
Arduino pin 4
13 (Data 6)
Arduino pin 3
14 (Data 7)
Arduino pin 2
15 Backlight +
Resistor to Arduino pin 13**
16 Backlight GND
GND Arduino pin*
Connect the load cell wires to the HX711 module based on their color. Then connect DAT (data) pin to Arduino Analog pin A3 and connect CLK (clock) pin to Arduino analog pin A2. Connect Vcc and GND supply from Arduino power source pins. Also, connect a simple push button for calibration.
Here is the Fritzing diagram:
Fritzing diagram of the load cell to the HX711 module.
When everything is connected, it should look like this:
The actual circuit connection.
Setting Up the Load Cell
Look for the arrow when you're setting up the load cell.
Check the arrow on the load cell. It tells us the direction that we need to apply force. You can assemble the load cell as shown in the figure above using metal strips. Just attach the metal strip on the load cell using bolts. Or you can simply attach bottle caps with bolts by making a hole in the bottle caps as I did in the image below.
Attached bottle cap with bolts to the load cell.
The load cell build between the pieces of cardboard.
Another view of the load cell build.
Project Source Code
const int rs = 12, en = 11, d4 = 4, d5 = 5, d6 = 6, d7 = 7;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
#define DT A2
#define SCK A3
#define sw 3
unsigned long readCount(void)
unsigned long Count;
unsigned char i;
lcd.print(" Weight ");
lcd.print(" Measurement ");
lcd.print("Put 100g & wait");
val=val/100.0; // put here your calibrating weight
Testing the System
After uploading the code, put the 100g weight and wait for calibration. After calibration, weight measurement should proceed normally.
Put 100g on the build and wait for calibration.
After calibration, your LED screen will show that it's ready to weigh objects!