Window comparator voltage monitor
Build it step by step
0 of 7 doneMake the thresholds
Three 10 kΩ resistors in series from +9 V to ground. Measure the two junctions: about 6 V and 3 V.
Wire the comparator
Pin 8 to +9 V, pin 4 to ground, pins 2 and 5 to the thresholds, pins 3 and 6 to the pot wiper.
Join the outputs
Pins 1 and 7 together with a 10 kΩ pull-up to +9 V.
Add the red LED
+9 V, 1 kΩ, LED, cathode to the joined outputs.
Add the green driver
Joined outputs through 10 kΩ to a BC547 base, emitter to ground, green LED and 1 kΩ from +9 V to the collector.
Test
Turn the pot slowly. Below 3 V and above 6 V the red LED lights. Between them the green LED lights.
Use it
Replace the pot with a divider of a battery to check if it is in a healthy range.
How do you build a window comparator voltage monitor?
Two comparators light a green LED when a voltage is inside a set window and red when it is outside. You need LM393 Comparator, Resistor 10 kΩ × 5, Potentiometer 10 kΩ, BC547 NPN transistor, LED 5 mm red, LED 5 mm green, Resistor 1 kΩ × 2, Breadboard 830 Tie Points, Jumper wires male to male (40 pcs, 20 cm), 9 V battery, 9 V battery snap with DC jack and Digital multimeter. It takes 7 steps and about 60 minutes.
- Level
- Beginner
- Time
- About 60 min
- Parts
- 12
Parts list
- Integrated CircuitsBuyLM393 Comparator × 1
- PassivesBuyResistor 10 kΩ × 5
- PassivesBuy
- SemiconductorsBuy
- SemiconductorsBuyLED 5 mm red × 1
- SemiconductorsBuyLED 5 mm green × 1
- PassivesBuyResistor 1 kΩ × 2
- PrototypingBuy
- PrototypingBuy
- BatteriesBuy9 V battery × 1
- PowerBuy
- Tools & InstrumentsBuy
Tick what you already own. It saves to My Garage, so “Build with what I have” knows.
Wiring
| From | To | Why |
|---|---|---|
| 9 V battery + | LM393 pin 8 | Supply |
| 9 V battery - | LM393 pin 4 | Ground |
| 10 kΩ chain | 9 V to node H, node H to node L, node L to GND | H is about 6 V, L about 3 V |
| Pot ends | 9 V and GND | The test voltage |
| Pot wiper | Vin: LM393 pin 3 (IN+ A) and pin 6 (IN- B) | Input to both comparators |
| Node L | Pin 2 (IN- A) | Low threshold |
| Node H | Pin 5 (IN+ B) | High threshold |
| Pins 1 and 7 (outputs) | Joined as node W, with 10 kΩ to 9 V | Open-collector outputs share a pull-up |
| 9 V + | 1 kΩ, then red LED anode; red LED cathode to node W | Red lights when W is pulled low |
| Node W | 10 kΩ to a BC547 base (emitter to GND) | Green driver |
| 9 V + | 1 kΩ, green LED anode; green LED cathode to the BC547 collector | Green lights when W is high |
No code needed
No code. Comparator A output is high when Vin is above the 3 V low threshold, and comparator B output is high when Vin is below the 6 V high threshold. Both outputs are open collector, so tied together they make an AND: node W is high only inside the window. A BC547 inverts W for the green LED. Wire the red LED from +9 V through 1 kΩ with its cathode to W: it lights only when W is pulled low, which means outside the window.
Test checklist
What you should see at each check. If a reading is far off, stop and use the troubleshooting list.
| Check | Expected |
|---|---|
| Vin 1.5 V | Red on, green off |
| Vin 4.5 V | Green on, red off |
| Vin 7.5 V | Red on, green off |
| Thresholds | Switch near 3 V and 6 V |
If it does not work
Both LEDs on
Output W sits at a middle voltage. Check the pull-up and the BC547 base resistor.
Neither LED on
No power on the LM393 or the pin numbers are shifted.
Switches at the wrong voltage
The resistors are not equal. Measure and use the measured thresholds.
LEDs flicker near a threshold
Comparators without hysteresis chatter. This is normal in this lab.
Still stuck? Find the fault step by step with your multimeter →
Common questions
What parts do I need for the window comparator voltage monitor?
LM393 Comparator, Resistor 10 kΩ × 5, Potentiometer 10 kΩ, BC547 NPN transistor, LED 5 mm red, LED 5 mm green, Resistor 1 kΩ × 2, Breadboard 830 Tie Points, Jumper wires male to male (40 pcs, 20 cm), 9 V battery, 9 V battery snap with DC jack and Digital multimeter.
How long does the window comparator voltage monitor take to build?
About 60 minutes for a beginner maker, in 7 steps.
How do I know the window comparator voltage monitor works?
Vin 1.5 V: Red on, green off. Vin 4.5 V: Green on, red off. Vin 7.5 V: Red on, green off.
Both LEDs on: what should I check?
Output W sits at a middle voltage. Check the pull-up and the BC547 base resistor.
Neither LED on: what should I check?
No power on the LM393 or the pin numbers are shifted.
Switches at the wrong voltage: what should I check?
The resistors are not equal. Measure and use the measured thresholds.
LEDs flicker near a threshold: what should I check?
Comparators without hysteresis chatter. This is normal in this lab.
