PCF8574 does not read as HIGH signals from PIR HC-SR501

Hi wonderful community,

I am having problems when reading the signals coming from my PIR sensors on a PCF8574 WaveShare card.

I was about to get crazy when reading always 1 in all the pins after restarting and don't know why sometimes I read 0s.

Anyway, the pins are set as INPUT because my idea is to read the state of the PIRs connected to it.

When the PIRs detect movement they send a 3,3V signal through the output pin which I connect directly to the corresponding pin on the PCF8574 board.

Everything is well addressed (the I/O expander) because I can read the status when connect directly the PINs from the PCF8574 to VCC in the protoboard, that's why I guess the problem is not there.

My problem is that I don't understand why when the PCF8574 receives the same +3,3V signal from the sensors, it does not read them as HIGH. I have checked the current flowing in both cases (when connecting the I/O pins to VCC directly, which is about 60-70mA), and (when connecting the +3,3V from the output of the sensor to the I/O pins on the PCF8574, which is very low 2,5mA).

So, I don't know if it is due to the Sensor is not available to deliver more current and so the PCF8574 is not able to detect that as a HIGH state, or simply I am doing something wrong.

I have been thinking to then put in the middle some Reles which leads the I/O expander Pins to VCC when the corresponding PIR sensors activate them, but that would be against what I am precisely looking for (reduce the total consumption). I have understood that a Rele average consumption is around 90mA, which is totally out of the range I am expecting to.

Finally, why is this happening? Is it not supposed to be very simple? just connect the expander and then start reading the signals normally? I don't think this PCF8574 is that useful when using it as an INPUT PIN expander. am I doing something wrong? Shall I add pull-up or pull-down resistors to the I/O Pins?.

Well, let's see how we can start, I will not bother you guys with more details yet. If you want to see the code or some pics, just let me know.


Are the grounds connected from the PIR and the PCF?

Are the grounds connected from the PIR and the PCF?

Yes, at the beginning I thought it was that; I joint all the grounds. From one side of the protoboard I have the 3,3V line and on the other 5,0V. But all the grounds are joined.

The 3,3V, 5V, and the ground are taken from a Nodemcu card, which is the controller finally I will use it with the extenders.

According to the datasheet, the max clampcurrent of an i/o pin of the PCF8574 is 20mA so if you’re measuring 60-70mA, something is wrong.

did you define the state of the pin by pull-down resistors?

please post a schematic or picture.