Projects / Window comparator voltage monitor

Window comparator voltage monitor

Beginner1 hGuided buildReviewed

Build it step by step

0 of 7 done
  1. Make the thresholds

    Three 10 kΩ resistors in series from +9 V to ground. Measure the two junctions: about 6 V and 3 V.

  2. LM393

    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.

  3. Join the outputs

    Pins 1 and 7 together with a 10 kΩ pull-up to +9 V.

  4. 11.3 mA

    Add the red LED

    +9 V, 1 kΩ, LED, cathode to the joined outputs.

  5. BC54711.3 mA

    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.

  6. 11.3 mA

    Test

    Turn the pot slowly. Below 3 V and above 6 V the red LED lights. Between them the green LED lights.

  7. ++

    Use it

    Replace the pot with a divider of a battery to check if it is in a healthy range.

In short

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

Tick what you already own. It saves to My Garage, so “Build with what I have” knows.

Wiring

FromToWhy
9 V battery +LM393 pin 8Supply
9 V battery -LM393 pin 4Ground
10 kΩ chain9 V to node H, node H to node L, node L to GNDH is about 6 V, L about 3 V
Pot ends9 V and GNDThe test voltage
Pot wiperVin: LM393 pin 3 (IN+ A) and pin 6 (IN- B)Input to both comparators
Node LPin 2 (IN- A)Low threshold
Node HPin 5 (IN+ B)High threshold
Pins 1 and 7 (outputs)Joined as node W, with 10 kΩ to 9 VOpen-collector outputs share a pull-up
9 V +1 kΩ, then red LED anode; red LED cathode to node WRed lights when W is pulled low
Node W10 kΩ to a BC547 base (emitter to GND)Green driver
9 V +1 kΩ, green LED anode; green LED cathode to the BC547 collectorGreen 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.

CheckExpected
Vin 1.5 VRed on, green off
Vin 4.5 VGreen on, red off
Vin 7.5 VRed on, green off
ThresholdsSwitch 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 →

Ask Lark AI

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.