I have an application with Arduino + HX711 + 4 50kg load cells with the standard library for Arduino (HX711.h and HX711.cpp). After the scale and tare adjusted, the weight measurement degrades over a few hours causing errors in my measurements. Even if there is no considerable change, will the temperature cause this error? To correct this, I think about implementing a "dynamic tare" that adjusts itself from time to time. Is this the best solution? Another factor is that the measurement does not "lock", it oscillates +- 0.005g.
I suggest you look for the "oscillations" you have discovered and when that occurs, just stop the display with one of the values. Or average the values of the oscillation and use that for the display and don't change it.
Then you will ask how to determine the oscillation. If you can see it, you can program for it.
Paul
Ok, I got it. But this function get_units(x), where x is a number of samples, does for me. The point is that even keeping the same weight, the value comes with different values within this oscillation.
So, ignore them if they are oscillating, or reoccurring small values. If there are any floating point calculations involved, you will always get this.
Paul
Yes. The function returns variable of type float. I will try to change it to long type.
What about the main problem (After the scale and tare adjusted, the weight measurement degrades over a few hours causing errors in my measurements), do you have any suggestions?
I guess you will have to define what you consider degrading. As for the "oscillation" assuming you really meant to type 0.005 kg, That would mean the oscillation is 0.01%
Welcome to the real world. Nothing is perfectly stable. Most things change with temperature and added noise on low level signals cause issues with a sampling A/D
You will have to define your expectations, and the load cells you are using for a better suggestion as to what is possible and / or what can be done to make it better.
The incidence of temperature on the sensor material is an issue. I have implemented a code to auto adjust tare. This solved the problem initially, but I'm still going to work on it because this solution is a bit complex and does not reach the cause of the problem.