Continue to Site

Welcome to

Welcome to our site! is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[PIC] Power failure detector logic for microcontroller

Not open for further replies.


Junior Member level 3
Jun 23, 2013
Reaction score
Trophy points
Activity points
Hello everyone.

I'm making a project in which i want to store the 8 bit data in external eeprom 24LC512 with pic18f85j11 in case of power failure. I already used the power capacitor ( 4700 uf) for providing the sufficient time for store the data. To save the data at power failure time, i used Low voltage detect (LVD) interrupt but in pic18f85j11 have simple low voltage detection ( we didn't set that voltage level where it can be triggered for saving the data ). I run this circuit on 3.3V. I think the low voltage interrupt is triggered at 2.3 Volt which will not provide enough time for storage.

Is there any way in which we can increase the low voltage detection time or any other way for power failure sense. Can anybody tell me the logic or circuit from which the power failure can be detected.?


* what power source dou you have?
* do you have a schematic of the complete supply?
* where is the 4700uF connected?
* isn´t the 2.3V the reset- or brown out threshold?

I use a early power fail interrupt. Where the mains voltage is monitored. If it fails the interrupt is triggered. This is far before the microcontroller voltage drops. The same signal is used to swtich off power consuming devices like motors...
If you have a voltage regualtor (switched or linear) then watch the input voltage instead of the output voltage. When the output voltage drops it may be too late.

Use ADC. The output of the bridge rectifier is scaled to 0 to 5V DC for ADC. uC is powered from batteries. When mains fail adc input will be 0. When mains go under volatge or over voltage that can also be detected. Control the required devices using relay or contactors when mains voltage is normal.

Use ADC. ...
Why? To have extra time delays during conversions when clean up time is critical?
Do we need extra code and extra processing time?

The solution with one digital external interrupt input (as KlausST already described) by monitoring the primary power source (before regulation) may be old, but it's perfect..
ADC is used only on battery sourced power.

Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to