# Suggestions to clarify comparator circuit

I'm confused with the next issue from school that I can't figure out and wasn't able to solve (this is homework already graded, but the teacher refused to explain me).

I was asked to design and implement a zero crossing detector using an op-amp (any op-amp, even the 741). I understand there are several ways to do this with opto, transformers,etc.

But the real issue was that this device must be able to detect the zero crossing and when the signal is at 90 degrees (in the positive and negative cycle).

So I made the circuits but separately. As in the next window detector:

(between 4.5 V and 5.5 V ) and

A non-zero level detector modified with the DC voltage source set to zero volts. If the sin-wave input voltage (Vin) is less than (Vref), the output remains at the maximum negative level. When Vin exceeds Vref, the output reaches its maximum positive value.

But if the output of the window is passed to the level detector it gets wrong result, since the level detector isn't a sinus signal but the square one, so how must they be wired together to make the 2 functions at the same time?

And is it valid to apply superposition to get the transfer function?

Thanks for your help.

• So, why did you choose the 741 when you had scope to avoid it like the plague. Commented Nov 23, 2021 at 8:58
• Because the teacher told the opamp was free, but strongly (ordered) "suggested" to make it with these. Yeah I know... Commented Nov 23, 2021 at 19:31
• 741 is a piece of sh1t Commented Nov 24, 2021 at 6:35

Homework guidance: If you cause 90 degrees phase lag to the sinusoidal input by feeding it through an integrator you can use another zero crossing detector to show when the input is on its plus or minus peak.

In theory a differentiator would also do the trick, but it amplifies easily noise; needs band limiting. But it doesn't need DC free input like an integrator which would get saturated if there's DC.

Integrator has a drawback, too: It in practice drifts even with no DC in the input signal. Opamp non-idealities are the main causes of the drifting. 741 is not the finest selection in this sense. Offset voltage error is the same as a DC component in the input. Input bias current is another cause for drifting. The capacitor needs a discharging resistor which hopefully can be big enough. Otherwise it causes phase error.

A multistage RC filter can be designed to cause 90 degrees phase shift, but that works only at a fixed and known frequency.

• Thanks for the support, Does these kind of circuit (like the one requested) has a specific name? like non zero and cero detector? Commented Nov 23, 2021 at 22:36
• Never heard a name for a circuit which gives a pulse when Uin is close enough zero and also when Uin is close enough plus or minus peak value. Nobody prevents one to call it what he wants, but a name which reveals it detects zero crossings and reaching the extremes should be used. (=my opinion). Generally people ask names of things because they think it helps finding better sources for information. How did you think to use the name if it exists? Someone may know it and he may also tell a plausible usage for the circuit if you ask them in the question.
– user136077
Commented Nov 23, 2021 at 22:58
• I was intending to name it in someway. Bexcause the teacher does not like the circuits to be refered as circuit A, A , the circuit of fig X.a, and so on. Thanks its a bit strange, Commented Nov 24, 2021 at 1:16