D
D
Dmitry Makarov2016-03-26 12:50:32
Arduino
Dmitry Makarov, 2016-03-26 12:50:32

How to make the microcontroller self-shutdown?

There is a microcontroller (let's say arduino and what else).
How to make the microcontroller turn on when the button is pressed without fixing, work and turn off the power when the program ends.
I tried the button that briefly applied to the mikruhu, then through the transistor (NPN) it would supply itself with power (collector 5+, emitter to its input, base to pin). But when pressed, it turns on and when released, it immediately turns off.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Androniy, 2016-03-27
@MDiMaI666

In addition to all of the above, I advise you to look at the power consumption of your microcontroller in Standby mode. For most microcontrollers in this mode, the power consumption is on the order of a few microamps or even nanoamps. For example, with a consumption of 1 μA and a battery capacity of 1000 mAh, it will last for 1 million hours (in the first approximation), which is more than a hundred years of such sleep. This is significantly less than the self-discharge of most batteries, so it may be easier to send the MK to sleep and wake up at the touch of a button than to complicate the power scheme. The only inconvenience is that the button, most likely, will have to be put on one specific port (see the documentation for your MK).

V
vanyamba-electronics, 2016-03-26
@vanyamba-electronics

An OR gate is required. When the button is pressed, the signal is applied to the OR element, from the output of which the transistor is turned on, supplying power to the microcontroller. The microcontroller at startup gives a second signal to the OR element so that the user can release the button. After the end of the program, the microcontroller gives a shutdown signal.
However, in this circuit there is a situation that the microcontroller has been powered off, but the button is still pressed by the user. In this case, after turning off the power in the program, the microcontroller must either enter an eternal loop, or fall asleep in the deepest sleep mode.
The user presses the button S1 and keeps it pressed until LED1 starts to glow. When the program starts, the microcontroller sends a high logic level on the PWRON pin.

S
Sergey Sapov, 2016-03-26
@softmart

we.easyelectronics.ru/Shematech/sistema-harakiri-i...
www.uschema.com/safe_power_switch
danyk.cz/zap-vyp_en.html
How to make the microcontroller turn itself off...
www.mosaic-industries.com /embedded-systems/microco...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question