Two transistors form high-precision, ac-mains ZCD
A simple two-transistor circuit can accurately detect the zero crossing of the ac mains voltage.
Djessas Zoheir, Constantine, Algeria; Edited by Charles H Small and Fran Granville -- EDN, June 7, 2007
Many applications that use 110V/230V-ac mains require a ZCD (zero-crossing-detection) circuit for the ac-line voltage, for example, to synchronize the switching of loads. One method of ZCD uses a high-value current-limiting resistor or a voltage-resistive divider to sense the ac voltage at the controller’s I/O pin. However, depending on whether the I/O pin is in TTL or Schmitt-trigger mode, the ZCD has a delay that depends on the threshold swing of the I/O pin and the slew rate of the power line. For example, assume a 230V, 50-Hz ac system voltage and a voltage divider of 100—that is, 230V/100=2.3V. Further, assume that the I/O pin triggers at 1V. This trigger level implies 1V×100=100V referenced to the 230V-ac mains. Thus, 100=230×sin(2×π×50×t) yields a delay of 1.43 msec, which represents 14.3% of the half-cycle period—a significant error.
Figure 1 shows a low-cost, efficient ZCD using two standard transistors. Coming directly from the ac mains, the supply network comprising C1, C2, D1, D2, and R1 forms a simple half-wave rectifier, which powers the ZCD. Q1 toggles with the ac-mains-voltage ZCD. To compensate for the base-emitter gap, Q2 acts as a diode to block the ac-positive cycle. For efficiency, the detector must sense the ac-mains cycles at as high a voltage as possible. This requirement drives the choice of the transistor. Q2 and Q1, low-noise, small-signal BC549B transistors, have collector-to-emitter-voltage limits of 30V. With this choice, you must attenuate the ac-mains voltage from 230 to 30V. (For a BC546 transistor, you can attenuate 230 to 80V.) Thus, the voltage-divider ratio is 30V/230V=13.4%, and the values of the divider resistors are R2/(R3+R2)=13.4/100, or R3=6.46×R2. R2 and R3 must be high enough for current limiting. The normalized value of R3, 820 kΩ, means that R2 is 820 kΩ/6.46=126.9 kΩ or 120 kΩ, the nearest standard-value resistor. With these values, Q2 can block 230V×R2/(R2+R3)=29.3V, which is less than the transistor’s maximum rating of 30V.
Upon the ac-positive cycle, the base of Q1 rises to approximately 0.6V through R4. Q2 acts as a simple diode. So, when the cycle voltage is higher than 0V, Q2 is reverse-biased and blocks any current flow. At 0V, Q2 is forward-biased, but it maintains 0.6V across the base-emitter junction, VBE. Thus, the collector, or base, of Q2, which connects to the base of Q1, stays at 0.6V. Q1 is saturated for the positive cycle, and the output voltage is low. At the ac’s negative cycle, when the ac voltage is less than 0V, current flows through Q2. Consequently, the base of Q1, which connects to Q2’s collector, falls to less than 0.6V, which leads to the blocking of Q1 and the output voltage’s becoming high. Note that the base of Q1 can reach about –30V from Q2; you can add clamp diode D3 for Q1 junction protection higher than –1V.
-
the supply is set up such that the precision zero crossing detector detects at the voltage drop of the Zener (D1), instead of zero. By making a slight adjustment to the circuit so the power supply is positive and Neutral goes to circuit ground, the detector truly becomes a ZCD. This was verified by LTSPICE.
The other comments about safety and error sources indicate that this circuit is best used as an educational example. A transformer coupled signal with a comparator or a circuit like this one that was based on optoisolators would be better for a safe design.
Carl Van Wormer - 2007-11-9 16:47:00 PDT -
To assure the Q1 state, Ib must be high than Ic/hfe (Ib is the base current, Ic the emitter current and hfe the Q1 current gain) thus
Ib > Ic/hfe or (5v/R4) > 5V/(R5.hfe)
R4 < hfe.R5 (1)
the bc549 with B classification has a hfe of 200 to 450
we must get R4 < (R5.200) or 4M
we must take resistors tolerances in consideration, and to use any standard transistor (with low current gain) R4 must be reduced to satisfy the equation (1).
Djessas Zoheir - 2007-20-6 00:34:00 PDT -
The circuit has an inherent error due to connection of the mains neutral to VDD. The circuit is unsafe as mentioned by Jazz but also because VDD is connected to the mains neutral.
The circuit is very susceptible to changes in the value of R4 and the hfe of Q1. The circuit is very susceptible to changes in the input voltage.
Richard P. Corey - 2007-11-6 09:54:00 PDT -
very unsafe design, you can''t simply drop 200v over a resistor, see all specs of resistors...
Jazz - 2007-9-6 06:39:00 PDT





















