Hacking a scale to log data with seeduino

i'm trying to connect an arduino to read a signal from a 500g weight scale.

gear:

weight scale - cheap with no brand or model number, but on the PCB i recognized the crucial E+,E-,S+,S-
load cell amp HX711 by sparkfun.
arduino mega 2560 R3 (for the time being, after it will work i will figure out the seeduino cause it has additional complications )

so far
i followed this tutorial but after uploading the program i got a 0.0 read without concern to any weight i put on the scale. (i first calibrated it)

moreover, i'm getting the following voltage readings while nothing is on the scale:
E+ ~ 4.24V
E- GND
S+ ~ 200-500 mV
S- ~ 2V

the other side of the HX711 (connected to the arduino):
VDD,VCC - connected to 5V of arduino
DAT - pin 3
CLK - pin 2
GND - arduino GND

another strange thing - the reading from DAT and CLK is around zero all the time.

would love to hear tips insights and opinions!

weight scale - cheap with no brand or model number, but on the PCB i recognized the crucial E+,E-,S+,S-
load cell amp HX711 by sparkfun.

Really? They use the breakout board from Sparkfun? Post a picture of that scale as I cannot believe that!

ether2213:
I'm getting the following voltage readings while nothing is on the scale:
E+ ~ 4.24V
E- GND
S+ ~ 200-500 mV
S- ~ 2V

S+ and S- should both be close to half of E+, with load and without load. And, if you measure the voltage between S+ and S-, with full load, they should be within 18 to 20mV of each other (at most, using 128 gain). Without load, they should be nearly the same (zero difference).

another strange thing - the reading from DAT and CLK is around zero all the time.

Those are digital pins - no point in measuring their potential.

Post some photos of your load cell and wiring, and post your code.

images:
photo 1
photo 2
photo 3
photo 4

note that in this weight scale the green wire is connected to S+ and the white wire to S- (i understood that usually it's the other way around) and therefore the load cell amp has the green wire connected to WHT pin and white wire to GRN - maybe that was a mistake?)

about voltage readings:
between S- and S+ there is ~0.7V but with large flactuations and also it changes, sometimes it goes to ~1-2V
the voltage between S- and GND is ~2V and S+ and GND is ~1V

i used the following code to calibrate:

/*
 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;

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.begin(DOUT, CLK);
  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;
  }
}

than i used the following code to operate:

/*
 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 example demonstrates basic scale output. See the calibration sketch to get the calibration_factor for your
 specific load cell setup.

 This example code uses bogde's excellent library: https://github.com/bogde/HX711
 bogde's library is released under a GNU GENERAL PUBLIC LICENSE

 The HX711 does one thing well: read load cells. The breakout board is compatible with any wheat-stone bridge
 based load cell which should allow a user to measure everything from a few grams to tens of tons.
 Arduino pin 2 -> HX711 CLK
 3 -> DAT
 5V -> VCC
 GND -> GND

 The HX711 board can be powered from 2.7V to 5V so the Arduino 5V power should be fine.

*/

#include "HX711.h"

#define calibration_factor -7050.0 //This value is obtained using the SparkFun_HX711_Calibration sketch

#define DOUT  3
#define CLK  2

HX711 scale;

void setup() {
  Serial.begin(9600);
  Serial.println("HX711 scale demo");

  scale.begin(DOUT, CLK);
  scale.set_scale(calibration_factor); //This value is obtained by using the SparkFun_HX711_Calibration sketch
  scale.tare(); //Assuming there is no weight on the scale at start up, reset the scale to 0

  Serial.println("Readings:");
}

void loop() {
  Serial.print("Reading: ");
  Serial.print(scale.get_units(), 1); //scale.get_units() returns a float
  Serial.print(" lbs"); //You can change this to kg but you'll need to refactor the calibration_factor
  Serial.println();
}

Here's what I'd do:

Disconnect the load cell wires from the scale and HX711, so the load cell is completely isolated.

Measure the resistance between the load cell wires with no load. Going around the bridge you should get four values that are very close, and across the bridge two other values that are nearly the same.

Then apply 5v to the excite wires and measure the sense voltages, without load and with full load. You should get values as I mentioned in post #2. If you get more than 20mV difference under full load you will have to use lower gain. Read the datasheet.

The large tray may create a no load offset that the HX711 can't deal with (in which case the resistances may be off, too.)

Then learn how to improve your soldering...I'm sorry to say your connections to the HX711 look very poor. (Pic 3)

Then remove all wires from the HX711, clean the pads (the red wire pad looks burnt...may be hard to clean), and then connect the cell to the HX711 (but not to the scale) and the HX711 to the Arduino.

I suggest not using magnet wire, too.

thanks for the help!

but i'm not sure i understand what you mean -

  1. the load cell is the PCB inside the scale? (the one in photos 1,2)
  2. should i measure resistance or voltage? i know they are connected but does it matter?
  3. what is the bridge, going around or across the bridge?

the bottom line of what you say:
check what is the voltage read (of S- -> S+ while not connected to the amplifier) with and without load and if it's above 20 mV than i need to correct the gain? how do i do that assuming i can't get a datasheet of the scale since there is no serial number or brand name on it.

about the soldering, yes i'm afraid i slightly burnt the HX711 but i don't think it caused real damage. i verified there is no contact between pins.

what do you mean by connect the cell to the HX711 but not to the scale? there's clearly something i am missing here...

so just to be fully clear -
what i did originally is to disconnect the 4 wires shown in photo 1 (E-,E+,S-,S+) from the PCB and connect them directly (from the actual sensor) to the HX711. the PCB is not connected at all to the sensor (the metal thing, is that what you call scale?) nor to the HX711...
so i'm confused about the terms load cell, and scale.

hope it's not too much questions!
XD

  1. the load cell is the PCB inside the scale? (the one in photos 1,2)

No, the load cell is that aluminum brick behind the PCB of pictures 1 and 2.

  1. should i measure resistance or voltage? i know they are connected but does it matter?

Without any connection to a battery or other power supply you cannot measure voltages, so you have to measure resistances.

  1. what is the bridge, going around or across the bridge?

The bridge is that star-like resistor array that forums the load cell. If that aluminum brick is loaded it will change the resistances slightly and these changes are measured by the HX711 (later on).

check what is the voltage read (of S- -> S+ while not connected to the amplifier) with and without load and if it's above 20 mV than i need to correct the gain? how do i do that assuming i can't get a datasheet of the scale since there is no serial number or brand name on it.

DaveEvans probably meant that you disconnect the internal PCB completely and just use the HX711 board as you show on the pictures.

what do you mean by connect the cell to the HX711 but not to the scale? there's clearly something i am missing here...

After you measured the resistances you connect the load cell (= bridge) to the HX711 (throw away the old PCB inside the scale) and the HX711 to the Arduino. If you have both boards connected you cannot measure the weight.

Right, except it may be informative to first measure the resistance between all elements of the load cell, under no load, as I suggested. If the scale was working before you started hacking it, there should be no anomalies. I would measure resistance out of curiosity, if nothing else.

Then apply 5v to the "E" wires and measure the voltage across the "S" wires, under no load and full load (and measure the voltage from each "S" to ground).

Regarding going around or across the bridge...google full Wheatstone bridge and it should become clear.

Regarding gain, see the datasheet for the HX711.