How to detect power failure?

I'm designing a monitor to detect utility power failures (among other things). I want it to be able to run for at least several hours once the power fails. Therefore it will be powered from a wall wart plugged into a UPS unit like would be used for a computer.

My question is how to detect the utility power failure. My current thinking is a second wall wart plugged directly into utility power, i.e. not into the UPS unit. I'm sure a circuit similar to the attached would do the job, but I'm wondering if anyone can suggest a better, simpler, or more elegant way.

Don't know whether it's better, a single relay with high voltage coil would be enough.

when I were a lad the UPS used to have a serial port to tell the pooter that it had lost its food supply
does your UPS have the same?

Simpson_Jr:
Don't know whether it's better, a single relay with high voltage coil would be enough.

Indeed it would! I'll think on that, thanks!

mmcp42:
when I were a lad the UPS used to have a serial port to tell the pooter that it had lost its food supply
does your UPS have the same?

Haven't purchased the UPS yet, but I did wonder about that. These days they're probably a USB interface? Guess I was discounting that option because (a) I'll just use a small, low-end UPS, not sure they all have that feature, (b) Wasn't sure about figuring the interface out, might be proprietary, etc., and (c) Wasn't sure it'd be any cheaper.

Thanks!

My question is how to detect the utility power failure

In the olden days, a good quality UPS had a contact closure to indicate power failure.

my ups had a very annoying beep . beep . beep - as if having no lights wasn't enough of an indication of no power - so other options are tapping into the beeper or the no power led

@ Jack Christensen

I make a circuit to test which breaker is for. It when power is off at a AC plug, a buzzing sound is made. Power in, no buzzing sound. You can simply modify to use with the Arduino. My design use a opto-coupler. And the AC transformer, I got from the garbage, extract the AC transformer. Here a schematic.

Techone:
I make a circuit to test which breaker is for. It when power is off at a AC plug, a buzzing sound is made. Power in, no buzzing sound. You can simply modify to use with the Arduino. My design use a opto-coupler. And the AC transformer, I got from the garbage, extract the AC transformer. Here a schematic.

Interesting, that idea could work. The optocoupler's LED could even be run direct from the mains with appropriate Rs and Cs. Thanx!

The optocoupler's LED could even be run direct from the mains with appropriate Rs and Cs.

PLEASE not DIRECTELY from the main ( You know Murphy's Law - I anythings can go bad ) . Just use a CHEAP AC transformer... it more safer. That what I have in my design.

Techone:

The optocoupler's LED could even be run direct from the mains with appropriate Rs and Cs.

PLEASE not DIRECTELY from the main ( You know Murphy's Law - I anythings can go bad ) . Just use a CHEAP AC transformer... it more safer. That what I have in my design.

LOL, yeah I know, there have been other threads about that. Don't worry, I'm appropriately trained/educated. Seriously, that's what the opto isolator is for (I may be crazy but I'm not stupid). I'm thinking a simple circuit like these LED night lights that you can get now. Except it'd be the LED on the input side of the opto isolator.

But I'm all for keeping the Legal Dept. happy, so like they say on the commercials:
CLOSED COURSE, TRAINED PROFESSIONAL, DO NOT ATTEMPT.

the nightlight idea is proberbly the best way to monitor utility power, get a cheap LED one, rip it open as much as you need to get access to the LED, replace that with an Opto Coupler and a few other bits to get it working and your prettymuch done, just rig the nightlight to think its dark all the time (proberbly by replacing the LDR with a variable resistor, so you can adjust it until it thinks its night).

hope this helps, also as normal its mains electric so i dont suggest messing with it unless you know what your doing.

@Kris, the circuit is so simple, I wouldn't bother tearing anything apart. I've seen several circuits that are variations on the attached. In my case the LED would be the input side of an opto-coupler. I might want some filtering as this example will flash the LED at the line frequency.

Actually I think I'm favoring the second wall wart approach for the prototype, but the mains-driven LED could be just as safe if done properly, in a proper enclosure with an opto-coupler, etc.

LED_120VAC.png

Jameco sells an opto isolated coupler p/n PS2505-2 that is AC tolerant. Connect the transformer through a properly sized resistor directly to the chip.

Jim

@ Jack

I was a bit worried...I look at your schematic, it a bit similar of a telephone circuit ...ringer detector. The parts... let see...

C is 0k has long it is well above 200 V
D1 - 1N914... Wrong...<--- Too weak !! Use a 1N4004 or above rated of 200 V. <--- Check datasheets. Use this site. http://www.datasheetcatalog.com/ It one of my favorite site to check datasheets.

R1 - 1 K ----> check calculations : 120 V AC rms --> 170 V peak so let use 200 V for V. LED operating current of 10 mA. Vled = 2.2 V ----> ( V - Vled ) / I led = R limiting ( 200 - 2.2 ) / 10 mA = 19 780 ohm ---> 20 K NOT 1 K. Let check the power rating of R1. Power = R1 * ( I led * I led ) 20 K * ( 10 mA * 10 mA ) = 2 Watt resistor

Re-list of part: C1 - 0.1 uF @ 250 V D1 - 1N4004 R1 - 2 Watt 20 K

Now that it will work. Except the LED will flash @ 60 Hz in that circuit.

@Techone, thanks, that was actually just a circuit I'd found on the web, hadn't tried it or analyzed it. I may try it yet, as it is an interesting approach, but for now, for several reasons, I think I'll go with the second-wall-wart approach. If I do try it, I'll report back with my findings.

Regarding your analysis, not sure what you mean by "C is 0k has long it is well above 200 V" ... If I calculate the reactance of a 0.22?F capacitor at 60Hz, I get a touch over 12K?. I didn't look up the PRV for a 1N914, but if memory serves it's 75V or so, which is probably way more than that of the LED. But neither diode will ever have a reverse voltage across it that's more than the forward voltage of the other diode, so I don't know why a 1N914 wouldn't work. It could also be a second LED.

@ Jack

Technicaly, the C - capacitor is not needed in that design, ( you don't have a DC component to block - a telephone line is yes ) Here a site about telephone interface Telephone ringing circuits ( I know it is unrelated, but in a way they are )

About "wall-wart", get some "free" from the garbage or a cheapy , took apart with a metal saw ( do it carefully ) Extract the transformer. I forgot that a 1N914 is OK, has long is connect in serie with a power resistor. ( Just my last posting ) The V drop should be the same has V led. Just my calculation for the LED ( positive swing of the AC wave ) and 1N914 ( negatiev swing of the AC wave )

And for more protection, add a fuse of 200 V @ 250 mA in serie ( in-line ) with the circuit.

So it should be -- Fuse - power resistor -- Diode // LED .. That it ! According to calculation, it should work.

@Techone,

Beg to differ, the capacitor is by far the main component responsible for limiting the current, it's not about blocking DC, or telephones for that matter. Build it without the capacitor and see, but I'd include a 1/4-to-1 amp fuse on the incoming line just for extra safety. I also might Google up some AC circuit theory.

Anyway, old habits die hard. I guess I can't analyze a circuit even partially and then not go into the lab and build it. Since I had the parts available...

Turns out this circuit is just about perfect for powering the average garden-variety LED. My standard LED dropping resistor when working with 5V is 330?, which results in 9mA or 10mA current through the LEDs I use.

I’ve had this circuit happily glowing here on my desk for a couple hours now without incident, nothing seems to be getting warm, etc. I’d think the 1/6W 1K resistor might heat up a bit, as my calculation says it should be dissapating ~100mW or about 60% of its rating, but if it is, I can’t tell. Still, I might prefer a 1/4W resistor just to be extra conservative.

I took the following measurements, all are AC RMS:
Vin = 119.9V (wow, the utility company is right on the money today)
Vcap = 119.0V
Vdiodes = 1.318V
Vr = 9.91V
Iin = 10.1mA

Attached is a picture of the circuit, along with an identical LED powered from a 5V regulated supply with a 330? dropping resistor (on the right). The AC-powered LED is not quite as bright, which stands to reason since it’s only on half the time.

Well..Well ..Well .. I am surprise... You design using a cap to take the biggest voltage drop work. My design use a power resistor. Your is a good one. No power resitor to buy. So you use this :

Reactance of Capacitor = 1 / ( 2 * PI * 60 Hz * 0.1 uF ) = 26 525.823 ohms <--- Interesting

I will never taught of this idea. I am still learning ... You surprise me.

Bear in mind, the LED still "flashing" @ 60 Hz. You just need to connect an opto-coupler instead of the LED. A 4N35 will work fine.

Anyway, old habits die hard. I guess I can't analyze a circuit even partially and then not go into the lab and build it. Since I had the parts available...

I use computer electronics simulators to check some of my designs. And I test for real. Here the link for the simulators I use.
Circuit Simulator Applet <--- It free but can not save & print.
http://www.new-wave-concepts.com/ <--- I use Circuit Wizard Pro ( Cost me about $300 can ) Yeah ! But it was worth it .

@Techone,

That's it! It's quite a clever circuit, isn't it! Now the really cool thing (literally) is that it limits the current without generating heat, i.e. wasting power. The 0.22?F capacitor, with a reactance of about 12K?, dissipates effectively zero power. Sure, we could use a 12K? resistor instead, but assuming the same current of about 10mA, that resistor would dissipate about 1.2W; as you observed, a 2W resistor would be appropriate. The circuit with the capacitor only wastes about 100mW, not counting the power consumed by the diodes, so it wastes only about 8% of the energy than would the circuit with the resistor.

I was still wondering what the 1K resistor was for, technically it's not needed, the capacitor alone should be enough. Then I thought about failure modes, and I'm thinking it may be to limit current in case another component in the circuit (especially the capacitor) fails. The worst failure modes would involve a component shorting out. In this circuit, the diodes are the most fragile components and effectively act as fuses. If the capacitor failed and became a dead short, without the 1K resistor, we'd have 120VAC straight across the diodes. It wouldn't last long, but there could be a few fireworks. With the resistor, the diodes would still fail, but in a much less spectacular manner, opening the circuit and resulting in a safe condition. If any other component in the circuit failed by shorting out, there would be effectively very little change in operation, the circuit would continue to draw ~10mA and would still be safe. And of course if any component failed by going open-circuit, then the current stops and things are still safe. So I think whoever originally designed this circuit thought it through a bit!

Now to delve into AC circuit theory a bit more, consider the fact that going around the circuit and adding up the observed voltage drops across the various components results in a total that is greater than the input voltage, i.e.

Vcap + Vdiodes + Vr = 119.0 + 1.318 + 9.91 = 130.2 > 119.9 input voltage

Have a great day! :slight_smile: