HELP! Load cell (50kg) and HX711 module

Hello! I am trying to use a load cell (50 kg) with HX711 module, but I am having a huge and long trouble. My HX711 is soldered and the code and conexiones are right, sometimes the cell measures ok, but then random values appear on the serial, what do you think it can be?? Could someone help me? I don't know what else I can do, I need to delivery the results next month, I am very anxious. Sorry for bad English.
The code I am using (found on the internet):
/*
Setup your scale and start the sketch WITHOUT a weight on the scale
Once readings are displayed place the weight on the scale
Press +/- or a/z to adjust the calibration_factor until the output readings match the known weight
Arduino pin 6 -> HX711 CLK
Arduino pin 5 -> HX711 DOUT
Arduino pin 5V -> HX711 VCC
Arduino pin GND -> HX711 GND
*/

#include "HX711.h"

HX711 scale(5, 6);

float calibration_factor = 32000; // this calibration factor is adjusted according to my load cell
float units;

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.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: ");
units = scale.get_units(), 10;
if (units < 0)
{
units = 0.0;
}
Serial.print(units);
Serial.print(" kg");
Serial.print(" calibration_factor: ");
Serial.print(calibration_factor);
Serial.println();
delay(500);

if(Serial.available())
{
char temp = Serial.read();
if(temp == '+' || temp == 'a')
calibration_factor += 1;
else if(temp == '-' || temp == 'z')
calibration_factor -= 1;
}
}

I did exactly the same conexiones as this document (https://content.instructables.com/pdfs/EQT/DHV9/JBWJWD2Z/Tutorial-to-Interface-HX711-With-Load-Cell-Straigh.pdf) does. :frowning:

sometimes the cell measures ok, but then random values appear on the serial

I have two suggestions--

  1. try and slow the reading to every second instead of the 500 ms. Do you see stable data?

  2. There are several libaries with the same name. I would suggest that you use the one from the library manager called HX711 Arduino Library. Latest version is 0.7.4. There are several library examples to test with.

Yes, this morning I saw stable data, but then, suddenly, it has random values or no output. In this exactly moment I am putting weight in the cell and it returns 0. I've tested all the conexiones and everything seems to be perfect. I tried a lot of libraries, including the original you told me to try. I'm gonna keep trying, but it seems very weird.

This certainly would point to a hardware rather than software issue.

Perhaps your connections are in the correct place but the wire or connector is not stable.

How much weight are you adding? How is the load cell mounted?

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.