My load cell gives Zero kg weight after arduino is reset or the power failure problem occurs . I want the current weight which is placed on the load cell .
Thanks in advance.
My load cell gives Zero kg weight after arduino is reset or the power failure problem occurs . I want the current weight which is placed on the load cell .
Thanks in advance.
Feel free to provide the details which may help us to help you to achieve your wishes.
@OP
1. Have you got a load cell? Is it like this?:
Figure-1: Load cell
2. Have you connected the load cell with HX711 Module in this way:
Figure-2: Load cell connected with UNO via HX711 Module.
3. Upload the following sketch and check that if the Serial Monitor shows some values (in counts).
/* This program takes 10 samples from LC + HX711B at
2-sec interval and then computes the average.
*/
unsigned long x = 0, y=0;
unsigned long dataArray[10];
int j = 0;
void setup()
{
Serial.begin(9600);
pinMode(A1, INPUT); //data line //Yellow cable
pinMode(A0, OUTPUT); //SCK line //Orange cable
}
void loop()
{
for (int j = 0; j < 10; j++)
{
digitalWrite(A0, LOW);//SCK is made LL
while (digitalRead(A1) != LOW) //wait until Data Line goes LOW
;
{
for (int i = 0; i < 24; i++) //read 24-bit data from HX711
{
clk(); //generate CLK pulse to get MSB-it at A1-pin
bitWrite(x, 0, digitalRead(A1));
x = x << 1;
}
clk(); //25th pulse
Serial.println(x, HEX);
y = x;
x = 0;
delay(1000);
}
dataArray[j] = y;
}
Serial.println("===averaging process=========");
unsigned long sum = 0;
for (j = 0; j < 10; j++)
{
sum += dataArray[j];
}
Serial.print("Average Count = ");
sum = sum / 10;
Serial.println(sum, HEX);
delay(2000);
}
void clk()
{
digitalWrite(A0, HIGH);
digitalWrite(A0, LOW);
}
4. If Step-3 works, get counts for the weight of 1kg and 3 kg; find equation for the unknown weight from these two counts; write code for the equation and include it in the sketch of Step-3.