In this tutorial, we’ll be using the Arduino digital weight scale HX711 load cell module. This module is perfect for measuring weight, force, or anything else that can be measured in grams. The module is easy to use and can be connected to any Arduino board. Check here Measure Weight Using Arduino With Load Cell & HX711 Module
The HX711 load cell module is a precision 24-bit analogue-to-digital converter (ADC) used to measure weight or force.
Required Material
HX711 Module for load cells
The HX711 module is a load cell amplifier that is used to interface load cells with Arduino. The HX711 module amplifies the small signal from the load cell and converts it into a digital signal that can be read by the microcontroller. The digital signal can be used to calculate the weight or force exerted by the load cell. The HX711 module can be used with a variety of different load cells, including strain gauge load cells.
Interfacing HX711 Module & I2C Display With Arduino
The load cell is connected to the HX711 module. The load cell has four wires, which must be connected to the first four pins of the HX711 module. We have an I2C LCD, so connect SDA to A4 and SCL to A5.
Connect the GND of the LCD, HX711 and Arduino to the GND, and also connect VCCs to the 5V+ pin of Arduino.
- Red wire to E+
- Black wire to E-
- White wire to A-
- Green wire to A+.
How to Mount the Load cell
The load cell has four screw holes, two on both sides. Any one side must remain stationary for best accuracy; it may be mounded to a plank of wood with reasonable weight and a relatively non-deformable surface.
Source Code-
Download Requires Libraries
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 65 66 67 68 69 70 71 72 73 74 75 76 77 |
#include <HX711.h> #include <Wire.h> #include <LiquidCrystal_I2C.h> #define DOUT A1 #define CLK A0 HX711 balanza(DOUT, CLK); //Create the lcd object address 0x27 and 16 columns x 2 rows LiquidCrystal_I2C lcd(0x27, 16, 2); //Variables for calibration int weight_conocido=493;//493 grams //functions void Calibrar(void); void setup() { Serial.begin(9600); // Initialize the LCD lcd.init(); //Turn on the backlight. lcd.backlight(); Calibrar(); Serial.println("ready to weight"); } void loop() { float weight= balanza.get_units(10); if(weight<1) weight=weight*-1; lcd.clear(); lcd.setCursor(0, 0); lcd.print("weight:"); lcd.setCursor(5, 0); lcd.print(weight,1); lcd.print(" g"); Serial.print("weight: "); Serial.print(weight, 1); Serial.println(" g"); delay(50); } void Calibrar(void) { float escala; float medicion; balanza.set_scale(); //The default scale is 1 balanza.tare(20); //20 measurements for(int i=3;i>=0;i--) { lcd.print("place the weight"); lcd.setCursor(0,1); lcd.print(i); medicion=balanza.get_value(20);//20 measurements lcd.clear(); } for(int i=3;i>=0;i--) { lcd.print("Remove the weight"); lcd.setCursor(0,1); lcd.print(i); delay(1000); lcd.clear(); } escala=medicion/weight_conocido; balanza.set_scale(escala); } |
Conclusion
In ending, the Arduino digital weight scale HX711 load cell module is a great way to measure weight. It is accurate and easy to use.