HX711 with 4 equal resistors in a wheatstone bridge config

Hi,

I was trying to debug a HX711 to see if it is functioning correctly. I wired 4 resistors in a wheatstone bridge config to the sensor, and was expecting readings of around 0 when printing on the uart terminal, but I get almost random values, ranging from -100 to 17000, back to 0 and -5000!

Code:

#include <HX711.h>

HX711 scale;

void setup() {}

void loop()
{

int scaleReading = scale.get_value(100);

Serial.println(scaleReading);
}

The bridge was hooked up like image on step 3 https://www.instructables.com/id/How-to-Interface-HX711-Balance-Module-With-Load-Ce/

Is this a normal behaviour of the sensor? I don<t have asecond one to test, and I am wondering if there are specific API calls from the library that could change the reading behaviour of the sensor. Thanks!

No mention of which Arduino, no (actual) picture of the setup, and no resistor values.
Should we guess?

The code has no Serial.begin() call, and you're printing high speed.
Shouldn't you get a delay() call in there (for testing).
Leo..

Yeah sorry nevermind my last post. Here is my real program:

#include <Arduino.h>
#include <SPI.h>
#include <Wire.h>

#include <HX711.h>

HX711 scale;

#define LOADCELL_DOUT_PIN 5
#define LOADCELL_SCK_PIN 6

#define CALIB_FACTOR 2000

void setup()
{
  // put your setup code here, to run once:
  Serial.begin(9600);
  scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN);
  
}

void loop()
{
  // put your main code here, to run repeatedly:
  scale.set_scale(CALIB_FACTOR);
  int scaleReading = scale.get_value(10);
  Serial.print("read: ");
  Serial.println(scaleReading);
}

and what I get:

read: -27392
read: -25140
read: -23049
read: -21095
read: -18751
read: -16869
read: -15026
read: -13780
read: -12019
read: -10716
read: -9037
read: -7788
read: -6188
read: -4132
read: -4370
read: -4061
read: -2540
read: -936
read: 528
read: 1865
read: 3694
read: 4007
read: 3370
read: 4175
read: 5267
read: 4140
read: 4159
read: 4106
read: 4892
read: 5918
read: 5867
read: 4849
read: 4205
read: 2762
read: 1418
read: 749
read: 955
read: 1480
read: 2790
read: 3812
read: 4114
read: 3944

Here is how I hooked up four 100k resistors: (see attachment below)

That’s not a picture of the setup, and I hope you didn’t connect E+ to to a potentially unstable VCC.

100k is too high.
Load cells are commonly <= 1k, to keep noise and offset down.
Try 4x1k, metalfilm 1%.
Leo…

Hi,

thanks for the reply. I tried with 1k resistors that I handpicked with same values read on my multimeter. Still, the values have that weird behavior where they slowly drift, i.e. increase until they reach 32k, then jump to about -32k, and start increasing again, or decrease, etc.

I tried playing around with the calibration factor, but it doesn’t have any effect.

Wawa:
That’s not a picture of the setup, and I hope you didn’t connect E+ to to a potentially unstable VCC.

The VCC I was using for the bridge was the 5V pin on the arduino. Maybe it isnt stable enough? I also tried hooking up the bridge with the same configuration, but while removing the GND and VCC connections (thus leaving only A+/- and E+/-) I get stable -1 values (meaning it could not read correctly I believe), but why is that? Aren’t E+ and E- enough to create a voltage potential between A+ and A-?

I added information on my photo attached below:

Thanks!

JCSB:
The VCC I was using for the bridge was the 5V pin on the arduino. Maybe it isnt stable enough?

The HX711 has it's own regulated/stable 4.25volt excitation output (E+), derived from Arduino's 5volt supply.
Use that to power the bridge.
Leo..

Wawa:
The HX711 has it's own regulated/stable 4.25volt excitation output (E+), derived from Arduino's 5volt supply.
Use that to power the bridge.
Leo..

When I power the bridge with E+, (like on the attached image below) I Seem to get no reading. The serial monitor prints the same value as fast as it can, compared to when I plug E+ to VCC, the values print slower and vary. Is this normal?

read: 13108
read: 13108
read: 13108
read: 13108
read: 13108
read: 13108
read: 13089
read: 13133
read: 13108
read: 13108
read: 13108
read: 13108
read: 13108
read: 13108
read: 13108
read: 13108
read: 12699
read: 14746
read: 13108
read: 13108
read: 13108
read: 13108
read: 13108
read: 13108
read: 13108
read: 13108
read: -13106
read: -13107
read: 13108
read: 13108
read: 13108
read: 13108

Connecting the bridge to E+ E- A+ A- is the only way.

Still no picture of the setup.
Leo..

JCSB:
Hi,

thanks for the reply. I tried with 1k resistors that I handpicked with same values read on my multimeter. Still, the values have that weird behavior where they slowly drift, i.e. increase until they reach 32k, then jump to about -32k, and start increasing again, or decrease, etc.

If they aren’t 0.01% resistors on a temperature-stable heatsink yes they will drift, resistor values are not
constant due to temperature changes caused by self-heating.

Actual strain guages are thermally bonded to each other and well heat-sinked, temperature drift is much
less (still an issue though).

Remember you are performing measurements with this kind of setup to ppm levels of precision…

Wawa:
Connecting the bridge to E+ E- A+ A- is the only way.

Still no picture of the setup.
Leo…

Here, I took a picture of the setup attached below. I still get the readings stuck at 13108 when using this config, are you able to tell if there is an error in the setup?

Thanks for your great help.

MarkT:
If they aren’t 0.01% resistors on a temperature-stable heatsink yes they will drift, resistor values are not
constant due to temperature changes caused by self-heating.

Actual strain guages are thermally bonded to each other and well heat-sinked, temperature drift is much
less (still an issue though).

Remember you are performing measurements with this kind of setup to ppm levels of precision…

This is true, I will switch to strain gauges once I understand why I get those messy readings with resistors. I just can’t find an explaination online to why I get those readings stuck at 13108 when I do not connect my E+ to 5v on the uno and E- to GND.

Here is code again, in case:

#include <Arduino.h>
#include <SPI.h>
#include <Wire.h>

#include <HX711.h>

HX711 scale;

#define LOADCELL_DOUT_PIN 5
#define LOADCELL_SCK_PIN 6

#define CALIB_FACTOR -200

void setup()
{
  // put your setup code here, to run once:
  Serial.begin(9600);
  scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN);
  scale.tare();
  scale.set_scale(CALIB_FACTOR);
}

void loop()
{
  // put your main code here, to run repeatedly:

  int scaleReading = scale.get_value(10);
  Serial.print("read: ");
  Serial.println(scaleReading);
}

While waiting for your image...

E+ should be 4.25volt, E- should be 0volt.

A+ and A- should both be 2.125volt, and there should not be more than 10mV between them
(with DMM pins on A+ and A-).
Leo..

On the green HX711 module GND is not connected to Arduino GND directly but via an input protection diode and so E- is not 0V (measured to Arduino GND) but about 0.6V. I don't remember what is E+.

Never seen that, and I can't imagine it to be right, looking at the HX711 datasheet.
That would seriously reduce the excitation voltage.

Do you have a link to the diagram of that module, or clear pictures of both sides of the board.
Leo..

https://www.eevblog.com/forum/projects/how-can-a-chip-(hx711)-work-without-a-ground-pin-connected/

So sorry! The image on next post (it failed to upload on this one)

Wawa:
While waiting for your image...

E+ should be 4.25volt, E- should be 0volt.

A+ and A- should both be 2.125volt, and there should not be more than 10mV between them
(with DMM pins on A+ and A-).
Leo..

This is interesting, I have 2,7V on all 4 pins (A+/- and E+/-) with this current setup. Do you think of a reason why? I have checked continuity between the 4 pins and none of them is.

ss

Wiring seems ok, apart from too much solder on the pins of the module.

Remove all the wires. and move the module to another position on the breadboard (BB do have bad contacts).

Then only connect VCC/GND to 5volt/GND of the Arduino, and measure E+ with black lead of the DMM on the metal shield of the USB socked (GND).

It should be 4.25volt..... ±0.1volt.

If not, check/re-solder, or try a new HX711 board.
Leo..

Wawa:
Wiring seems ok, apart from too much solder on the pins of the module.

Remove all the wires. and move the module to another position on the breadboard (BB do have bad contacts).

Then only connect VCC/GND to 5volt/GND of the Arduino, and measure E+ with black lead of the DMM on the metal shield of the USB socked (GND).

It should be 4.25volt..... ±0.1volt.

If not, check/re-solder, or try a new HX711 board.
Leo..

Thanks, I measured 0V from E+ to GND, and made sure the 5V was reaching VCC of the HX711 module. I am wondering if it might be a setting that deactivates the E+/- pins sent to the chip (maybe it would be saved on its eeprom?) I am not the first person who used this specific module and I am unaware of any changes that could have been made firmware wise. I cant find anything on the datasheet though..

You could be right.
The chip has a power-down mode, activated with the clock pin.
Not sure if that will also affect the E+ excitation supply.
Haven't got a board handy at the moment, so I have to pass that problem on to another forum member.
Leo..

One of my spares, with the clock pin held low (tied directly to ground):

Vcc=4.97v from a wall wart
E+=4.96v
E-=0.81v

All are relative to the GND pin.

E+ to E- = 4.15v

If the clock pin is floating, the behavior may be undefined.