can anyone please help me,I am working on weight sensor hx711 with 10kg load cell on arduino uno.when trying to take calibration values,no constant values and showing some weight in negative values when no weight is placed.Actually,it has to show zero when no weight is placed and display weight when weight is placed.output is continously changing irrespective of weight.But for load cell r1/r2=r3/r4. load cell is already changed. HX711 is also getting 5v proper input from arduino. please tell me how do i get proper calibration and with constant values when weight is placed.
Here is my calibration code.
#include "HX711.h"
#define DOUT A1
#define CLK A0
HX711 scale;
//long val=0;
float calibration_factor = -17034.36; //-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(), 3);
Serial.print(" kgs"); //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;
//}
}
output:This is the output i got when no weight is placed. continously changing values irrespective of weights i placed.
Reading: -1.935 kgs calibration_factor: -17034.36
Reading: -1.959 kgs calibration_factor: -17034.36
Reading: -1.917 kgs calibration_factor: -17034.36
Reading: -1.929 kgs calibration_factor: -17034.36
Reading: -1.952 kgs calibration_factor: -17034.36
Reading: -1.925 kgs calibration_factor: -17034.36
Reading: -1.978 kgs calibration_factor: -17034.36
Reading: -1.999 kgs calibration_factor: -17034.36
Reading: -1.934 kgs calibration_factor: -17034.36
Reading: -1.890 kgs calibration_factor: -17034.36
Reading: -1.899 kgs calibration_factor: -17034.36
Reading: -1.872 kgs calibration_factor: -17034.36
Reading: -1.867 kgs calibration_factor: -17034.36
Reading: -1.935 kgs calibration_factor: -17034.36
Reading: -1.931 kgs calibration_factor: -17034.36
Reading: -1.917 kgs calibration_factor: -17034.36
Reading: -1.943 kgs calibration_factor: -17034.36
Reading: -1.973 kgs calibration_factor: -17034.36
Reading: -1.915 kgs calibration_factor: -17034.36
Reading: -1.946 kgs calibration_factor: -17034.36
Reading: -1.902 kgs calibration_factor: -17034.36
Reading: -1.969 kgs calibration_factor: -17034.36
Reading: -1.975 kgs calibration_factor: -17034.36
Reading: -1.895 kgs calibration_factor: -17034.36
Reading: -1.875 kgs calibration_factor: -17034.36
Reading: -1.869 kgs calibration_factor: -17034.36
Reading: -1.910 kgs calibration_factor: -17034.36
Reading: -1.983 kgs calibration_factor: -17034.36
Reading: -1.930 kgs calibration_factor: -17034.36
Reading: -1.906 kgs calibration_factor: -17034.36