Load cell connection,coding,calibration.

I have two 3 wired load cells (white, red, black) and I'm using them to create a 100 kg scale using HX711 but the connections and the coding given in all the sites are not giving the expected results instead they are printing random values. I've used this HX711 library GitHub - bogde/HX711: An Arduino library to interface the Avia Semiconductor HX711 24-Bit Analog-to-Digital Converter (ADC) for Weight Scales. .Nothing seems to help. I don't know a lot about these cells. Please help. Thank you.

Circuit:Connect HX711 to a three wire load cell

Cell:http://www.amazon.in/3-Wired-Half-Bridge-Electronic-Weighing-Sensor/dp/B00R1J7WTA

Hi, and welcome to the forum.

More information is needed.
Did you connect one or two load cell to the HX711, and how (post a picture).
Do you use a 5volt Arduino (which one), and is the HX711 powered by 5volt (not 3.3volt).
How do you power the Arduino, and what else is connected.

This page might give you the info you need.

Leo..

Hi,
Welcome to the forum.
We need to see your code please.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Can you please post a picture of your project?

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Can you tell us your electronics, programming, arduino, hardware experience?

Thanks.. Tom... :slight_smile:

Hey Tom,
These are the following codes which I have tried.
1.

#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.println("Before setting up the scale:");
  Serial.print("read: \t\t");
  Serial.println(scale.read());			// print a raw reading from the ADC

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

  Serial.print("get value: \t\t");
  Serial.println(scale.get_value(5));		// print the average of 5 readings from the ADC minus the tare weight (not set yet)

  Serial.print("get units: \t\t");
  Serial.println(scale.get_units(5), 1);	// print the average of 5 readings from the ADC minus tare weight (not set) divided
						// by the SCALE parameter (not set yet)

  scale.set_scale(2280.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("After setting up the scale:");

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

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

  Serial.print("get value: \t\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("get units: \t\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("Readings:");
}

void loop() {
  Serial.print("one reading:\t");
  Serial.print(scale.get_units(), 1);
  Serial.print("\t| average:\t");
  Serial.println(scale.get_units(10), 1);

  scale.power_down();			        // put the ADC in sleep mode
  delay(5000);
  scale.power_up();
}
/* sample for digital weight scale of hx711, display with a HD44780 liquid crtstal monitor
 *
 * hardware design: syyyd
 * available at http://syyyd.taobao.com
 *
 * library design: Weihong Guan (@aguegu)
 * http://aguegu.net
 *
 * library host on
 * https://github.com/aguegu/Arduino
 */

// Hx711.DOUT - pin #A1
// Hx711.SCK - pin #A0

#include "hx711.h"

Hx711 scale(A1, A0);

void setup() {

  Serial.begin(9600);

}

void loop() {

  Serial.print(scale.getGram(), 1);
  Serial.println(" g");

  delay(200);
}

The following is the diagram of the connection.(Blue is used for white colored wire)

Wawa:
Hi, and welcome to the forum.

More information is needed.
Did you connect one or two load cell to the HX711, and how (post a picture).
Do you use a 5volt Arduino (which one), and is the HX711 powered by 5volt (not 3.3volt).
How do you power the Arduino, and what else is connected.

This page might give you the info you need.
SparkFun Load Cell Amplifier - HX711 - SEN-13879 - SparkFun Electronics
Leo..

I have connected two load cells to the HX711 and the picture and the code is in the above reply.
I used an arduino UNO and the hx711 is powered by 5V(Btw what is a 5V arduino?)
I powered it by connecting it with the computer system, and nothing else is connected with it.
The link (SparkFun Load Cell Amplifier - HX711 - SEN-13879 - SparkFun Electronics) you have mentioned is sparkfun's hx711 mine is the typical one.
Thank you.

Hi,
The images did not stick, if you use REPLY rather than QUICK REPLY and it has an attachment facility.

The images must be less than a Meg in size, so if too big, us PAINT to resize your image.

Thanks.. Tom... :slight_smile:

I hope now you can see it.

Hi, have you got the cells loaded?
What does your monitor display?

Tom… :slight_smile:

I have placed a load of 113g and used the following codes and the following are the outputs.
CODE1:

#include <HX711.h>

HX711 scale(4, 2); // parameter "gain" is ommited; the default value 128 is used by the library

void setup() {
  Serial.begin(38400);

  scale.set_scale(); // this value is obtained by dividing the calibration value with the known weight;
  scale.tare(); // reset the scale to 0
  Serial.println("You Have 20s to Place a Known weight on the Sensor:"); // Time delay to place weight

  delay(20000);
  Serial.println("Calibration Value:"); // divide this bby the weight of the load used
  Serial.println(scale.get_units(10));

}

void loop() {

}

CODE2:

#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 #4
  // HX711.PD_SCK	- pin #2
  scale.begin(4, 2);

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

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

  Serial.print("get value: \t\t");
  Serial.println(scale.get_value(5));		// print the average of 5 readings from the ADC minus the tare weight (not set yet)

  Serial.print("get units: \t\t");
  Serial.println(scale.get_units(5), 1);	// print the average of 5 readings from the ADC minus tare weight (not set) divided
						// by the SCALE parameter (not set yet)
scale.set_scale();
  scale.set_scale(54.22f);                      // 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("After setting up the scale:");

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

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

  Serial.print("get value: \t\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("get units: \t\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("Readings:");
}

void loop() {
  Serial.print("one reading:\t");
  Serial.print(scale.get_units(), 1);
  Serial.print("\t| average:\t");
  Serial.println(scale.get_units(10), 1);

  scale.power_down();			        // put the ADC in sleep mode
  delay(500);
  scale.power_up();
}

CODE3:

#include "hx711.h"

Hx711 scale(4, 2);

void setup() {

  Serial.begin(38400);

}

void loop() {

  Serial.print(scale.getGram(), 1);
  Serial.println(" g");

  delay(500);
}

Below are the Outputs.

code1.PNG

code3output (1).PNG