logo elektroda
logo elektroda
X
logo elektroda

Simple Discrete Circuit for Dual-Range Voltage Window Detection (0-1V, 4-5V)

273 16
Best answers

How can I detect whether an analog voltage is between 0–1 V or 4–5 V using as few discrete components as possible?

The practical answer is to use two comparators or op-amps as comparators rather than trying to build it from a few transistors and diodes. A simple two-op-amp comparator approach was suggested directly, and the LM139/LM239/LM339 family was recommended as a better fit if you want a dedicated comparator IC [#21684568][#21684581] Two transistors with resistor dividers can sort of do it, but the switching thresholds depend heavily on the individual transistor characteristics, so it is not very precise [#21684571] Using a reverse 3.3 V zener for the upper threshold and a forward diode for the lower threshold was also considered, but it was concluded that low-voltage zeners and series diodes do not have a sharp enough turn-on point for reliable thresholds [#21684572][#21684573][#21684574] The LM2900 quad Norton amplifier was specifically called out as needing special current-input resistor networks, so it is not a drop-in ordinary op-amp comparator solution [#21684579][#21684581]
Generated by the language model.
ADVERTISEMENT
  • #1 21684566
    Graham Rounce
    Anonymous  
  • ADVERTISEMENT
  • #2 21684567
    Giovanni Di Maria
    Anonymous  
  • #3 21684568
    Giovanni Di Maria
    Anonymous  
  • ADVERTISEMENT
  • #4 21684569
    Graham Rounce
    Anonymous  
  • #5 21684570
    Giovanni Di Maria
    Anonymous  
  • ADVERTISEMENT
  • #6 21684571
    Elizabeth Simon
    Anonymous  
  • #7 21684572
    Graham Rounce
    Anonymous  
  • #8 21684573
    Elizabeth Simon
    Anonymous  
  • #9 21684574
    Graham Rounce
    Anonymous  
  • #10 21684575
    Elizabeth Simon
    Anonymous  
  • #11 21684576
    Graham Rounce
    Anonymous  
  • #12 21684577
    PeterTraneus Anderson
    Anonymous  
  • #13 21684578
    Graham Rounce
    Anonymous  
  • ADVERTISEMENT
  • #14 21684579
    PeterTraneus Anderson
    Anonymous  
  • #15 21684580
    Graham Rounce
    Anonymous  
  • #16 21684581
    PeterTraneus Anderson
    Anonymous  

Topic summary

✨ The discussion focuses on designing a simple discrete circuit for dual-range voltage window detection with two outputs indicating when an input voltage (from an op-amp) is within 0-1V or 4-5V ranges. The original poster prefers to avoid using additional op-amps due to prior purchases of single-package MCP601 devices. Suggestions include using two op-amps as comparators, as implemented with LT1001 and LT602 devices, or employing transistor-based solutions with PNP and NPN BJTs combined with zener and silicon diodes to set threshold voltages. However, transistor threshold variability and zener diode voltage instability at low currents complicate this approach. The LM2900 quad Norton amplifier was tested but found unsuitable without careful consideration of its current-differencing input stage and unique input characteristics, which differ from standard voltage-input op-amps. Users recommend consulting datasheets and application notes for LM2900 and considering LM139/LM239/LM339 quad comparators as better alternatives. Spice simulation challenges were noted due to limited availability of low-voltage zener and specific op-amp models like MCP601 in LTSpice libraries. Overall, the consensus favors using dual op-amp comparator circuits for reliable window detection over discrete transistor or unconventional amplifier solutions.
Generated by the language model.

FAQ

TL;DR: LM2900 dates to 1972; “Check the LM139 LM239 LM339 quad comparators.” Build the 0–1 V and 4–5 V detector with two standard comparators, not Norton amps. [Elektroda, Anonymous, post #21684581]

Why it matters: This FAQ helps designers quickly choose reliable, low-cost parts and avoid LM2900 input pitfalls for dual-range window detection.

Quick-Facts

Quick Facts

What’s the simplest way to detect 0–1 V and 4–5 V windows?

Use two comparators set as window detectors. One triggers between 0–1 V, the other between 4–5 V. This approach is stable and easy to scale. It beats transistor-only tricks for repeatable thresholds. “Much easier to use two op-amps.” [Elektroda, Anonymous, post #21684571]

Can I do it with just a couple of transistors or MOSFETs?

Yes, but thresholds vary with device parameters, temperature, and Vth spread. That makes calibration painful across many units. Designers in the thread recommended moving to comparator-based windows for consistency and fewer surprises. [Elektroda, Anonymous, post #21684571]

Why did my LM2900/LM3900 window comparator misbehave?

LM2900 is a Norton amplifier with current inputs. It sets input nodes near a diode drop above ground. Driving it from a low-impedance voltage source causes errors and may damage inputs. Use resistor networks or choose a voltage comparator. [Elektroda, Anonymous, post #21684579]

What does “Norton amplifier” actually mean here?

It follows Norton’s Theorem: current source behavior with resistive networks. The LM2900/LM3900 compare input currents rather than voltages. Designers suggested LM339-family comparators for voltage windows instead. [Elektroda, Anonymous, post #21684581]

Which comparator should I pick for dual windows?

Pick a quad comparator like LM339/LM239/LM139. You get four channels per package, so two handle your two windows, leaving two spares. “Check the LM139 LM239 LM339 quad comparators.” [Elektroda, Anonymous, post #21684581]

How do I build the two windows with standard comparators?

  1. Set comparator A thresholds near 0 V and 1 V using a divider and reference.
  2. Set comparator B thresholds near 4 V and 5 V similarly.
  3. OR each window’s in/out logic to two outputs as needed. Two-op-amp examples were shared and simulated successfully. [Elektroda, Giovanni Di Maria, post #21684568]

Can I just program an MCU instead of adding comparators?

Yes. Sample the input and assert two digital outputs for the windows. The posted pseudo‑code shows the logic structure. Hardware may not reduce, but flexibility improves. [Elektroda, Giovanni Di Maria, post #21684567]

Are Zeners a good way to set 1.2 V and 3.9 V thresholds?

Not for precision at low current. Sub‑5 V Zeners and diode stacks have soft knees. Their breakdown varies with current and temperature. Expect drift and fuzzy switching without careful biasing. [Elektroda, Elizabeth Simon, post #21684573]

My LTspice result looked great, but the hardware is mushy—why?

A model set may lack accurate low‑voltage Zeners, and idealized diodes hide softness. Real parts show rounded knees and higher tolerance. The OP saw this and switched to quad op‑amps. [Elektroda, Anonymous, post #21684574]

How do I add real vendor parts to LTspice fast?

Download SPICE models from manufacturer pages and include them in LTspice. Many op‑amps, diodes, and transistors provide ready models. A quick “part + model” search helps. [Elektroda, Anonymous, post #21684575]

Any small tweak to stabilize a BJT-as-diode threshold?

Add a resistor from base to emitter. It raises diode current and sharpens the effective knee, improving repeatability slightly. This still trails a comparator for accuracy. [Elektroda, Anonymous, post #21684577]

Is there a risk if I connect a voltage source straight to LM2900 inputs?

Yes. The inputs prefer current drive through resistors. Direct voltage drive violates its input structure and can damage inputs. Route through resistive networks or choose LM339 instead. [Elektroda, Anonymous, post #21684579]

What did the original designer finally choose?

They moved away from Zeners and Norton amps, and ordered quad op‑amps instead. Simulations and experience led to the simpler, more reliable comparator path. [Elektroda, Anonymous, post #21684574]

Does this approach scale for many channels on a board?

Yes. A quad comparator gives four channels per IC, reducing cost and space. That’s 4 inputs per package, useful when duplicating windows across sensors. [Elektroda, Anonymous, post #21684581]

What if my signal source is a Hall sensor like in the thread?

Buffer or condition the Hall output, then feed the comparators. The OP’s node toggled ~0.2–4.8 V with magnet polarity, suiting window detection well. [Elektroda, Anonymous, post #21684578]
Generated by the language model.
ADVERTISEMENT