LED Wiring Help

I'm pretty new to the Arduino community, and to Arduino itself. I dont have a lot of experience in electronics, but mostly motors and little toy cars. I decided to go more in depth, and purchased a duemilanove.

My first project is to wire LEDs around my room (look here: http://www.instructables.com/id/Fast-Quick-Cheap-Good-looking-LED-room-lighting/), and have Arduino blink/fade them using PWM to the music playing on my PC. I've got everything set up on the PC end, with a winamp plugin that sends information through the serial port to the arduino board. The board then calculates an appropriate level for the brightness of the LED.

My problem now is that I'm not very experienced in picking the proper resistor (to be honest I've actually never used one before). I'm also not sure how I'll be able to power 30 LEDs with 5V output from the USB (chances are I'll have to use an external power source).
So if anyone could please list the materials I'll be needing and maybe just outline the steps I'll have to take. Right now, I've got :

15 x Red LEDs (2V @ 20mA)
15 x Blue LEDs (3.3V @ 22mA)

(I plan on wiring these up in parallel)

Thanks, Sam

Don't hook up 30 LEDs at 20mA to 1 I/O pin on your arduino you'll fry it! The max current from one pin is 40mA for the Duemilanove.

Use a transistor and a parallel arrangement of LEDs - there are plenty of online calculators for this sort of thing (if your unfamiliar with how to calculate values) - a good one for LEDs is: LED Resistor Calculator

First off, welcome to the forums, Sam!

Now down to the issue at hand. A food good resistance calculator can be found here: http://led.linear1.org/led.wiz You would want to use transistors for this application. They can drive hige loads, but only require a few mA to make them turn on and off. They also do pwm easily!

A food resistance calculator...

Maybe you should tell Weight Watchers about it!

;D

;D I totally said good! :wink:

Thanks everyone! So you're basically saying to use transistors (those black little boxes with 3 pins sticking out of them, right?), and do I still hook the LEDs up to the duemilanove or an external power source? I've got tons of phone chargers with different combinations of volts and amps. Will I attach a transistor to each LED? or just one in the beginning before I attached all the LEDs in parallel?

do I still hook the LEDs up to the duemilanove or an external power source?

The regulator on the arduino board is only good for about 400mA so you will need an external supply for your 630mA load.

Will I attach a transistor to each LED? or just one in the beginning before I attached all the LEDs in parallel?

If the transistor can handle 1amp then you only need one, otherwise if you have a small signal transistor use one transistor for every 5 LEDs.
Remember you need a 1K resistor in the base of each transistor.

I made a quick diagram for you I think it would all work but I haven tested it.

I found a transistor that you can use to power i think 120 leds so i think you're good to go with this one :smiley:

For your LEDs if you use 3 D batteries you'll need 68 ohms for the blue and 100 ohms or more for the red.

If you use a wall AC adapter you'll need 600 milliamps anywhere between 4-9 V will work good just use an LED calculator, to see how much resistance you'll need.

Hope this helps :smiley:

Hope this helps

Sadly showing a beginner to use pin 0 will not help. That is the pin used for serial communication and should be left alone (along with pin 1) until you know what you are doing.

Also there is no common ground and no power connected to anything. So posting a totally non functioning setup is less than helpful.

:-? The power supply is coming from a battery or ac adapter as I have clearly specified.

I wasn't sure about pin 1 and 0 I've seen them being used before and it's under digital so I assumed it all does the same thing. While I'm on the subject What does the PWM on some of the digital pins mean?

I agree with the ground I saw some one say that you cant put more than 400ma to the ground, so I wasn't sure about that can I put the ground from the LEDs into the arduino? I do not know.

But at least I showed him how to wire up a transistor.

But at least I showed him how to wire up a transistor.

No you didn't. It still won't do anything even with an external power source if the grounds (arduino+power source) aren't connected.

And is that even the correct pinout?
Correction: it is the wrong pinout. From the datasheet:

1.Base 2.Collector 3.Emitter

The base is most certainly not in the middle.
That wiring will fail.
Next time look up the pinouts for things and know what you are talking about.

ome one say that you cant put more than 400ma to the ground,

You misunderstood what they were talking about or they were talking rubbish.

Hey atleast he tried. I'm still a little lost tho, I need to use an external power source, and that is clear. Then I need to figure out how much resistance I need and how I'll be wiring these up. I'll need transistors to increase the current? I'm not too sure coz I've never used transistors before. And then I have to find out how to PWM with an external power source.

Thanks for your replies
Sam