Pages: [1]   Go Down
Author Topic: Controlling 9 RGB LED's with arduino  (Read 1462 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 8
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey so I recently built a Gibson SG electric guitar. I put about 9 RGB LED's in the neck and I want to control them individually with the Arduino. Each of them have their own set of wires. How should I approach this? I have a intermediate understanding of C++ so programming shouldn't be to bad I just haven't really programmed with Arduino that much. The picture shows the neck hooked up to a few battery's.


* 20110704161012.jpg (168.01 KB, 800x600 - viewed 43 times.)
Logged

Copenhagen / Denmark
Offline Offline
Edison Member
*
Karma: 6
Posts: 2360
Do it !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

To control the colors of each of the 9 RGB LED's individually is the same as controlling 27 LED's.

Normally this is done using PWM, but Arduino does not have enough PWM pins to do that.
One solution would be to use a PWM driver IC like the TLC5940. (You would need two of thwm).

Here's a link to one place to get it: http://www.sparkfun.com/products/10136.
Logged

Pittsburgh, PA, USA
Offline Offline
Faraday Member
**
Karma: 98
Posts: 4807
I learn a bit every time I visit the forum.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Find the Wiki on 'charlieplexing'. You could run the matrix with 6 pins and have 3 leds grow space.



Logged

I find it harder to express logic in English than in Code.
Sometimes an example says more than many times as many words.

0
Offline Offline
Newbie
*
Karma: 0
Posts: 8
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok so I tried creating a diagram for my project only issue is I realized I am using RGB LED's and they have a common cathode...
Logged

Colorado
Offline Offline
Edison Member
*
Karma: 47
Posts: 1562
Reviving dead brain cells with Arduinos.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok so I tried creating a diagram for my project only issue is I realized I am using RGB LED's and they have a common cathode...
Nothing wrong with that ...  There are both current source and sink drivers.
Logged

Netherlands
Offline Offline
God Member
*****
Karma: 7
Posts: 650
A naughty mind is a joy forever.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Arduino by itself has 6 hardware PWM-pins, but PWM can be done in software as well.

http://www.arduino.cc/playground/Main/PWMallPins shows an example capable of PWM-ing all output pins of the arduino.

Needing at least 27 pins to control the shift-PWM library of Elco Jacobs, http://www.elcojacobs.com/shiftpwm/, also done in software may be interesting as well.

Apparently Elco succeeded to PWM up to 768 leds (256 RGB leds) by software using 96 standard 74*595 shiftregisters. Using so many... there are a few ifs/buts, maximum brightnesscontroll has to be set to 32 instead of 255 like analogWrite() for example, arduino hasn't got the speed to PWM all leds in a finer resolution.

Up to 32 RGB-leds (96 pins/12 shiftregisters) brightness resolution can be 0-255 though and an 74hc595 doesn't have to cost much more as $0.25-0.45.

Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 626
Posts: 34210
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Find the Wiki on 'charlieplexing'.
You can't charlieplex an RGB LED due to the common connection.

Your best bet is to get a hand full of shift registers and use the shiftPWM library to control the brightness.
http://www.elcojacobs.com/shiftpwm/
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 8
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yeah I decided that shift registers are the way to go. However I was able to charlieplex several RGB LED's. The schematic became very messy and not practical.
Logged

Pages: [1]   Go Up
Jump to: