• Skip to main content
  • Skip to primary sidebar

Homemade Circuit Projects

Get free circuit help 24/7

New Projects | Privacy Policy | About us | Contact | Disclaimer | Copyright | Videos | Circuits for Beginners | Basic Circuits | Hobby Projects | Transistor Circuits | LED Drivers 

You are here: Home / Electronics Tutorial / How to Make a Zero Crossing Detector Circuit

How to Make a Zero Crossing Detector Circuit

Last Updated on December 26, 2022 by Swagatam 19 Comments

caution electricity can be dangerous

Making a zero crossing detector circuit is actually very easy and it could be effectively applied for protecting sensitive electronic equipment against mains switch ON surges.

A zero crossing detector circuit is mainly used for protecting electronic devices from switch ON surges by ensuring that during power switch ON the mains phase always "enters' the circuit at its first zero crossing point.
Strangely, except "wikipedia" no other top online site has so far addressed this crucial application of a zero crossing detector concept, I hope they will update their articles after reading this post.

What is a zero crossing detector?

We all know that our mains AC phase is made up of alternating sinusoidal voltage phases as shown below:

In this alternating AC, the current can be seen alternating across the central zero line and across the top positive and bottom negative peak levels,  through a particular phase angle.

This phase angle can be seen rising and declining exponentially, meaning it is doing so in a gradually rising and gradually falling manner.

The alternating cycle in an AC happens 50 times per second for 220V mains and 60 times per second for 120V mains inputs as set by the standard rules. This 50 cycle response is called 50 Hz frequency and the 60 Hz is called 60 Hz frequency for these mains outlets in our homes.

Whenever we switch ON an appliance or an electronic device to the mains, it is subjected to a sudden entry of the AC phase, and if this entry point happens to be at the peak of the phase angle could imply maximum current being forced to the device at the switch ON point.

Although, most devices will be ready for this and might be equipped with protection stages using resistors, or NTC or MOV, it is never recommended to subject them to such sudden unpredictable situations.

To tackle such an issue, a zero crossing detector stage is used which ensures that whenever a gadget is switched ON with mains power, the zero crossing circuit waits until the AC phase cycle reaches the zero line, and at this point it switches ON the mains power to the gadget.

How to Design a Zero Crossing Detector

Designing a zero crossing detector is not difficult. We can make it using an opamp, as shown below, however using a opamp for a simple concept as this looks to be an overkill, so we'll also discuss how to implement the same using an ordinary transistor based design:

Opamp zero crossing detector circuit

Zero Crossing Detector Circuit using opamp
Note: Input AC should be from a Bridge Rectifier

The figure above show s simple 741 opamp based zero crossing detector circuit which can be used for all applications requiring a zero crossing based execution.

As can be seen, the 741 is configure as a comparator, wherein its non-inverting pin is connected with ground through a 1N4148 diode, which causes a 0.6V drop potential at this input pin.

The other input pin#2 which is the inverting pin of ther iC is used for the zero crossing detection, and is applied with the preferred AC signal.

As we know that as long as pin#3 potential is lower than pin#2, the output potential at pin#6 will be 0V, and as soon as pin#3 voltage goes above the pin#2, the output voltage will quickly switch to the 12V (supply level).

Therefore within the fed input AC signal during the periods when the phase voltage is well above the zero line, or at least above the 0.6V over the zero line, the opamp output shows a zero potential....but during the periods when the phase is about to enter or cross the zero line, the pin#2 experiences a potential below 0.6V reference as set for pin#3, causing an immediate reversion of the output to 12V.

Thus the output during these points becomes 12v high level, and this sequence goes on triggering each time the phase crosses the zero line of its phase cycle.

The resultant waveform can be seen at the output of the IC which clearly expresses and confirms the zero crossing detection of the IC.

Using a opto-coupler BJT circuit

Although the above discussed opamp zero crossing detector is very efficient, the same can be implemented using an ordinary opto coupler BJT with reasonably good accuracy.

optocoupler based Zero Crossing Detector Circuit
Note: Input AC should be from a Bridge Rectifier

Referring to the image above, the BJT in the form of a phototransistor associated inside an opto coupler can be effectively configured as a simplest zero crossing detector circuit.

The AC mains is fed to the LED of the opamp via a high value resistor. During its phase cycles as long as the mains voltage is above 2V, the phototransistor stays in the conducting mode and the output response is held at near zero volts, however during times when the phase reaches the zero line of its travel, the LED inside the opto shuts off causing the transistor to also shut off, this response instantly causes a high logic to appear at the indicated output point of the configuration.

Practical Application circuit using zero crossing detection

A practical example circuit using a zero crossing detection can be witnessed below, here the triac is never allowed to be switched at any other phase point except the zero crossing point, whenever power is switched ON.

This makes sure that the circuit is always kept away from the switch ON current surge, and from its relevant dangers.

single BJT Zero Crossing Detector Circuit
Note: Input AC should be from a Bridge Rectifier

In the concept above, a triac is fired through a small signal SCR controlled by a PNP BJT. This PNP BJT is configured to execute a zero crossing sensing for the intended safe switching of the triac and the associated load.

Anytime when power is switched ON, the SCR gets its anode supply from the existing DC trigger source, however its gate voltage is switched ON only at the moment when the input transits through its first zero crossing point.

Once the SCR is triggered at the safe zero crossing point, it fires the triac and the connected load, and in turn becomes latched ensuring a continual gate current for the triac.

This kind of switching at the zero crossing points every time power is switched ON ensures a consistent safe switch-ON for the load eliminating all possible dangers that is normally associated with mains sudden power switch ON.

RF Noise Elimination

Another great application of a zero crossing detector circuit is for eliminating noise in triac switching circuits. Let's take the example of an electronic light dimmer circuit, we normally find such circuits emitting a lot of RF noise into the atmosphere and also into mains grid causing unnecessary dumping of harmonics.

This happens due to the rapid intersection of the triac conduction across the positive/negative cycles via the zero crossing line...especially around the zero crossing transition where the triac is subjected into a undefined voltage zone causing it to produce rapid current transients which in turn are emitted as RF noise.

A zero crossing detector if added to triac based circuits, eliminates this phenomenon by allowing the triac to fire only when the AC cycle has crossed the zero line perfectly, which ensures a clean switching of the triac, thererby eliminating the RF transients.

Using an Opto Coupler

A good zero crossing load circuit can be built using the following configuration.

The circuit uses an opto coupler to switch ON an associated triac exactly when the AC phase passes through the zero crossing line.

As long as the phase cycle is above the zero crossing line, the opto coupler LED remains switched ON which in turn causes the opto transistor to remain switched ON. During this period the triac gate is held at the ground potential which keeps it switched OFF.

The moment the AC phase reaches the zero crossing line, the opto LED and the transistor are turned OFF, allowing the triac gate to get the required switching voltage from the +5V source.

The triac now switches ON and operates the load.

Opto Coupler with Transistor

The above explained opto coupler with zero crossing detector can be also modified with an external transistor for powering sensitive DC electronic circuits. The complete circuit diagram is shown in the following figure:

Reference:

Zero Crossing Circuit

You'll also like:

  • 1.  How to make a Transistor Latch Circuit
  • 2.  How Wireless Power Transfer Works
  • 3.  Calculating Capacitor Charge/Discharge Time using RC Constant
  • 4.  What is IGBT: Working, Switching Characteristics, SOA, Gate Resistor, Formulas
  • 5.  USB Isolator Diagram and Working
  • 6.  Simple Buck-Boost Converter Circuits Explained

About Swagatam

I am an electronic engineer (dipIETE ), hobbyist, inventor, schematic/PCB designer, manufacturer. I am also the founder of the website: https://www.homemade-circuits.com/, where I love sharing my innovative circuit ideas and tutorials.
If you have any circuit related query, you may interact through comments, I'll be most happy to help!

Reader Interactions

Comments

    Have Questions? Please post your comments below for quick replies! Comments should be related to the above artcile Cancel reply

    Your email address will not be published. Required fields are marked *

  1. A.verone says

    September 26, 2021

    In the second circuit the current limiting resistor (220k in your case) should be wirewound type resistor or something else? Also how to calculate the wattage? Should we aim for lower or higher wattage?

    Reply
    • Swagatam says

      September 26, 2021

      A simple 1/4 watt CFR resistor will do.

      Reply
      • A.Verone says

        September 27, 2021

        Thank you.
        Why is it so high resistance? At 230 volts you get 1,04 mA forward current. Is this enough for your optocoupler?

        Reply
        • Swagatam says

          September 27, 2021

          You can try 100k also, the 220k value was selected randomly because I guess even a slightest bit of illumination of the opto LED is enough to drive the transistor ON.

          Reply
          • A.Verone says

            September 27, 2021

            But I think in a real situation where you need for example 10 mA to turn on the LED in your optocoupler, you would only need 23 kOhm at 230 Volts. Am I way off? Is there something I’m not taking into consideration?

            Reply
            • Swagatam says

              September 27, 2021

              An LED will stat illuminating even with a 1 mA current although the illumination will be very dim, barely visible in dark. So the process of illumination is not sudden, rather it follows the intensity of the current from minimum to maximum.

              Yes 23k would work but it would dissipate a lot of heat, therefore it will need to be a high watt resistor.

              Reply
  2. Graham says

    May 31, 2021

    Your statement: As we know that as long as pin#3 potential is lower than pin#2, the output potential at pin#6 will be 0V, and as soon as pin#3 voltage goes above the pin#2, the output voltage will quickly switch to the 12V (supply level) is not quite correct. The voltage at pin 2 will fall below the reference voltage applied to pin 3.

    Reply
    • Swagatam says

      May 31, 2021

      My statement is correct, it is a basic comparator rule….. the input is supposed to be fed from a bridge rectifier

      Reply
  3. Johann B. says

    February 28, 2021

    Hi swagatam,
    I tried the second circuit with a bridge rectifier and mct2e. If I try 180k 0,25W resistor, temperature of the resistor seems to be ok.
    But If y try 180k 1W resistor it’s very hot (can’t touch the resistor more than 3seconds.)

    Is it normal?

    If I put 43k 1W resistor before bridge rectifier on line and neutral they are hot too.

    Reply
    • Swagatam says

      February 28, 2021

      Hi Johann, It is normal, however I would rather suggest to add a 0.22uF/400V or 0.33uF/400V capacitor in series with the resistors and then reduce the resistor value to 10k (4.7k + 4.7k) 1/4 watt, and see the effect

      Reply
  4. sedighhosein says

    February 1, 2021

    hello dear sir,God bless you .i always read your site and through site i was able to be almost a few successful in electronics. both zero crossing detectors can not be effective in the negative cycle, My dear friends,i designed a very good circuit that is very effective ,accurate and simple ,and i use this circuit a lot to control triak device and i wanted to share this circuit with you,noble man

    Reply
    • Swagatam says

      February 1, 2021

      Thank you Dear Sedigh,, all the above circuits are supposed to be fed from a bridge rectifier, not from an AC source, and therefore both the cycles will be processed!

      I have put a note below all the diagrams for clarifying the issue!

      Reply
  5. Frank Fattori says

    April 18, 2020

    I would also question the description of the 3rd circuit as it would seem that the base of the PNP is 3 diodes lower than it’s emitter during positive half cycle, hence able to supply current to the SCR trigger device. So I do not see how it stops the circuit being triggered during a positive cycle. The diagram is missing a capacitor on the emitter of the PNP. Without this capacitor, the PNP cannot provide trigger current during negative half cycle… but again, although it would then clear turn on a zero crossing, I cannot see any reason why it would not turn on during a latter portion of the AC cycle either positive or negative…. I’d be happy to discuss it further with you though!

    Reply
    • Swagatam says

      April 19, 2020

      The total diode drop at the base of the PNP will be around 2V, which means as long as the input positive cycle is above 2V across base/emitter, the PNP cannot conduct. Adding a capacitor will mean the PNP keeps conducting permanently due to the holding charge of the capacitor and will make the main purpose useless. The ScR gate current is decided by the 0.33uF value and seems to be quite enough for a SCR triggering. 0.33uF will provide around 15 mA sufficient for the ScR gate.

      Reply
  6. Brian Hambleton says

    December 6, 2019

    Hi,
    Interesting stuff, thanks.

    Regarding your “Using a opto-coupler BJT circuit” however, surely it will only work as described during the positive half of the A/C cycle.
    During the negative half cycle the LED will also be off and the transistor non conducting resulting in a different o/p wave form than shown. Addition of a bridge rectifier feeding the LED would be required to obtain the pulse at every zero crossing as shown in your sketch. No?

    Cheers,

    Brian H.
    Uxbridge Ont Canada

    Reply
  7. Afolabi Lasisi says

    July 11, 2018

    Hellow Swagatam, I quite understand the first two zero crossing circuits, but sir, to my understanding, the third circuit ‘practical application circuit might not work, it will conduct at the peak of the line voltage because the base of the PNP BJT is always lower than it’s emitter, and hence is forward biased. Please Sir, if it is a lack of enough understanding on my part, kindly explain how how the zero detection could be accomplished by the PNP BJT.

    Reply
    • Swagatam says

      July 11, 2018

      Hi Afolabi, The base of the PNP is connected with the positive line of the circuit via a few diodes. During the mains peak voltages this line will be at full 12V DC which will keep the PNP switched OFF. The PNP will be able to conduct only during the periods when the peak drops below 1.5V, when the base of the PNP will be able to access the ground negative potential. I hope you got the point.

      Let me know if you have any further doubts.

      Reply
  8. rohit pandey says

    August 9, 2016

    hello swagatamji, do i required this circuit for SCR firing circuit.
    can you pleas help to control SKKT 57B16E SCR in back to back model to control AC voltage.

    Reply
    • Swagatam says

      August 10, 2016

      hello Rohit, sorry I do not have an SCR controlled dimmer circuit at the moment with me…

      Reply

Primary Sidebar

Calculators

  • 3-Phase Power (15)
  • 324 IC Circuits (19)
  • 4017 IC Circuits (52)
  • 4060 IC Circuits (25)
  • 555 IC Circuits (98)
  • 741 IC Circuits (19)
  • Arduino Engineering Projects (83)
  • Audio and Amplifier Projects (114)
  • Battery Chargers (82)
  • Car and Motorcycle (94)
  • Datasheets (46)
  • Decorative Lighting (Diwali, Christmas) (33)
  • Electronic Components (100)
  • Electronic Devices and Circuit Theory (36)
  • Electronics Tutorial (116)
  • Fish Aquarium (5)
  • Free Energy (34)
  • Fun Projects (13)
  • GSM Projects (9)
  • Health Related (20)
  • Heater Controllers (29)
  • Home Electrical Circuits (102)
  • How to Articles (20)
  • Incubator Related (6)
  • Industrial Electronics (28)
  • Infrared (IR) (40)
  • Inverter Circuits (98)
  • Laser Projects (12)
  • LED and Light Effect (93)
  • LM317/LM338 (21)
  • LM3915 IC (25)
  • Meters and Testers (65)
  • Mini Projects (148)
  • Motor Controller (67)
  • MPPT (7)
  • Oscillator Circuits (26)
  • PIR (Passive Infrared) (8)
  • Power Electronics (34)
  • Power Supply Circuits (77)
  • Radio Circuits (10)
  • Remote Control (48)
  • Security and Alarm (61)
  • Sensors and Detectors (120)
  • SG3525 IC (5)
  • Simple Circuits (75)
  • SMPS (29)
  • Solar Controllers (60)
  • Timer and Delay Relay (53)
  • TL494 IC (5)
  • Transformerless Power Supply (8)
  • Transmitter Circuits (40)
  • Ultrasonic Projects (16)
  • Water Level Controller (45)

Calculators

  • AWG to Millimeter Converter
  • Battery Back up Time Calculator
  • Capacitance Reactance Calculator
  • IC 555 Astable Calculator
  • IC 555 Monostable Calculator
  • Inductance Calculator
  • LC Resonance Calculator
  • LM317, LM338, LM396 Calculator
  • Ohm’s Law Calculator
  • Phase Angle Phase Shift Calculator
  • Power Factor (PF) Calculator
  • Reactance Calculator
  • Small Signal Transistor(BJT) and Diode Quick Datasheet
  • Transistor Astable Calculator
  • Transistor base Resistor Calculator
  • Voltage Divider Calculator
  • Wire Current Calculator
  • Zener Diode Calculator

© 2023 · Swagatam Innovations