Electronic – Arduino weight sensor value increasing/decreasing for no reason

arduinosensorvoltage-regulator

I connected a weight sensor like this one to this load cell amplifier based on hx711 and I use an Arduino (Uno or nano) to get the readings. I have no other components to my circuit and it is built on a breadboard.

Everything works fine except that my readings are never perfectly stable, it's either increasing or decreasing over time. For example, over the course of 2-3 hours, the reading will go from 47.50 grams to 48.30 grams and continue increasing for at least a couple days where I end up with a 3-4 grams difference(I never actually waited enough to see where it ends). Of course, this happens even if there is absolutely no additional pressure applied to the weight sensor.

I tried connecting the sensor to a 5v voltage regulator but get the exact same result. It looks like either the resistance builds in the sensor or the voltage is increasing/decreasing in the Arduino but I can't point a finger to what generates this behavior and what to do about it.

Any ideas are welcomed as I've been struggling to find a solution to this for days now.

Precisions

I'm building an automated cat feeder which drops the required amount of food into a drawer. Once full, the drawer gets out of the feeder and the cat can eat. Once empty, the drawer gets back inside until the next feed. The problem is that it is pretty hard to predict when the cat will be finished eating if the sensor data keeps increasing by itself. Sometimes, the cat can take a few hours to eat everything. If I close the drawer and there is still food in, the tare process is underminded and after a couple of days, the amount of food being dropped is far from what it should be.

Best Answer

After many trials I found out that the issue came from 2 places:

1 - the scale.get_units() function provided in the hx711 library allows to specify the number of samples to average in order to get a more precise reading. When I changed the number of samples from 20 to 1, the values stopped jumping around and I got a more flat line. (+- 0.02 grams between values). There is probably a bug in the library since the result should have been the reverse.

2 - I had "noise" in my circuit and resoldering parts of it solved another intermittent variation in values I experienced.

I ran tests over a period of 8 hours and could notice the readings going slightly up, then down and probably back up if I waited longer. Variations were of 0.8 grams over 8 hours like shown here:

enter image description here

I now account for these variations using software to calculate a drift value.

Thanks for all the help!