NodeMCU + HX711 + 4 50kgs Load Cells Returns "-83388608" or "83388607"

Hello, I'm trying to use 4 50kgs loadcells with a nodemcu and an hx711 to create a Bed Presence Sensor.

This is my circuit

What happen, is that the serial monitor just reports "-83388608" or "83388607" as value. I'm using the hx711 library by Bodge, but I also tried other two different hx711 libraries and all of them gave me the same result.

Anyway, this is the code I'm using now.

#include <Arduino.h>
#include <ArduinoOTA.h>
#include <ESP8266WiFi.h>
#include <PubSubClient.h>

#include "config.h"
#include "HX711.h"

WiFiClient espclient;
PubSubClient client(espclient);

HX711 scale;


void reconnect() {
    // Loop until we're reconnected
    while (!client.connected()) {
        Serial.print("Attempting MQTT connection...");
        // Attempt to connect
        if (client.connect(HOSTNAME, MQTT_USER, MQTT_PASSWORD)) {
            Serial.println("connected");
            // Once connected, publish an announcement...
            client.publish(AVAILABILITY_TOPIC, "online");
        } else {
            Serial.print("failed, rc=");
            Serial.print(client.state());
            Serial.println(" try again in 5 seconds");
            // Wait 5 seconds before retrying
            delay(5000);
        }
    }
}


void setup() {

    
    Serial.begin(115200);
    Serial.println();
    scale.begin(5, 4);

    WiFi.mode(WIFI_STA);
    WiFi.begin(SSID, PASSWORD);
    Serial.print("Connecting...");

    while (WiFi.status() != WL_CONNECTED) {
        delay(500);
        Serial.print(".");
    }
    Serial.println();

    Serial.print("Connected, IP address: ");
    Serial.println(WiFi.localIP());

    client.setServer(MQTT_SERVER, 1883);
}


void loop() {
  static int lastValue = 0;
    int value;
  if (!client.connected()) {
      reconnect();
   
    }
   value = scale.read_average(5);
    Serial.println(value);

    // Only publish new value if difference of 500 or more
    if (abs(lastValue - value) >= 500) {
        String value_str = String(value);
        client.publish(STATE_TOPIC, (char *)value_str.c_str());
        lastValue = value;
    }


}

I also have two copies of this sensor, one soldered to a protoboard and one tested using a breadboard, both seems to give me the same problem.

What can I do?

The wifi and mqtt parts are working fine. The value output from the hx711 is "-8388608" when vcc connected to 3v pin or VU pin (that should output 5v).

I'm quite a noob, but if you guys could give me some advice I would love it.

Check the DO pin with a scope or logic analyzer. Does it change? The values you get indicate that this pin is constantly pulled high, for whatever reason.

I kinda made it work, but in a strange way, I really need someone to explain me what is going on with this.

Normally, as seen in my schematic, the VCC pin on the hx711 should be connected to the 3v pin, but this stuck the output to the infamous value, -8388608.

I was playing with my cables, and I noticed that if I link the 3v pin of nodemcu, to the E+ pin on the HX711, suddenly the load cells are working fine.

What am I missing here? Could I actually wire my sensor this way without even passing from the vcc pin on hx711?

16:44:17.150 -> Connecting....
16:44:17.632 -> Connected, IP address: 192.168.1.136
16:44:17.632 -> Attempting MQTT connection...connected
16:44:19.946 -> -1 -------------> 3v pin not connected to anything
16:44:21.216 -> -1
16:44:22.451 -> -1
[...]
16:44:35.996 -> -8388608 -------------->3v pin connected to vcc, as in the diagram
16:44:38.131 -> -8388608
16:44:43.015 -> -8388608
16:44:45.150 -> -8388608
16:44:47.283 -> -8388608
16:44:48.525 -> -1 ------------->3v pin disconnected again
16:44:50.589 -> -327076 ------------> 3v pin connected to E+ pin (vcc not connected to anything)
16:44:52.714 -> -326920
16:44:54.885 -> -202974 ------>applying load to the loadcells, it works
16:44:57.010 -> -223136
16:44:59.142 -> -194757
16:45:01.278 -> -165867
16:45:03.413 -> -362636
16:45:05.581 -> -329727
16:45:07.712 -> -327398
16:45:09.850 -> -327435

Your circuit is wrong (but it might have nothing to do with the problem you're having).
A standard HX711 board with a single VCC input needs a 5volt supply for a stable output.

There are HX711 boards with seperate analogue and digital VCC pins, suitable for 3.3volt processors (NodeMCU).
Or you can make one by separating the two VCCs with a craft knife.
Post a picture and/or link of the board you have.
Leo..

Edit:
Look at this board. It has a VCC pin for the analogue/load cell part of the HX711 (4.6volt minimum).
Can be powered from the 5volt/USB pin of the NodeMCU.
And a VDD pin for the digital half of the HX711, that must be powered from the 3.3volt pin.
Schematics can be found on the same page.
(note that the VCC voltage range on that .pdf is wrong, email sent).

Wawa:
Your circuit is wrong (but it might have nothing to do with the problem you're having).
A standard HX711 board with a single VCC input needs a 5volt supply for a stable output.

There are HX711 boards with seperate analogue and digital VCC pins, suitable for 3.3volt processors (NodeMCU).
Or you can make one by separating the two VCCs with a craft knife.
Post a picture and/or link of the board you have.
Leo..

Edit:
Look at this board. It has a VCC pin for the analogue/load cell part of the HX711 (4.6volt minimum).
Can be powered from the 5volt/USB pin of the NodeMCU.
And a VDD pin for the digital half of the HX711, that must be powered from the 3.3volt pin.
Schematics can be found on the same page.
(note that the VCC voltage range on that .pdf is wrong, email sent).

Ok, thanks a lot, I'll buy this one for my next sensor. Do you have any idea why my scale is working with the circuit I posted? I know it should be wrong, but I let it run for about 12 hours now, and it hasn't show any problem for now. Do I risk something?

As said, if you're clever you can separarate VCC and VDD yourself.
Show us clear pictures if you want help with that.

Are you sure the setup can take the weight of a bed with occupant,
and the bridge is not too far out of ballance with bed only.
Measure the voltage between A+ and A-
I think it should be (a lot) less than 40mV, bed only.
Leo..