Esp32 shorts out tp4056 status pins when powered off

Gabriel992
Posts: 1
Joined: Wed Nov 29, 2023 12:49 pm

Esp32 shorts out tp4056 status pins when powered off

Postby Gabriel992 » Wed Nov 29, 2023 1:04 pm

Hello, this is my first post, i hope I'm not in the wrong category :) I've been struggling with this problem for the last 2 days and for the life of me i cant figure it out.
Basically i have a tp4056 battery charging module with 2 wires coming from the open drain status pins (6 and 7) to a Esp32 devkit board pins 34 and 35. Everything works perfectly, i can read the tp4056 status charging/charged just by declaring the pins 34 and 35 as INPUT_PULLUP and digitalRead, however if the esp32 is powered off both status LED's on the tp4056 light up like they are shorted together or something. What could be causing this? Has anyone had this problem before? Could it be that the status LEDs also have pull up resistors and somehow interfere with the resistors inside the esp32 board when it's powered off?

ESP_Sprite
Posts: 9583
Joined: Thu Nov 26, 2015 4:08 am

Re: Esp32 shorts out tp4056 status pins when powered off

Postby ESP_Sprite » Thu Nov 30, 2023 2:39 am

It's because an ESP32, like most chips, have ESD protection on its pins. You can see that as a diode that shorts everything that is lower than 0V to the GND rail, and everything that is higher than the power supply to the power supply rail. If you power off the ESP32 by disconnecting its power rail, that will sit at 0V, and whatever GPIO you connect the status pins to will run a current from the positive of the LED via the GPIO via the internal ESD protection to the now-0V power supply rail.

A fix could be to add two diodes in the signal lines, so the current can't flow that way even when the ESP32 is off. Other ways are to power down the ESP32 by keeping the power rails up but making EN low.

Who is online

Users browsing this forum: Google [Bot] and 71 guests