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.

Problem with zero cross signal

Status
Not open for further replies.

pop

New Member
Hi, I'm using LM311 zero cross detector as shown in LM311 datasheet.

After breadboarding the circuit and testing it I got the following result. (Since I couldn't save the oscilloscope image I drew one to show you what the problematic waveform looks like. All the pulses are periodic even though I forgot to draw several pulses to the right of the image).

The less-wider pulses are right on the zero cross, but they appear to be only several micro-seconds wide. The larger pulses are several millisecond wide but start almost half a millisecond after zero cross and end half a millisecond before the next zero cross.


Now I would idealy like to detect the smaller width pulses as they are right on the zero cross. But considering their width I am not sure if the microcontroller's external interrupt (16F877 RB0/INT) is going to pick them up!

What can I do about this problem? This happened to me before, but then I was building projects where the accuracy of zero cross detection was not as important.

Can perhaps a shmitt-trigger detect this pulse correctly? Or do you guys know a zero cross circuit with much better precision?

Thank You
 

Attachments

  • problem.png
    problem.png
    3.9 KB · Views: 1,782
You must read the application hints as well. You need some +ve feedback as you will get multiple switchings around the zero point with this fast comparator when used with slow rising/falling signals
 
This assumes you are powering from the mains and it is the mains zero crossing that you want
**broken link removed**
 
Darn dialup! Couldn't logon forever....

After messing around entire day with the zero crossing circuits (unfortuately with crappy results), I'll definately give the application hints and Fried's circuit a try tomorrow.


Thanks guys!
 
Of course you could use a 555 for the job. The AC input is low voltage ~9-12V
 

Attachments

  • zero_cross1.gif
    zero_cross1.gif
    33.4 KB · Views: 1,837
I never thought a 555 could be used for a zero cross...

I don't understand what is the purpose of 3 diodes in series?

Thanks.
 
It clamps the control pin to about 2.1V which lowers the comparator's lower and upper trip point. You could use a low voltage zener or a voltage divider here as well.
 
you would be supprised what a 555 can be used for.
There is a book dedicated to what cct you can make out of the timer chip
 
Yes, it will but then you can't control the width of the output pulse obviously. I used the 1k external instead of the internal 5k to get a higher voltage drop over the diodes. Without the 1k the voltage drop is much less (indicated by the simulator model) and another diode or zener must be used.
 

Attachments

  • diode_volt.gif
    diode_volt.gif
    7.4 KB · Views: 1,562
Now I got it!
The 555 is really an ingenious solution to the zero cross.

A few questions on the practical nature of this circuit

Is it more stable then LM311 for slow input signals (e.g 60Hz)? In other words, does it oscillate on the zero cross?

The reason why I am asking this, is that 555 might be a viable solution to using LM311 for my design (it looks like it is less bulkier than LM311 with a hysterysis feedback).
Just to recap, I've used the notes from application hints on LM311 to create a weak positive feedback (thanks TheOne), and I have had some very good results. The tiny pulses have decreased in amplitude, and the larger pulses are almost on the zero cross (within a few degrees).

Thanks for all the help!
 
wow, stop right there.

The LM311 is an extreamly good comparator and it is used in zer0-crossing detectors alot (mainly for thyristor rectifiers).

If it is a cost thing then go for the 555 (remember cost includes surrounding components.


The spurious pulse is occuring at one of the peaks of the sinewave. Are you sure the input signal is not exceeding the voltage rail's of the comparator?
This is not due


Also as already stated do you have some positive feedback around the comparator. This will clean up the zero-crossings (the rising and falling edges ).



I still think the input signal is too high.
What is the EXECT cirucit you are using.
 
There's nothing wrong with the LM311 if used correctly. People get into trouble by ignoring certain things like hysteresis, tying the offset pins and layout.

The 555 will not oscillate on the zero cross as the comparators drive a flip-flop and have an offset between their trip levels (2.1V upper and 1.05V lower).
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top