Multipe LEDs on one resistor, what values?

Okay, I've been trying out stuff and I'm about to set a new order for LEDs. My goal is to make a RGB lamp that can illuminate my desk enough for me to be able to read a book and stuff.
Now the LEDs I am getting have these specs:

Blue:
3,8 volt, 20mA, 600mcd and 120 degrees.
Green:
3,8 volt, 20mA, 500mcd and 120 degrees.
Red:
1,8 volt, 20mA, 400mcd and 120 degrees.

Now this is my question: how do I calculate what kind of resistors I need?
My goal is to use multiple LEDs of each color, so if possible I would like to use one resistor per color. Right now I am thinking of 2 LEDs per color, but I'd like to be able to use 3 or 4 if I'm not satisfied, and I'd like to be able to recalculate it myself.
I'm plugging them on the Arduino PWM pins (which are 5v).

Why not use one resistor pr. LED ?

Be carefull with too many LED's on one Arduino pin. Ardunio Pins can source a maximum of 40mA.

Maybe it's better to drive the LED's with a transistor.

EDIT:

Also don't expect to get "real white light" by mixing R /G /B LED's, especially not when they have different ratings.

Why not use one resistor pr. LED ?

Be carefull with too many LED's on one Arduino pin. Ardunio Pins can source a maximum of 40mA.

Maybe it's better to drive the LED's with a transistor.

EDIT:

Also don't expect to get "real white light" by mixing R /G /B LED's, especially not when they have different ratings.

Yes, I was planning on adding one or two white LEDs as well, for brightness and pure white light. So 2 20mA LEDs per pin is the maximum? And a transistor (I'm a real noob, mark my words), does it live on Arduino's power, and if so, will I be able to drive my LEDs with a transistor and control them (PWM) with Arduino's PWM pins?
If it's safe to use 2 LEDs per PWM pin (@ 20mA) and it will be bright enough I'd rather take the easy road, but if you think I might need more LEDs or if 40mA might be a bit tricky I'd really appreciate it if someone could explain me how to hook up a transistor ^^.

I'd really appreciate it if someone could explain me how to hook up a transistor ^^.

give Google a try: Arduino transistor led Brings up this thread: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1200895650

I'd really appreciate it if someone could explain me how to hook up a transistor ^^.

give Google a try: Arduino transistor led Brings up this thread: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1200895650

I hadn't tried google to be honest, but I'm not getting enough info out of this thread... I'm afraid I'm quite the noob on electronics.
Basically what I now know is that I can get myself as much as 50 LEDs @ 20mA and drive them with this transistor (TIP102). Now I've found a webshop here in Holland that ships the thing for a couple of euro's, but the schematics at the other thread aren't helping me (due to my noob skills)... I've been googling some more around, but there's not really something that I think I understand.

First thing to do is to break your project up into smaller managable tasks:

Ask your selv a few questions :

Do you want to be able to control the LED's individually or in groups ?
Do you want to just turn them on / of or to control the intensity as well ?
How many LED's in total ?
I what confuiguration ( like how many in how many groups)

Read a little bit about the very basic electronic stuff, this is a good place to start:
Electronics Index Page (saved my BEEEP a few times)

Check Lady Ada's tutorials, they are hghly recomended:
http://www.ladyada.net/learn/arduino/lesson0.html

The transistor in the schematic

http://www.arduino.cc/playground/uploads/Learning/multiple_leds2.jpg

kind of takes some of the burden of the Arduino pin, it's a way to allow a pin to control stuff that would therwise draw too much current. Many different transistors could do the job the one in the schem. is a very common and cheap one.

If many LED's are used, i would use a seperate powersupply in stead of connecting the resistors at the top to the Arduino's 5V supply. Besides the 40 mA pr. pin limit, there's a Ca. 300 mA total limit for the board, if my memory serves me, which sometimes is absolutely not the case :slight_smile:

Hope this helps a little.

First thing to do is to break your project up into smaller managable tasks:

Ask your selv a few questions :

Do you want to be able to control the LED's individually or in groups ?
Do you want to just turn them on / of or to control the intensity as well ?
How many LED's in total ?
I what confuiguration ( like how many in how many groups)

Read a little bit about the very basic electronic stuff, this is a good place to start:
Electronics Index Page (saved my BEEEP a few times)

Check Lady Ada's tutorials, they are hghly recomended:
Arduino Tutorial - Getting ready

The transistor in the schematic

Arduino Playground - HomePage

kind of takes some of the burden of the Arduino pin, it's a way to allow a pin to control stuff that would therwise draw too much current. Many different transistors could do the job the one in the schem. is a very common and cheap one.

If many LED's are used, i would use a seperate powersupply in stead of connecting the resistors at the top to the Arduino's 5V supply. Besides the 40 mA pr. pin limit, there's a Ca. 300 mA total limit for the board, if my memory serves me, which sometimes is absolutely not the case :slight_smile:

Hope this helps a little.

Ok, I've been rather inactive due to school and stuff, but now I have some time again for arduino programming and the like.
First of all I want to control 3 or 4 groups of LEDs (red, blue, green, possibly white as well).
I want to build a moodlight that can be hung on the wall and still be able to light my books / whatever I read, PWM controlled as I want to mix them smoothly.
I haven't really got a clue how many LEDs that's gonna take, hopefully some of you have?
Configuration: I want them to be in such a configuration that no color is more dominant than another, so if blue LEDs are naturally brighter, I will use less blue LEDs than red for example.
I've red the pages you suggested, and though I think I'm starting to get it.

What I think now is this:
I'll have to get an X number of X powerful LEDs (I'm currently thinking of 1 watt LEDs), hook them up to some kind of transistor and then I should be able to control them with Arduino's PWM pins, is that right?

Some of the very powerfull LED's require special driver circuits, make sure that you know what the requirements for the ones you buy are before spendingyour hard earned money.

Otherwise your plan sounds OK to me.

How about this answer:

Get yourself an LED "flashlight".

Connnect it to its ordinary battery, but through a relay.

Use the Arduino to switch the relay on and off.

Any good?

I am having the same question
here is the info:
1 arduino with 6 pwm channels
I want to use 6 RGB Leds
so 6 pwm chanels can handle 2 rgb leds

question:
can I add 3 rgb leds in paralles so the arduino will handle 6 rgb's
if so what is resistor values ( lower than 300h ?)
if not how can I do this with out a Megaboard.

thank you ..

I think what you guys are looking for is Ohm's Law: V = IR, or you can rearrange it to R = V/I (R is Resistance, V is Volts, I is Current)

So a digital pin can put out 5 Volts.
Read the package/specs for the LED, and it should give a maximum current. For now, will assume 10 mA, or 0.010 A (Amps).

R = V/I
= (5 Volts) / (0.010 Amps)
= 500 Ohms

So you would need a 500 Ohm resister or more. Actually, there's some play in the values, so you should be ok with a 470 Ohm resister which is a common value.

The higher the value of the resister, the dimmer the LED will be.

Note that even if your LED can handle high current, the pins on the Arduino should be limited to 40 mA (0.040 A), otherwise you risk hurting it.

Of course, I take no responsibility for anything you do or don't do based on what I say or don't say :slight_smile:

Good luck!

can I add 3 rgb leds in paralles so the arduino will handle 6 rgb's

Yes with 3 LEDs in parallel they will all be the same brightness and on at the same time. BUT they each need their own resistor.

if so what is resistor values ( lower than 300h ?)

I think that was answered above but you nee one resistor for each of the LEDs. 270R is a good value.

if not how can I do this with out a Megaboard.

If you want more PWM control you can use external chips like the TLC 5940, this will control 16 LEDs or 5 RGB LEDs, there is a libary to drive this chip.

Thank you.
great help.

Just as another option, why not use the BlinkM MaxM RGB LED cluster. This has 450000mcd brightness if I remember correctly and should light up your desk very well. It is also easy to customize and program to do whatever you want.

Mowcius

thanks for the info,
In this case I can not use other Leds,
I am embeding the Leds in plexiglass, by the way I am working in a sculpture of plexiglass and the leds will light up like a hart beat, then whensome one gets closer the color mixer will triger.
I will update more of this if you guys are interested

Yeah i'm sure people will be interested... I am :smiley:

Post it in the exhibition section when you have done it. Or now and then I'm sure people will post ideas that may be interesting to you.

Mowcius

great
I am going to post the project