It probably wasn't too long after comparators were invented that someone thought to put two of them together to make a window comparator. These days, this popular application of two comparators is made easier by semiconductor vendors who offer two comparators and a voltage references on a single silicon chip. This article takes a representative dual comparator from ADI and shows how to add an externally controlled test function to the basic circuitry in order to test whether the circuit is working properly or not.
Figure 1 shows an ADCMP670 low-power dual comparator configured as a window comparator to monitor a Li-ion battery with a nominal voltage of 3.6 V. Generally, both over-voltage and under-voltage battery excursions need to be monitored independently and reported separately due to the different responses required by the different situations. A typical over-voltage limit is around 4.2 V, while a typical under-voltage limit is 2.3 V.
The ADCMP670 comprises two low power comparators and a shared high-accuracy 400-mV reference. The hysteresis around each comparator is fixed at 9 mV. In figure 1, Channel A monitors the high side of the window. For the circuit to alarm at 4.2 V, the required R1A/R2A ratio is 9.5. Channel B watches the low side of the window. For it to alarm at 2.3 V, the required R1B/R2B ratio is 4.75.
Both OUTA and OUTB are low when this circuit is working properly, only going high when an alarm condition is present. In critical applications, it is wise to periodically test the window comparator to see that things are still okay and to provide reassurance that the circuit is still working.
Figure 2 shows how this test functionality can easily be added to the standard circuitry of Figure 1. Transistor QA is wired in series with R2A and is normally on. Transistor QB is wired in parallel with R2B and is normally off. Inverting the drive signals to these transistors turns QA off and QB on, setting the trip levels in a way that drives both comparators into their error states simultaneously. If both components are working properly, OUTA and OUTB will be driven high. When the QA and QB drive levels are restored, the normal trip levels are restored, the output levels return to their normal operating state, and the window comparator has been shown to be working correctly.
Transistors QA and QB can be any general purpose, low cost, low voltage, N-channel MOSFETs. Their typically low on-resistance will not lead to significant errors in the circuit's operation.