# Resistors for zero crossing detector with optocoupler

I'm trying to understand how to calculate the right value for resistors R1 and R2 in this circuit using the 4N25 optocoupler, and with 12Vac.

With 12Vac, Vp is 16.27v.

In this case, the optocoupler has a photo-transistor, does that mean that the voltage for the LED diode is 0.7v and the VCE for the transistor is 0.2v in saturation as a normal transistor?.

If that's right, then when V2 > 0.7v then the LED diode will be active with 0.7v, and the photo-transistor will be in saturation, with 0.2v in VCE, leaving 9.8v for R2.

But how to calculate the values for R1 and R2??

## 1 Answer

No, the characteristics of the LED do not depend on the nature of the photodetector. An LED is always an LED, but the forward voltage drop does depend on its color. Often, IR LEDs are used in optocouplers. So you need to look for that specification in the datasheet for your specific optopcoupler. For the 4N25, the forward voltage is 1.3 V typical, 1.5 V maximum @ 50 mA forward current.

As far as saturating the output transistor, you need to look at the "current transfer ratio" and determine whether you're driving enough current in such that the transferred output current flowing through the pullup resistor exceeds the supply voltage. If so, then it is saturated.

If you're looking for a fairly precise zero crossing output, you'll want to drive the LED reasonably hard (within its limitations, of course) so that the output saturates quickly as the input voltage rises from zero. And remember that you're already losing two diode drops in your bridge rectifier!