Electronic – ESP32: LED turns on when deep sleep is activated

esp32ledmicrocontroller

I'm trying to figure out why a LED I connected to GPIO #15 and GND on an Adafruit's ESP32 board is turning on (but dimmed) when I launch the deepsleep() mode via machine.deepsleep() (board running on MicroPython).

The LED pin is instantiated in the code like this: MY_LED = Pin(15, Pin.OUT)

The last operation done on the pin is pin.value(0).

Here's a partial circuit diagram:

enter image description here

Has anyone seen such a thing? Why does it turn on when it's off right before the machine.deepsleep() command line?

Best Answer

As pointed out in the comments, the issue was coming from a "weak pull-down syndrome": I simply changed the pin declaration to MY_LED = Pin(15, Pin.OUT, Pin.PULL_DOWN) and the problem went away.