Resistors?

Hello!

Being new to arduino and hardware in general, I have a project that I want to use sound and light in.

I'm planning on grabbing the arduino uno and the mp3 player shield https://www.sparkfun.com/products/10628 to make this possible. With that said I'm planning to connect 3 RGB leds to my arduino so that I can change their value depending on the track that I'm playing (If track 1 is playing make all LEDs shine yellow, if track 2 is playing make all LEDs shine orange, etc).

Someone suggested these LEDs: LED - RGB Clear Common Anode - COM-10820 - SparkFun Electronics

They also mentioned needing resistors. I have an idea of what they do, but no clue which ones I need.

You'll also need resistors for you LEDs to limit their current draw. You can use this to calculate the appropriate resistor value.
http://led.linear1.org/1led.wiz
Note that you'll need different resistance values for each color.

They said I'd need different resistance values for each color. Can anyone maybe clarify? Thank you so much. What do you guys recommend? Thank you!! :slight_smile:

well the data sheet tells you what currents you need to know

which are pretty typical for normal brightness leds

in the first row of the first table, they say they are rated for 20ma each color, but in the first row of the second table you can see that they require different voltages.

so take that info, and plop it in the calculator

source voltage will be 5 volts
forward voltage for red is 2.0
green and blue is 3.2
forward current will be 20ma

which gives you 150 ohms for red, and 100 ohms for green and blue.

Thats in an ideal world with generic data, in reality you may have to raise the resistance a little for each color to even them out to your eye, but that gives you a good baseline to be safe to your arduino and your led's (ie RED is going to appear brighter than green so you might try 180 ohms on red so they look the same to you)

the reason different color led's have different forward voltages is based on the crystal material used inside of them.

Thank you so much for your reply!

If i'm using a 9V DC wall charger for my arduino uno, does that mean my source voltage is 9V instead of 5V? Isn't the forward voltage for red 2.2V and for green & blue 3.4V?

I'm using this calculator to calculate the ohms: http://led.linear1.org/1led.wiz

Calculating it with 9V and the Max Forward Voltage, this is what I got:

390ohms, 1/2W (The wizard recommends a 1/2W or greater 390 ohm resistor. The color code for 390 ohms is orange white brown). <-- That's for the red value.

330ohms, 1/4W (The wizard recommends a 1/4W or greater 330 ohm resistor. The color code for 330 ohms is orange orange brown.) <-- That's for the green and blue values. Would these work: Resistor 330 Ohm 1/6th Watt PTH - COM-08377 - SparkFun Electronics

I might be way of, but just checking since you know best! P.S. Would I need 3 resistors per LED?

VAlexander:
Thank you so much for your reply!

welcome

VAlexander:
If i'm using a 9V DC wall charger for my arduino uno, does that mean my source voltage is 9V instead of 5V?

the output of the arduino is regulated to 5 volts, you have to jump through a couple hoops to drive LED's with external voltage

VAlexander:
Isn't the forward voltage for red 2.2V and for green & blue 3.4V?

Max, yes, you never want to drive anything to its max, thats just the most it can take without popping

VAlexander:
I might be way of, but just checking since you know best!

who says ]:smiley:

VAlexander:
P.S. Would I need 3 resistors per LED?

Ideally, you can work around it with some bad design, but they will vary in brightness drasticly depending on what combination of LED's is on at the time.

Thanks for your detailed response!

Well I'm planning on using 4 leds (Still don't know how I'll hook them up) but I'm definitely shooting for anything close to maximum brightness. So would 12 resistors work best for achieving that?

Also this is the charger that I was planning to use: https://www.sparkfun.com/products/298
And sometimes (for presentation) this: 9V to Barrel Jack Adapter - PRT-09518 - SparkFun Electronics

Should I be using a 5V charger? Im confused about that haha. What wall charger or charging source would you recommend?

9 volts, power enters the arduino board and almost instantly hits a regulator which converts input to 5 volts by burning off the excess as heat, more volts, more heat

you need at least 7 volts for that to work right, 9 is more common, 12 makes it get a little toasty

Oh I see! So even if I use the 9v wall charger, I should calculate for 5v!!! Thanks! Would I still need 12 resistors?

yes or else the "ghetto" way would have it only use 3 resistors, but lets say 2 blue were on they would be half the brightness of only one being on, or if all 4 were on each LED would be 1/4 brightness

sounds like you dont want to sacrifice brightness, so 12 is your magic number.

if sparkfun doesnt have what you need go to a real supplier instead of a hobby shop, like mouser, harder to use website, cheaper prices, much more selection. (or if you want to dive into the deep end, digikey, but its one step away from querying a database from a command line)

Thanks Osgeld!

Oh that makes sense, so if I had only 3 resistors for all 4 lights, their brightness would be evenly spread among all of them (each one would shine at 25%), but my using 12 resistors each one would shine at 100%. Thanks a lot and looking back, your ohm calculations were correct. I'll be going with 100 ohms for green & blue, and 180ohms for red!

Consider that the RGB leds have a common Anode+ instead of a common Cathode-. Try finding an RGB LED with an common Cathode-, it would be much easier to configure the LED that way.