Hi everyone I've been looking for a topic similar to mine but did not find any'so im posting this one.I want to light up 10~ RGB leds, all of them doing the same - for now just fading between colors, and after that controlling the color with potentiometer.So about controlling the color i dont think the arduino will have a problem - all leds connected in parallel to pins 8,9,10 (for example). The power supply should be the problem. I should mention that im newbie to electronics&arduino , and this is my first project, i'll be happy to get some guidness - like: - do i need anything else than arduino&external power supply? - how much should be the external power supply?- should i connect all the leds in parallel ? or devide it to 3in a rowx3in parallelThanks

It would help to know the Forward Voltage for each of the colors, the current requirement of each color, and if the RGB LEDs have a Common Anode or Common Cathode.

Because of the Common you can't put the LED's in series. You can't put them directly in parallel because some will draw more current than others and might overload.

The cheapest way to drive them is to put a current limiting resistor in series with EACH and put a small NPN transistor between the LED Cathode and Ground. This works fine if your LEDs are Common Anode. If you got Common Cathode LEDs you will need to use a 5V supply and a PNP transistor between +5V and the Anodes. You will find the PWM inverted: the light will turn off at 255 and on at 0.

30 (10x3) LEDs drawing probably around 20 mA each will require a 600 mA power supply. Add 100 mA if you want to run the Arduino off the same power. You can either use a regulated 5V supply or an unregulated 7-12V supply an get 5V 600 mA from the Arduino's regulator. Note: If you power the Arduino from USB it only has about 400 mA to spare so you WILL need an external supply.

I didnt bought the leds yet, so its not a problem. i just dont know the forward oltage (and whats its means), what should i get a common cathode or anode?Can you explain me why do i need transistors? as far as i know they function as a buuton - but not physically' you "press" it with and electric pulse, so why do i need many transistors?

Quote

30 (10x3) LEDs drawing probably around 20 mA each will require a 600 mA power supply

Since it is easier to use NPN transistors between Cathode and Ground you want Common Anode. That way you can separate the Red, Green, and Blue Cathodes and use one transistor per color.

> Can you explain me why do i need transistors?

Arduino pins can supply AT MOST 40 mA. Each of your color channels will draw about 200 mA. The transistor allows a small current from the Arduino (< 40 mA) to switch a large current from the power supply (~200 mA).

> I only want 10 leds.Yes. 10 RGB LEDs. Inside those are 10 Red, 10 Green, and 10 Blue. That makes 30. Just because they are in a single package doesn't mean they don't each require about 20 mA. If you want to think of them as single units then each one will draw about 60 mA. 60 * 10 = 600 mA. Same answer either way.

ok, i read you reply like 10 times - im starting to get the idea you meant.1. is that mean that i need 30 NPN transistors...? 2. i didnt understand how to connect the NPN to the arduino pin AND to an external battery so after a bit of searching i found this sketch- (led strip), and i do understand it - BUT it's not with an external powerthnx

It is with external power. The grey wire connecting to the "9V" pin (which should be labeled "Vin") is directly connected to the power jack and "unregulated" (not regulated by the Arduino which only regulates the 5V and 3.3V pins).

No, you need one transistor per GROUP of cathodes. Since you have three groups of cathodes (reds, greens, and blues) you need three transistors, like in the LED strip example you found. Each cathode will need a current limiting resistor. That is EACH cathode so you will need 30 resistors.

Like this.With an appropriate power supplyhttp://www.dipmicro.com/store/DCA-07510

Make yourself a splitter cable for the powerhttp://www.alltronics.com/cgi-bin/item/98J009/search/2.1mm-X-6mm-Coax-Power-Connectorhttp://www.alltronics.com/cgi-bin/item/23J013/search/5.5mm-x-2.1mm-Coax-Power-Connector

1.so for external power, is it gonna be ok to take this: http://www.dipmicro.com/img/1/DCA-FULLVIEW.jpgcut his adapter-then i'll have two wires-so i'll connect one to "GND" pin and the other wire to "Vin" pin?(im planing to do it with an old charger like nokia phone charger - but with the right properties)

2. The NPN, what do i need to know about it in the datasheet?which one will fit the best:http://www.taydaelectronics.com/2n3904-npn-general-propose-transistor.htmlhttp://www.taydaelectronics.com/2sc945-c945-bipolar-transistors-npn-50v-0-15a.htmlhttp://www.taydaelectronics.com/2n2222a-2n2222-npn-transistor-0-8a-40v-to-18.htmland whats are the purpose of each one, i mean whats the differences?

3. just out of curiosity, insted of putting a resistor in every led, can't i put "high" resistor at the emmiter of each NPN? i mean between GND and Collector&Base "junction".

again thnak u all i apriciate your help CrossRoads special thank for the sketch pic

3. just out of curiosity, insted of putting a resistor in every led, can't i put "high" resistor at the emmiter of each NPN? i mean between GND and Collector&Base "junction".

No, you can't. Ten LEDs draw ten times the current of one LED but if you put 10 LEDs in parallel and feed them ten times the current there is no way to make them share the current equally. Some devices will hog the current, overheat, and die.

#2 - each transistor needs to haveContinuous Collector Current:of 10 * LED current (10 X 0.02A = 0.2A, 200mA)The 2n2222 can do that. The other2 can't.Good to give yourself some margin there too - don't run parts right at the limit of what they can do.

For the splitter cable - hard to draw graphically. I can't open your attachments.The arduino will draw what it needs, like 40-50mA.The 30 LEDs will draw whatever you decide to let them draw via resistor selection.30 LEDs, 20mA, so 600mA.So use that to size your supply requirements.The barrel jack connector output goes to a reverse polarity protection diode which then connects to the Vin header pin, and then feeds the 5V regulator and shows up at the 5V header pin.If you want to use 7.5V to supply the barrel jack, or the Vin pin, and the LEDs in parallel (adjusting your resistor values accordingly) that would be ideal.

Red/Green/Blue - approximate values from experience. Read your device's datasheet.Higher will only make the LEDs dimmer and not damage anything.

Total current - your supply may be capable of 5V, and a gazillion mA- the circuit will only draw what is needed, limited by internal resistances, or LED current limit resistors.http://arduino.cc/en/uploads/Main/Arduino_Uno_Rev3-schematic.pdfLook at the top right - X1 is barrel connector, D1 is reverse polarity protection diode, U1 is the onboard regulator.The voltage before the diode should be ~7.5V, the voltage after the diode ~6.5V, and the regulator will output 5V.

Connect your RGB LED anodes to Vin.Make sure your walwart is >=7.5V (up to abiout 12V). You don't need the external diode, but it does offer extra protection.