Numbers are jumping too much
iyssoft opened this issue · 1 comments
I have the same weight on the load cell. Even I am not doing anything , just watching the screen, as you see in the attached image, number jump suddenly almost double . What can be reason here
Thank you so much for the help
//my code is
from HX711 import SimpleHX711, Rate
with SimpleHX711(5, 6, 1489, -367471, Rate.HZ_80) as hx:
while True:
print(hx.weight(1))
It's hard to know what could be causing it, because it could be from a number of issues. But here's what you can try:
-
Because of the way the Raspberry Pi operates, it is impossible* to ensure the values from the HX711 chip are read within the very short frame of time according to the chip's specification. If there are other programs running, especially if they are CPU-bound, that will negatively impact the reliability of this software to obtain accurate values. Try stopping those programs.
-
Try using
nice
to run the Python script. -
Try using
AdvancedHX711
instead ofSimpleHX711
. See here for details. -
If all else fails, try either:
a) increasing the number of samples you obtain; or
b) lengthening the time spent obtaining samples
and then filter them using the median function. Examples of how to do that are here.
* with the current configuration and installation of the software