# Bi-color LED 12v=green, 0v = red

#### jeffjohnvol

Joined Oct 15, 2008
37
Hi. I'm trying to find the simplest way to drive a bi-color LED using one color (green) when 12 volts sensed, and red when 0 volts sensed. I understand the resistor values I need to put on each leg to limit the current ( (12-.7)/20ma ), but not sure the simplest way to do this. Essentially I'm going to have a series of indicators in a room that indicate if a door/window is open or if something is left on. I know how to drive the 12 volt indicator from the source using microswitches or relays, but my question is at the LED indicator side of things. I'll have 12 volts if something is normal (green) and red if abnormal (0 volts). Given I may have up to 20 of these things, using relays to drive the LEDs would be way overkill.

Thanks in advance. I did search for this, and will keep searching.

Part number I'm using:
https://www.amazon.com/EDGELEC-Bi-Color-Resistors-Included-Emitting/dp/B077X91PLX

Only other similar search I found:

#### BobTPH

Joined Jun 5, 2013
4,769
What power is available at the Indicator?

Bob

#### Ian0

Joined Aug 7, 2020
4,865
D1 = red, D2 = green. D3/D4 = any signal diode.
V2 is the signal being monitored.
If you wanted the colours the opposite way round, you could lose one signal diode.
V1 is any convenient supply voltage >5V.

#### dl324

Joined Mar 30, 2015
14,318
1. How much current can whatever is providing the signal sink or source?
2. Do you really need to operate the LEDs at 20mA? You can often use less than the maximum continuous current rating for an indicator.
3. Are these LEDs going to be centrally located?
4. Do you have a power source for the LEDs and drivers?
5. You can use transistors to drive the LEDs, but if current requirements are low enough, you could use something like CD4049. 74AC04 will sink/source 20mA but you might need to worry about power dissipation in the IC.

#### LesJones

Joined Jan 8, 2017
3,702
IF the 12 volts is DC AND you can do the switching on the negative side I can see a way to do what you want usling 4 resistorts and one PNP transistor. If this will meet your needs I will post the schematic.
Edit. I have just seen Ian's post #3. That is even simpler than what I was going to suggest ant his circuit works with switched positive.
Les.

Last edited:

#### Ian0

Joined Aug 7, 2020
4,865
Make D3 a zener, and you can change the switching threshold.

#### ElectricSpidey

Joined Dec 2, 2017
2,143
Your resistor calculation is incorrect, you can't use .7 for the LED it should be the forward voltage of the LED.

#### jeffjohnvol

Joined Oct 15, 2008
37
What power is available at the Indicator?

Bob
It's esentially a microswitch in the case of a door open/closed or window open/closed. I'd have a voltage source at the LED display panel that goes to the switch and one line that returns. Does that make sense?

#### jeffjohnvol

Joined Oct 15, 2008
37
View attachment 251368D1 = red, D2 = green. D3/D4 = any signal diode.
V2 is the signal being monitored.
If you wanted the colours the opposite way round, you could lose one signal diode.
V1 is any convenient supply voltage >5V.
Okay, I may be confused. I only have one voltage, I can use 12 volts dc or 5 volts dc, lets assume 12vdc. If a door is closed, a microswitch is closed and it returns back to me 12vdc. If the switch opens, it'd be an open circuit and would go to zero. I want the 12 volt to be green, and the 0 to be red, using the component below. You may need to dumb it down for me, I don't see any place for the switch in your circuit. Thanks.

#### jeffjohnvol

Joined Oct 15, 2008
37
IF the 12 volts is DC AND you can do the switching on the negative side I can see a way to do what you want usling 4 resistorts and one PNP transistor. If this will meet your needs I will post the schematic.
Edit. I have just seen Ian's post #3. That is even simpler than what I was going to suggest ant his circuit works with switched positive.
Les.
Please feel free to post, as Ian's post is over my head. Note I'm using a component with the following schematic below... I can make the NC zero or 12v, whichever makes life simpler.

#### Ian0

Joined Aug 7, 2020
4,865
Ian's post is over my head
If two diodes and a resistor is too tricky for you, I'd suggest that you give up.

#### jeffjohnvol

Joined Oct 15, 2008
37
1. How much current can whatever is providing the signal sink or source?
2. Do you really need to operate the LEDs at 20mA? You can often use less than the maximum continuous current rating for an indicator.
3. Are these LEDs going to be centrally located?
4. Do you have a power source for the LEDs and drivers?
5. You can use transistors to drive the LEDs, but if current requirements are low enough, you could use something like CD4049. 74AC04 will sink/source 20mA but you might need to worry about power dissipation in the IC.
1. not a lot of current, it'd probably be 100 feet of cat 5 wire. Enough to send 12 volts, but not enough to drive a motor obviously. I'm just trying to sense the condition of a switch whether it's open or closed.
2. No, 20ma was just a rough guess. When in college that's what I generally used on small LEDs.
3. Yes, all of the LEDs would be at a panel at an exit so we can see the state of all of the doors and windows.
4. I can if needed.
5. I'll check those out. Thanks.

#### jeffjohnvol

Joined Oct 15, 2008
37
If two diodes and a resistor is too tricky for you, I'd suggest that you give up.
I didn't see how it mapped to my situation. I only have 1 voltage source that's controlled with the switch. I understand diodes and resistors, and I didn't see how your circuit matched up with the common anode LED I listed in the OP.

#### jeffjohnvol

Joined Oct 15, 2008
37
What power is available at the Indicator?

Bob
What ever voltage is sent to it. I have a signal line (say 12 vdc) going to a microswitch and a return line that I want to use to control the LED. Perhaps I should send one signal and have 2 returns instead, given the nature of the common anode design of the bi-colored LED.

#### Ian0

Joined Aug 7, 2020
4,865
I didn't see how it mapped to my situation. I only have 1 voltage source that's controlled with the switch. I understand diodes and resistors, and I didn't see how your circuit matched up with the common anode LED I listed in the OP.
V2 is the voltage source before it gets to the switch.
V1 is the voltage that you are monitoring.

Also, you did say that the monitored voltage can be either 0V or 12V. If you really meant that it can be either 12V or disconnected, then it needs a different circuit.

#### Ian0

Joined Aug 7, 2020
4,865
If you've just got a supply and a switch you can use this arrangement. D1 = red, D2=green.

#### jeffjohnvol

Joined Oct 15, 2008
37
V2 is the voltage source before it gets to the switch.
V1 is the voltage that you are monitoring.

Also, you did say that the monitored voltage can be either 0V or 12V. If you really meant that it can be either 12V or disconnected, then it needs a different circuit.
Yes, 12v or disconnected. I guess I was thinking in terms of what you'd see on a meter. Given the circuit, I guess it may be easiest for me to do something like this assuming there's not a lot of resistance in the wires (using cat 5 cable which I guess I could get 2 circuits each (6 of the 8):

#### dl324

Joined Mar 30, 2015
14,318
1. not a lot of current, it'd probably be 100 feet of cat 5 wire. Enough to send 12 volts, but not enough to drive a motor obviously. I'm just trying to sense the condition of a switch whether it's open or closed.
You can do something like this:

Operating the CD4049 at 12V would allow it to sink at least 10mA. You can't let the output of the inverter sinking current for the green LED be high enough to not be recognized as a LOW input for the inverter driving the red LED.

Each IC can drive 3 of the dual LEDs. It'll be more convenient to wire than discrete transistors.

#### jeffjohnvol

Joined Oct 15, 2008
37
If you've just got a supply and a switch you can use this arrangement. D1 = red, D2=green.View attachment 251374
okay, but if the switch is closed, won't both D1 and D2 light up, giving me a red/green at the same time, or is the nature of those LED's that only one color shows up if both cathodes are sent to ground?

#### Ian0

Joined Aug 7, 2020
4,865
okay, but if the switch is closed, won't both D1 and D2 light up, giving me a red/green at the same time, or is the nature of those LED's that only one color shows up if both cathodes are sent to ground?
No - that's the neat trick about it - red and green LEDs have different voltages, so only the one with the lower voltage will light.
Red = 1.8V, Green = 2.2V (approx)
If you want them the other way round, put a diode in series with the red, then red+diode = 2.5V, green=2.2V.