#include "HX711.h"
#define calibration_factor 105.65 //This value is obtained using the SparkFun_HX711_Calibration sketch
#define DOUT 3
#define CLK 2
HX711 scale(DOUT, CLK);
void setup() {
Serial.begin(9600);
Serial.println("HX711 scale demo");
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
}
void loop() {
//double x=scale.get_units(40);
Serial.print("Reading:");
Serial.print(scale.get_units(40),3);
//Serial.print(3.829935739385924+0.9845073409025196*x-0.0005277155842050920*pow(x,2)+0.000002894159881057114*pow(x,3)-0.000000004539284963929932*pow(x,4));
Serial.print(" gr"); //Change this to kg and re-adjust the calibration factor if you follow SI units like a sane person
Serial.println();
}
in this code and hardware,sensor doesnt give zero value when there is no weight on scale so scale.tare function doesnt work well. also every reset of arduino scale give different offset tare value.
Post a link to the load cell.
Post a picture of how you have connected things.
Not all use the same colour code. Some have red as supply, some have red as output.
Measure the voltage on A+ and A-. Both should exactly the same, and half of what's on AVDD.
Leo..
ı checked connections many times between hx711 and load cell.ı ensured that there isnt any problem between hx711 and load cell in your opinion what type of error can be occured in my system?
ı connected A+ green
A-. white
E+ red
E- black
ı connected A+ green
A-. white
E+ red
E- black
as Wawa said,ı measure the voltage on A+ and A-,obtain same value. ı still dont solve reset problem.what can be other option or solution to handle this issue?
ı supply the arduino from usb port.
weight increase when you put something on the load cell.Also for example ı put no weight sensor give 2.2 gr then ı put 100gr give 99.8 .After reset arduino,ı put no weight sensor give 3.1 gr then ı put 100gr give 99 gr.ı think this problem occurs because of "tare" funvtion
I had a closer look at the picture of the HX711 from your link.
It seems there is a 220?ohm resistor in series with E-
This is different from the Sparkfun board.
Don't know why your board has that.
Try connecting the E- wire of the load cell directly to ground, as in the HX711 datasheet.
I also see a heavy steel disc mounted on the 500gram load cell.
Did you try without that plate.
Leo..