ESP8266 + HX711 + 4 small load cells giving incorrect values

@thibmaek from the log it shows you’ve configured DOUT Pin as INPUT and SCK
Pin as OUTPUT
DOUT Pin should be as OUTPUT and SCK Pin as INPUT. Below is snippet of code from the HX711.h


class HX711
{
	private:
		byte PD_SCK;	// Power Down and Serial Clock Input Pin
		byte DOUT;		// Serial Data Output Pin
		byte GAIN;		// amplification factor
		long OFFSET = 0;	// used for tare weight

You have defined these pins in your common.yaml?

I have this configured for the DOUT and SCK pin:

dout_pin: D1 # OUTPUT
clk_pin: D2 # INPUT

And wired DT (HX711) to D1 (NodeMCU/Wemos) and SCK to D2.

Check your previous post in which you have put the image of the logs. In this image DOOUT is input


https://community-assets.home-assistant.io/original/3X/4/d/4d76e080038e37a429dad0d7a657af1dc5865c57.png

Try running that log again, and see the output of the log.

@diaphanouscloak based on your picture of the load cell have ordered the 3d printed shoes(so to say) for the load cells. Will test the setup after they are delivered, expected by 6 August.

I used this thread to get 4 identical load cells, HX711 and wheatstone wiring as OP, got them wired up to a NodeMCU.

The first values I got were in the range of 8388607, which came awfully close to your first reported values, except the minus. As I used welding clamps to create the Wheatstone bridge, I suspected my wire connections were not solid. After soldering everything, I got -234390 at zero loads. One KG gave me around -234046 (I will have to do this again with a more exact weight)

Simply using the ‘calibrate_linear’ function in ESPHome solved the negative scale, every load cell works like a charm now.

My ESPHome code:

esphome:
  name: nodemculoadcell
  platform: ESP8266
  board: nodemcuv2

wifi:
  ssid: "MySSID"
  password: "MyPassword"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "MySSID"
    password: "MyPassword"

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:

sensor:
  - platform: hx711
    name: "HX711 Value"
    dout_pin: D0
    clk_pin: D1
    gain: 128
    update_interval: 10s
    
    # ... Other HX711 options
    filters:
      - calibrate_linear:
          - -234390 -> 0
          - -234046 -> 1
    unit_of_measurement: kg

@thibmaek did you ever get this to work correctly?
I have started getting -838860.00 all of a sudden also.
Worked before that for several months, so not sure what caused it?

Nope. I never got it working and gave up in the end to focus on other projects. I suspect this method of weighing with a HX711 and the load cells I have (square ones) is just not very accurate

I agree on the accuracy but was only using this to determine if I was in bed or not so the value didn’t need to be accurate.
I ended up redoing all the connections of the load cells and found oxidation around the solder points so I just tied them together instead, then shrink wrapped them and it works again now.

Hey guys

I’m also having this issue -838860.00

After a bunch of testing I have no continuity from the + pins (I have the green HX711) to VCC

Can someone confirm I would need to bridge it? GND to - pins are ok

Thanks

Have the same setup. D1 mini, HX711 green board and 4x 50kg load cell.
Tryed everything, but not working. Arduino and tasmota too. 2 different laptop and pc. Changed usb cables and ports.
Used D1 mini 5V GND D1 and D2 ports.
Have 2x HX711 and 8x loadcell not working at all. Only D1 mini can’t change yet. Maybe that is the problem?
Tryed E- to GND but nothing changed.
When I measure the load cells all are good E+ and E- 2kohms and the same between A+ A-.

Holy smokes this was one convoluted thread. All you have to do is follow the docs:

I’ve got several working with various brands. They literally all work the same if you follow the directions.

:slight_smile: tryed every permutation. Spent about 2 weeks for it. Many times resoldered everything.
Receive some ESP32 board now and use with that. One of my green HX711 not working at all and the chip very hot on it, never seen any value change.
The same connection the second green HX711 try to work but the value always moving down and up. If I put some weight I see that but never the right value. Setting up the filters but after restart get another value so can’t setup correctly. After some restart just stopped working and get high value about 8xxxxxx constantly and after that never show any change. Tryed with pc usb and with my phone charger with usb connection but nothing changed.

filters:
      - calibrate_linear:
          - 1147446 -> 0
          - 1059000 -> 4.135

This is my full code:

esphome:
  name: esp32
  platform: ESP32
  board: esp32dev

# Enable logging
logger:

esp32_ble_tracker:

# Enable Home Assistant API
api:

ota:
  password: "xxxxxxxxxxxxxxxxxxxxx"

wifi:
  ssid: "xxxxxxxxx"
  password: "xxxxxxxxxxx"
  

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esp32 Fallback Hotspot"
    password: "mksquiiKAPlX"

captive_portal:

sensor:
  - platform: hx711
    name: "Bed Weight (L)"
    id: bed_weight_l
    dout_pin: 12
    clk_pin: 14
    gain: 128
    filters:
      - calibrate_linear:
          - 1147446 -> 0
          - 1059000 -> 4.135
      - sliding_window_moving_average:
          window_size: 5
          send_every: 5
    update_interval: 2s
    unit_of_measurement: kg
    accuracy_decimals: 2

Holy smokes this was one convoluted thread. All you have to do is follow the docs

No need to be so pedantic when a bunch of people with the same problems try to figure out a solution

Not trying to be insulting at all. It’s just people come to these forums looking for answers and this issue is simply user error. It’s not hard at all. It’s 4 wires and a few lines of code. If its connected properly, it works. The op simply doesn’t have something connected right but instead of trying to help him through that, we have people talking about 5v vs 3.3v or various calibration algorithms One user (Karanbir) even suggests using a multiply filter. What?! That isn’t even remotely in the ballpark of helping. It’s frustrating for users to come here and read through pages and pages of various rabbit holes of troubleshooting which just makes the “problem” even more complex to diagnose. There were 2 or 3 users who actually posted the correct answers but for some reason they were ignored.