Arduino Microcontroller Self Power Off




Introduction: Arduino Microcontroller Self Power Off

This short instructable presents a very simple way of auto powering off your microcontroller. I'm using an Arduino, but it should work for others in the very same way. I've searched myself for this for a while and found the solution in this application note: . The solution presented here is simpler than others I found, and it works for higher voltages than the 5V used out there. What you need:

  • 1x P-MOSFET - I'm using an IRF9640, although this is overkill - the board is using only 50mA incl. the display
  • 1x Small signal N-MOSFET - I'm using a BS170
  • 1x Resistor 4,7k or 10k - anything between 1k and 10k should do
  • 1x push button to power on the controller

The following figure shows the circuit:

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Build Up the Circuit

Build the circuit as shown in the diagram. It is important to use the Vin pin of the arduino as the 9V need to go through its 5V converter.

Step 2: Implement Your Code

The example shows the code required to turn D7 (any other will do as well) HIGH after powering on the Arduino. Then, after 5 seconds, D7 is set to LOW, thus powering off the device.

Replace the 5 seconds delay with your code.

I've measured ~55mA when the Arduino is on, including the display, and I could not measure any current when it was off.

Be the First to Share


    • Backyard Contest

      Backyard Contest
    • Silly Hats Speed Challenge

      Silly Hats Speed Challenge
    • Arduino Contest 2020

      Arduino Contest 2020

    5 Discussions


    6 weeks ago

    Very good idea. Now i'm wondering if i could use the same push button to turn the Arduino off. Looking at this circuit, it seems that you can not turn Arduino off before the Self Power Off time has come. Anybody can help me on it?


    Question 1 year ago on Step 2

    We have 2 dc power circuit.. 1 9v battery and 1 usb cable. We need to power on, if usb cable are active and switch to 9v battery if usb power is gone, then auto power off the 9v battery after x time.. could you help me with the electronic schema ?


    3 years ago

    I think you can do this job with only one N-channel Mosfet ?! (see attached pic)


    3 years ago

    This is a very good idea. I had to do this, but I made it different, the micro-controller went in sleep mode.