Control 3x3 RGB LED's with transistors

Hello, i got 9 RGB Leds and i’d like to control them with my arduino. I do not want to control them seperately, but i want to have them all the same color at the same time. So for this i need 3 transistors and 3 digital pins right ? I tried this: (see attached picture). But it is not working. In this example i just hooked up 1 rgb led, not 3x3 to keep it simple, but it should be the same. Anyone an idea why my circuit in this picture is not working ?

Thanks a lot.

It looks like you may have a few problems, but at the very least, pin 2 of the LED has to be connected or nothing will happen.

And read about how to hook up transistors to drive LEDS. Maybe this: http://www.sqlskills.com/blogs/paulselec/post/arduino-figuring-out-transistors-and-associated-resistors.aspx

arduinodlb: It looks like you may have a few problems, but at the very least, pin 2 of the LED has to be connected or nothing will happen.

And read about how to hook up transistors to drive LEDS. Maybe this: http://www.sqlskills.com/blogs/paulselec/post/arduino-figuring-out-transistors-and-associated-resistors.aspx

Oh yeah, sorry i just forgot it in this picture. On my breadboard pin2 of the led is connected to ground of cause, because it is an common cathode rgb led.

Lots of problems.

Well now if you have a common-cathode LED so that you wire the cathode to ground, you have to use the transistors to supply the current from the positive supply. You can use NPN transistors as "emitter followers" with their collectors to the supply voltage (which could be the 5V from the Arduino for a few LEDs, but preferably something you are using as "Vin" to supply the Arduino), their emitters to the current limiting resistors, and their bases to the Arduino ports without resistors - you would have to use resistors (2k2) in series with the base of each transistor if you were using a common emitter arrangement with the emitters connected to ground.

Another matter is which connection on the transistor is which. Many (most?) small transistors have the collector as the centre wire, so you have to figure out for the transistors you have, which way they work.