Maker Pro
Maker Pro

How to monitor AC voltage with an optocoupler


Sep 26, 2017
Sep 26, 2017
Key ideas
  • Optocoupler with 2 LEDs => faster trigger
  • Darlington topology => less power waste in the resistor in series with LEDs
    • Sink a current greater than dark current => Stability over temperature
    • Digital output => processed by an MCU => cheaper than making an hardware trigger.
      • Uses few resources of MCU
I propose a simple but tricky schematic to monitor mains. I got inspired by this post. I changed it a bit for my requirements.

Key points

  • Temperature range : -20°C to 85°C
  • Input signal : 210 to 230V RMS, f : 50 to 60Hz
    • Lowest input : 200V RMS
  • Output signal is a digital LVTTL (VCC=3.3V)
  • Output signal frequency is twice the incoming signal : mains
  • FOut : 100 to 120Hz
  • Low power on the input stage : 160mW
This circuit is very simple to assemble. But I simulatied over temperature range : -20°C to 100°C for
  • Optimum operating conditions
  • Minimum operating conditions
  • Leakage current
  • IE in simulation is negative : it's just to say it comes out of the optocoupler.
  • To get its extrememum I had to evaluate : min(I(U1:e)) : the most negative value.

To use it, one just has to measure time between 2 positive or negative edges : a bit like a watchdog : if you don't receive an edge within 15ms for instance, it means that input is off.

Please note I'm french. In my word processing "." were changed with ",".
If I wrote something wrong or inaccurate please tell me.


  • sim2_complet.pdf
    267.8 KB · Views: 69