Francisca Lima
Francisca Lima

Reputation: 1

No response when measuring different weights in my load cell+HX711+esp32

I am doing a project where I need to measure small differences in weight (like 0.01g differences).

Right now I am using this load cell (with 300g of max capacity), with this HX711 amplifier and this ESP32 wroom modules. The wiring of the circuit:

Wiring circuit except the red and the green wires of the load cell are switched (as appointed in the load cell datasheet)

The code I am using to test it in arduino IDE is:

#include "HX711.h"


// HX711 circuit wiring
const int LOADCELL_DAT_PIN = 16;
const int LOADCELL_CLK_PIN = 4;

HX711 scale;

void setup() {
  Serial.begin(9600);

 
  Serial.println("Initializing the scale");

  scale.begin(LOADCELL_DAT_PIN, LOADCELL_CLK_PIN);

  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(37);
                      // this value is obtained by calibrating the scale with known weights; which I did apart
  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), 5);

  scale.power_down();             // put the ADC in sleep mode
  delay(5000);
  scale.power_up();
}

According to the load cell's datasheet, its rated output is 0.9mV/V. As I am using ESP32 I am limited to 3.3V of power, which is not ideal since the recommended excitation for the load cell is 10V. So in the end the voltage output from the load cell is aproximately 2.97mV (0.9mV/V *3.3V), right? Meaning the amplifier would need to have an input sensitivity lower than 2.97mV in order to detect the differences? I am struggling to find the input sensitivity of HX711, which I think might be the problem.

I calibrated it with a 35g object with the example code of the HX711 library used.

Afterwords I tested it with the above code and it does not detect weight differences when i put an object of 70g on it and when I take it off the load cell. It just continues to give me around the same readings... Which led me to believe that maybe the problem was with the input sensitivity... What do you think?

Also the readings itself are wrong, around -83g which I also do not understand. But as my project requires only the detection of the weight differences I am not concerned with the wrong values just yet. Just with the lack of detection of this differences...

Thank you in advance.

Upvotes: 0

Views: 50

Answers (0)

Related Questions