# Zero crossing Detection

Discussion in 'The Projects Forum' started by ruwad, May 15, 2012.

1. ### ruwad Thread Starter New Member

May 11, 2012
8
0
I was trying to obtain a square wave from a sine wave through a zero crossing detector using an op-amp with its high voltage gain and the inverting terminal grounded and the non-inverting terminal with the input the op-amp is driven to saturation and the output will be a square wave with amplitude equal to the supple voltages regardless what the input amplitude is , but thats what i m getting and i cant figure out why , anyone can help please ?
here are the output pictures at different input amplitudes with a 10KHz sine input.

+VCC = +5V
-VCC = -5V

@ input = 2V - 10Khz

@ input = 10V - 10Khz

2. ### wayneh Expert

Sep 9, 2010
12,368
3,224
The slow rise and fall is due to the slowness of that ancient op-amp.

The inability to hold (lower figure) is less obvious. You're putting a voltage on the input higher than the rail voltage, which is a no-no.

3. ### SgtWookie Expert

Jul 17, 2007
22,183
1,728
A 741 opamp has an input range of about -V +3v to +V -3v; so with you using ±5v for the supply, you only have about -2v to +2v for your input range.

As Wayneh mentioned, the 741 is a really slow and ancient opamp.

What you should really be using in this case is a comparator; they are designed to have a digital-like output. If you use a comparator like a 111/311, 2903, 393 or 339, you will need to use a pull-up resistor on the output, as the outputs are open-collector; they can sink current but can't source current.

Size the resistor so you get about a 4mA current flow when the output is on (sinking current).

Note that the 111/311 has the output transistors' emitter on its' own pin; you will need to connect it to GND or V- to get a signal out.

4. ### WMJBUTLER New Member

May 15, 2012
3
0
Hi,

The slew rate on a 741 is around 0.5v/us. If you look at your first circuit, you see that the time from -4v to +4v is somewhere around 12us. So, the slew rate is (+4 - -4)v/12us = 8v/12us = 0.67v/us. This is close to the spec, and since there is a family of 741, it might be very close for one of them. You must remember when using a model of a device, that the model will never act like the part you put in the circuit. Also, the real circuit you put it into will have parasitic elements of capacitance, resistance, transmission lines, and power cross talk, etc., that will make it even more different... In all, this first circuit't performance looks good as a first order modeling job.

The second circuit is not operating at all, and in real life, you would probably have destroyed it the second you applied an input voltage that far exceeds the rail voltage. (wayneh was right on.) As I remember, the 741 doesn't allow you to exceed rail voltages. You could add a limiting circuit between your signal and the input to the op-amp. It would consist of a series resistor between your input signal source and the op-amp input, and then two diodes. One diode will connect the anode to the op-amp input and the cathode to ground, and the second diode will be connected with the cathode to the op-amp input, and the anode to ground. This would limit the input to about +0.7 volts on the positive 1/2 cycle of the input signal, and -0.7v on the negative half cycle. This protects the input. The resistor value could be 10K or so. Good old 2N914, or just about any signal diodes you have in your parts box will do...

I wonder what your simulation tool is. The oscilloscopes are very realistic, and would provide great training for a beginner.

Enjoy - Bill

5. ### ruwad Thread Starter New Member

May 11, 2012
8
0
the simulator i m using here is Proteus ,
and here is a picture using the LM111 comparator , but the output is stuck on 15V which is the +Vcc voltage , and it doesnt toggle to the -Vcc voltage , the circuit is taken exactly from the datasheet of the LM111 IC

why is that happening ?

6. ### bertus Administrator

Apr 5, 2008
15,796
2,384
Hello,

You have the open collector output of the LM311 connected directly to the + powersupply.
You will need a resistor from the output to the + powersupply.

Bertus