So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By Alelex
#66183 Hi all. I am building a panic button project with the NodeMCU and am in need of some advice on how to power the board with batteries to make it last as long as possible.
In summary, I have written my code in such a way that if a button on my circuit is pressed, the microcontroller wakes up from deepsleep mode, connects to the wifi, sends the message and goes back to sleep after the message has been sent. ( I wired RST to GPIO 16 and connected a switchbutton in between).
I have tried using a 9V battery connected to Vin and ground, however even in deep sleep mode it drains it quite fast even though it was supposed to be around 20 microamps I thought. (according to the datasheet)
Anyway, the panic button isn't something that will be pressed too often, at most once every few months, so the device will be in deepsleep(0) mode for 99% of the time.
All I need is some advice for powering the nodeMCU to give it the longest possible battery life while in deep sleep mode. It will only be out of deepsleep mode for 15 seconds once every few months.

Thank you in advance,

Alex

EDIT 1 : removed wire connecting gpio16 to rst and simply connected rst to the switchbutton since I am not using a timer. Dont know yet if that was the reason for my battery losing power so fast during deep sleep mode, will leave it overnight.