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?

  • 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". – Chris Stratton May 29 '17 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. – shankar narayan May 31 '17 at 14:01
3

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.

  • Thanks a lot danny for the input. I will check the same. – shankar narayan May 31 '17 at 14:02
0

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.

  • 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. – Chris Stratton Jun 12 '17 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. – shankar narayan Jun 22 '17 at 4:19

protected by VE7JRO Nov 13 at 21:10

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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