Load cell issues

Hi all,

I have 4 half bridge load cells (See attached to see a picture of one), a HX711 and an Ardunio and I want to make a weighing scales (it will update a google sheet with my weight as I'm planning on losing a few pounds :))

I have done a fair amount of research (as my electrical knowledge is next to nothing at this point) and I think i want a to make a Wheatstone bridge. So I've wired them as the attached schematic (sorry about the crude use of MS paint).

I've checked the resistance coming out of the cells with no load and so I know its the red ones that need to be excited (is that the right word?).

I then upload the code below having installed the relevant library (GitHub - bogde/HX711: An Arduino library to interface the Avia Semiconductor HX711 24-Bit Analog-to-Digital Converter (ADC) for Weight Scales.). The print out from the serial monitor is increasing with no weight on it and also the read out is negative. I ignored this as I've read there is some sliding issue. and maybe once calibrated it would go away.

So I calibrated using a 3kg weight but the continuous increase continues. Any advice as to why this might be happening? Anyone had any experiences of using these load cells and can shed some light on what worked for them?

I've checked the voltage coming out of the Ardunio and it is a steady 4.8v.

Possible causes I can think of;

  1. Faulty load cells, is there any standard test i can run on the load cells to determine if they are functioning as they should

  2. Faulty wiring, at the moment I've just twisted the wires between load cells together as I will solder once I know its working and I don't have to take them apart again.

  3. Faulty HX711, again is there any standard tests I can run to see if this isn't working as it should.

  4. Faulty code, maybe the library isn't good, but others seemed to have used it and be fine.

On a Slightly different note. At the moment I've got them lying on chipboard and then putting another piece of chipboard on top. The cells have 2 rivots on the bottom which make them unstable, would this be causing measurement errors when calibrating? Hows best to mount them in place?

Any help would be greatly appreciated. I thought this project would be relatively simple and its really annoying that it is not working! Also I can't start dieting without a good spreadsheet to show me precisely my progress (defo not procrastination :D) .

Thanks,

Ben

Code:

#include "HX711.h"

HX711 scale;

void setup() {
  Serial.begin(38400);
  Serial.println("HX711 Demo");

  Serial.println("Initializing the scale");
  // parameter "gain" is ommited; the default value 128 is used by the library
  // HX711.DOUT  - pin #A1
  // HX711.PD_SCK - pin #A0
  scale.begin(A1, A0);

  Serial.print("Raw ave(20): \t\t");
  Serial.println(scale.read_average(20));   // print the average of 20 readings from the ADC

  // Scale factor:
  scale.set_scale(19150.f);                      // this value is obtained by calibrating the scale with known weights; see the README for details
  scale.tare();               // reset the scale to 0

  Serial.println("\nAfter setting up the scale:");

  Serial.print("Raw: \t\t\t");
  Serial.println(scale.read());                 // print a raw reading from the ADC

  Serial.print("Raw ave(20): \t\t");
  Serial.println(scale.read_average(20));       // print the average of 20 readings from the ADC

  Serial.print("Raw ave(5) - tare: \t");
  Serial.println(scale.get_value(5));   // print the average of 5 readings from the ADC minus the tare weight, set with tare()

  Serial.print("Calibrated ave(5): \t");
  Serial.println(scale.get_units(5), 1);        // print the average of 5 readings from the ADC minus tare weight, divided
            // by the SCALE parameter set with set_scale

  Serial.println("\nReadings:");
}

void loop() {
  int t, i, n, T;
  double val, sum, sumsq, mean;
  float stddev;
  
  n = 20;
  t = millis();
  i = sum = sumsq = 0;
  while (i<n) {
    val = ((scale.read() - scale.get_offset()) / scale.get_scale());
    sum += val;
    sumsq += val * val;
    i++;
  }
  t = millis() - t;
  mean = sum / n;
  stddev = sqrt(sumsq / n - mean * mean);
  Serial.print("Mean, Std Dev of "); Serial.print(i); Serial.print(" readings:\t");
  Serial.print(sum / n, 3); Serial.print("\t"); Serial.print(stddev, 3);
  // Note: 2 sigma is 95% confidence, 3 sigma is 99.7%
  Serial.print("\nTime taken:\t"); Serial.print(float(t)/1000, 3); Serial.println("Secs\n");

}

I’m not sure how you wire such sensors, having only used full bridge devices with the HX711. - found this link

I thought that a half-bridge load cell had 2 strain gauges and hence 3 wires, which you balanced with a pair of stable equal resistors to make a full bridge... and then coupled to eg a HX711.

How many wires do your 1/2 bridges have?

Strain gauges have terrible temperature coefficients, which is why you must always use them in closely temperature coupled pairs or quads so this effect cancels out.

Could explain your drift.

Allan

I've checked the resistance coming out of the cells with no load and so I know its the red ones that need to be excited (is that the right word?).

No, that's not how debugging works, you provide us with the data, not your interpretation of the data,
otherwise we have no idea at all how these things are wired internally.

You have conventional half-bridges.

Place 2 close together at right angles.

Both reds to vcc.
Both blacks to gnd

One white to INA+, one to INA-.

Strongly recommend solder all joints.

Allan

allanhurst:
Both reds to vcc.
Both blacks to gnd

That would result in zero output from the bridge.
Red/black of ONE load cell needs to be swapped,
assuming pressure on the two cells is in the same mechanical direction.

And ofcourse the load cells should NOT be powered from VCC/ground of the HX711, but from E+ and E- , which is the regulated 4.2volt supply output of the HX711.
Leo..

You're right about the psu - .

But I'd presumed the load cells as orthogonal, not linearly additative. As in a standard beam stress measurement.

Soggy ply is not a good material for accurate measurements - I'd use high tensile steel.

A long time ago a colleague required a strange weighing device, so knowing nothing about strain gauges I
read the literature, and decided I needed some very good steel. I looked in the catalogues and specified EN24T

It had to be machined to a particular shape, so we had a dozen prototypes milled out by a local jobbing machine shop.

When he returned the products he said he'd have to raise the price - it ruined his milling cutters.

EN24T is a bit over the top.

Allan

allanhurst:
But I'd presumed the load cells as orthogonal, not linearly additative. As in a standard beam stress measurement.

Not sure if that reply is meant for me, or if you did understand what I meant.

Two half-bridge load cells in a full bridge must produce opposite differential voltages with weight.

If you just parallel the two cells, then cell output voltage of the two cells changes in the same direction, resulting in a different common mode voltage, but not in a different differential voltage.
Leo..