Page 1 of 1

Can reversed polarity damage GPIO?

Posted: Fri Feb 16, 2024 12:39 am
by 22Essence
Hi!
I'm working on this project with a Lolin32 Lite and has a built in lipo battery charger. I connected a voltage divider so I can get the battery voltage and it seems to work just fine. I also want to know when the battery is fully charged, the board has a led light (the one marked as "charge" at the picture) that turns on when charging and turns off when fully charged, so I thought about connecting one of the led pins to one of the GPIO so I can set it as an input.
I tried measuring the voltage between GND and one of the led pins but I couldn't get an stable voltage (around 1,6v and 3,3v). What I could fin out is that the polarity changed when the led was on or off.

Finally I gave it a go and soldered a wire to one of the LTH7 pins (the one at the bottom left at the picture) that is connected to one of the led pins (the one at the bottom) just because it was easier to solder, and connected it to the GPIO14.

Image

After setting the pin as an input I can check if the battery is being charged when GPIO14 is DOWN and It has been working with no problem for many hours and multiple tests.

My question is if dealing with the reversed polarity could damage the GPIO pin or even the whole board.

Thanks and sorry for my bad English!

Re: Can reversed polarity damage GPIO?

Posted: Fri Feb 16, 2024 3:55 pm
by mikemoy
My question is if dealing with the reversed polarity could damage the GPIO pin or even the whole board.
Basically Yes,

If you look at the schematic for the board 5v goes through a 2k resistor to one end the led and the other goes to the the charge controller (pin 1).

To be safe you could either

A) take Pin 1 and have it drive a transistor or fet to then toggle your input pin.
B) Using a voltage divider to ensure it does not go above 3.3v.