License

MIT

Recommend Projects

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

1 month ago 101
  • Description
  • Documents
  • BOM
  • Attachments
  • Members
  • Comments

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.

Documents

Soft Latch Schematic

Soft Latch PCB

BOM

ID Name Designator Footprint Quantity
1 CONN-TH_2P-P5.00 POWER_CONNECTOR CONN-TH_2P-P5.00 1
2 IRL3803PBF NMOS TO-220F-3_L10.2-W4.9-P2.54-L 1
3 WEMOS D1 MINI U1 WEMOS D1 MINI 1
4 BC337-25-TA NPN TO-92-3_L4.9-W3.7-P1.27-L 1
5 SWITCH,6*6*5,DIP2 MOMENTARY_BUTTON_2,MOMENTARY_BUTTON_1 KEY-TH_2P-L6.0-W6.0-P5.00 2
6 LED-TH-3mm_R LED1 LED-TH_BD3.0_RED 1
7 10k R5,R8,R1,R2,R3,R4 R_AXIAL-0.4 6
8 1k R6 R_AXIAL-0.4 1
9 330 R7 R_AXIAL-0.4 1
10 NDP6020P PMOS TO-220-3_L10.0-W4.5-P2.54-T 1

Attachments

None
Success
The owner does not allow comments in this project now

Comments (0)

goToTop
你现在访问的是EasyEDA海外版,使用建立访问速度更快的国内版 https://lceda.cn(需要重新注册)
如果需要转移工程请在个人中心 - 工程 - 工程高级设置 - 下载工程,下载后在https://lceda.cn/editor 打开保存即可。
有问题联系QQ 3001956291 不再提醒
svg-battery svg-battery-wifi svg-books svg-more svg-paste svg-pencil svg-plant svg-ruler svg-share svg-user svg-logo-cn svg-double-arrow
We use cookies to offer you a better experience. Detailed information on the use of cookies on this website is provided in our Privacy Policy. By using this site, you consent to the use of our cookies.