Load Cell No Analog Output with HX711

Hi guys,

I'm currently working on a small project that consists of:

1 x Arduino Uno
1 x HX711

1 x Breadboard
1 x Load Cell from 0.1g to 500g Jewelry Scale from Ebay. I took the load cell out of that.
http://www.ebay.com.au/itm/172127193402

My project is to measure the weight of products between 0.1g to around 500g, so nothing too heavy. I hooked everything up and used the code from Sparkfun to calibrate my scale. The way I hooked everything up is identical to the image below(image from Sparkfun).

NOTE: The the green wire above is blue in my situation

When I run the code:

/*
 Example using the SparkFun HX711 breakout board with a scale
 By: Nathan Seidle
 SparkFun Electronics
 Date: November 19th, 2014
 License: This code is public domain but you buy me a beer if you use this and we meet someday (Beerware license).
 
 This is the calibration sketch. Use it to determine the calibration_factor that the main example uses. It also
 outputs the zero_factor useful for projects that have a permanent mass on the scale in between power cycles.
 
 Setup your scale and start the sketch WITHOUT a weight on the scale
 Once readings are displayed place the weight on the scale
 Press +/- or a/z to adjust the calibration_factor until the output readings match the known weight
 Use this calibration_factor on the example sketch
 
 This example assumes pounds (lbs). If you prefer kilograms, change the Serial.print(" lbs"); line to kg. The
 calibration factor will be significantly different but it will be linearly related to lbs (1 lbs = 0.453592 kg).
 
 Your calibration factor may be very positive or very negative. It all depends on the setup of your scale system
 and the direction the sensors deflect from zero state
 This example code uses bogde's excellent library: https://github.com/bogde/HX711
 bogde's library is released under a GNU GENERAL PUBLIC LICENSE
 Arduino pin 2 -> HX711 CLK
 3 -> DOUT
 5V -> VCC
 GND -> GND
 
 Most any pin on the Arduino Uno will be compatible with DOUT/CLK.
 
 The HX711 board can be powered from 2.7V to 5V so the Arduino 5V power should be fine.
 
*/

#include "HX711.h"

#define DOUT  3
#define CLK  2

HX711 scale(DOUT, CLK);

float calibration_factor = -7050; //-7050 worked for my 440lb max scale setup

void setup() {
  Serial.begin(9600);
  Serial.println("HX711 calibration sketch");
  Serial.println("Remove all weight from scale");
  Serial.println("After readings begin, place known weight on scale");
  Serial.println("Press + or a to increase calibration factor");
  Serial.println("Press - or z to decrease calibration factor");

  scale.set_scale();
  scale.tare(); //Reset the scale to 0

  long zero_factor = scale.read_average(); //Get a baseline reading
  Serial.print("Zero factor: "); //This can be used to remove the need to tare the scale. Useful in permanent scale projects.
  Serial.println(zero_factor);
}

void loop() {

  scale.set_scale(calibration_factor); //Adjust to this calibration factor

  Serial.print("Reading: ");
  Serial.print(scale.get_units(), 1);
  Serial.print(" lbs"); //Change this to kg and re-adjust the calibration factor if you follow SI units like a sane person
  Serial.print(" calibration_factor: ");
  Serial.print(calibration_factor);
  Serial.println();

  if(Serial.available())
  {
    char temp = Serial.read();
    if(temp == '+' || temp == 'a')
      calibration_factor += 10;
    else if(temp == '-' || temp == 'z')
      calibration_factor -= 10;
  }
}

I get 0g as my starting weight and when I try and calibrate by using the a,z, - or + the the weight doesn't change with or without a known weight. See below.

My first bet would be the type of load cell as I can't find the actual manufacture. I did some voltage testing shown below. They're the same voltage with or without the weight. Maybe too minor to realise the voltage variation?

Voltage across:
Red Wire (E+) and Black Wire (E-): 4.02V.
Red Wire (E+) and Blue Wire (A-): 2.02V
Red Wire (E+) and White Wire (A+): 1.99V

Blue Wire (A-) and White Wire (A+): 0.030V

Black Wire (E-) and Blue Wire (A-): 1.99V
Black Wire (E-) and White Wire (A+): 2.02V

Resistance across:
E+ and E-: 1kOhm
E+ and A-:742Ohm
E+ and A+: 748Ohm
A- and A+: 1kOhm

The voltage output at the output is 30mV with or without the load so that could be causing the issue?.

HOWEVER, when I pull out either A- or A+, I get some readings and I can adjust the calibration factor using the a,z, - and +. See below.

Can someone shed some light on this?. Thank you.

"No load" 30mV between blue and white is "out of range" for the HX711 with a gain of 128.
Measure between blue and white with a DMM, and try if you can get that down by pushing/lifting the platter. Maybe the platter is too heavy, or you have distorted the load cell.
Leo..

Hi Leo,

Thanks for the response.

So with a load of 300 grams, I get 32mV, so 2mV difference. With no load, it's at 30mV.

I'm assuming it could be the load cell itself.

Did you apply excessive force to the load cell at some stage.
Is the platter heavy.
I think DMM readings have to be within +/-20mV without and with max load.
What are the readings if you mount the load cell upside down.
I had to apply some mechanical force once to a load cell to get it within range.
Do that as a last resort.
Leo..

Or trim one output of the loadcell with a 50k linear pot?

Yes, you could add an offset voltage to one input of the HX711.
Even with a fixed high value fixed resistor to +E or -E.
But you might introduce some temp dependency that way.
Last time I just put a big screwdriver under the load cell, and forced it in small steps untill the output voltage was in range.
I guess it could be done without HX711.
With the load cell (and blocks of wood) in a vice, and a 9volt battery to red and black.
And the DMM connected to blue and white.
Leo..

I may have added some force prior to installing the load cell into my project which could be causing the 30mV @ no load.

Wawa and MarkT, I will try both methods if I don't get it working.

Quick question:

Extract from hx711 datasheet:

Channel A differential input is designed to
interface directly with a bridge sensor’s
differential output. It can be programmed with a
gain of 128 or 64. The large gains are needed to
accommodate the small output signal from the
sensor. When 5V supply is used at the AVDD pin,
these gains correspond to a full-scale differential
input voltage of ±20mV or ±40mV respectively.

If my wheatstone bridge voltage output is giving in the 30mV range, does that mean the amplifier is producing a gain of 64 and not 128?.

Wouldn't the gain of 64 be enough to produce some linear result?.

My understanding is that the software sets the gain.
And the full weight/no weight has to be in the corresponding range to prevent the input stage from clipping.
Don't know how to lower the gain. You could look through the library files.
Much easier to just try a ~100k resistor from A+ to E-
Leo..

Hey Leo,

So I had time today figure out the issue and I got something working.

I got it working first by setting the gain to 64 in the hx711.h file rather than the default 128. That would set the max input into differential opamp to 40mA rather than the 20mA so essentially it was clipping the voltage output.

I wanted to set the gain to 128 to be more accurate so I set the default back to 128 and offset the voltage by adding a 1kOhm in series to the E- wire(ground). This brought the no load voltage down to 15.1mV from 30mV (in range for the diff voltage input).

I then set my calibration factor and I expected at @ no load there would be 0g (I'm using grams). However I get -0.2g from the very beginning every time. When I add the known weight, I'll get a reading and it's always 0.2g less.

Does anyone know the issue around that?.

JamesDoakes:
I set the default back to 128 and offset the voltage by adding a 1kOhm in series to the E- wire(ground). This brought the no load voltage down to 15.1mV from 30mV (in range for the diff voltage input).

You effectively lowered the excitation voltage that way, and so the output voltage, sensitivity and resolution.
And you moved the common mode voltage (A+ A-) up, and possibly out of range of the input stage.
That could be the cause of your problems now.

100k (100-330k) from A+ (one input) to E- (ground) will do what you want.
Or the bending trick.
Leo..