Electronic – Isolated mains (AC) presence detector

acdetectionmains

I need to detect a AC mains outage, isolated way. Output marked as [?] goes to AVR MCU. I don't need to detect undervoltage or zero-crossings. I actually need a simple feedback to MCU interrupt which will trigger interrupt only in mains outage. MCU are powered from UPS. I've picked following circuit found on the net based on PC817, but adjusted C1/R1 to 230VAC.

ac mains detector circuit

Any errors, i.e. will this work? Suggestions/comments on parts/values are welcomed.

Best Answer

Simply use something like HCPL3700, which is basically your circuit in one package. You only need one input resistor and bypass cap to make it work.

Note, that either your circuit or HCPL3700-based one are not actually "isolated", but rather "optocoupled", because you still have to connect wires to mains somehow, so full voltage is present at least on part of the board.

Truly isolated circuit would be something like Non-contact voltage (NCV) sensor found in some multimeters. For example circuit like this or this can be used without ever coming in contact with mains.