xreef / PCF8575_library

i2c 16bits digital expander with i2c digital expander for Arduino, Raspberry Pi Pico and rp2040 boards, esp32, SMT32 and ESP8266. Can read write digital values with only 2 wire. Very simple and encoder support. Uncommet NOT_SEQUENTIAL_PINOUT define to have pins like datasheet and not sequential one.
MIT License
53 stars 19 forks source link

Keypress Wiring Not registering low #12

Closed neliel123 closed 6 months ago

neliel123 commented 1 year ago

Hi, I tried the keypress on a switch button and followed the wiring on your home page. I then used the code here https://github.com/xreef/PCF8575_library/blob/master/examples/keyPressedPin1/keyPressedPin1.ino I am using an ESP32 and it actually does not work for me.

If I removed the 10K pull-down resistor connected to the ground then it now work. I brought out my tester and I noticed that when the switch is open the reading at the P1 pin is around 4.2V (HIGH) but when I pressed the button it goes down to 3.9V which still registers as a HIGH which is not registering a LOW.

I tried removing the 10K resistor and everything is ok?

Can you comment on this or if the wiring is correct? Or I could be missing some setup on my end. Thank you.

neliel123 commented 1 year ago

I think my solution is not appropriate... If I removed the 10K resistor then it looks like that I am shorting the VCC pin to the ground which is bad I believe.

But if I do not do that then it is not registering a LOW on the P1 input pin.

Is my concern valid or I am just making something wrong on my circuit? I know your diagram uses an Arduino Uno board but I think they are applicable to ESP32 right?

donskytech commented 1 year ago

Found the issue. I think the wiring on the switch on the project home page is wrong. Change the input pin to the other end of the switch.