Looking at Window Comparator Circuits
A window comparator will output a voltage between two selected voltage points and be off outside that range. In Fig. 1 we have used 2 of 4 comparators in a LM339. The outputs of the each comparator in the LM339 is a open collector transistors tied together and connected to a LED and resistor. This open collector arrangement allows one to use a separate power supply form the rest of the circuit.
Note that U1b is connected as an inverting comparator while U1c is connected as a non-inverting comparator.
See Voltage Comparator Circuits
The rule for open collector comparator is both comparators must be turned OFF at the same time to output a HIGH. in Fig. 1 we use three 10,000 ohm resistors in series that produces 2/3s Vcc at Vref HIGH and 1/3 Vcc at Vref LOW.
On an inverting comparator if the MINUS input is greater than the PLUS input the internal open collector transistor is turned on. On a non-inverting comparator if the PLUS input is greater than the MINUS input the internal open collector transistor is turn on.
Thus the LED in Fig. 1 is on between these two voltages of 4V and 8V.

Fig. 2 Window comparator using LM358 dual Op-Amp at 3 volts.

Fig. 3 Window comparator using LM358 dual Op-Amp at 6 volts.

Fig. 4 Window comparator using LM358 dual Op-Amp at 9 volts.
Because each LM339 comparator is nothing more than an operational amplifier we can use a LM358 and do the same thing as Fig. 1 other than the output is 12-volts fed into two transistors Q1 and Q2. We use both a non-inverting and inverting comparators together. Vin is TP1.

Above is the logic table for the window comparator circuit at different voltages at Vin. Output transistor Q3 is turned on by the 10K pull up resistor when both Q1 and Q2 are turned off at the same time.
- Related:
- Basic Transistor Driver Circuits for Micro-Controllers
- Opto-Isolated Transistor Drivers for Micro-Controllers
- New Nov. 2014
- Using the ULN2003A Transistor Array with Arduino YouTube
- ULN2003A Darlington Transistor Array with Circuit Examples
- Using the TIP120 & TIP120 Darlington Transistors with Arduino YouTube
- Tutorial Using TIP120 and TIP125 Power Darlington Transistors
- Driving 2N3055-MJ2955 Power Transistors with Darlington Transistors
- Using Power MOSFETS with Arduino YouTube
- N-Channel Power MOSFET Switching Tutorial
- P-Channel Power MOSFET Switch Tutorial
- Using PNP Bipolar Transistors with Arduino, PIC YouTube
- Using NPN Biploar Transistors with Arduino, PIC YouTube
- Understanding Bipolar Transistor Switches
- How to build a Transistor H-Bridge for Arduino, PIC YouTube
- Build a High Power Transistor H-Bridge Motor Control
- Build a Power MOSFET H-Bridge for Arduino, PIC YouTube
- H-Bridge Motor Control with Power MOSFETS
- More Power MOSFET H-Bridge Circuit Examples
- Basic Triacs and SCRs
- Constant Current Circuits with the LM334
- LM334 CCS Circuits with Thermistors, Photocells
- LM317 Constant Current Source Circuits
- TA8050P H-Bridge Motor Control
- All NPN Transistor H-Bridge Motor Control
- Basic Triacs and SCRs
- Comparator Theory Circuits Tutorial
- Constant Current Circuits with the LM334
- LM334 Constant Current Source with Resistive Sensors
- LM317 Constant Current Source Circuits
- Introduction Hall Effect Switches, Sensors, and Circuits
- Using Ratiometric Hall Effect Sensors
- Pulse Width Modulation Power Control for Microcontrollers
- Introduction to PIC12F683 Programming
- Basic Transistor Driver Circuits for Micro-Controllers
- Opto-Isolated Transistor Drivers for Micro-Controllers
- Added Nov. 16, 2014
- ULN2003A Darlington Transistor Array with Circuit Examples
- Tutorial Using TIP120 and TIP125 Power Darlington Transistors
- Driving 2N3055-MJ2955 Power Transistors with Darlington Transistors
- Understanding Bipolar Transistor Switches
- N-Channel Power MOSFET Switching Tutorial
- P-Channel Power MOSFET Switch Tutorial
- H-Bridge Motor Control with Power MOSFETS
- More Power MOSFET H-Bridge Circuit Examples
- Build a High Power Transistor H-Bridge Motor Control
- Comparator Theory Circuits Tutorial
- Arduino Projects Revisited Revised
- Schematic for Following Projects
- Programming ADS1115 4-Channel I2C ADC with Arduino
- Arduino uses ADS1115 with TMP37 to Measure Temperature
- Connect Arduino to I2C Liquid Crystal Display
- Arduino Reads Temperature Sensor Displays Temperature on LCD Display
- Arduino with MCP4725 12-bit Digital-to-Analog Converter Demo