check in
Ongoing

Soft Latch Power On Button - GPIO Power Off (Wemos Example)

STDSoft Latch Power On Button - GPIO Power Off (Wemos Example)

tag

2.8k
0
0
0
Mode:Full

License

MIT

Creation time:2020-08-28 16:03:32Update time:2020-09-16 18:50:57

Description

Some time ago I was searching for a circuit where the short push of a button switches on the power to the MCU, and the MCU was able to turn off the power itself.

Because I don't like waiting for the bootloader to power up the MCU to hold the power on.

It's hard to find such a circuit, so I've created this one for educational purposes.

It's similar to the "Mini Pushbutton Power Switch" produced by Pololu.

It's also possible to create such a circuit only with PNP and NPN transistors instead of MOSFETs. But this one uses 1 PMOS, 1 NMOS and 1 NPN transistor, because when I used my PNP/NPN transistors, they were only able to power an ATmega328, but not a Wemos D1.

Note that not all types of MOSFETs work. It probably only works with logic level MOSFETs. This circuit uses an IRL3803PBF as N-channel MOSFET and a NDP6020P as P-channel MOSFET. The BC337-25 is used as a NPN transistor (which shorts the NMOS gate to ground, just like the Off Button does, to switch off the power).

The code to switch off the power is very simple:

https://gist.github.com/Miraculix200/794e8dbdff5e4fde01a146a9388b2e38

The Off Button and the power indicator LED are optional. Of course this circuit also works without an MCU connected to it.

The R8 resistor is also optional. I found that I'd have to push the button for like 500 milliseconds instead of 10 milliseconds for the circuit to keep powered, when that resistor is not in place.

Design Drawing

schematic diagram
PCB

BOM

IDNameDesignatorFootprintQuantity
1CONN-TH_2P-P5.00POWER_CONNECTORCONN-TH_2P-P5.001
2IRL3803PBFNMOSTO-220F-3_L10.2-W4.9-P2.54-L1
3WEMOS D1 MINIU1WEMOS D1 MINI1
4BC337-25-TANPNTO-92-3_L4.9-W3.7-P1.27-L1
5SWITCH,6*6*5,DIP2MOMENTARY_BUTTON_2,MOMENTARY_BUTTON_1KEY-TH_2P-L6.0-W6.0-P5.002

Attachments

OrderFile nameDownload times
No data
Clone
Add to Album
0
0
Share
Report

Project Members

Comment

All Comments(1)
Sort by time|Sort by popularity
Followers0|Likes0
Related projects
Empty

Bottom Navigation