HX711 sometimes gives wrong reading to MQTT broker
Moderators: grovkillen, Stuntteam, TD-er
-
- Normal user
- Posts: 13
- Joined: 02 Jun 2022, 12:12
HX711 sometimes gives wrong reading to MQTT broker
Hi, I have a problem with readings from HX711 to Wemos D1 mini - The system is a beehive scale with two sensors.
System description:
Wemos D1 mini
scale 1 - first HX711 - pins SCK - D7 and DAT - D6 - Measurement Channel A - gain 128,
scale 2 - second HX711 - pins SCK - D1 and DAT - D2 - Measurement Channel A - gain 128.
The system starts every 15 minutes and reads 2 scales from 2 different HX711, the reading interval HX711 is 10 sec.
Problem with readings - the system sometimes sends values significantly different from the correct reading to the HA MQTT controller, e.g. a correct reading of 14 kg, without changing the load, the system suddenly gives a reading of -3,8 kg and then again 14 kg.
Is it possible to apply rules to reject, for example, the largest and smallest result that will be passed to the controller?
Or do you have any other ideas to solve the problem?
Thank you in advance for your help
System description:
Wemos D1 mini
scale 1 - first HX711 - pins SCK - D7 and DAT - D6 - Measurement Channel A - gain 128,
scale 2 - second HX711 - pins SCK - D1 and DAT - D2 - Measurement Channel A - gain 128.
The system starts every 15 minutes and reads 2 scales from 2 different HX711, the reading interval HX711 is 10 sec.
Problem with readings - the system sometimes sends values significantly different from the correct reading to the HA MQTT controller, e.g. a correct reading of 14 kg, without changing the load, the system suddenly gives a reading of -3,8 kg and then again 14 kg.
Is it possible to apply rules to reject, for example, the largest and smallest result that will be passed to the controller?
Or do you have any other ideas to solve the problem?
Thank you in advance for your help
Last edited by kaczmar1989 on 22 Feb 2023, 14:05, edited 3 times in total.
Re: HX711 sometimes gives wrong reading to MQTT broker
What version of ESPEasy do you have installed on your ESP?
/Ton (PayPal.me)
-
- Normal user
- Posts: 13
- Joined: 02 Jun 2022, 12:12
Re: HX711 sometimes gives wrong reading to MQTT broker
Build: ESP_Easy_mega_20221224_collection_A_ESP8266_4M1M_VCC Dec 24 2022
Re: HX711 sometimes gives wrong reading to MQTT broker
Please download the ESP8266 zip file from this Github Actions run, and install the same Collection A build (via Tools/Update Firmware button).
I've fixed a few issues with the HX711 plugin recently (multiple plugin-instances, dual-channel support, stability), that's already merged but not yet released.
You will need a (free) Github account to be able to download that file.
I've fixed a few issues with the HX711 plugin recently (multiple plugin-instances, dual-channel support, stability), that's already merged but not yet released.
You will need a (free) Github account to be able to download that file.
/Ton (PayPal.me)
-
- Normal user
- Posts: 13
- Joined: 02 Jun 2022, 12:12
Re: HX711 sometimes gives wrong reading to MQTT broker
Thanks, I'll test it and let you know if it works.
-
- Normal user
- Posts: 13
- Joined: 02 Jun 2022, 12:12
Re: HX711 sometimes gives wrong reading to MQTT broker
It doesn't work properly - after Deep sleep first it sends 0 kg to the MQTT broker and next step send the correct weight.
In domoticz it correctly sends the weight to controlers.
In domoticz it correctly sends the weight to controlers.
-
- Normal user
- Posts: 13
- Joined: 02 Jun 2022, 12:12
Re: HX711 sometimes gives wrong reading to MQTT broker
Do you have any idea how to solve the problem of sending value 0 after deep sleep?
In domoticz it correctly sends value.
In domoticz it correctly sends value.
Re: HX711 sometimes gives wrong reading to MQTT broker
That will probably need a new setting, to suppress the first value after startup. After initialization of a plugin, the Plugin_Read event is fired, as if an Interval has passed.kaczmar1989 wrote: ↑23 Feb 2023, 21:18 Do you have any idea how to solve the problem of sending value 0 after deep sleep?
I assume it is often used with a 0 starting point, so that it doesn't matter that the initial measurement is 0...
/Ton (PayPal.me)
-
- Normal user
- Posts: 13
- Joined: 02 Jun 2022, 12:12
Re: HX711 sometimes gives wrong reading to MQTT broker
When there is a load on the scale all the time - the weight of the hive - a reading of 0 is misleading and destroys the graph.
Re: HX711 sometimes gives wrong reading to MQTT broker
Yes, that's clear. I only recently worked on the code of that plugin, it has been in ESPEasy for longer then I have been using/working on ESPEasykaczmar1989 wrote: ↑23 Feb 2023, 21:41 When there is a load on the scale all the time - the weight of the hive - a reading of 0 is misleading and destroys the graph.
/Ton (PayPal.me)
-
- Normal user
- Posts: 13
- Joined: 02 Jun 2022, 12:12
Re: HX711 sometimes gives wrong reading to MQTT broker
If you solved my problem i would be very happy.
Re: HX711 sometimes gives wrong reading to MQTT broker
I have created a pull request #4517 to this effect. It is available from this Github Actions run in a short while, for you to test.
/Ton (PayPal.me)
-
- Normal user
- Posts: 13
- Joined: 02 Jun 2022, 12:12
Re: HX711 sometimes gives wrong reading to MQTT broker
Now correctly reports the value to the mqtt broker. I will leave a few days for testing without changing the load - we'll see if it works stably.
Re: HX711 sometimes gives wrong reading to MQTT broker
Thanks for the feedback
Looks really promising
Looks really promising
/Ton (PayPal.me)
Re: HX711 sometimes gives wrong reading to MQTT broker
Those load cells and HX711 can be somewhat sensitive to temperature, so keep that in mind when you experience some drift without changing the load.
-
- Normal user
- Posts: 13
- Joined: 02 Jun 2022, 12:12
Re: HX711 sometimes gives wrong reading to MQTT broker
Yes, I know, I noticed temperature-dependent changes in the indication, but the values change very little. It works fine for now. There are no big jumps in value. Such accuracy is enough for the weight of the hive.
Who is online
Users browsing this forum: Ahrefs [Bot] and 80 guests