3
\$\begingroup\$

I’m struggling to build a window comparator circuit where the output is high when the voltage is in range. I do not have access to any kind of inverter. I have tried using an inverting op-amp, but this made the voltage negative.

I want an LED to switch ON when the input voltage is within a range. Does anyone have solutions for how else I could do this without an inverter?

\$\endgroup\$
2
  • 2
    \$\begingroup\$ Welcome! Please show what you have tried. Have you thought about using two comparators with for example open collector output? \$\endgroup\$
    – winny
    Commented Sep 26, 2023 at 16:14
  • \$\begingroup\$ What @winny said, ti.com/lit/an/sboa221a/… or many other results of a simple google search. \$\endgroup\$
    – John D
    Commented Sep 26, 2023 at 19:49

3 Answers 3

6
\$\begingroup\$

schematic

simulate this circuit – Schematic created using CircuitLab

This will do it. You'll have to adjust the supply and resistors to your taste, but you create a voltage divider to present the high and low window values to the (open collector/drain) comparators. CMP1 will turn off the FET and LED if it goes above the higher threshold; CMP2 will do the same if it goes below the lower threshold. The LED remains on as long as the input is between the two thresholds.

\$\endgroup\$
2
  • \$\begingroup\$ That circuit suffer from many possible errors. a) If comparators with push pull output is used, then there will be short circuit of their outputs. b) If non-input-rail-to-rail comparators are used, then in this case voltage at noninverting input of CMP1 can be out of input common mode range. With correct comparators, M1 can be omitted. Comparator output transistors can directly drive LED. \$\endgroup\$ Commented Sep 26, 2023 at 21:05
  • \$\begingroup\$ FWIW, I assume values left blank (edit component, delete the value) are generic, but that values given represent a typical/realistic embodiment. A simple circuit like this is easy enough to ballpark so that's fine. (In the spirit of nitpicking -- i.e. don't mind me if you're not in the spirit :) -- LM393 and 2N7000 would be fine examples at 5V supply, or IRL530 or TIP120 for a higher current load.) \$\endgroup\$ Commented Sep 27, 2023 at 13:49
4
\$\begingroup\$

If your normal condition is in-window, this would be a reasonable approach using open-collector comparator devices (e.g., LM139 type) that doesn't require an additional component (simulate it here):

enter image description here

The comparators short out the LED if the voltage is out-of-window, otherwise the LED is on (the normal condition.)

If you're using push-pull devices, you can do this (simulate it here):

enter image description here

Notice the polarity flip on the bottom (window-high) one.

\$\endgroup\$
3
  • 1
    \$\begingroup\$ Are these your ideas? \$\endgroup\$ Commented Sep 26, 2023 at 23:20
  • \$\begingroup\$ Odd question - yes, of course they are. \$\endgroup\$ Commented Sep 27, 2023 at 1:06
  • \$\begingroup\$ Definitely beautiful structures…... \$\endgroup\$ Commented Sep 27, 2023 at 3:30
2
\$\begingroup\$

Basic idea

This transistor circuit of a window LED comparator is based on the following sub-devices:

  • voltage divider (R1, R2)

  • transistor comparator (Q1 or Q2)

  • transistor switch (Rb, Q1 or Q2)

  • current steering diode (D1 or D2)

  • The circuit resembles an RTL NOR gate with different (NPN and PNP) transistors.

The R1-R2 voltage divider (with a LED in the middle) sets the two reference (threshold) voltages and also, the LED current. The transistor comparators compare (by their base-emitter junctions) the input voltage and the respective reference voltage.

Operation

Vin = 5 V (inside the window)

The both transistor base emitter voltages are less than 0.7 V so both transistors are cut off. All the current flows through the LED and it lights up.

schematic

simulate this circuit – Schematic created using CircuitLab

Vin > 5 V (above the window)

Q1 begins turning on and connecting D1 (0.7 V) in parallel to the LED (1.5 V). Thus the LED current is gradually diverted through D1, and the LED goes out.

schematic

simulate this circuit

STEP 2.1

STEP 2.2

Vin < 5 V (below the window)

Now Q2 turns on and connects D2 in parallel to the LED. The current is diverted through D2 and the LED goes out.

schematic

simulate this circuit

STEP 3.1

STEP 3.2

All cases superimposed

schematic

simulate this circuit

STEP 4.1

STEP 4.2

More considerations

  • The window of 2 V can be enlarged by increasing the LED forward voltage (by changing the LED or adding more diodes in series); accordingly, the diode forward voltages must be increased.

  • The window can be moved up and down by changing the R1/R2 ratio.

  • The LED current can be adjusted by changing the sum R1 + R2.

Another version

In the circuit solution above, the two thresholds are set by two diodes put in emitters. This can be done more conveniently with only one Zener diode connected between the bases (for convenience, I have used an "ideal" diode with an adjustable forward voltage from the CircuitLab library).

schematic

simulate this circuit

Here there is more freedom to set the width of the window.

STEP 5.1

STEP 5.2

The schematic can be drawn in another form that would be more understandable for some.

schematic

simulate this circuit

In the DC Sweep simulation, I have set the "ideal" diode forward voltage as a second parameter with several values. As a result, the family of curves in the graph below was obtained.

STEP 6.1

STEP 6.2

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Great circuit +1 \$\endgroup\$ Commented Sep 27, 2023 at 13:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.