Questions about the TLC5940 & RGB LEDs

Hey everyone !

I've been playing around with my arduino for a few days now and I'd like to start my first real project...

I would like to individually control 36 RGB LEDs (with PWM), so from what I've been reading on the boards I need to "extend" my arduino board with more pins (3 pins per RGB LED so that would make a total of 108 additional pins??) with TLC5940 chips...

So I found this hxxp://blushingboy.org/content/dusk , it has 64 pins that support PWM so I thought I would buy 2 of those and chain them up together?

I had a look at the TLC5940 library for arduino & I have a question concerning it's usage for a LED, how can I define a certain color for a led as it uses grayscale value instead of RGB/HEX values ?

Tlc.set(uint8_t channel (0-(NUM_TLCS * 16 - 1)), int value (0-4095))

So let's say I would like to have a purple glowing LED, how would I know the value I have to use for each R, G, B pin ?

Thanks for your help!

And please give me any advices you might have concerning my setup :slight_smile:

Each LED in the RGB LED is a separate LED. Controlled by a separate channel of the TLC5940. So set the grey scale (brightness) value of each LED to get the colours you want.

See my project: Mini Monome

Hi!

What I don't understand is what the bightness value corresponds to ? (4000 for example ?)

How am I gonna know how much brightness of each channel is needed to get a specific color (all 3 combined)?

Thanks for your help!
Great project btw !

Or is there any kind of ratio for example:

Let's say I want a special blue:
R: 108
G: 232
B: 238

Would it correspond to (grayscale brightness):
Red pin: 1735
Green pin: 3727
Blue pin: 3823

Using a simple ratio as (4096/255)*COLOR in RGB format ?

Thanks

What I don't understand is what the bightness value corresponds to

It is a 12 bit value so a value of 4095 represents the full current through the LED as set by the external current resistor. So half that value, 2047, represents half that current. Actually it is full current but only on for half the time, because it is a PWM control.

How am I gonna know how much brightness of each channel is needed to get a specific color

You don't, you have to experiment, because the same current through each colour in the RGB LED does not produce the same brightness. You roughly know the proportions of RGB you need from your colour so a good start is setting the channels at that. Then you adjust them until you get the tint right.

Hey everyone,

So I finaly bought the Dusk (hxxp://blushingboy.org/content/dusk), 64 PWM drivable PINs...

Now I only have a question, what DC Input should I use ?!

I'd like to have ~20mA per PIN for my LEDs, so following this schematic:

I should use 1.92kOhms resistors, but something's not right in my calculations because following V = R × I,
1920 x 0.020 = 38.4V ?!

But they say "The IC's max rating is 17V and 120mA/pin."

So where am I doing it wrong?
What DC input voltage should I use ?

Thank your for your help !!

So I came across this in the specs:

Imax =( V(IREF) / R(IREF) ) * 31.5

where:
V(IREF) = 1.24 V
R(IREF) = User-selected external resistor.

So what? How much LEDs (DC Forward 2~3.4V) am I going to be able to light using a 12V (500mA?) DC Source?

Thanks