PDA

View Full Version : early power down



iw2fvo
- 19th August 2009, 08:32
Hi to all ,
I am going to implement a system that detects the AC power removal from my PIC18F452 board in order to save data before the Pic stops to operate definitively. I am thinking to use a LVD ( low voltage detect ) input of the PIC connected to a resistor voltage divider connected at the full wave rectifier of the power supply. Some sort of clamping will be used to avoid input voltage greather than 5 Vdc.
Any suggestion ?
Thanks
Ambrogio
IW2FVO
North Italy

mackrackit
- 20th August 2009, 05:34
Have a look a this thread. Might give you an idea.
http://www.picbasic.co.uk/forum/showthread.php?t=11567

iw2fvo
- 21st August 2009, 12:28
Hi Mackcrackit,
I saw the final circuit diagram and it seems OK to me .
The interrupt pin detect the lack of the 12 Vdc before the PIC stops to work.
I hope to have time enough to store my data before the cpu collapses.
Thanks for the suggestion.
regards,
Ambrogio

mackrackit
- 21st August 2009, 13:34
If you need more time you can add more/bigger capacitors.

Or, if you really want to make sure the data is saved and you have the room and an extra PIC pin...

Run the PIC from a rechargeable battery or battery pack, have the mains keep a float on the battery.
Rig a MOSFET/transistor/relay as a self holding relay with the PIC doing the holding.
When the interrupt triggers the PIC can save the data, close the windows and put the cat out. Then shut
it self down.

When it is time to start the system have a momentary switch to energize the "relay". If you want it to come on automatically. Add another relay that the mains control to put the initial power to the relay. One the PIC starts it will do the holding.

iw2fvo
- 21st August 2009, 14:06
Thanks Dave,
Ambrogio