I want to create a small device that detects AC outages and sounds a buzzer powered by a battery. I have some experience working with arduino and DC electronics but I have no experience in working with alternating current, so I'm kind of lost here.

I think I could use some kind of AC relay that would switch whenever current is lost, shorting the DC circuit, but I'm not sure such a component exists.

  • \$\begingroup\$ You could use a relay with an AC coil. Have you tried Googling it? Digikey, Mouser surely carry them. \$\endgroup\$
    – mike65535
    Commented Dec 12, 2018 at 17:04
  • \$\begingroup\$ For longevity, you don't want to continuously power the AC coil until power failure. See electronics.stackexchange.com/questions/367993/… \$\endgroup\$
    – crj11
    Commented Dec 12, 2018 at 17:07

2 Answers 2


You should not mess with mains AC if you lack the experience.

I recommend using a (old, obsolete) power adapter which can output AC or DC but at a low voltage so that it is safe.

Then if it is AC, rectify the AC to DC.

If it is DC, no need to rectify.

Use that voltage to power a relay.

Use the normally closed contacts (the ones that open when the relay is powered) of the relay to power the buzzer from the battery, like so:


simulate this circuit – Schematic created using CircuitLab

I did not add many voltage ratings and component values as they will depend on what the Power adapter will deliver.

You need the bridge rectifier only when the Power Adapter outputs AC

But even if the Power Adapter outputs DC and the Bridge rectifier is present, things will still work. Having the Bridge rectifier makes this more "fool proof".

  • \$\begingroup\$ Thanks for your answer and the detailed diagram. I'll follow your advice of not dealing with AC, I surely have some really old AC/DC adapter from an old Nokia phone I can use. Thanks! \$\endgroup\$ Commented Dec 12, 2018 at 21:09

For really small, use HCPL3700 type of part. Couple of resistors for current limit on the input side, a cap for some hysteris. Output is optically coupled, can have transistor output to drive a buzzer.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.