HX711 Weight sensor with long cable

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
gorogdaniel
Normal user
Posts: 15
Joined: 21 Feb 2020, 17:33

HX711 Weight sensor with long cable

#1 Post by gorogdaniel » 15 Jun 2021, 05:55

Hi,

i have a project of 2 Microcontrollers who are connected to 6 hx711 pcb´s

i have fluctuation in the reading of the values.

is it possible to make advanced settings inside the code becouse a guy say me thath it is possible thath becouse th cable are so long (4x0,6) 15m the controller dont wait all the data what come from the sensor.

This is why i whant to ask in the form wich options did i have to play with the reading time.

https://bienchen.life/waage/10/beelogge ... eWatch.php

you can see on "waage 1" thath gewicht 40kg fall sometimes down to 33 and come after a time again back to the right value.

i actualy change by the hand the wrong values by hand in the database but i am search a solution for this problem.

If someone have a idea please post it i try evry thing.

thank you very much.

User avatar
chromo23
Normal user
Posts: 821
Joined: 10 Sep 2020, 16:02
Location: germany

Re: HX711 Weight sensor with long cable

#2 Post by chromo23 » 15 Jun 2021, 08:44

Hi,

first of all you can look here under "Messergebnisse des HX711-Moduls verbessern" to improve the reliability of the readings:
https://honey-pi.de/a-d-wandler-hx711/


Wich cables do you mean? the ones from the loadcell or the ones from the hx711 to the esp?
And what do you mean by 4x0,6? Your cable is 60cm and has 4 wires?
How thick are these wires?

If possible keep the cables as short as possible and they should be thick enough.
I build some logger for beehives and placed the hx711 directly on the same perfboard as the microcontroller.
The cable to the load cell there is around 50cm.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: HX711 Weight sensor with long cable

#3 Post by TD-er » 15 Jun 2021, 09:18

The measurement is done using quite low currents and low voltages.
So if you have long cables between the measurement points and the HX711, you might pick up noise affecting the measurement.

One thing you can do, is twist the cables from the measurement point to the HX711.
Since it is using such a low current, I doubt the wire thickness will make much of a difference.
The 4 wires all lead to 4 resistors in a wheatstone bridge formation.
Image

The resistor value is typically around 1k.
Thus even if the resistance of cables is significant, it is added to the resistor values, so in worst case scenario your scale is off by a few gram per kg.

I suspect noise to be an issue here.

If however the distance between the HX711 and the ESP is quite long, you may want to add some pull-up resistors to the SDA and SCL pins. One resistor per I2C signal and the other end to 3v3.
Typical pull-up values are 4k7 - 10k, but on longer cables you may want to go a bit lower, maybe even 2k7.
Also lowering the I2C clock frequency may help here.

gorogdaniel
Normal user
Posts: 15
Joined: 21 Feb 2020, 17:33

Re: HX711 Weight sensor with long cable

#4 Post by gorogdaniel » 15 Jun 2021, 19:19

chromo23 wrote: 15 Jun 2021, 08:44
Wich cables do you mean? the ones from the loadcell or the ones from the hx711 to the esp?
And what do you mean by 4x0,6? Your cable is 60cm and has 4 wires?
How thick are these wires?

If possible keep the cables as short as possible and they should be thick enough.
I build some logger for beehives and placed the hx711 directly on the same perfboard as the microcontroller.
The cable to the load cell there is around 50cm.
Thanks for the reply.

I use this cable: https://www.hornbach.at/shop/PVC-Fernme ... tikel.html

it is a 10x0,6mm² and i use only 4 wires of it.

i have all the pcbs in a cabinet and after them i go to the hives.

1st ESP8266 <----10cm---> hx711 (1) (A) <-------------------------4.90m------------------------------> Loadcell 1 left &2 right
1st ESP8266 <----10cm---> hx711 (1) (B) <-------------------------4.90m------------------------------> Loadcell 3 left &4 right
1st ESP8266 <----10cm---> hx711 (2) (A) <-------------------------5.94m------------------------------> Loadcell 5 left &6 right
1st ESP8266 <----10cm---> hx711 (2) (B) <-------------------------5.94m------------------------------> Loadcell 7 left &8 right
1st ESP8266 <----10cm---> hx711 (3) (A) <-------------------------7.05m------------------------------> Loadcell 9 left &10 right
1st ESP8266 <----10cm---> hx711 (3) (B) <-------------------------8.1m-------------------------------> Loadcell 11 left &12 right
2nd ESP8266 <----10cm---> hx711 (4) (A) <------------------------8.1m-------------------------------> Loadcell 13 left &14 right
2nd ESP8266 <----10cm---> hx711 (4) (B) <------------------------9.46m------------------------------> Loadcell 15 left &16 right
2nd ESP8266 <----10cm---> hx711 (5) (A) <------------------------9.46m------------------------------> Loadcell 17 left &18 right
2nd ESP8266 <----10cm---> hx711 (5) (B) <-----------------------10.85m------------------------------> Loadcell 19 left &20 right
2nd ESP8266 <----10cm---> hx711 (6) (A) <-----------------------10.85m------------------------------> Loadcell 21 left &22 right

You can see the fluctuation here
https://bienchen.life/waage/10/beelogge ... eWatch.php

on the weight 1 HX711 Channel A it is evry time 40 kg +-1kg but it fall down to 33kg for 3 hours after them it is back again.

on the weight 2 HX711 Channel B it is evry time 48 kg +-1kg but here the weight go up to 57kg for 5 hours after them it is back again for 3 hours and then go again up.

On all pcbs channel A the weight go down and on channel B it go´s up.

I order now some ferrit rings for the cable maybe this help, i dont think so but maybe :)

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: HX711 Weight sensor with long cable

#5 Post by TD-er » 15 Jun 2021, 20:41

You must twist the cables. So better use UTP cables, although I don't really know which cables should be part of a pair.
My first idea would be to try to put Output+ and Output- in a pair and Excitation+ and - in a pair.


Ferrite may also help, but only for higher frequencies.
It doesn't look like this is related to HF noise.

gorogdaniel
Normal user
Posts: 15
Joined: 21 Feb 2020, 17:33

Re: HX711 Weight sensor with long cable

#6 Post by gorogdaniel » 15 Jun 2021, 23:43

TD-er wrote: 15 Jun 2021, 20:41 You must twist the cables. So better use UTP cables, although I don't really know which cables should be part of a pair.
My first idea would be to try to put Output+ and Output- in a pair and Excitation+ and - in a pair.


Ferrite may also help, but only for higher frequencies.
It doesn't look like this is related to HF noise.
Thank you very much i try tommorw the ferrite option and twisted cable and write the result.

I was today and make for 2 beehives the soldering completly new but with no effect, and i try 2 shilded not twisted cable and also no effect.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: HX711 Weight sensor with long cable

#7 Post by TD-er » 16 Jun 2021, 00:02

Still if you can avoid it, using shorter cables is always better.

User avatar
chromo23
Normal user
Posts: 821
Joined: 10 Sep 2020, 16:02
Location: germany

Re: HX711 Weight sensor with long cable

#8 Post by chromo23 » 17 Jun 2021, 09:47

I have not much to add but i also urge you to try one loadcell with a much shorter cable (0,5-1m).
Just to rule out, that this is a cable issue.

When i look at your data of the first two days (12th-14th) the weight is stable. Thats odd. Might something has changed in your setup since then?

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: HX711 Weight sensor with long cable

#9 Post by TD-er » 17 Jun 2021, 10:10

Could it also be some external issue, like humidity?
e.g. the cable in a puddle, changing the cable into some kind of capacitor.
Also not sure if the strain resistors are also affected by humidity.

You also mention one channel, the weight goes up and on the other it goes down.
Are both part of the same scale? Has the center of mass moved? Can the scale move freely? Could something have expanded due to heat of the sun, causing some shifts in the scale

Post Reply

Who is online

Users browsing this forum: No registered users and 33 guests