# Is it possible to control 2 leds from one pin?

May be a noob question but I just wanted to know if it is possible to control 2 leds [u]separately[/u] from one pin. It would make my next project a lot easier is it is possible. I was thinking of something like this:

Seemed like a great idea to me at first then I quickly realized how obvious it was that it wouldn't work because the two leds are connected in series.

So any ideas on this or is it just not possible? :-/

Separately, yes. Independently … not sure … or at least not without additional circuitry so you can send more than high/low down the pin. If you are only sending one bit down the wire (hi or low), you can only distinguish between two states. That is what a bit is: the minimum amount of information needed to distinguish between two states.

But you can reduce the 4 states (2 LED’s each with 2 states) down. A pin can control a switch, which has two positions. Each of the two positions can light one of the LED’s, so one can be off while the other is on. Not sure if that helps you tho’.

Your idea will work just fine as long as you are okay with having exactly one LED on at all times. If you want to be able to have both off, you will need to add a diode or two in series with each LED so that the total Vf of the diodes and LEDs is greater than 5V. That way if you tristate the output pin no current will flow between 5V and Gnd. If you want to have both on at the same time, you'll need to make the pin oscillate rapidly enough that persistence of vision masks the flicker.

@ajb

So you are saying I need to make the leds require more power than what will flow through the opposite led. If so, can't i use a resistor? OR am I misunderstanding how Vf (voltage forward) works?

OR am I misunderstanding how Vf (voltage forward) works?

Yes you are.

First off you need a resistor between the LEDs and the arduino output to limit the LED current.

Then you have to make sure that the two LEds in series will not "see" enough voltage to light them. Resistors only limit current. Diodes will only conduct when there is enough voltage across them. So you need a diode or two in series with each LED such that the forward volts drop for both LEDs and series diodes add up to more than 5v and that the volts drop for one LED and series diodes add up to less than 5V.

You can have both LEDs appear on by rapidly switching the output on and off at least 32 times a second.

So yes you can have all four combination of states with only one output line. ;D

Diodes will only conduct when there is enough voltage across them.

Ahh there's something I didn't know before ;D! Thanks for the help everyone its all clear to me now. There are so many helpful people here on this forum. :)

Diodes will only conduct when there is enough voltage across them.

Before some one jumps on this statement, I know that without enough voltage to make them conduct there will be a tiny current called the forward leakage current flowing, but this is so small, in the order of uA (micro amps) or less, as to be unimportant in this context.