I'm trying to build a door sensor with the esp8266. I want it to be battery powered and use deepSleep for power saving. I'm going to use a normally closed reed switch between D0 (GPIO16) and RST.

I set the deepsleep to be for about 30 seconds (time to close the door). After that GPIO16 goes LOW and when the door is opened it will close the circuit and connect GPIO16 to RST and reboot the board.

Since the Red onboard LED is connected to GPIO16 and is activated on LOW as well, at the end of deepsleep it turns on.

2 Questions

  1. Is this setup a good approach to powersaving on the esp8266? My concern is how much power setting GPIO16 to LOW uses.

  2. Is it save to just rip off the LED from the board? I figure it being on would be the biggest drain of battery power. I already did some googling and it SEEMS safe? But I trust stack over forums.

  • the Red onboard LED is connected to GPIO16 - which board is that? Mar 27, 2018 at 7:42
  • If I understand correctly your LED is working when the deep sleep is activated?
    – Coder_fox
    Mar 27, 2018 at 8:24
  • @Coder_fox at the end of the deepsleep timeout GPIO16 goes LOW, the LED turns on because it is connected to GPIO16 and turns on when LOW.
    – Danielle
    Mar 27, 2018 at 17:43
  • @JaromandaX nodeMUC board.
    – Danielle
    Mar 27, 2018 at 17:43
  • the battery would last longer if you powered it through the reed switch, obsoleting any power-saving code with a true zero-current standby. Using ESPNOW, you can fire off an event in 200ms, then go to sleep until the reed disconnects or sleep for 30 seconds to try to re-broadcast a "door is still open" message. I've moved a lot of sensors to ESPNOW and it can fire off messages faster than an always-on pre-connected http sketch, taking into account wifi sleep/lag.
    – dandavis
    Mar 27, 2018 at 19:40

1 Answer 1


Following @dandavis's advice. I will connect the switch between the power source and the board, get rid of the LED, and use ESPNOW for communication! Thanks for the help.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.