Sinusoidal voltages signals are often converted to square waves using Zero-Crossing detectors. In this circuit, Op-Amp operates in the open loop comparator mode. The supply voltage can be single or dual. This circuit is generally used to start a process after zero-crossing, like turning ON the load or generating firing pulse through a microcontroller by starting the timers or counting the cycles or frequency of alternating voltage signal etc.
When the input signal is connected to V+ and V- is grounded, as the input voltage rises above the ground voltage i.e, when the input is positive, the output of the Op-Amp is +Vsat and output is –Vsat while the input is negative.
Op-Amp as Non-Inverting Zero-Crossing detector
Alternatively, when the input signal is connected to V- and V+ is grounded, as the input voltage rises above the ground voltage i.e., when the input is positive, the output of the Op-Amp is -Vsat and the output is +Vsat while the input is negative. This difference is used when input signal is obtained from the secondary of a transformer, and square wave output is to be used for some other applications.
Op-Amp as Inverting Zero-Crossing detector
However, suitable filter circuits must be inserted between input signal and the Op-Amp circuit in order to eliminate harmonics.