# A simple circuit to toggle between LEDs based upon input voltage

I’m trying to design a circuit to test a certain component, so I want to have different pairs of red/green LEDs for indicating whether various parts of the component are working. Indication as to whether or not each component is working will be determined by whether or not a voltage is above/below a certain threshold.

I realize that I can do this with an op-amp/comparator or maybe a relay. However, I’m trying to avoid mechanical or bulky parts (no relay) and I’m not assured that I will have a voltage rail above/below the input voltages (so no op-amp?). Furthermore, since I know exactly what I need from the circuit (just lighting LEDs), I don’t need the nice impedances afforded by an op-amp.

I would like to do this all with some common transistors, diodes, or zeners, and I was able to get something kinda working, but I couldn’t avoid cases where either both LEDs were on or off unless I made the circuit very dependent upon the betas of the transistors.

How simple of a circuit can be made which, for example, given a 12V rail, will toggle between two LEDs when an input voltage crosses, say, 11V? Can it also be done with only a 5V rail?

• LM339 is a great comparitor, it's cheap and works down to 3V and isn't scared of 30V, so you can probably power it off the input voltage. Mar 23, 2018 at 23:43
• what is the component that you are testing? Mar 24, 2018 at 0:32
• Define object, specs expected and actual results in point form, eg detect voltage or current and output "1,0" Vcc=5V Mar 24, 2018 at 2:40
• If you want to avoid the case where both are on, then you must put hysteresis in your circuit i.e. positive feedback. Using IC's (opamps etc) may reduce the transition region as the gain is so high. Using bi-color leds is another solution, as the orange bicolor state makes logical sense. Mar 24, 2018 at 3:24
• What exactly are you looking to do? You talk about a 12 V rail and a 5 V rail. Does this mean you want something that can work with any reasonable rail voltage, equally well? Or does this mean you have two rails you care about? Or just one? Do you want an adjustable threshold? Is there a reason why you don't want to use the comparators on a 555/7555? (Do you only want to do this with discrete parts?) What kind of repeatable precision do you expect with random active parts from a junkbox over a range of operating temperatures? Details....
– jonk
Mar 24, 2018 at 6:51

Here is an arrangement that was on all my industrial power supply modules, and boat switchboards, that let you know if you have No-power, blown-fuse or OK, with a single led.

simulate this circuit – Schematic created using CircuitLab

Over the years I have made quite a few arrangements with bi-colour that transition from green through orange to red giving you an excellent view of what is happening in a single led.

• I would expect that D1b would be exposed to reverse voltage in excess of its datasheet maximum once the fuse blows. Am I wrong? Isn't the reverse breakdown voltage for most LED's pretty low? Mar 24, 2018 at 5:27
• the datasheet voltage always seems to be. Now you have me wondering if I had an extra diode in the circuit or not. Tested some leds: Ordinary Rd=1uA@30V, Gn and Yellow=90nA@32V. A pure-green led is 500uA@30V and looks like it is at zener point, but then GaN leds are the ones that do have reverse antistatic diodes in the package. Mar 24, 2018 at 5:56

divide the input voltage down and then use a comparator.

simulate this circuit – Schematic created using CircuitLab

• 1M from U1a+ to U1bOut to provide hysteresis and hard R/G switching Mar 24, 2018 at 6:08
• what will be the range of the input?
– CNA
Mar 26, 2018 at 11:33
• This circuit accepts input upto around 40V the colour change is at around 11V Mar 28, 2018 at 7:21

Here is a simple circuit that uses no ICs, as requested, however Jasen's circuit is probably a better choice if you don't mind a couple chips.

D3 provides a ~5V reference and R3/R4 divide the 11V down to 5V. Q1/Q2 are a differential pair, and the current through R1 switches from D2 to D1 when the input voltage rises above 11V.

For better accuracy replace D3/R2 with an LM78M05. To use a 5V rail, change R4/R3 to divide down to 2.5V, replace D3 with an LM431 and R2 with 2K to get the minimum 1mA anode current.

simulate this circuit – Schematic created using CircuitLab

Edit: Simulation using Circuitlab:

• I spent a while simulating this arrangement, and the gm means that both leds are on for over a volt. You can flip the whole circuit, use pnp's and 3-pin bicolor led, so you get the orange state. Surprisingly, I couldn't find a positive feedback arrangement that worked to give hard switching. (without several extra comps) Mar 24, 2018 at 21:48
• @HenryCrun I get about 10.9 to 11.4V using Circuitlab (not going to enter it again into LTspice or PSpice). Of course there is no specification to meet, so it must be okay. You could consider the two being on at once as a bug or a feature as it gives an idea of how close to the threshold you are. Mar 24, 2018 at 22:00
• Probably I was using higher led currents (>10mA), from memory gm is 20mA/V Mar 24, 2018 at 22:29
• @HenryCrun Good point. 1-2mA is probably enough for a modern LED. Mar 25, 2018 at 1:22

simulate this circuit – Schematic created using CircuitLab