Load Cell + HX711

Hello,

I´m a student in Germany and I try to build this experiment: picture1

Now my Arduino is ready for calibration the load cells.

But there is no connection to the load cells. The calibration don't do right and then my measurements all time 0.

I think it´s a problem with the hardware...
How can I try, if the load cells are connected right to the HX711 and the Arduino??

When I load the code to the Arduino, it is also starting the calibration, without any other connection form the Arduino to the HX711/load cell.

I think it´s a problem how the Arduino "speak" with the HX711/load cells...

Do you have any tips for me?

The code is: A.ino

Thank you !!

A.ino (2.99 KB)

Did you run the example sketch supplied with the HX711 library - did that work?
You need to post your code correctly with tags.

Without seeing the code, I’d imagine addressing each HX711 could be a problem.

Even if your calibration functions work, you don't do anything with the resulting scale factors, and the offsets generated by the calls to .tare aren't saved.

Try assigning the 2 offsets (from .get_offset after each .tare) and 2 scale factors (from your functions) to variables and then call .set_scale and .set_offset prior to each .get_units

Or, give this a try (not tested by me): GitHub - compugician/HX711-multi: An Arduino library to interface multiple HX711 units simultaneously

@OP

This link (calibrating Load Cell + HX711) could be helpful for you.

loadcellCalib.png

Hello, at first thanks to everybody for the tips.

tomorrow I will test it..

Here is my Code:
But I think the code is correct..
may you have a look at the code?

#include "HX711.h"
#define DT1 3
#define SCK1 2
#define DT2 5
#define SCK2 4
HX711 scale1(DT1,SCK1);
HX711 scale2(DT2,SCK2);
char temp;
int n=1;

float sub_calibration1(float calibration_factor){
Serial.println("Load Cell 1 Calibration");
Serial.println("Remove all weight from scale");
Serial.println("After readings begin, place known weight on load cell");
Serial.println("Press + or a to increase calibration factor");
Serial.println("Press - or z to decrase calibration factor");
Serial.println("Press s to start calibration");
Serial.println("Press f to finish calibration");
do{
if(Serial.available()){
temp=Serial.read();
}
delay(500);
}while(temp!='s');
scale1.set_scale();
scale1.tare();//Reset the scale to 0
do{
scale1.set_scale(calibration_factor); //Adjust to this calibration factor
Serial.print("Reading:");
Serial.print(scale1.get_units(5),3);
Serial.print("g");
Serial.print("calibration_factor:");
Serial.print(calibration_factor);
//Serial.print();
if(Serial.available())
{
temp=Serial.read();
if(temp=='+'||temp=='a')
calibration_factor+=10;
else if(temp=='-'||temp=='z')
calibration_factor-=10;
}
delay(100);
}while(temp!='f');
return calibration_factor;
}

float sub_calibration2(float calibration_factor){
Serial.println("Load Cell 2 Calibration");
Serial.println("Remove all weight from scale");
Serial.println("After readings begin, place known weight on load cell");
Serial.println("Press + or a to increase calibration factor");
Serial.println("Press - or z to decrase calibration factor");
Serial.println("Press s to start calibration");
Serial.println("Press f to finish calibration");
do{
if(Serial.available()){
temp=Serial.read();
}
delay(500);
}while(temp!='s');
scale2.set_scale();
scale2.tare(); //Reset the scale to 0
do{
scale2.set_scale(calibration_factor); //Adjust to this calibration factor
Serial.print("Reading:");
Serial.print(scale2.get_units(5),3);
Serial.print("g");
Serial.print("calibration_factor:");
Serial.print(calibration_factor);
//Serial.print();
if(Serial.available())
{
temp=Serial.read();
if(temp=='+'||temp=='a')
calibration_factor+=10;
else if(temp=='-'||temp=='z')
calibration_factor-=10;
}
delay(100);
}while(temp!='f');
return calibration_factor;
}

void sub_measure() {
Serial.print("Measurement#");
Serial.println(n);
Serial.println("Move the table and press z to make a new single date set");
Serial.println("Press x When finish data collection");
Serial.println("Force1(N) Force2(N)");
do{
if(Serial.available())
{
temp=Serial.read();
if(temp=='z')
{
Serial.print(scale1.get_units(10)9.811E-3,2);
Serial.print(" ");
Serial.println(scale2.get_units(10)9.811E-3,2);
}
}
delay(200);
}while(temp!='x');
temp=' ';
Serial.println();
n++;
}

void setup(){
Serial.begin(9600);
sub_calibration1(-2270);
sub_calibration2(1930);
}

void loop() {
sub_measure();
delay(100);
}

Thank you !!

No, your code is probably not correct. Study post #2 and modify your code accordingly.

And when you post code, use the code tags (see the </> ?)