Go Down

### Topic: Resistors? (Read 1 time)previous topic - next topic

#### VAlexander

##### Mar 19, 2013, 02:25 am
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: https://www.sparkfun.com/products/10820

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

Quote
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!!

#### Osgeld

#1
##### Mar 19, 2013, 03:26 amLast Edit: Mar 19, 2013, 03:30 am by Osgeld Reason: 1
well the data sheet tells you what currents you need to know

http://dlnmh9ip6v2uc.cloudfront.net/datasheets/Components/LED/YSL-R596AR3G4B5C-C10.pdf

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.
http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL

#### VAlexander

#2
##### Mar 19, 2013, 03:37 am
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: https://www.sparkfun.com/products/8377

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

#### Osgeld

#3
##### Mar 19, 2013, 03:56 am

Thank you so much for your reply!

welcome

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

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

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

who says  ]

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.
http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL

#### VAlexander

#4
##### Mar 19, 2013, 04:02 am
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: https://www.sparkfun.com/products/9518

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

#### Osgeld

#5
##### Mar 19, 2013, 04:09 am
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
http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL

#### VAlexander

#6
##### Mar 19, 2013, 04:12 am
Oh I see! So even if I use the 9v wall charger, I should calculate for 5v!!! Thanks! Would I still need 12 resistors?

#### Osgeld

#7
##### Mar 19, 2013, 04:19 amLast Edit: Mar 19, 2013, 04:21 am by Osgeld Reason: 1
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)
http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL

#### VAlexander

#8
##### Mar 19, 2013, 04:23 amLast Edit: Mar 19, 2013, 04:32 am by VAlexander Reason: 1
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!

#### mixania

#9
##### Mar 19, 2013, 07:16 pm
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.

Go Up