Why Multiple Resistors

I am relatively new to Arduino, programming and electronics, generally, but have written several successful sketches that use XBee's, LED's, RGB LED's, relays, LCD's, etc. I think I understand the math/logic behind needing a resistor for use with a typical 2v LED, and how to calculate the appropriate resistance.

I have read many different source materials, and each shows three resistors for use with an RGB LED. I can't understand, from a logic/electronics perspective, the need for three resistors (other than the need for a "larger" resistor if using only one.

What am I missing?

Thanks,
Rick

Different colour LEDs have different working voltages.

If you connect a red LED and a blue LED in parallel, with one current limiting resistor..
Then the red LED (Vf ~2volt) will take the full current, while the blue LED (Vf ~3.3volt) won't even light up.
Leo..

MYTraveler:
I can't understand, from a logic/electronics perspective, the need for three resistors (other than the need for a "larger" resistor if using only one.

What am I missing?

Thanks,
Rick

You're only missing the LED specifications. If you know its specifications, like typical operating current value (from product specs), then you can determine a suitable resistor to put in series with the LED.

Usually, a LED can handle at least 10 mA. Sometimes, you might have an unmarked LED sitting in a container, and don't know the operating current. So use a "suitable size" potentiometer (variable resistance) in series with the LED, and set the potentiometer to highest resistance. Then slowly and gradually reduce the resistance until you start getting glowing. And keep reducing resistance until the LED appears to be glowing strongly enough.

If you know the typical operating current for the LED, then you don't need to do the trial and error thing. Sometimes, you may even find that using the same size resistor for your different coloured LEDs is ok for your needs. Just depends on operating current, and how much you need to get the LED to operate the intensity it normally operates at.

Thank you all for the replies. I don't think I was completely clear, however. The examples put one resistor in series with each anode (on a common cathode RGB LED), and each of those three resistors had exactly the same value. Couldn't the same result have been achieved by putting just one of those resistors in series with the cathode?

No because the current gets split 3 ways if all are on - or if just 1 is on it would be dimmer than intended.

With a 2volt LED and a 3.3volt LED in parallel (one CL resistor), the voltage across the LEDs can never be higher than the voltage across LED with the lowest Vf.

That one gets all the current. The other one gets nothing, because the voltage can never reach the threshold of the 3.3volt LED.
Leo..

If in doubt of what Leo says hook it up and try it. It won't hurt anything.

All forward voltages assumed 2V; for 20 mA you calculated the resistor as (5V - 2V) / 20mA = 150 Ohm

Start
all pins HIGH
no current flowing though the resistor

make pin 4 low
current flows through resistor causing a voltage drop, led 4 and pin

make pin 5 low as well
current flows through resistor causing a voltage drop, leds 4 and 5 and pin
the current now has to be split over both LEDS resulting in 50% going to each and the intensity for each being less

Another problem is that the forward voltage of each LED is never exactly the same. One might be 1.9V and the other 1.95V. Physically this will be impossible and both LEDs wil fight each other.

MYTraveler:
Thank you all for the replies. I don't think I was completely clear, however. The examples put one resistor in series with each anode (on a common cathode RGB LED), and each of those three resistors had exactly the same value. Couldn't the same result have been achieved by putting just one of those resistors in series with the cathode?

If 1 or 2 of those LED's go open-circuited for some reason (eg. open-circuited faulty, or even removed), then you would have more current going down each remaining LED (compared to the case when all 3 LEDs are working).

The case of having 1 series resistor for each LED is considered as three LED branches, each branch independent of each other - which allows the current in each LED to be set.

On the other hand, the case of three LEDs connected in parallel (between supply rail and some point) with a single resistor between the point and ground - is considered as ONE single branch, where that single branch - comprising the whole of those components together (the LEDs plus the resistor). Here, the current through each LED cannot be set independently.

What you ideally want (for reliability), is the first case.... series resistor for each LED.

sterretje:
Another problem is that the forward voltage of each LED is never exactly the same. One might be 1.9V and the other 1.95V. Physically this will be impossible and both LEDs wil fight each other.

True, but OP asked for an RGB LED.
Vf differences there are greater than two LEDs of the same colour.
The red LED in a 1watt RGB LED might be 2.4volt, while the blue one might be 3.3volt.
The red LED will get most of the current.
Leo..

Wawa:
True, but OP asked for an RGB LED.

OOPS, saw that but forgot.