I am trying to detect line voltage (230V AC, if the supply is ON/OFF) by a microcontroller with the help of an AC optocoupler. The optocouplers I have evaluated are PC814, H11AA1 and SFH620A-3, out of which I found SFH620A-3 to be more efficient (must be due to the better CTR). I had connected a series resistance of 440K (1/4W) and everything seems to be fine i.e the microcontroller is able to sense when there is line and otherwise. While testing my circuit at various input voltages I found that the opto will start giving fluctuating output when my voltage is 145V. I calculated the voltage and found that for 145V AC and a series resistance of 440K, the current is just 0.33mA which may to be insufficient to turn on the opto. Now I could reduce the resistance, however the heat dissipated would be more (which I don't want). I am also not able to use a x-capacitor or use a transformer due to size constraints. Due to all these factors, someone suggested me to find another opto which works at very low current. Hence I started searching for it and found one i.e SFH628A-3, however I am not good in understanding their datasheet and need help to see if it fits.

Sorry for the long story, I am still learning.

  • 3
    \$\begingroup\$ Schematics you've tried would be nice. Also, I'd like to know exactly what you mean by "detect line voltage." Does this mean "measure" or does it mean "observe zero-cross events" or does it mean "see if the peak voltage is above some threshold, with hysteresis" or... exactly what. Just saying "MCU" doesn't tell me what it is for. Yes, I see you wrote, "sense when there is line and otherwise." But again, my mind can put too many interpretations on that. Write more? \$\endgroup\$
    – jonk
    Apr 11, 2018 at 19:16
  • \$\begingroup\$ Take a look at an IL300 if you want to know what the line voltage is as the current in the two output diodes is well matched. Or do you just want to know that AC of at least a certain rms voltage is there? \$\endgroup\$ Apr 11, 2018 at 19:17
  • \$\begingroup\$ I am just trying to get the state of an electrical device, i.e if its on or off and nothing more is needed. \$\endgroup\$
    – Zac
    Apr 11, 2018 at 19:28
  • \$\begingroup\$ "the heat dissipated would be more (which I don't want)" Are you aware that the resistor you're using only dissipate 1/20 of a watt? \$\endgroup\$ Apr 11, 2018 at 19:41
  • \$\begingroup\$ @WhatRoughBeast yes I understand that the heat dissipated is less, however my circuit sits inside a closed container and I have many of these (multiple opto and resistors). Hence we cannot accommodate more heat. \$\endgroup\$
    – Zac
    Apr 11, 2018 at 19:49

1 Answer 1


Where I use to work at we detected 230 VAC with a 4 pin H11AA814 AC optocoupler. Use a 220K 1/4W resistor to get 1.045 mA of current at 0.24 watts, which is plenty enough to sense AC. The output will be a 120 HZ ripple on 60 HZ power lines.

After research the H11AA814 is obsolete and can be replaced with a Vishay SFH628 series.

We used the simple ripple filter below to output a clean DC voltage equal to Vcc (+5V to +12V) minus about 1.25 volts.

As long as there is AC input Vout is at close to zero volts. If AC fails then Vout is +3.75 to +10.75 volts, depending on the voltage you power this circuit with. This circuit will respond to a power fail within 1/4 second. This simple filter also blocks reaction to brief power flickers lasting less than 200 mS.


simulate this circuit – Schematic created using CircuitLab

Copied from datasheet. It shows operation at 500uA and 1mA.

Copied from datasheet

  • \$\begingroup\$ This would create lot of heat (compared to the one with 440K) and as mentioned in my query we cannot accommodate more heat. \$\endgroup\$
    – Zac
    Apr 11, 2018 at 19:44
  • \$\begingroup\$ I changed R1 to 220K which greatly reduces heat. This opto-coupler will work fine at 1 mA AC. \$\endgroup\$
    – user105652
    Apr 11, 2018 at 19:49
  • \$\begingroup\$ Ok H11AA814 seems to work on 1mA. What is the minimum current required for this opto. Also H11AA814 seems to be obsolete. \$\endgroup\$
    – Zac
    Apr 11, 2018 at 20:32
  • \$\begingroup\$ H11AA814 is supplied by Digikey and Mouser. Fairchild still makes it. \$\endgroup\$
    – user105652
    Apr 11, 2018 at 21:09
  • 2
    \$\begingroup\$ It was the chief engineers design, and he had to obey UL standards, so for 230-277 VAC it was 2 33K 3W resistors to keep about 3mA flowing into the opto-coupler. At 600VAC it was 2 47K 3W resistors. But I did notice the change from 6 pin to 4 pin opto's. The 4 pin opto's tend to start working at just 100uA. That is not on the datasheet, just from personal experience. I would say that 200uA is a safe bottom end for drive current. But that's off the record. I have no way to test it. \$\endgroup\$
    – user105652
    Apr 12, 2018 at 21:20

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.