Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

back up power supply for a microcontroller(sensor)

Status
Not open for further replies.

jahan

New Member
can anyone pls give information about how to sense a power failure within nanoseconds so as to interrupt the microcontroller using the sensor and so that the microcontroller can activate a backup battery supply through the corresponding interrupt service routine so that the microcontroller makes itself work continuously even during an event of a power failure without getting reset.
 
I do it in the following way: A transformerless power supply and a back up battery (square battery with a zener diode to rectify it to 5 volts) to feed a pic12c508 then, I detect the Zero crossing and time the duration of the Zero crossing and you take it from there. Microchip.com has many free samples and design ideas. This is the cheapest way to control a crydom relay(or any other relay) to perform a task after a power failure. Remember that a Half cycle on a 60 Hz is 8.33ms and a zero crozzing every 180 degrees. Good Luck!!
 
some doubts

thank u miguel but i have some doubts
first is that when we are using a dc supply how do we get time for half cycle or zero crossing
by power failure i mean the dc supply of 5 volts or so drops to zero like it does when switched off and the requirement is that b4 it falls to zero the sensor senses the power failure and interrupts the microcontroller which activates the backup power supply battery so that it gets uninterrupted power supply
pls help
 
The 5V shouldn't drop to zero instantanously because there are filter capacitors. And if you monitor the unregulated voltages, you would have enough headstart to turn ON the batteries before the voltage regulators stop working.
 
I think what Miguel is trying to say is that you should use a switch mode supply; the output is still present for about a second or so after the mains is switched off.

If you monitor the AC side of the PSU, you can monitor the the average time it takes for the AC signal to pass through zero and get back to supplying a voltage that would yield the required output. If the "zero time " is longer than normal, you have a power failure (zero time shouldn't be longer than 5ms on 50Hz or 4ms on 60 Hz; zero is @ 180deg, AC should peak again at 270deg which is a 1/4 of a cycle, thus 4 or 5 ms)

Thus if the mains is zero for longer than 5ms, switch your back-up PSU on. You should have the required output from the back-up before the output of the SMPS dies.
 
I have done that before.

Hi, I have had the problem of power failures before. I cured it once by making a printed circuit board that controled a small fixed relay reversed so it would latch on when the power is abscent. I designed it to turn the relay on (off in reverse) when the power is first turned on, then if the power goes off the relay switches and applies the backup power. It also output a signal to the controller so it would know. That is about all I know about the power thing. LOL
 
Yes you all are way overengineering this thing, as can be seen with the simple solution in Exo's link. All you need to use are diodes. :) Just make sure your power supply is greater than the battery you are using. That way the diode is nonconducting and the battery is unaffected while the device is plugged in and getting power. As soon as main power is lost, the diode becomes active and the battery powers the circuit.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top