Measuring weight with Arduino

While there are different solutions to achieve weight measuring, it seems the cheapest and neatest way is to use the HX711 amplifier and A/D converter.


Of course, a test weight is needed for you to be able to set the scale right. In my case that is going to be done by that idler that totals 11.30 grams. My sample load cell is a 100 grams unit so it is not that bad, but for a larger end scale, you want to have a test weight at least 10% of end of scale value.

What HX711 does is two things, on one hand, it is a precision low-noise amplifier for the load cell signal and on the other hand, it performs a 24-bit analog to digital conversion (much higher resolution than the 10-bit resolution of the Arduino built-in analog inputs).
Once data is converted to digital format, Arduino can read it from the HX711 using a two-wire serial interface. It basically streams the 24-bit value on one pin while the other provides the clock signal for the transfer. There are several Arduino libraries for that.
You want to wire the HX711 board (I used one I bought off eBay) to be close to the load cell. Example code is very simple and just provide you a numerical value that represents the digital number provided by the HX711 representing the current measurement.

My load cell is measuring around 106088 units (after I have divided by 100 the measured value to filter out most of the noise). And once I place the test weight on the load cell I get the measurement of 104635 units. That means the difference, that is 1.453 units, represents the weight of my test weight. Given that I know its real weight is 11.30 grams, that means there are 128.58 units per gram.

So, to measure in grams any other weight what I do is
grams = ( 106088 - measurement )/ 128.58;

Given my setup, each weight I measure is giving me a smaller number than the one I get when the scale is empty. If yours is the opposite, just invert the two terms (the zero-value and the measurement) or just consider the magnitude and not the sign of the value. 



Please note that even though I have divided the measured values by one hundred, there is still some jitter on the measured value. For better accuracy, you may want to average several measurements together.

Comments

Unknown said…
Add a nice simple low pass filter and you are good to go.
I have build a arduino scale with with 4 load cells in this style:

https://www.instructables.com/id/Arduino-Bathroom-Scale-With-50-Kg-Load-Cells-and-H/

I have used a serial lcd with it becouse of the simple wiring:

https://www.instructables.com/id/How-to-connect-a-serial-LCD-with-an-Arduino-Nano/

Popular posts from this blog

VFD control with Arduino using RS485 link

How to get sinusoidal s-curve for a stepper motor

Stepper motor step signal timing calculation