Pages: [1]   Go Down
Author Topic: Switch controlled soft-shutdown  (Read 542 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

In adding an ON/OFF switch to my Arduino project, I'm looking to implement a circuit that creates a timed delay following the switch being moved to the OFF position for the Arduino to do some clean-up before losing power.

I received some advice to add a resistor-capacitor circuit (2.2k ohm & 100microfarads)

The resistor and capacitor sit in series in a circuit parallel to the Arduino and battery circuit so that the Ardiuno-capacitor-resistor circuit remains closed when the switch is flipped to OFF.  When toggling the switch back and forth however, I see no delay from the Arduino's 'ON' LED.

Any help or advice is greatly appreciated... I am not very well electrically versed.

Thanks,

Sean
Logged

Sydney, Australia
Offline Offline
Edison Member
*
Karma: 27
Posts: 1184
Big things come in large packages
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

In my mind you need something where the arduino is responsible for turning its own power off, so something like a relay in parallel to the switch. When the switch is turned on the software also turns on the relay. When the switch is turned off the arduino detects this and shuts itself down, switching power off as the last thing.
Logged

Arduino libraries http://arduinocode.codeplex.com
Parola hardware & library http://parola.codeplex.com

UK
Offline Offline
Shannon Member
****
Karma: 184
Posts: 11164
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What sort of timed delay are you hoping for? If you calculate the amount of charge in that capacitor and the current taken by the Arduino you'll see that the capacitor will only keep the Arduino powered up very briefly. You'd need to be monitoring the input voltage and do your shutdown code pretty promptly if you intend to do anything before the board dies.

Alternatively, if you can get away with the Arduino swoitching itself off (i.e. you don't need to cope with power supply failures etc) you can put a transistor in the power supply and let the Arduino decide when to switch itself off.
Logged

I only provide help via the forum - please do not contact me for private consultancy.

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 176
Posts: 12283
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


http://www.pololu.com/catalog/product/751
Logged

Pages: [1]   Go Up
Jump to: