Application & Interface of Window Comparator

As the name implies, a window detector is a specialized comparator circuit designed to detect the presence of a voltage between two prescribed limits that is, within a voltage “window”. A window comparator is useful in test and production equipment to select components that are within a specific set of limits.

This circuit is implemented by logically combining the outputs of two single-ended comparators. One indicates an input greater than the lower limit, and the other an input less than the upper limit. If both comparators indicate a true condition, the output is true. If either input is not true, the output is not true. A basic window comparator circuit is illustrated in Figure 3-46.

In this circuit, the outputs of the two comparators are logically combined by the 1N914 diodes. When the input voltage is between the upper limit (VUL) and the lower limit (V LL) the output voltage is zero; otherwise it equals a logic high level. The output of this circuit can be used to drive a logic gate. LED driver or relay driver circuit. The circuit shown in Figure 3-47 shows a 2N2222 npn transistor being driven by the window comparator. When the input voltage to the window comparator is outside the range set by the VUL and VLL inputs, the output changes to positive, which turns on the transistor and lights the LED indicator.

Figure 3-46. Basic Window Comparator

The TLC372 features extremely high input impedance (typically greater than 1012Ω) which allows direct interfacing with high-impedance sources. The outputs are n-channel open-drain configurations, and can be connected to achieve positive-logic wired-AND relationships. While these devices meet the 2000 V ESD (electrostatic discharge) specification, care should be exercised in handling the chips because exposure to ESD may result in a degradation of the device performance. If the input signal will exceed the common-mode voltage, it is good design practice to include protective input circuitry to the comparators. Clamp diodes and/or

series resistors, as shown in Figure 3-48, could be used for this purpose.

COMPARATOR INTERFACE CIRCUITS

A comparator is a useful building block in signal conditioning circuits as well as in instrumentation and control circuits. Once the inputs to the comparator have been correctly matched and connected, the comparator must interface with any additional output circuitry to perform functions such as: energizing a relay, lighting a lamp or driving another type of logic circuit.

Figure 3-47. Window Comparator with LED Indicator
Figure 3-48. Input Protection Circuitry

Figure 3-49 shows three similar output interface circuits which can be used to drive a lamp, a relay, and an LED. All three circuits utilize the popular LM311 comparator and 2N2219/2N3904 family of discrete transistors. A resistor in series with the transistor base should be used in circuits of this type in order to limit the current. Although it is possible to directly drive some small lamps and relays from the output of the comparator, it is advisable to use a buffer transistor as illustrated. The output buffer will minimize loading on the comparator to preserve its gain and drift characteristics, and provide a higher output current.

Figure 3-49(a) is a circuit which can be used to turn on a 28- V lamp. A 100 Ω resistor must be included in series with the lamp. The purpose of this resistor is to limit the cold lamp inrush current. Lower voltage lamps of up to 150-mA current rating can be driven by reducing the lamp supply voltage appropriately.

Figure 3-49(b) illustrates a relay driver circuit. The relay is connected in series with the transistor collector terminal and the 24-V supply. The 1N914 diode across the relay clamps the back EMF voltage generated when the relay is turned off. Lower voltage relays can be driven as well as the relay illustrated here, provided the maximum current is less than 150 mA.

Figure 3-49(c) illustrates an LED driver, using a 2N3904 transistor switch rather than the high-powered 2N2219. The TIL220 is a red LED and has approximately a 1.7-V drop in the forward-bias condition at a forward current of 20 mA with a VCC of 5 V. The value of the current limiting resistor is calculated as shown below.

The next higher standard value is 180Ω which has been used in this circuit.

A comparator output may interface with digital logic. If the comparator operates from a single 5-V supply, there is no problem. Interfacing to a comparator that is operating from +15-V supplies may require some level shifting and/or clamping to drive logic circuits. Figure 3-50 illustrates graphically how to interface comparators to different level logic circuits.

Figure 3-50(a) illustrates a comparator with a single 5-V power supply and has a 10-kΩ pull-up resistor on the output. This circuit will drive standard TTL logic circuits or low-level CMOS logic circuits. These logic circuits require a maximum of 0.8 V for low state and a minimum of 2.4 V for high state.

Figure 3-49. Comparator Output Interface Circuits

Figure 3-50(b) illustrates a comparator circuit capable of driving high-level CMOS circuits. This circuit operates from dual  +15-V supplies and uses a 100-kΩ pull-up resistor on the output. High-level CMOS logic requires a maximum of 4.0 V for a low state and a minimum of 11.0 V for a high state.

Figure 3-50(c) illustrates how a three-state output is produced by following the comparator with a hex-bus driver such as the SN74367. In this circuit the comparator has a 10 kΩ pull-up resistor on its output and sends TTL logic signals to the input of the hex buffer. The output of the hex buffer is controlled by the input control pin’s logic level. When this pin is low the device is enabled and the output is TTL logic. When the input control pin is high there is no output from the device and the output looks like a high impedance.

Figure 3-50. Comparator Logic Interface Circuits