I have an Adafruit Feather ESP32 whose GPIOs I use to control an external device. I don't want the device to drain the power of the ESP32 sometimes, so I set the GPIOs to INPUT. When I go into deep sleep though, the GPIOs suddenly get some random voltages and start drawing power. A few GPIOs are 3.3V, others are 0.7V, and some are near 0V.

What is the correct/standard way to make the microcontroller not leak any power to that external device. One way is obviously physically disconnecting that device, but I want an automated way. Is it solvable by software or do I need special hardware to achieve my goal?

  • 1
    measure the current flowing at the GPIO pins when the ESP32 is in deep sleep .... measuring the voltage tells you nothing about the current, unless you know the value of the resistance – jsotola Mar 15 at 5:22
  • the board has a pull-up on some pins – Juraj Mar 15 at 7:56
  • @jsotola Certainly I also measured the current. When I disconnect the external device, the current drops significantly. – clash Mar 15 at 8:37
  • @Jurai that is true. So I moved away from those pins. This does not entirely solve my problem though. I want the current to the external device be the same as when I disconnect the external device: 0A. How can I achieve this? – clash Mar 15 at 8:40
  • Please provide some more information. What is the external device? How do you power this device? How is it connected? PS setting a pin to input, means it's now "floating" so it could be any voltage. – Gerben Mar 15 at 16:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.