# Control RGB LED without microcontroller

I have an RGB LED that I'd like to change from green to red when a circuit is completed. While I know this is very simple with tools like an Arduino, I'd love to not use a microcontroller. Would it be possible using basic components (which can certainly include transistors, diodes or even common ICs like a 555 timer) to achieve this? If so - how would I connect the components?

Clarification: I'm using a common anode RGB LED (a lead for each color plus ground - four in total). I'd like to have it be green when a switch somewhere in the circuit is open (not connected) and red when the switch is closed. The switch is not connected to anything else.

• How are the LEDs connected internally? – Ignacio Vazquez-Abrams Jan 27 '14 at 15:30
• And what does "when a circuit is completed" mean? You mean you have a normally open pushbutton, or an open collector output, or what? When the button is pushed, you want green, and when it's not pushed, you want red? Or, when the button is pushed, do you want the LED to be red and then some time later green? There are a lot of ambiguities in your question that make it hard to answer. – Phil Frost Jan 27 '14 at 16:54
• @PhilFrost To clarify, I'm trying to have an RGB LED be green when a switch somewhere in the circuit is open and turn to red as soon as that switch is closed. – mbeasley Jan 27 '14 at 20:39
• @mbeasley if you edit your question to clarify that, it will go in the reopen queue. You also need to specify what kind of RGB LED you have. Is it common-cathode? Common-anode? Each emitter available separately (six leads)? Is the switch connected to anything else? – Phil Frost Jan 27 '14 at 20:44

This is the simplest circuit I can think of (2 parts):-

simulate this circuit – Schematic created using CircuitLab

Input = 5V Red Input = 0 Green

The circuit works because the $V_F$ of a Red LED is generally much less than the $V_F$ of a Green or Blue LED.

Here is a typical RGB LED datasheet:

And here are the typical plots of $V_F$ vs. current:

When the transistor is "off", the Green LED will have a forward voltage of about 3.0V at 10mA. When the transistor is "on", the Red LED will have a forward voltage of less than 1.9V. Referring back to the Blue/Green graph, little current will flow through the Green LED at that forward voltage.

This particular arrangement shows a common-cathode arrangement, however it could be flipped and a similar P-channel MOSFET used. In that case, 0V would select the Red LED, and +V in would select the Green LED.

• Are you depending on a higher Vf for the green LED to turn it off? – Tut Jan 27 '14 at 16:06
• Yes, that's correct. – Spehro Pefhany Jan 27 '14 at 16:16
• I like this circuit iff the green LED can be depended to turn off fully (or near enough). Perhaps a little further explanation including LED selection would be in order. – Tut Jan 27 '14 at 16:38
• I just looked at a Kingbright RGB LED that seems to have a pretty large Vf difference. +1 ... clever circuit! – Tut Jan 27 '14 at 16:47
• Might be easier to replace M1 with a BJT, since finding a MOSFET with a sufficiently low threshold voltage takes a little more work than grabbing the first one out of the parts drawer. – Phil Frost Jan 27 '14 at 16:48

Maybe something like this?

simulate this circuit – Schematic created using CircuitLab

• It would be normal to have current-limiting resistors for LEDs and for BJT bases. – RedGrittyBrick Jan 27 '14 at 15:48
• Sorry. Sort of assumed that. You are correct. – mikeY Jan 27 '14 at 15:50
• R5 is not needed. You can also invert Q2 with the led cathode on the emitter, collector to GND and then you can remove R4 too. – alexan_e Jan 27 '14 at 23:03
• @alexan_e When you answer the question, you should certainly do those things. – mikeY Jan 28 '14 at 16:03
• @alexan_e My fault - bad wording on my end. Not upset. Merely suggesting that if you have another way, you could provide it to OP. It's all good. I appreciate your comment. – mikeY Jan 28 '14 at 16:25

For this particular case ONLY, there are various ways to do this

Digital gate ICs, flip-flop, ON/OFF transistor configuration, etc. depending on your actual configuration

Assuming common anode RGB, attached a sample circuit using transistors

simulate this circuit – Schematic created using CircuitLab

• Where is your power-supply? – Tut Jan 27 '14 at 16:00