I've been wanting to use the H11AA1 zero-crossing detector to detect the zero-crossing points of Mains Voltage - 120 V AC @ 50 Hz. The data sheet says that the max forward currents of the diodes are \$I_F\$ = 60 mA, max power dissipation is \$P_{diss}\$ = 100 mW, and typical voltage through \$ V_d = 1.2 V\$. I'd like to hook the H11AA1 up to the Mains line without a transformer and instead use passives to dissipate the remaining energy.

I've been modeling each line using this model:

enter image description here

The 'input voltage' that the impedance sees should be a half-wave rectified sine function, and the output should be a periodic square wave.

\$ v_i(t) = Asin(\omega t) * (u[t] - u[t- {\frac T2}]) \$

where \$ A = 120, \omega = 2\pi f = 100\pi\, T = \frac {1}{2\pi f}\$

Because of the diode truncates the voltage, the waveform should look like a periodic square wave (pretending there are instant rise/fall times)

\$ v_f(t) = \sum_{k=-\infty}^\infty 1.2(u[t] - u[t - kT]) \$

The current through the diode should look like:

\$ v_i(t) = 0.6sin(\omega t) * (u[t] - u[t- {\frac T2}]) \$

Using node voltages,

\$ \frac {V_i - V_f}{Z} = I_d\$

\$ Z = \frac {V_i - V_f}{I_d}\$

The issue I'm having is that I'm expecting the impedance to have a complex component and thus my expected output functions should have a phase shift - but I have no idea how to account for that, if so. Are there any other mistakes in my assumptions about the diode voltage and current? How should I go about solving for the impedance?

  • \$\begingroup\$ Take a safe margin 50ma. Round to 100v peak. This is 5W peak of passive dissipation, equivalent of a 2k 5W resistor (which would work). With a 120V rated small current transformer (like the kind for off line smps) you can use standard 1/2W parts to set the detector current \$\endgroup\$
    – crasic
    Commented Feb 27, 2016 at 23:25
  • \$\begingroup\$ I think you're over analyzing this, and why are you expecting a phase-shift with no reactive components? Just choose a resistance which ensures that Irms stays safely under 60mA. And put a regular diode in parallel with, but opposite polarity to your LED. \$\endgroup\$
    – brhans
    Commented Feb 28, 2016 at 1:24
  • \$\begingroup\$ @brhans That particular optoisolator is 'AC input' - it has two back-to-back LEDs (not shown by the OP) so the diode is not required in this case. \$\endgroup\$ Commented Feb 28, 2016 at 2:12
  • \$\begingroup\$ Aah ok - I was just looking at the diagram. No extra diode necessary then. \$\endgroup\$
    – brhans
    Commented Feb 28, 2016 at 2:23

2 Answers 2


An ordinary resistor will have virtually no complex component at 50Hz- delays in the optoisolator will be far more significant.

Your minimum value is set be the dissipation, maximum ambient temperature, maximum current rating, voltage variations and how conservative you want to be.

Your maximum resistor value is determined by the minimum CTR, load resistance, and allowances for aging and voltage variations.

120VAC is about 170V peak. If you allow something like 40mA peak, a minimum resistor of 4.7K might be appropriate. The resistor power dissipation would be ~\$0.5 \frac{120^2}{R}\$ = 1.5W, so you might use a 2W resistor. The LED power dissipation is about \$0.5\cdot 0.9\cdot V_f\cdot \frac{120}{R}\$ = 14mW, so should be fine even at high Ta. The 0.9 factor comes from the ratio of RMS voltage to average voltage- LED power dissipation is proportional to average current since Vf is fixed to a good approximation.

Adjust the above as per your requirements and preferences. Then you should calculate maximum allowable resistance depending on your load resistance and required switching threshold. If the maximum resistance is lower than the minimum then you have a problem. If it is much higher consider using a value in between the two. Aging is accentuated by high current and high temperature.


I think you haven't taken into consideration of junction capacitance and resistance of the diode. Check the data sheet of the diode and replace the above diode with those parameters(Rf and Cj).
Calculate the reactance(jXc) of capacitance substitute it with forward resistance of the diode. Now you have what you need a complex impedance.
Zt^2 = (Z + Rf)^2 + (jXc)^2
with phase
tan(x) = (Xc/(Z+Rf))

  • 1
    \$\begingroup\$ Diodes do not have 'resistance' except in a small signal sense (not applicable here) and the capacitance of LEDs is typically (and specifically in this case, if you look at the datasheet the OP helpfully linked) not specified (and would vary greatly with applied voltage in any case). So I don't see how this is helpful in the slightest. \$\endgroup\$ Commented Feb 28, 2016 at 3:19

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.