turn the arduino on or off with push button

Hi i want my arduino turn off after 1 min and turn it on with push button!! that's easy with trasistor, but i am trying to make it with a code sleep mode not helping me to save the power i am using 9V battary

Sleep mode only reduces power in the '328P. The 5V regulator is still drawing current to reduce 9V to 5V The power LED is still drawing current. The USB/Serial interface is still drawing current. The autovoltage switch comparator is still drawing current. The 3.3V regulator is still drawing current.

finally a professional answer :D i think using other type of battery will be better, than make it in sleep mode, so actually they used the sleep mode just to let the arduino board can handle a commands to change between modes, thanks ;)

You could use a relay across a switch to supply the power. Press the switch for some seconds until the program starts. Program turns on relay across switch. Release switch. After your time is up, turn off relay.


Self Shutting Down Arduino

This is a relatively simple circuit that should suit your needs. The On/Off switch behaves like normal except than when you turn it on the circuit only supplies power for about 100mS. The MCU must pull the control pin high to maintain power.

You can manually turn the robot off using the power switch or the MCU can turn the circuit off by pulling the control pin low. Once the MCU has turned off power the circuit must be reset. This can be done by switching the On/Off switch to the "Off" position long enough for the capacitor to discharge or by using an optional reset button.

When the power to the arduino is turned on, doesn't it look for a program download? How long does it take to start the program?


If it has a bootloader, it depends on the bootloader. 1 to several seconds. If no bootloader, then almost instantanesously.

Pololu makes a nice little pushbutton power switch: Pololu Pushbutton Power Switch LV (old version)

good ideas everyone, but i think the best thing you can do it to disconnect the USB serial curcit from the bourd, you will not use it again so adding tiny switch to turn it off save alot of battary, other thing is to remove the power circut too,& the leds and use a simple one to take 1.5v and boost it to 5V,

i found other idea is to use attiny85 ship, it’s a small project and not need alot of pins, so i remove the main ship atmel and replace attiny85, and work great, of course you need to remove the cristal16hrz,
so acctully new arduino uno, i will call it narzanino lol 8)

I wrote a post about doing something similar, turning on by push button and then off by logic. Pressing the power button does not turn the circuit off.

It maybe helpful for you:


you could use: https://www.walmart.com/ip/9V-Battery-Spring-Clip-Slot-Holder-Case-With-On-Off-Switch-DC-Plug-Power-Jack/835732229?wmlspartner=wlpa&selectedSellerId=15715&adid=22222222227134589281&wl0=&wl1=g&wl2=c&wl3=242052177024&wl4=pla-398020979458&wl5=9032187&wl6=&wl7=&wl8=&wl9=pla&wl10=118924286&wl11=online&wl12=835732229&wl13=&veh=sem

and use a switch instead, and connect it to the power.