ESP32 + HX711 + 50kg load cells - readings barely change under load

Hello,

I want to make a digital scale.

My idea is to make a scale with 4 sensors connected in series. This idea is unsuccessful for me. So now I'm trying to make a scale with one weight sensor.

This is what I have:

  • 1 weight sensor of 20kg.
  • HX711 module
  • ESP32 module
  • USB debugging cable.

Attached is a picture of how my weight sensor is connected to the HX711 module and the ESP32 module.

This is the code I use in the Arduino IDE

type or paste code here

#include "HX711.h"

#define DT 16
#define SCK 17

HX711 scale;

void setup() {
Serial.begin(115200);
scale.begin(DT, SCK);

Serial.println("Taring... don’t touch");

delay(2000);

scale.tare();

Serial.println("READY");
}

void loop() {
long raw = scale.read_average(10); // faster and more stable

Serial.print("RAW: ");
Serial.println(raw);

delay(200);
}

My problem is that I get inappropriate and illogical values.

I expect when I add weight the values ​​to increase and when I remove weight the values ​​to decrease. That doesn't happen.

In my case, no matter how much weight there is (or no weight at all) the values ​​I see in the Arduino IDE are always constant (vary in a certain interval).

My weight sensor is placed in this kind of plastic that I made on a 3D printer in order to keep only the variable part moving from the weight sensor relative to the fixed part of the sensor.

I also tried other combinations of connecting the weight sensor and the HX711 module - I have the same problem again.

Please help me how to solve the problem and what I am doing wrong.

First, the HX711 need 5V for accurate readings, second, if you plan on using a single loadcell you need the type with four wires.

For four loadcells connect like this


If you use an ESP32 then you need to use a voltage translator on the HX711 CLK and DAT pins or use this module:

...and when you do eventually get a 'sensible' reading, you will quickly become disappointed with the amount of drift experienced.
My experience with HX711...

What makes you believe your drift is caused by HX711?

Thank you for your answer.

I'll order this, connect it according to the schematic, and let you know how it goes. I hope this is exactly what I need.

One off-topic question: are all these modules we're using—ESP32, HX711, and Arduino—suitable for serious industrial projects, or are they mainly intended for small, hobby, or non-industrial projects?

Not really, maybe OK for cheap comsumer product.

Could you recommend professional-grade weight measurement modules, similar to the ESP32, HX711, and load cells, that are designed for reliable everyday industrial use?

You didn't calibrate the sensor. Start with the appropriate sample code in the library and study several examples to learn what is needed.

No.
You can buy entire weighing systems/scales

My experience with the HX711 is with a very similar setup to that shown in post #2
The loadcells look the same, bought as a 4 x 50kG kit with HX711. (May have been Sparkfun).

Getting a tare and a reading worked ok, but the tared value would just continually drift. A lot.

It was a long time ago now, but I seem to remember using the loadcell calibrator I have and monitoring the drift when that was connected in place of the loadcells. Drifted just as much.
You can try it easily. To get a static reading use 4 resistors, wired to simulate the loadcell. The loadcell data sheet will give the resistance values. (Don't use half watt carbon composition resistors!)

Tare it, then monitor how much it drifts. If it doesn't drift much, you're in luck. You just likely need better loadcells.

It would be better to use 4 wire loadcell devices. But typically, the prices are not in the hobbyists range. (Not in mine, anyway).

I have experience of using Procon Engineering GS100 amplifiers (now superceded GS101)
Also LCA15, now supeceded by the LCA20 (Amber Instruments).
Both using 4/6 wire individual loadcell devices.
They didn't drift. (Much).
Assuming the latter models are as good, if not better than the earlier ones, I can recommend either of these.

Your picture shows a common/cheap HX711 board that is not compatible with an ESP32.
Only the one from Sparkfun is.

That board is 5volt-only. Some parts of it won't work with 3.3volt.

You can make it work with the ESP by

  1. powering the HX711 from the 5V/USB pin
  2. using a 1k:2k2 voltage divider on the data line of the HX711, to drop the 5volt logic to a safe 3V3 value. Don't mod the clock line.

1k between HX Dout and ESP input, 2k2 between ESP pin and ESP ground.

a better way is to split AVDD and DVDD of the HX chip, and power them with 5V and 3V3 respectively. As the Sparkfun module does.

I Agree here.
For my experience, the problem comes mainly from load cell drift, creep, temperature changes, mechanical flex etc. While I don't consider hx711 even near to best in class, I have got quite good results in all of my trials. I have not used these "green boards" though.
While 3.3V voltage is not correct supply voltage and usually load cell specs ask >5V excitation which hx711 can't provide even with 5V supply, I have not seen "catastrophic" results when powered at 3.3V.
You get what you pay, but I consider it usable.
But only if you have reasonable expectations. I'm not expecting to have 10g accuracy from my Chinese 2000kg loadcell combined with hx711.

Those boards have a 4.25volt linear voltage regulator that powers the load cell.
It's a dumb idea to under-power that voltage regulator with 3.3volt. Any noise/ripple (from WiFi activity) on the 3V3 supply will blow right through that regulator. It needs at least 4.5V to do it's job.

Power the module from 5volt and use a level shifter on the data output.
Doing the right thing only requires adding two resistors.

Suggest you buy a commercial scale from a reputable company (e.g. Mettler Toledo). If the scale has RS232 capabilities, then with a simple module you can use an Arduino to communicate with the scale.

Is there a digital scale that allows me to read the weight values directly in an Android application? I am a software developer, and I am currently developing an Android application where I need to receive weight data from a digital scale. That's why I'm working on this project using an ESP32 module. Does such a scale exist? I know this might be a bit off-topic, but it's very important to me, so I would really appreciate your help.

Not that I know of off hand but you can search the internet just as easy as I can. You might also consider a scale with an RS232 interface which can be connected to a Bluetooth device (like esp32) for communication to Android device.

Exactly what is your application?
What do you need to weigh?

Sure.
The Mantracourt LCA20 I mentioned in post #11, has RS232 and 485 options. Contact them for details.

If you really want to use an ESP32, interface it with RS232 say and then Bluetooth or Wifi to an Android device

I do something similar with a dog tracking system.
A dog collar with a GPS module, interfaced with a HC-12 wireless serial module as Tx. Another HC-12 as a reciever, with an ESP32 configured to Tx Bluetooth BLE, which I put in my pocket.

A serial Bluetooth app on my phone, allows me to see the exact latitude and longitude location of the dog in real time, if necessary. (Lost dog. Never happened yet.).

It's primary purpose was to log the dogs track to an uSDcard, to compare how much extra distance the dog ran, compared to my 'walk with the dog'.
Data saved in .GPX format, which can be dropped onto Google maps.

Different data, same principle.

I don't know how to read you question, but if you go to Amazon and search "bluetooth weight scale" you get hundreds of results...

What kind of HX711 module fo you use? Maybe this one?

The Hx711 I used looked similar to those shown in post #1 & #2.
A green PCB.