First I´m pretty new to all this stuff so please be patient
Im working on my Bachelor thesis right now and a part of it is a project with a load cell.
Im Using a a Elegoo UNO R3, a HX711, and a 1kg load cell.
I tried different load cells, different boards, and more than one HX711. I also tried different libaries and different wiring. (because i wrote that maybe the color of the wires are not the same as in the discription)
The Arduino is connecting with the HX711 but i dont geht any values, it shows always zero.
Its realy frustating for me, has anyone an advices what the problem could be?
In order to come up with a working project, carry out the following steps:
A: Functional Check of HX711 Module 1. Build the following circuit to test that the HX711 Module is functional.
Figure-1: Test circuit for the functional check of HX711 Module
2. Upload the following sketch.
/* This program takes 10 samples from LC + HX711B at
1-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);
}
void clk()
{
digitalWrite(A0, HIGH);
digitalWrite(A0, LOW);
}
3. Slowly vary the Pot-R3 and check that counts of the Serial Monitor changes. This is the end of the functional check of your HX711 Module.
B: Functional Check of Load Cell 1. Replace the resisitor based load cell of Fig-1 with the real Load Cell that you have. Be sure that the excitation terminals (E+, E-) of the HX711 Module are properly connected with the excitation terminals of the Load Cell; signal terminals (A+, A-) of the HX711 Module are properly connected with the signal terminals of the Load Cell.
Figure-2: Test circuit for the functional check of Load Cell
2. Change weight on the load cell and check that the count changes in the Serial Monitor.
The console only shows mit 1000000 or something, i think it was 1mio, buuut anyway, the value didn´t change when i used the wheel of the poti.
Edit: ofcourse 1mio, 8 bit ... but as i said, only the first bit was 1, and nothing changed during the test
The HX711 was wired like this:
VCC to 5V
SCK to A0
DT to A1
GND to GND
sooo does that mean something isn´t working with the HX711? In the code is a comment that says its for a HX711B?! is that the same ?
Edit: okay, i started the progam once more and i got HEX as output, FF FF FE, nothing was changing
Ignore B of HX711B of the comment field of Post#3.
It (of Post#3) is a tested program for the given setup. Check the continuity of the jumpers using a DVM/AVM. Try with another HX711 Module.
If you don't have 100 ohm pot, place 2x100 ohm in parallel; after that, place 3x1000 ohm in parallel and see the response on the Serial Monitor. Do not connect 10k Pot in parallel with 100 ohm. Anyway, you need to make your HX711 Module working first.
GolamMostafa:
It (of Post#3) is a tested program for the given setup. Check the continuity of the jumpers using a DVM/AVM. Try with another HX711 Module.
what exactly do you mean with DVM/AVM? a multimeter ? i don´t know the shortcut.
Edit: i tested the pins/Jumper with a multimeter, and they the continuity is fine, on both sides :S tomorrow i just will test another hx711, the 4th or so ... and i probably will buy new ones, maybe the seller isnt that great.