In this tutorial, we will see how we can interface HX711 Load Sensor with ARIES v3.0 Board. Using HX711 load sensor you can measure weight of different objects.
HX711 Load Sensor
Above figure shows an weight machine, by interfacing Load Cell and HX711 Weight Sensor.
5kg load cell – A load cell is a transducer that is used to create an electrical signal whose magnitude is directly proportional to the force being measured. Load cells have a strain gauge, which deforms when pressure is applied to it. And then strain gauge generates an electrical signal on deformation as its effective resistance changes on deformation. A load cell usually consists of four strain gauges in a Wheatstone bridge configuration. Load cell comes in various ranges from 1kg to 100kg and more. Here we will be using a 5kg load cell which can measure weight upto 5kgs..
HX711 Load Cell Amplifier – This microchip is specially made for amplifying the signals from load cells and reporting them to another mircocontroller. The load cells plug into this board, and this board tells the Aries what the load cells measure. So HX711 module amplifies the low electric output of Load cells and then this amplified & digitally converted signal is fed into the Aries to derive the weight. For more details refer the datasheet.
5kg load cell
HX711 Load Cell Amplifier
Prerequisites
- Windows 10 or above/Linux (64 bit)
- Arduino IDE
- VEGA ARIES Board support package
Components Required
- ARIES v3.0 Board
- USB type C to USB type A cable
- Load sensor
- Jumper Wires
Note: All of the following boards can be used for this project
Connection Diagram
Connections
HX711 load sensor | ARIES V3 board |
VCC | 3V3 |
GND | GND |
SCK | GPIO-3 |
DT | GPIO-2 |
Libraries
Arduino libraries are an extension of the standard Arduino API and consists of thousands of libraries, both official and contributed by the community. Libraries simplifies the use of complex codes. Every version of Arduino IDE has a library manager for installing Arduino software libraries. The libraries required for this projects are
- HX711_ADC
To install the libraries required for this project.
Go to Tools -> Manage Libraries -> and search for HX711_ADC
Click on Install
Once you have downloaded the required libraries you can upload the code to ARIES board.
Procedure
Open and set up the Arduino IDE as described in Getting Started with ARIES v3.0.
- Make sure you have selected ARIES v3 Board from Tools -> Board -> VEGA Processor: ARIES Boards -> ARIES v3
- Select Programmer as VEGA XMODEM from Tools -> Programmer -> VEGA XMODEM
- Also select appropriate port from Tools -> Port -> COM* (ARIES Board)
For measuring weights, First we should calibrate the sensor using a known weight and then you can see the weight measurements of any object in serial monitor.
Weight Calibration:
Open Files -> Examples -> Under Examples for ARIES v3 -> GPIO -> LOAD_SENSOR -> Weight_Calibration
Steps for Weight Calibration:
1) Prepare an object with a known weight. I used my power bank(1000g).
2) Connect the weight sensor to Aries board,and Open the following code in your Arduino IDE.
3) Inside the code search for the line “known_mass = 1000;” and Substitute this value with the value of your known weight in GRAMS
4) After uploading the code, open the Serial Monitor at a baud rate of 57600.
5) Place the load cell at a level stable surface
6) Follow the instructions on the Serial Monitor: remove any weights from the scale (it will tare automatically).
7) Then Send ‘t’ from serial monitor to set the tare offset.
8) Then, place your known mass on the load-cell (Here i place my power bank which is my known mass with weight of 447 grams). The default value for the known mass in the code is set to 1000. Please replace it with the actual known weight you have available.
9) Then send the weight of this mass (in this example: 447) from serial monitor.
10) Now the calibration using a known weight is completed.
11) Now you can remove the known weight from the load cell and You can measure the weight of any object, by placing the object on the load cell. The maximum weight that can be measured by each load cell will be mentioned in the load cell itself. Here the maximum weight this load cell can measure is 5Kg.
Output
Phone kept on the load cell to measure weight
Book kept on the load cell to measure weight
Weight of the phone measured by the load cell
Weight of the book measured by the load cell
Example 2: Weight Measurement
Similar to the example above, In this demo also , you can see the weight measurements of any object in serial monitor.
Once the Weight Calibration code is done you can open this example from Files -> Examples -> Under Examples for ARIES v3 -> GPIO -> LOAD_SENSOR -> Weight_Measurement.
Once you upload the above code, you can see the weights of different objects which is placed on the load cell that is displayed on the serial monitor placed
Output
Pen kept on the load cell to measure weight
Weight of the pen measured by the load cell
Object kept on the load cell to measure weight
Weight of the object measured by the load cell