I’m trying to connect a PCF8574 to a Wemos D1 Mini. I would like to eventually daisy-chain 4 of the PCF8574 to one Wemos D1 Mini. Supposedly, you can connect up to 8.
If you daisy chain the pcf8574 board each board needs a different address. The addresses range from 0x20 to 0x27. From what I understand, you change the address by adjusting jumpers on the board. (address table). If I’m understanding this right, and I’m no expert, the image below would show an address of 0x21, correct?
Moving all the jumpers to the right (-) is the default and has an address of 0x20. When the jumpers are in that position (address 0x20) everything works great. I can connect the board to the Wemos D1 Mini, the Wemos boots, and ESPhome reads the GPIO pins on the pcf8574 board. But, with the address pins in any other position (any address other than 0x20) the Wemos D1 Mini board won’t even boot.
My connections from Wemos D1 Mini to first pcf8574
pcf8574 -> Wemos D1
vcc -> 3.3v
gnd -> G
SDA -> D2
SCL -> D1
Correct, it fails even if one expansion board is set 0x21.
If I unplug the wemos, set the address to 0x20, the plug the wemos back in I get a quick flash of the LED on the wemos and within 10 seconds ESPhome connects to the board. If I then unplug the wemos, set the address to 0x21 (or any other address) and plug the wemos back in the blue LED on the wemos board doesn’t flash and ESPhome can’t find the board. The ESPho.e log just says “can’t connect”
If I connect the Wemos to my Pi running HA with the pcf8574 on address 0x21 I just see this in the log.
INFO Connecting to 192.168.1.31:6053 (192.168.1.31)
WARNING Initial connection failed. The ESP might not be connected to WiFi yet (Error connecting to 192.168.1.31: [Errno 113] No route to host). Re-Trying in 30 seconds
Here is what the log shows after commenting out those lines
When the pcf8574 is set to 0x20
INFO Connecting to 192.168.1.31:6053 (192.168.1.31)
WARNING Couldn't connect to API (Error connecting to 192.168.1.31: [Errno 113] No route to host). Trying to reconnect in 25 seconds
I have tried two different PCF8574 boards with the same results. I have not tried to switch out the Wemos D1 Mini.
I do have a multimeter. Can you clarify what pins you are referring to? Do you mean that all 3 address pins (A0-A2) should be GND when on address 0x20? And address 0x21 should have VCC on address in A2? Or are you referring to different pins?
I bought a NodeMCU to see if it would work with that. It doesn’t I have the same issue. I even seemed to have the problem before installing ESPhome on the NodeMCU. With the PCF8574 in 0x20 the LED on the non-programmed NodeMCU flashed. With any other address I don’t get an LED flash when I power up the NodeMCU.
Do I need to add any resistors or anything between the pcf8574 and the Weoms D1 Mini? I currently just have bread board jumper wires connect directly from the pcf8574 to the wemos d1 mini.
I’m getting the same issue with a different project connecting the board to my Arduino Uno. Whenever I set the address to anything other than 0x20my Arduino won’t boot up at all. Even if I only have a single board connected to the Arduino
I have 4 PCF 8574 boards. They all behave exactly the same way. I. Getting ready to send them back thinking there is some kind of manufacturing issue
I found this in the header for the arduino library. In the past I’ve had similar issues myself and couldn’t work it out. To me the it’s hardcored for that 0x21 address?!