Chat freely about anything...

User avatar
By cristian_c
#91716 Hi, I've searched in the web a lot but I've found nothing related to that until now. I've got esp8266 board (Wemos d1 mini) and a battery shield (I've got a LiPo battery too). So, I've planned to put this stuff in a plastic case and in this way there is no need to power Wemos d1 mini on by cable.

Anyway, I need to power on and off the device using a pushbutton (because esp8266 board is battery-powered) but I don't know how to make this possible. I mean:
1) How should pushbutton be wired to Wemos d1 mini (or battery shield)? Which pins?
2) Which type of code should I write in order to make that working?

I've got no information until now, so I ask for help in this forum. Waiting for a reply, thanks.
User avatar
By deflaok
#91798 You forgot about the power supply in your cost. Does your spouse/gf approve of arcade buttons on the wall? You can do something similar using cheap WiFi switches ($12-16) and Tasmota firmware and you don't have to stuff a power brick in your outlet box.
User avatar
By Bonzo
#91807 You could get a latching button or slide switch and put it into your 3V3 supply to your Wemos.

I used a slide switch on a project although most of them don't have the current rating. You should really use a P mosfet with it.

If you would be happy with a toggle switch they are rated for higher currents.