USING HX711 ( WITH LOADCELL) WITH PCF8574 IN NODEMCU

Hi,

I have used hx711 and loadcell with nodemcu (esp8266) in its D1 and D2 pins ( here I have used Logic level shifter and a 5v supply to power hx711).It worked perfectly fine.

Due to the lack of enough pins to accommodate other sensors in Nodemcu, I’m using PCF8574. I have connected hx711 to pins P0 and P1 of PCF8574.I’m not able to get any output in serial monitor while running like this.

The PCF8574 was connected using resource -

The Hx711 was connected using this code.It is compiling but not getting any output in serial monitor.

#include “Arduino.h”
#include “PCF8574.h”

// Set i2c HEX address
PCF8574 pcf8574(0x20); // A0,A1,A2 all connected to GND
unsigned long timeElapsed;

include <HX711.h>
HX711 scale;

void setup() {
Serial.begin(9600);
Serial.println(“initializing”);
pcf8574.pinMode(P0,INPUT);
pcf8574.pinMode(P1,OUTPUT);
pcf8574.begin();

Serial.println(“initializing”);

scale.begin(P0,P1); //dt , sck

scale.get_value(5); // print the avg of 5 readings from ADC minus tare weight (not set)
scale.set_scale(-450.f); // callibration value
scale.tare();// reset scale to zero
}

void loop() {

int weight = scale.get_units(3);
Serial.println(weight);
delay(1000)

}

The HX711 library doesn't know anything about IO expanders.
In theory you could write a version that interfaces to something like a PCF8574 but I'm not aware of any.

Perhaps draw a diagram showing what inputs and outputs need to be connected to the Arduino.