ESP8266 + HX711 + 4 small load cells giving incorrect values

Tags: #<Tag:0x00007f7394e24258> #<Tag:0x00007f7394e24118>

I’m having a hard time getting these HX711 + load cells to work.

Currently using:

  • HX711 Sensor
  • Wemos D1 Mini
  • 4 Load cells connected in wheatstone bridge

I’ve tried hooking them up in different ways and experimenting with the sensor, YAML, firmware but could never get accurate readings. What am I missing to get these working. Note that I connected the wires for the load cells by twirling them together and then hot-glueing them, previously soldered them but made no difference.

I’m just getting the same very high negative value (even when placing different weights on the cells) and when I look at the history it briefly changed to another value (with nothing on the scale)

Wemos D1 mini connected to HX711 via 2 GPIO pins and 5V.

substitutions:
  device_name: esp8266_hx711
  friendly_name: "ESP8266 HX711"

esphome:
  name: "${device_name}"
  platform: ESP8266
  board: d1_mini

<<: !include common.yaml

sensor:
  - platform: hx711
    name: "Weight"
    dout_pin: D1
    clk_pin: D2
    gain: 128
    update_interval: 30s


Screenshot 2020-06-18 at 18.01.26

1 Like

The wemos inputs are only rated for 3.3v. Try running the HX711 from 3.3v.

Doesn’t seem to make any difference running on the 3v3 pin. Shows the same reading with nothing on the scale, a clay pot and a propagation station in plastic.


Have you checked here: https://github.com/Skaronator/ESP8266-Load-Cell maybe they can help?

@thibmaek Wemos DI has a divider of 3.3 on the adc input.
You need to multiply with 3.3 to get correct results.
This divider is placed to protect the ADC input which can take max of 1 Volt.

sensor:
  - platform: hx711
    name: "Weight"
    dout_pin: D1
    clk_pin: D2
    gain: 128
    filters:
     - multiply: 3.3
    update_interval: 30s

Hope this helps.

That clarifies it a bit, but I’m confused. Since I’m not using A0 but dout (digital out) D1 on the Wemos, it seems like I’m not using the ADC pin?

@thibmaek have look at calibrating as given here.
https://esphome.io/components/sensor/hx711.html

@thibmaek
You have indicated that you have connected the load cells in Wheatstone bridge config.
Is the reading of each load cell added and finally divided by 4?

Multiplying by 3.3 didn’t do the trick. Here’s how I connected everything. The diagram doesn’t show wiring to D1 Mini but I’ve got that to:

  • DAT: D2
  • CLK: D3
  • GND: GND
  • VCC: 3.3V

Apart from the ESPHome code above I have not made any additional changes like dividing by 4

[14:50:11][D][hx711:031]: 'Weight': Got value -8388608
[14:50:11][D][sensor:092]: 'Weight': Sending state -27682406.00000  with 0 decimals of accuracy
[14:50:35][D][sensor:092]: 'ESP8266 HX711 — Uptime': Sending state 55.86800 s with 0 decimals of accuracy
[14:50:41][D][hx711:031]: 'Weight': Got value -8388608
[14:50:41][D][sensor:092]: 'Weight': Sending state -27682406.00000  with 0 decimals of accuracy
[14:50:52][D][sensor:092]: 'ESP8266 HX711 — Signal': Sending state -78.00000 dB with 0 decimals of accuracy
[14:51:11][D][hx711:031]: 'Weight': Got value -8388608
[14:51:11][D][sensor:092]: 'Weight': Sending state -27682406.00000  with 0 decimals of accuracy
[14:51:35][D][sensor:092]: 'ESP8266 HX711 — Uptime': Sending state 115.86700 s with 0 decimals of accuracy
[14:51:41][D][hx711:031]: 'Weight': Got value -8388608
[14:51:41][D][sensor:092]: 'Weight': Sending state -27682406.00000  with 0 decimals of accuracy

Another thing I noticed is that all four load cells are placed in the base packaging material which is compressible. How about placing them on the floor instead.

Yeah, that’s a 3D printed case I put them in but makes no difference on the floor, tried that before as well.

Just starting this project and from what I see you have your black & white wires connected incorrectly. Don’t know if that is what’s causing your problem or not but worth a test.

I’m using the picture from here in step 10 https://www.instructables.com/id/Wi-Fi-Smart-Scale-with-ESP8266-Arduino-IDE-Adafrui/

Where did you get your bases from?
Hope this helps

My wiring is basically the same but in the opposite direction, don’t think that matters (only direction might be reversed in readings) The bases are 3d printed, load cells and HX711 from Aliexpress

Used the diagram and code from this: https://www.thingiverse.com/thing:4213002

@thibmaek, you have not applied the calibration if you notice very large negative number is zeroed and another negative value set to about 79 Kg.
Maybe without calibration the output is negative.
I am quoting from the link posted by you

Whatever weight I put on the scale, the value always reads 8388608

For purpose of testing may I suggest you test with only one weight sensor at a time. Follow the diagram as shown on page 6 of 10 in this data sheet here:
https://www.mouser.com/datasheet/2/813/hx711_english-1022875.pdf

@thibmaek have a look at this:
https://learn.sparkfun.com/tutorials/getting-started-with-load-cells/all
Same setup as yours.

I now have this but it seems to wildly fluctuate even when there is no weight applied to the scale.

Started at 0.0 kg then went up to 0.19. I think these load cells are only meant to measure rough and high loads, not to the gram.

filters:
      - calibrate_linear:
          - -2112820 -> 0
          - -1279866 -> 2.684 # measured this with a kitchen scale first
[11:23:43][D][hx711:031]: 'Weight': Got value -2052437
[11:23:43][D][sensor:092]: 'Weight': Sending state 0.19457 kg with 0 decimals of accuracy
[11:24:13][D][hx711:031]: 'Weight': Got value -2054781
[11:24:13][D][sensor:092]: 'Weight': Sending state 0.18702 kg with 0 decimals of accuracy
[11:24:21][D][sensor:092]: 'ESP8266 HX711 — Uptime': Sending state 3243.59399 s with 0 decimals of accuracy
[11:24:22][D][sensor:092]: 'ESP8266 HX711 — Signal': Sending state -81.00000 dB with 0 decimals of accuracy
[11:24:43][D][hx711:031]: 'Weight': Got value -2055960
[11:24:44][D][sensor:092]: 'Weight': Sending state 0.18322 kg with 0 decimals of accuracy
[11:25:13][D][hx711:031]: 'Weight': Got value -2057177
[11:25:13][D][sensor:092]: 'Weight': Sending state 0.17930 kg with 0 decimals of accuracy
[11:25:21][D][sensor:092]: 'ESP8266 HX711 — Uptime': Sending state 3303.59009 s with 0 decimals of accuracy
[11:25:22][D][sensor:092]: 'ESP8266 HX711 — Signal': Sending state -80.00000 dB with 0 decimals of accuracy
[11:25:43][D][hx711:031]: 'Weight': Got value -2055728
[11:25:43][D][sensor:092]: 'Weight': Sending state 0.18397 kg with 0 decimals of accuracy
[11:26:13][D][hx711:031]: 'Weight': Got value -2057550
[11:26:13][D][sensor:092]: 'Weight': Sending state 0.17809 kg with 0 decimals of accuracy
[11:26:21][D][sensor:092]: 'ESP8266 HX711 — Uptime': Sending state 3363.58789 s with 0 decimals of accuracy
[11:26:22][D][sensor:092]: 'ESP8266 HX711 — Signal': Sending state -81.00000 dB with 0 decimals of accuracy
[11:26:43][D][hx711:031]: 'Weight': Got value -2060993
[11:26:44][D][sensor:092]: 'Weight': Sending state 0.16700 kg with 0 decimals of accuracy
[11:27:13][D][hx711:031]: 'Weight': Got value -2062969
[11:27:13][D][sensor:092]: 'Weight': Sending state 0.16063 kg with 0 decimals of accuracy
[11:27:21][D][sensor:092]: 'ESP8266 HX711 — Uptime': Sending state 3423.58691 s with 0 decimals of accuracy
[11:27:22][D][sensor:092]: 'ESP8266 HX711 — Signal': Sending state -80.00000 dB with 0 decimals of accuracy
[11:27:43][D][hx711:031]: 'Weight': Got value -2061792
[11:27:43][D][sensor:092]: 'Weight': Sending state 0.16443 kg with 0 decimals of accuracy

Even with a weight applied it seems to just build up the weight the longer the ESP stays active.
Started at 2.6kg, after 30 min reading 4.99640 kg without a different weight applied to it.

@thibmaek, if you have an Arduino why don’t you test these load cells with it.

https://github.com/espressif/arduino-esp32/issues/936