-->
Page 1 of 1

Turning Wemos D1 mini on/off by a pushbutton

PostPosted: Sun Jun 20, 2021 11:17 am
by cristian_c
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.

Re: Turning Wemos D1 mini on/off by a pushbutton

PostPosted: Thu Jul 01, 2021 9:36 am
by deflaok
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.

Re: Turning Wemos D1 mini on/off by a pushbutton

PostPosted: Fri Jul 02, 2021 2:53 am
by QuickFix
deflaok wrote:You forgot about the power supply in your cost.

Did you even read the TS question? :?

Have a read through this article: I think it's exactly what you're after. :idea:

Re: Turning Wemos D1 mini on/off by a pushbutton

PostPosted: Fri Jul 02, 2021 3:04 am
by Bonzo
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.