I would like my Arduino-controlled gadget to shut itself down after 5 minutes, to save the battery. It will then be powered up again by switching the power toggle switch manually. Is there a way to tell the Arduino to power down programmatically after some delay?
Thanks for your quick reply!
So I guess that is a no?
My gadget is doing something that takes less than 5 minutes (prefer not to discuss this) and the user may forget to turn it off. I have wasted two 9V batteries already from this. I don't think a power-saving but still on mode is what I want. I want it to actually switch off, using a timeout function.
power down sleep mode can be pretty low tho.
If you have arduino powered from 9V into barrel jack connector, then the regulator is still working, the USB/Serial chip is still powered, the power LED is stil powered.
External circuit to interrupt power into the barrel jack is needed, as noted above.
Maybe you can discuss what sort of external circuit one would use for the simplest manually-resettable arduino-controlled self-power-interruptor. A mechanical relay?
I was thinking a p-channel mosfet to source 5V to the circiut.
Gate pulled up to 5V to turn it off.
Momentary power switch pulls gate low to turn it on, uC then holds gate low to maintain power on, when done it drives gate high to kill power, pullup holds it high to keep power off.
It lets you turn on/off something with a push-button, plus there is a logic level input that lets the device (ie the processor) turn itself off. Then you push the button to turn it on again.