2

Am interfacing HX711 with arduino to measure the load of something. However, in my project, I need to continuously monitor the load.

I get fairly accurate values most of the time however, at times I suddenly get a junk value. For example, I call the weight function every 3 seconds and I have placed a 10kg weight, this is what I get. 17.25 is the concern.

10.04, 10.03, 17.25, 10.04, 10.03, 10.03

Am using HX711 library and my process function is a simple call as shown below.

float Processweight()
{
  Serial.print(scale.get_units(40), 2);

  scale.power_down();              // put the ADC in sleep mode
  delay(500);
  scale.power_up();
}

is there something that am missing? What could cause the wrong values?

2
  • Actually debugging that would require examining the code and circuitry in detail. If you don't need answers quickly, you could try a filter; not something that averages but something that rejects rapid change. Also be aware in your application of the load cell behavior called "creep". May 29, 2017 at 17:23
  • Thanks chris, I will try writing a correlation to reject sudden changes. However, I was curious to understand if HX 711 itself has such issues. I will sure use filtering if I get confident that I have done everything else right. May 31, 2017 at 14:01

2 Answers 2

2

I get fairly accurate values most of the time however, at times I suddenly get a junk value.

if you use the ebay board, it has the incorrect grounding, which may contribute to the sporadic values you saw.

For example, I call the weight function every 3 seconds

poor quality libraries could be another possibility.

I have used the board quite extensively and aside from its tempco, it is fairly reliable. you can see here: https://dannyelectronics.wordpress.com/2015/10/25/a-hx711-based-milliohm-meter/

when everything is done right (and in a constant temperature environment), it has very good consistency.

1
  • Thanks a lot danny for the input. I will check the same. May 31, 2017 at 14:02
1

Finally I got this right by adding a code to check if 5 consecutive values are fairly close enough and only then respond. That way I was able to flush out sudden changes. However, I still am not sure as to what is causing that jump.

2
  • The power down and power up could be an issue. Probably you should add some delay between the power up and reading attempt. Also, you may want to examine the wrong values and see if there is any pattern to them. Jun 12, 2017 at 17:32
  • Thanks for the leads chris, the wrong values had no recognizable pattern. I have tried adding delay, in fact I fully removed the power up and power down cycle (always kept it powered up) and I still saw the issue. Jun 22, 2017 at 4:19

Not the answer you're looking for? Browse other questions tagged or ask your own question.