Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Zero crossing detector for Subzero

Not open for further replies.


Well-Known Member
Here is a way you can get the trigger pulse for your 555 and also use the transformer and bridge to provide the DC for the rest of the circuit. If you have a alternate source of DC, I have a couple of slightly simpler ideas for you.


  • zero_xing.gif
    4.6 KB · Views: 2,153
thank you ron, I do have an alternate source for dc, can you please post the simpler circuits? :)

basically I want to do 2 things:

1. use the 555 to control the intensity of a 120V ac light bulb (or small motor)

2. use a PIC microcontroller to control the intensity of the same thing...

I want to start with the 555 and than move on to using a microcontroller instead...
I have a question: do you need to detect the zero crossings and make sure the pulses start on the zero crossings? Can you clarify exactly what a triac is actually doing??

Any help would be greatly appreciated
alright, I have constructed the above circuit! (i used a seperate dc source instead of the regulator circuit)

it works pretty good... if a put vcc=12V
than I get a nice 5 volt square wave trigger signal (high for about 8ms and low pulse for about 1ms)

Can you please explain the function of the transistors in this circuit?
are they just to make the signal stronger and square?
The triac is a solid-state switch which will conduct in either direction, hence its use in AC circuits. Once triggered, it will stay on until the current goes to zero, which is every half cycle, so you need to retrigger it every half cycle. The average power to the load can be varied by adjusting how long you wait after each zero crossing before turning the triac on. This is the job of the 555 in your circuit. The zero crossing detectors you have seen recently (Fairchild's and mine) simply generate a negative-going pulse which starts just before the zero crossing. This immediately triggers the 555. At the end of the 555's timeout, the triac turns on, and stays on until the next zero crossing, where the absence of current causes it to turn off.
While it's true that a short pulse will theoretically allow you to trigger the triac earlier in the next half cycle, in fact it won't turn on anyway until the voltage reaches a certain minimum value, even if you have applied a pulse to the gate which starts at the very beginning of the half cycle.
I don't think you need a shorter pulse. You can knock a few tenths of a millisecond off the width by changing the resistor between the bridge and the base from 100k to 10k or so.
The transistors do exactly what you surmised - they provide gain, which gives you a nice pulse with fast transition times. The first transistor gives a pretty good-looking pulse, but it needs to be inverted. The second one does that and improves the transition times.
The other circuits, posted below, have slower transition times, which should be OK. The pulse width on zero_xing8 (the top one) is on the order of 200 to 300 microseconds.
You can also use a bridge rectifier and a comparator to get almost any pulse width you want.


  • zero_xing4.gif
    4.6 KB · Views: 2,571
  • zero_xing8.gif
    4.9 KB · Views: 1,491
thank you very much Ron...

so if I have a nice square wave that pulses low on every zero crossing, and i wanted to make a light bulb 50% bright....

I could use a PIC to take in the zero cross pulse and every time it goes low I could time for 4ms and than pulse an "on" for the triac... than the next low pulse I would do the same thing... right?

I really appreciate all of the help you have given me on this matter... I have searched the internet high and low and I have found the information regarding triacs is very limited (at least to someone with my limited knowledge base).

Thank you for helping me understand how triacs work and how to detect zero crossings so I can control the phase of the triacs.

Within the next month I hope to create a webpage detailing some important information on triacs and triac circuits. I want the next person who has to build this kind of circuit to find it on the net right away!
I have a confession to make. I have never used a triac! However, I'm an old dude with a lot of experience in analog design, and have read a lot about triacs since they were invented about 40 years ago.
well... lets hope you're right... I'll be testing the triac portion today...
at least I know the zero crossing detector works :)
Well, I explained how triacs work, but fortunately I didn't design that portion of your circuit. If it doesn't work, blame Fairchild!

PS I hope you survive the test. You didn't seem to take my warnings about grounding too seriously.
thanks... I have the zerocrossing detecting circuit hooked up and running... no electricution yet...

I already have a triac circuit working... (just in on/off mode controlled by a PIC) i just need to program the PIC to pulse the triac when it needs to...

I think everything is safe, but can you please clarify the warning? I'm not sure I understood it fully...
Sub, this grounding issue is sorta complicated. The design as it stands probably is not dangerous to use, but as with any AC line powered circuit, it is dangerous to test. If you happen to touch the high side of the line (the black wire) while you are touching something that's grounded, you can be electrocuted, or at least receive a nasty shock. The way to protect yourself is to get power from a ground fault circuit interrupter (GFCI) outlet. The problem with Fairchild's circuit is that it will trip a GFCI as soon as you turn on the power. The way to avoid this is to remove the connection which goes from the plug ground to the low side of the AC line. Instead, connect the plug ground to the circuit ground on your controller.
To understand why the GFCI will trip with the circuit wired as shown in the app note, you have to know how GFCI's work. GFCI's will trip an internal breaker if the current into the load (motor) through the black (hot) wire is not exactly the same as the current returning through the white (neutral) wire. Remember that the neutral returns to earth ground at the breaker box. With a GFCI powered circuit, if you are grounded and touch the hot side of the line, you provide an alternate current path to ground, which reduces the current in the neutral wire. The GFCI will instanteously detect this imbalance between currents in the hot and neutral wires, and will trip the circuit breaker in the GFCI, saving your skin. With the ground (green) wire connected in parallel with the neutral wire as it is in the app note, the return current will split between the neutral and ground wires. Since the neutral wire carries less current than the hot wire, the GFCI breaker will trip. This is not dangerous in itself, but it will force you to use a non-GFCI outlet if you want to be able to test your circuit, and therefore you won't be protected.

Whew! :)
Use opto-coupler (MOC3011) for added safety. Using it atleast the low voltage side of your circuit will be safe for tocuhing while its on.
The circuit in question is this one. As you can see, it already is optically isolated, although Subzero plans to replace the zero crossing detector/isolator with a transformer and a separare zero crossing detector. I was just trying to explain why he should rewire the ground so he can run it from a GFCI outlet for added safety.
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips