2
\$\begingroup\$

I bought four 5 kg load cells (link) and connected them all together (all white cables, all green cables, etc.). Then I hooked them up to the HX711:

wiring

When I read the values from the Arduino using the HX711 library, I can read the numbers and I can tara the scale. Here the very simple code (tara is done in the client):

#include "HX711.h"
HX711 scale;

const int LOADCELL_DOUT_PIN = 4;
const int LOADCELL_SCK_PIN = 5;

void setup() {
  pinMode(LOADCELL_DOUT_PIN, INPUT);
  pinMode(LOADCELL_DOUT_PIN, INPUT);
  Serial.begin(9600);
  while (!Serial) {
    ;
  }
  scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN);
}

void loop() {
  if (scale.is_ready()) {
    long reading = scale.read_average(10);
    Serial.print(": ");
    Serial.println(reading);
  } else {
    Serial.println("! not ready");
  }

  delay(300);
}

This works really well and I get realistic, precise measurements. However, the problem is, that the readings drift quite a bit over time. The readings vary 10 to 100 gram in a few seconds. Also it seems to be directional. Often it goes down, down, down, down. And only a few times up. Here a chart of the absolute values (a few minutes, drift of up to 12%):

measurements

I tried using different Arduinos (Uno & Nano). I tried to use four HX711 and yesterday I soldered all cables of the load cells together (but I am still using a bread board and jumper cables for the rest).

I really have no ideas what to try next. Please help.

\$\endgroup\$
3
  • \$\begingroup\$ HX711 is "ratiometric". Try a capacitor (100 nF) directly on pins E+ and E- of the board. E+ and E- are "outputs", I think. So can't be wired to Uno power supply. Decouple also, if needed, VCC and GND on the board. C6 should do it, but perhaps not enough (long wiring). \$\endgroup\$
    – Antonio51
    Commented Nov 29 at 9:26
  • \$\begingroup\$ hey @Antonio51, wow there are a lot of ideas. Thanks! Since I am not a professional, can you "unpack" the things a little for me? - I can add a capacitor. Can you share why this is might solve the problem? - Mmm, so I should not use the power source of the Arduino? Would a powerbank do? (since batteries tend to be more stable?) - What do you mean with "also"? Decouple the Uno and something else too? - What does C6 refer to (googling did not yield results)? \$\endgroup\$
    – Motine
    Commented Nov 29 at 11:40
  • \$\begingroup\$ C6 is the capacitor on the board HX711.. 1uF-10 uF should be ok. Since you are using "long"wires, decoupling more should be ok. Try also torsading this long wires by pair. \$\endgroup\$
    – Antonio51
    Commented Nov 29 at 13:31

1 Answer 1

1
\$\begingroup\$

You've apparently got some reading issues as evidenced by those spikes. Maybe give Sparkfun's library a try.

The downward trend is a bit like load cell creep, but the amount seems large (though perhaps not for a $4 load cell- 10 grams is only 0.2% of full scale) perhaps try replacing the load cells with similar valued precision resistors to determine the source of the drift.

\$\endgroup\$
5
  • \$\begingroup\$ Thanks for the ideas. Just a quick question: Do you see another library than I? When I follow the link on the Sparkfun page, I land on the same library as I shared. \$\endgroup\$
    – Motine
    Commented Nov 29 at 12:22
  • \$\begingroup\$ Yours is github.com/bogde/HX711 and the link I gave is to github.com/sparkfun/HX711-Load-Cell-Amplifier , I don't know if the content is the same, but they are two different github repositories. \$\endgroup\$ Commented Nov 29 at 15:43
  • 1
    \$\begingroup\$ SparkFun uses the same bodge/HX711 library. \$\endgroup\$
    – hcheung
    Commented Nov 29 at 23:46
  • \$\begingroup\$ Okay, kind of looks like a timing issue - maybe the not ready line is being reached. \$\endgroup\$ Commented Nov 30 at 1:34
  • \$\begingroup\$ found it via google: github.com/adafruit/Adafruit_HX711 unfortunately, the library was not the culprit. \$\endgroup\$
    – Motine
    Commented Dec 2 at 9:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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