You must have seen a digital weighing machine in numerous shops, but have you ever wondered how it works and how it can be made into a low cost, portable device? If not, then let’s make one.
How digital weighing machine works?
- This digital weighing machine has two 50 kg load cells that have the ability to change its resistance value according to the weight applied on it
- The load cells are then connected to the HX711 module, which is a 24-bit analog to digital converter.Â
- After that, the HX711 module sends the data to a microcontroller, which then processes it and displays the measured value in grams on the OLED screen.
Bill of Material
SoftwareÂ
First, install the required libraries into the Arduino IDE. To do so, go to Sketch → Add library → Library Manager. Now search for the following libraries. (Refer Fig 1.)
- Ug82 libraryÂ
- AdaFruit SSD1306 OLEDÂ
- HX7111 libraryÂ
After setting up the prerequisite libraries, now we can start our coding. In the first part of the code, we will include the libraries and the variables for storing our sensor values. Next we create a setup function, which will setup the serial communication and OLED display. (Refer Fig 2,3)
Next, create a loop function through which we will be able to get the sensor’s output and then display it on OLED screen. (Refer Fig 4.)
Note: To get an accurate reading, you will have to calibrate in such a way that measured value is not affected by any extra weight of the device itself.
Connection
Arduino to OLED display connectionÂ
Arduino Pin | OLEDÂ Pin |
SCL | OLED SCL |
SDA | OLED SDA |
GND | GND |
VCC | VCC of OLED |
Arduino to HX711 Pin connection
Arduino Pin | HX711 Pin |
VCC | VCC |
GND | GND |
A0 | SCK |
A1 | DT |
Load Cell to HX711 connection
Load Cell | Hx711 |
Load Cell 1 White Wire | E+ |
Load Cell 1 Black Wire | E- |
Load Cell 2 White Wire | E- |
Load Cell 2 Black Wire | E+ |
Load Cell 1 Red Wire | A+ |
Load Cell 2 Red Wire | A- |
Testing
Now after connecting all the components, cross check that everything is connected properly, after which you can put all of them in any pocket-sized box of your choice. Finally, connect a battery to your digital weighing machine.Â
Good project. The write up lacks detail. Calibration which is most important is left out
Thank you for your feedback.