Arduino Scale With HX711 Using Visuino

by RonFrtek in Circuits > Arduino

131 Views, 2 Favorites, 0 Comments

Arduino Scale With HX711 Using Visuino

2024-08-10_9-33-152.jpg

In this tutorial we will learn how to use a HX711 Load Cell Amplifier and ADC module to build the scale with Arduino, OLED Display and Visuino.

Watch the video!

Also make sure to check out this tutorial for more details: Arduino Nano and Visuino: Measure Weight With HX711 Load Cell Amplifier and ADC

What You Will Need

Scale With HX711.png
VisuinoAdvrtisemenM5StackCoreS3.jpg
breadboard.png
F5OFEUQJJ4ZYFKY.LARGE.jpg
oled.jpg
FNLOD2CKEY93G5N.jpg
  • Arduino board (or any other board)
  • Breadboard
  • One Weight Load Cell
  • One HX711 ADC Sensor Module for Load Cells
  • OLED Display
  • Jumper wires
  • Visuino program: Download Visuino


Note: You can purchase online Weight Load Cell and HX711 ADC Sensor Module together already as a kit.

The Circuit

HX711.jpg
  • Connect the Red wire from the Load Cell (Picture 1) to the E+ pin of the HX711 module
  • Connect the Black wire from the Load Cell (Picture 1) to the E- pin of the HX711 module
  • Connect the White wire from the Load Cell (Picture 1) to the A- pin of the HX711 module
  • Connect the Green wire from the Load Cell (Picture 1) to the A+ pin of the HX711 module


  • Connect HX711 ADC Sensor Module Ground wire(Black wire) to Ground pin of the Arduino board
  • Connect HX711 ADC Sensor Module Power wire(Red wire) to 5V pin of the Arduino board
  • Connect HX711 ADC Sensor Module  DT wire(Green wire) to Digital pin 3 of the Arduino Nano board
  • Connect HX711 ADC Sensor Module  SCK wire(Yellow wire) to Digital pin 2 of the Arduino Nano board


  • Connect OLED Display pin [SCL] to Arduino pin [SCL]
  • Connect OLED Display pin [SDA] to Arduino pin [SDA]
  • Connect OLED Display pin [VCC] to Arduino pin [5v]
  • Connect OLED Display pin [GND] to Arduino pin [GND]


Start Visuino, and Select the Arduino Board Type

select-board-uno.jpg
Visuino-Select-Board-UNO.jpg

Start Visuino as shown in the first picture Click on the "Tools" button on the Arduino component (Picture 1) in Visuino When the dialog appears, select "Arduino UNO" as shown on Picture 2

In Visuino Add Components

2024-08-08_11-43-09.png
2024-08-08_11-44-05.png
  • Add "Weight Scale HX711" component
  • Add "OLED I2C" component

In Visuino Set Components

2024-08-08_11-47-01.png
2024-08-08_11-50-15.png
2024-08-08_11-50-33.png
  • Double click on the "DisplayOLED1" and in the "Elements" window drag "Draw Text" to the left side and in the "Properties" window set "Size" to 2 and "Text" to "Weight (g)"
  • In the "Elements" window drag "Text Field" to the lefty side and in the "Properties" window set "Size" to 3 and "Y" to 30
  • Close the "Elements" window


After Uploading the Project we will start with the Calibration.

In Visuino Connect Components

2024-08-08_11-56-28.png
Scale.png
  • Connect Arduino Digital pin [2] to "WeightScale1" pin [Sensor Data]
  • Connect "WeightScale1" pin [Sensor Clock] to Arduino Digital pin [2]
  • Connect "WeightScale1" pin [Out] to "DisplayOLED1" > "Text Field1" pin [In]
  • Connect "DisplayOLED1" pin I2C [Out] to Arduino pin I2C [In]
  • For Calibration only also Connect "WeightScale1" pin [Out] to Arduino Serial Pin [In]

Generate, Compile, and Upload the Arduino Code

Visuino-Compile-UNO.jpg

In Visuino, at the bottom click on the "Build" Tab, make sure the correct port is selected, then click on the "Compile/Build and Upload" button.

In Visuino: Set the Weight Zero Offset for the HX711 Component

2024-08-08_12-05-26.png
2024-08-10_9-38-00.jpg
2024-08-10_9-40-45.jpg
2024-08-10_9-44-39.jpg
  • Open Serial Terminal Tab in Visuino, Set the correct Port, Click "Connect" button and you will see the value measured by the HX711 module
  • Copy one Value in our case it is 104216 and in Visuino select "WeightScale1" component and in the "Properties" window set "Offset" to Minus the value, in our case: -32899

Upload the Project to the Arduino Board and Open and Connect the Serial

  • Now place 1 gram weight on the Weight Load Cell In my case I just placed a 1000mg Vitamin C pill, but you can place any other object for example 100g chocolate and divide the final value by 100 to get the 1g value out.
  • The value that you now see in the Serial window put in the "Properties" window under "Scale Divider" in my case it is 740
  • Now the Scale is more or less calibrated, of course you can play with the values to really Fine Tune it.
  • You can now disconnect the wire going from "WeightScale1" pin [Out] to Arduino Serial Pin [In]

Upload the Project again to the Arduino Board and you should see the weight Value on the OLED Display

Play

Congratulations! You have completed your project with Visuino. Also attached is the Visuino project, that I created for this tutorial, you can download it and open it in Visuino: https://www.visuino.eu

Downloads