# zero crossing detector circuit using lojic gates

Discussion in 'General Electronics Chat' started by ricepatties, Sep 12, 2008.

1. ### ricepattiesNew Member

Joined:
Sep 1, 2008
Messages:
1
Likes:
0
I am new to circuit design so forgive my question if it sounds silly. I am just playing around with some ideas but I was looking at some schematics for a zero crossings detector. Can a two input 'and' lojic gate be used for this type of circuit? Have one input tied to ground. The other input would be tied to a low voltage ac power supply. Then when the ac voltage crosses zero both inputs to the and gate would be zero and would therefor provide a high output. Or am I missing something? Thanks in advance for any feedback i may receive.

Ricepatties

2. ### BoncukNew Member

Joined:
Nov 10, 2007
Messages:
5,382
Likes:
88
Location:
Phetchabun,Thailand
Zero crossing detetector

Hi Ricepatties,

the problem with logic gates, in this case it must be an 'AND'-gate is the logic level for the function. Both inputs must be high to achieve a positive output state.

In order to to that you require a power supply for the logic gates. The AC must then be adapted not to exceed the allowed input voltage (CMOS-ICs) can handle up to 15V provided they are supplied with a 15VDC power supply.

for the steady ground you require a steady high as one input to the 'AND'-gate and for the AC-input it must be inverted, causing high on the other input when AC reaches zero Volt.

Boncuk

3. ### WillbeNew Member

Joined:
Aug 16, 2008
Messages:
1,236
Likes:
7
Location:
MD
Try this; unless you attenuate it, Vp-p of the incoming AC waveform has to be < +V of the CMOS gate.
The resistor/zener string should pass current >5x more than the gate input current.

Thanks, Mr. G., for telling me how to do a thumbnail.

#### Attached Files:

• ###### zerocrossing.jpg
File size:
147.9 KB
Views:
1,049
Last edited: Sep 13, 2008

Joined:
Jan 12, 1997
Messages:
-
Likes:
0

5. ### ericgibbsWell-Known MemberMost Helpful Member

Joined:
Jan 4, 2007
Messages:
21,312
Likes:
649
Location:
Ex Yorks' Hants UK

hi Willbe,

Also get free PDFCreator program.
and free ScreenHunter 5.

The ExpressSCH is ideal for quickie drawings, then use either PDFCreator or get a clipped GIF with ScreenHunter.

Last edited: Sep 13, 2008
6. ### WillbeNew Member

Joined:
Aug 16, 2008
Messages:
1,236
Likes:
7
Location:
MD
Don't you know that computers are The Work of Satan???

Can it also put meters everywhere? Meters are handy when ideas fail.

Last edited: Sep 13, 2008
7. ### ericgibbsWell-Known MemberMost Helpful Member

Joined:
Jan 4, 2007
Messages:
21,312
Likes:
649
Location:
Ex Yorks' Hants UK
hi,
Dont understand the use of 'meters' in this context.?

Computers are just a tool and only as good or bad, as the people who use them.

8. ### KMoffettWell-Known Member

Joined:
Oct 5, 2007
Messages:
2,498
Likes:
58
Location:
Minnesota, USA
I agree, it's a great schematic tool. I use ExpressPCB's Export function to transform schematics to a .bmp file (@ 300 pixels per inch). Then right click on the file and "Open with >" Microsoft Office Picture Manager. Easy to crop out frame, resize, and export to many formats...usually .gif. I think the best part is the ease in creating any schematic symbol you want...or modifying any in their large library.

Ken

Last edited: Sep 13, 2008
9. ### audioguruWell-Known MemberMost Helpful Member

Joined:
Mar 16, 2004
Messages:
32,674
Likes:
958
Location:
I make schematics with Microsoft Paint program.
Parts of other schematics and datasheets are copied and are pasted into the Paint program. Straight lines are made with the SHIFT key down. Simple and look good.

10. ### rezerNew Member

Joined:
Aug 13, 2008
Messages:
361
Likes:
1
Location:
Missouri, USA
I agree. I have used ExpressPCB for some time now. It was a lot easier to learn than Eagle. The components are easier to manage (at least right now). I downloaded Eagle because a number of people had suggested it and the price was right I'm still working with Eagle, trying to learn the ins and outs. Is there a "sticky" somewhere that could give me some helpful hints? Or maybe a tutorial on-line?

11. ### WillbeNew Member

Joined:
Aug 16, 2008
Messages:
1,236
Likes:
7
Location:
MD

Some people have posted schematics with meters showing readings that were evidently calculated using math models for the components shown in the schematic.
How'd they do that?

12. ### rezerNew Member

Joined:
Aug 13, 2008
Messages:
361
Likes:
1
Location:
Missouri, USA
The may have been using MultiSim. There are different instruments you can put into your schematic to make "simulated" measurements.

13. ### WillbeNew Member

Joined:
Aug 16, 2008
Messages:
1,236
Likes:
7
Location:
MD
Thanks; I think you're right.
http://en.wikipedia.org/wiki/NI_Multisim
Maybe earlier versions are free?

14. ### rezerNew Member

Joined:
Aug 13, 2008
Messages:
361
Likes:
1
Location:
Missouri, USA
It comes from National Instruments. They have an eval version free for 30 days. I've used it and as far as I know does everything the licensed one will do. You should be able to reinstall to extend it. The license cost \$40.00 as of last Fall.

15. ### audioguruWell-Known MemberMost Helpful Member

Joined:
Mar 16, 2004
Messages:
32,674
Likes:
958
Location:
You can spot a Multisim schematic because its parts are spread out all over your neighbourhood and it has measles dots all over it.

There is another schematic software that makes its schematics as a negative, white lines on a black background. Weird.

16. ### Ubergeek63Well-Known Member

Joined:
Apr 16, 2008
Messages:
1,886
Likes:
37
oy! a resistor, with diode clamps if you are paranoid, to the input of a schmidt trigger is all you need.

17. ### MrAlWell-Known MemberMost Helpful Member

Joined:
Sep 7, 2008
Messages:
11,056
Likes:
963
Location:
NJ
Hi there,

A comparator makes a much better zero crossing detector because you can control
the hysteresis much better. If you must use a logic gate then use a high voltage
AC signal through a resistor to drive the input, and use two diode clamps (one to
positive and one to ground) to clamp the input to a safe level for the gate. This
will get you closer to the true zero crossing.

18. ### WillbeNew Member

Joined:
Aug 16, 2008
Messages:
1,236
Likes:
7
Location:
MD
I think hysteresis muddies when the crossover occurs.

19. ### BlueteethWell-Known Member

Joined:
Oct 15, 2003
Messages:
1,168
Likes:
34
Location:
Hertfordshire, UK
You're right, thats the point.

With a definate cross-over point noise on a slow moving signal will cause multiple crossings. It's a conpromise between sensitivity and relability. You don't have to have a lot of hysteresis, a few mv should be enough to curb any noise issues.

Also, zero-crossing detectors are designed to cope with a certain bandwidth. What frequency are you dealing with here? If it is a datastream from some form of telecommunications, then the bandwidth would be fixed, or at least within a narrow band. This way you can tune the zero crossing detector. You can't expect it to cope with a sine wave of 5Hz, AND say 100khz.

Blueteeth

20. ### BoncukNew Member

Joined:
Nov 10, 2007
Messages:
5,382
Likes:
88
Location:
Phetchabun,Thailand
KILOMETERS!

Don't forget computers are individuals. Hug them from time to time to carry on working.

Hans

Last edited: Sep 14, 2008
21. ### BoncukNew Member

Joined:
Nov 10, 2007
Messages:
5,382
Likes:
88
Location:
Phetchabun,Thailand
Zero crossing detector

if you just want to detect the zero crossing of mains AC here is a circuit which works with mains.

It's output is half cycle of mains frequency. (full wave rectifier) You can control a triac directly from the output transistor.

Boncuk

File size:
12.1 KB
Views:
727