Go Down

Topic: powering 64 rgb led matrix kinda. (Read 2959 times) previous topic - next topic


hello all, pretty sure  this is the right place for this.

this is my first real project.
i cant get my head around how I'm going to power my project. I'm not really making a matrix just two banks of 32 rgb leds for a full size chess board.figured id get a cool chess board that i can make any color or always fading so the white and black squares are never the same color. and some thing to mess with different inputs.i figured it be easy compared to a matrix coding and wireing.  ive tested all my code and that works, i made the chess board. but I'm not sure how to go from two leds to 64. i have a few ideas in my head but, id rather not burn my arduino out.

iam using common cathode rgb leds from spark fun. the specs on them are
Four legs, common cathode
Forward Voltage (RGB): (2.0, 3.2, 3.2)V
Max Forward Current (RGB): (20, 20, 20)mA

for what iam doing so far with this i only need the 6 pwm pins on my uno and one ground pin.
gnd pin. on my bread board i just have one led leads going to pins 9,10,11 and the other to 3,5,6 with some resistors thrown in.
so my idea and help from my buddy who i got in to arduino, was just going to wire two groups of 32 leds in parallel. in each group the colors will be split up but all the grounds  from both groups will be wired up.
so my idea was to use a transistor for each pin between its group of leds.
i was going to send  power to the transistors from a power supply. and the arduino from a 9v battery or the power supply.
the few bits we cant figure out are this.

1.are we miss understanding how to use a transistor. lol

2.if i make the power going to the transistors for the red leds 2.0v or little less and the power to the other two colors 3.2 or little less, would i need resistors after the transistors?

3. iam i way over thinking this and the arduino could power all 64 rgb on its own.


Each diode needs a resistor.  Take the input voltage, subtract the voltage drop for that color LED, and divide by the current in Amps to get resistance in Ohms.  For example a 2V drop 20 milliamp LED run on 5V:  5v-2V = 3V / .02 A = 150 ohms.  A 3V drop 20 milliamp LED run on 5V:  5v-3V = 2V / .02 A = 100 ohms.

The transistor can go between the power supply and the resistor to LED anode (high-side switching) or the transistor can go between the LED cathode and ground (low side switching).  I think it depends on what kind of transistor you use (NPN or PNP).

The Arduino pins can only drive 40 milliamps so only two of your diodes per pin.  To drive 3x64 you will need transistors or other power drivers.
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp


The Arduino cannot safely drive 40mA - that's the "absolute maximum rating" - you shouldn't go there, stay below 30mA per pin to avoid over-stressing the chip.

From what I can tell of the project you only have 6 channels to drive, 2 lots of 32 RGBs (each channel happens to involve one colour from 32 LEDs).

If the LEDs are all identical just common them up in parallel and treat as one large RGB LED that takes 640mA per colour.  If they aren't identical (same batch) then you are best giving each one a series resistor - if they are identical you can share a series resistor (but it will need to be rated for the power it will dissipate).

Since each colour has a different forward voltage drop each colour's current limiting resistor will be a different value.

To drive 640mA you'll need a power transistor (either bipolar or MOSFET).  As your devices are common anode you'll want high-side driving  - PNP or p-channel.

Unfortunately RGB LEDs aren't able to be wired in series because of the common terminal which means you'll need a low-voltage high-current supply - 6 channels at 640mA each = 4A or so (at 5V).  The good news about 5V is that the high-side driving is easy - only one transistor per channel (PNP power or p-channel logic-level power MOSFET)....
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]


i have a idea what i should do but iam really confused.
i figured i would only need 6 transistors. i got bag of pnp and npn transistors from radio shack 15 in each.
andthe bag that came in the mail was a bag of 100 common anode rbg leds. and i know i need one type of resistor for red and one type for green and blue.

iam kinda confused has how i would wire them  since ive been testing different ways. and got werid results with my muti meter. for my test i had my arduino plug in by usb and my exttranal power source was a fre 9v battery.
i ran my normal program that fades thru all the colors.but i only used one pin in my testing so i didnt have two wire 3 transistor etc. i know i need to connect the + side of the batter to my arduino but i was sure if i should plug that in to the 3.3v 5v or vin pin i didnt want to mess some thing up. so i concceted my gnd to the gnd of the battery. any ways i was able to get the led to fade but when i  got weird reading on my muti meter. but that dosent really help me out any ways since i need it to  switch with gnd. i have a idea iam doing right but the reads didnt seem right.

if you could wire this setup with just one rgb common anode led and 3 transistors and 3 pins on a arduino in fritzig i could maybe understand it better.

i figured id just need to
run the wire from the arduino to base.
- of the battery to the collector.
and the emitter to a resistor and the cathodes of all my leds. but that didnt work right with one led with a pnp or npn transistor.


May 15, 2011, 10:50 pm Last Edit: May 15, 2011, 10:56 pm by Warwickben Reason: 1
ok i found some info in the playground. so i need a PNP transistor.
my power supply will be 5v.

i connect the gnd from the battery to the collector.

the pin to base.what resistor would i use between them. or do i need one.

and one resistor and all the same color cathodes to the emitter.(do i use a resistor of the same vaule as if i was going to light one led off of 5v or what.( the bag of leds i got came with the right resistors to do this. so sould i just give each led there own resistor)

what do i do with the + of the battery and anode of all 64 leds just wire them to them togarther?


May 16, 2011, 11:49 am Last Edit: May 16, 2011, 11:54 am by Warwickben Reason: 1

what am i doing wrong.


It's probably a bad move to connect an external battery pack to an Arduino pin.

You can drive a single LED directly from an Arduino pin so you don't need a separate battery pack for that. Here is an example wiring diagram:


Schematic for driving multiple LEDs from a single pin using a 2N2222 transistor:

Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp


I'm confused I used a battery pack as a stand in for a power supply and one red led as a stand in for the red cathode of 32 rgb common anode LEDs.


I just confused really confused now lol. I need to power more or less 192 LEDs with just 6 pins .  64rgb LEDs  really is just 192LEDs. So each pin is controlling 32 LEDs .
With my setup I'm useing pwm to change the color of the LEDs . The LEDs turn on when the pin is low. I don't get how the arduino with out a separate power supply can power there's

From reading the play ground Stuff about transistors as a switch if it was high to turn  the LEDs on postive from the power supply goes to the colletor neg goes to the common cathodes and a gnd. But I need.  I'm so fringing confused and all I need to figure this out and I can finsh my project .

Go Up