9 years, 8 months ago.

How to implement a On / Off button for custom board (STM32L053R8)

Hi, I'm developing a data logger using STM32L053R8. I'm preparing the custom board with some sensors. I would like to use a On/Off button to my board. I am trying to build a circuit so that you can hit a button to turn a microcontroller on and hitting the button again turn off.

you can connect 5-9V powrer source with your mbed via switch. when you close the switch it will complete the circuit and turn the microcontroller on.

posted by zain aftab 06 Jan 2016

1 Answer

9 years, 8 months ago.

There are many options to design such a circuit so here is one found through a quick Google search:

http://www.mosaic-industries.com/embedded-systems/microcontroller-projects/electronic-circuits/push-button-switch-turn-on/latching-toggle-power-switch

Other ideas are to simply use software with the micro to enter SLEEP (DEEP SLEEP) mode once the push button is pressed and then again to wake up the CPU.

https://developer.mbed.org/users/jose_23991/code/Nucleo_Sleep/file/4d80b159d444/main.cpp

The use of an external circuit will increase your cost & complexity but then you will have true power removal from the black box you are designing. Be sure to note that you will need to keep track of your required data values, etc. in non-volatile memory (no power = no ram contents the next time you boot / power up). Also note the delay in power up from scratch using this external power circuit. Hope this helps.

Accepted Answer