Let's Make Robots!

Self Shutting Down Arduino (or any other microcontroller, for that matter)

If a locking relay was attached to a micro-controller's power-supply, couldn't said micro-controller shut itself off? Does a locking relay require a pulse of a certain length? I am an absolute beginner in electronics and I would love improvements/suggestions. I would be sending a command from a computer (pi?) for my robot to shut itself off and save the map of its environment. This led me to thinking about remote turn on. Could some sort of unpowered rf receiver be used to trigger said relay? I would love suggestions/ideas/part numbers for CHEAP rf modules that would work for this.



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

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. 

The IRF9540 is a low cost, commonly available Pch FET that can switch a few amps without a heatsink and up to 20A using a suitable heatsink. Other Pch FETs can be used as long as your input voltage does not exceed their Vgs rating which is usually between -12V and -25V depending on the FET being used.

The BC548 is just a general purpose NPN transistor and can be replaced with any other NPN transistor such as a PN100 or a 2N series transistor.

Depending on your controller and it's bootloader you may want to extend the the time needed for the MCU to power up and pullup the control pin. Increasing the capacitor value to 1uF may be necessary.


I'd think you'd want to avoid having a μ controller controlling its own power. Do it one way and it has to hold a pin high all the time-a brief drop-out (admit it-they happen) and night-night. Do it the other way, so that it turns off by interrupting, and you have to have (as bdk notes) a separate way of turning it back on. Best to keep it a separate circuit so you can do the standby thing.
With information given, I'd say take a hardware route. Some sort of device to trigger the relay long enough for your code to boot, then have one of your digital pins hold the relay open. When your done, set the pin to low. It would help to know the goal: e.g., to save battery life. If that is the case, it'd be better to simply shutdown the connected devices. Might also check out... http://playground.arduino.cc/Learning/arduinoSleepCode

Although my robot will be autonoumous, I wanted a controller to interface and debug with it. I was then thinking about adding a remote turn off feature. the robot will be active when it is on almost continously, so sleeping the arduino would not help much.