The zero-level detector in Figure 13–1 can be modified to detect positive and negative voltages by connecting a fixed reference voltage source to the inverting (-) input, as shown in Figure 13–2(a).
A more practical arrangement is shown in Figure 13–2(b) using a voltage divider to set the reference voltage, VREF, as follows:
where +V is the positive op-amp dc supply voltage.
The circuit in Figure 13–2(c) uses a zener diode to set the reference voltage (VREF =VZ).
As long as Vin is less than VREF, the output remains at the maximum negative level.
When the input voltage exceeds the reference voltage, the output goes to its maximum positive voltage, as shown in Figure 13–2(d) with a sinusoidal input voltage.