Pages: [1]   Go Down
 Author Topic: Resistors?  (Read 647 times) 0 Members and 1 Guest are viewing this topic.
Los Angeles
Offline
Newbie
Karma: 0
Posts: 25
 « on: March 18, 2013, 08:25:21 pm » Bigger Smaller Reset

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

SE USA
Offline
Karma: 41
Posts: 3783
@ssh0le
 « Reply #1 on: March 18, 2013, 09:26:06 pm » Bigger Smaller Reset

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.
 « Last Edit: March 18, 2013, 09:30:13 pm by Osgeld » Logged

Los Angeles
Offline
Newbie
Karma: 0
Posts: 25
 « Reply #2 on: March 18, 2013, 09:37:58 pm » Bigger Smaller Reset

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?
 Logged

SE USA
Offline
Karma: 41
Posts: 3783
@ssh0le
 « Reply #3 on: March 18, 2013, 09:56:08 pm » Bigger Smaller Reset

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.
 Logged

Los Angeles
Offline
Newbie
Karma: 0
Posts: 25
 « Reply #4 on: March 18, 2013, 10:02:03 pm » Bigger Smaller Reset

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?
 Logged

SE USA
Offline
Karma: 41
Posts: 3783
@ssh0le
 « Reply #5 on: March 18, 2013, 10:09:59 pm » Bigger Smaller Reset

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
 Logged

Los Angeles
Offline
Newbie
Karma: 0
Posts: 25
 « Reply #6 on: March 18, 2013, 10:12:36 pm » Bigger Smaller Reset

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

SE USA
Offline
Karma: 41
Posts: 3783
@ssh0le
 « Reply #7 on: March 18, 2013, 10:19:26 pm » Bigger Smaller Reset

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)
 « Last Edit: March 18, 2013, 10:21:13 pm by Osgeld » Logged

Los Angeles
Offline
Newbie
Karma: 0
Posts: 25
 « Reply #8 on: March 18, 2013, 10:23:50 pm » Bigger Smaller Reset

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!
 « Last Edit: March 18, 2013, 10:32:39 pm by VAlexander » Logged

Westbrook, CT
Offline
Full Member
Karma: 2
Posts: 139
"Why should I bother with made-up games when there are so many real ones going on." (c) Kurt Vonnegut
 « Reply #9 on: March 19, 2013, 01:16:04 pm » Bigger Smaller Reset

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.
 Logged

Arduino Uno R3
Mac OSX Lion

 Pages: [1]   Go Up