My problem is that when I press down with force on the load cell it is not noticed on the serial output. It keeps showing the same number regardless of what I do to the load cell. I've tried changing arduinos, weighing modules, wires, load cells, reinstalling arduino and libraries to no avail.
Attached are pictures of my wiring diagram, pictures of the setup and a picture of the serial output. If anyone has any suggestions I am all ears! Thanks!
This is the code that I am using:
#include <HX711.h>
// HX711.DOUT - pin #A1
// HX711.PD_SCK - pin #A0
HX711 scale(A1, A0); // parameter "gain" is ommited; the default value 128 is used by the library
void setup() {
Serial.begin(38400);
Serial.println("HX711 Demo");
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();
}
I am having this same problem too! I had it working for me this last summer and now when I try it months later it is not working. It might be because I updated the Arduino software? I'm not sure, I'm in the same boat as you are and would like a solution too.
So I tried the code that you posted with aguegu's Hx711 library and its not working correctly. It does not recognize when I put force on the load cell and the numbers in the serial keep increasing (screenshots below).
Could it be a wiring issue? I don't believe it is a hardware issue since I have tried swapping out my load cell, weighing module, wires and arduino with no better luck
After I changed my load cell (for the 2nd time!) the problem stopped. The ones I was using (1kg, 30kg) did not work with it so I tried other ones (50kg, 100kg) and they worked fine.
I’m unsure what the difference is between this one but maybe it does not work with the DFRobot weighing module? It may be because of the wires. I’m going to try and solder better ones onto the ends and see if that makes a difference, because I would like to get the 30kg working as well.
Hi,
Those reading were with no load what so ever on the cell?
It looks as though the cell is not balanced, E+ to any S should be equal, just like E- to any S is equal.
This will give you an output that is not zero with no load.
Your cell could be faulty.
The cell should have an arrow on it, that is the load end and it should point down.
Can you post a picture of your load cell and how you have mounted it please.
I checked the resistance in the unit and got the same result. I checked the resistances in my functional 100 kg load cell and got the following results:
E+ to S+ (red to yellow) 0.29
E+ to S- (red to white) 0.29
E- to S+ (black to yellow) 0.29
E- to S- (black to white) 0.29
They are all equal as you stated a functional load cell should be. Is this a faulty load cell? Is there anything I can do to correct this issue?