If you need an Arduino to shut off from within your Sketch, this is the solution.

We will explore wiring the Pololu Pushbutton Power Switch, programming the Arduino to shut off the power, and making the unit "power on" only.

The Pololu Pushbutton Power Switch comes in two versions - the SV version geared towards 4.5V-20V range, and the LV which specifies 2.5V-7.0V range. I will use a 9V battery for this demo, and thus the SV version of the power switch.

Webpage for the Pololu Pushbutton Power Switch

Parts List:

1 - Arduino (I am using an UNO R3 for this Demo)
2 - Solderless Breadboard
3 - Pololu Pushbutton Power Switch SV
4 - 9V battery and holder with power leads
5 - 2.1mm male power jack to plug directly into the Arduino

Step 1: Getting Familiar With the Pololu Power Switch

The power switch has 2 connectors each for GND, VIN and VOUT, allowing multiple attachment points for your projects. A digital connection labeled OFF allows a 5V signal to turn the unit off. The kit comes with 0.1" headers, making insertion into a Solderless Breadboard effortless, or into a 18-pin DIP for your project.

It also sports 2 connectors for a momentary contact switch, allowing you to use the provided switch directly on the board, or solder your own leads for a switch (or switches) separate from the unit.
I am fairly sure you could just wire an ordinary switch to both the Pololu Power Switch as a "Power On" only switch as described and also to the Arduino at the same time and it would work fine, however if you wanted to be perfectly correct find a DPST momentary pushbutton. Your Arduino code would have to watch for a push to the button, run your operations and shut down the Pololu Power Switch
I need to have a controlled powering down of my project. What I would like is to be able to sence the pushbutton pressed by arduino, then do some operations and then turn off the arduino. What I want is to use the pushbutton to switch on the system and to use the same pushbutton to send a signal to arduino to turn it off. My idea is to wire the pushbutton to both the Pololu Power Switch and to the arduino at the same time and then use the arduino to sence when the pushbutton is pushed. Is this possible?

About This Instructable




More by Kev_MacD:Steampunk ESP8266 Internet connected Clock using the Arduino IDE Replace the touchscreen on a Garmin Oregon for $20 Adding Free OpenStreetMaps to your Garmin Oregon 450 GPS 
Add instructable to: