TLC5940: 8 LEDS (15V/40mA) load on each pin.

Hello dear people of the Arduino forum.
Some time ago I decided that my bookshelf needed some funky RGB LED lights. Not knowing anything about digital electronics I made it an analog project, soldering 25 analog PWM dimmers (based on a 555), each connectiong to 8 LEDs. Unfortunately, a few things went wrong; there was a lot of interference between the channels, and the end result wasn't as funky as I was hoping for. This is what it looks like:

(if picture doesn't show, click here)

Now, I did quite a bit of reading on Arduinos etc. and learned a thing or two. Time to redo the project, this time with a micro-controller, and probably some input sensors to control the light patterns. First things first: I should find out how to connect the 25 LED channels to the Arduino so they can be controlled with PWM.

In the Arduino Cookbook I read that using TLC5940's is the way to do this. I figured out how to daisy-chain two of them, giving me 32 channels, which is more than enough.

Each channel consists of 2 parallel strings of 4 LEDS, powered with +15V. Each channel has a current of 40mA. There are 25 channels.

This is the set up. Pictures say more than words.

Now, my question is:
-Would it be possible to connect these channels directly to a TLC5940 pin?
If so:
*am I correct that the Iref resistor on pin20 should be 1K to allow a 40mA current?
*what is the voltage drop in the TLC5940? Should I adjust the resistor in the LED-chains?
If not:
*should I use a transistor (which type, and how to connect?), or an octocoupler (which type, and how to connect?), or are there better options?

My humble apologies for my n00bness, and thank you for your answers! :slight_smile:

hmm.. sorry first post here.. something bad happened to the links:

the bookshelf:

the project set-up:

I have done something similar recently. Its not exactly the same but its close.

This the thread,66126.15.html

This is the circuit I used to control my LEDs

Thanks for your answer!
I learned a thing or two from your thread, and, I also found a bit more info on the powerdissipation of the TLC5940: Google Code Archive - Long-term storage for Google Code Project Hosting.
I understand the datasheet a bit better now, though only slightly. I don't have a solid background in electronics; I'm always willing to learn, but there are so many things I don't know.. :frowning:

OK, I think connecting the LED strings directly maybe tricky. And your solution looks easy and inexpensive. The main difference that my serial LEDs need 15V. The schedule for each channel should look like this:

In your case you use R2=10k?, R3=1K?.
Unfortunately reading the datasheet of the 2N3906 doesn't make clear to me whether I should change the values of R2 and R3 when using 15V (there are so many figures, I just don't know which ones are relevant), eg. R2=33k? and R3=3.3k?. Also I don't know how to calculate what the current will be for 1 OUTpin.
Can I keep the R(Iref) to the default 2K,allowing ! 20mA per pin, or should this be changed?

Again, my apologies for my ignorance. Thanks for your help!

This page will explain many of your questions regarding the PNP transistors

Your initial setup is exactly what the TLC was designed for.
Give the LEDs the correct voltage, use a 1k resistor to set the TLC to sink 40ma and you're done, no need for transistors and the power dissipation will not hit the maximum, especially if you spread the load over 2 TLCs (which you'll need to do to get the 25 outputs anyway).
You don't need transistors as you're not over 130Ma or using common-cathode LEDs.

You're not using RGB LEDs as far as I can see though?


You're not using RGB LEDs as far as I can see though?
Currently, I have seperate LEDs for red, green and blue, but I am going to replace them by 6pin RGB LEDs. The catch is: the red and blue LEDs are connected horizontally, the green ones vertically.
I have to change the LEDs anyway if I follow your idea not using transistors, because currently they have a common cathode.

OK.. it would be better if the transistors aren't necessary. :slight_smile:

Still, if I wouldn't use a resistor on the LED-string, according to my calculation, I am still very close to the theoretical max. power dissipation of the TLC; around 2W. That is going to be trouble.

Am I right if I assume there is no objection in putting a resistor in the LED-strings (I use a 15V adaptor, let's say the LEDs have a 3.1V drop, in a series of 4 I need a resistor of 120?), and that putting that resistor decreases the power dissipation of the TLC?
In other words, even though the TLC 5940 makes it possible to connect a LED without a resistor, doesn't mean I could still add that resistor, to prevent overheating of the TLC?

One other thing: not all the channels are equal, the red LEDs have a different, smaller, voltage drop, and the green LEDs only have 7 LEDs in a string (although I could always add an eighth one..). Would that give me additional problems?


6 pin RGB LEDs would make everything a bit easier, letting you specify the exact voltage per colour. As resistors only affect current, not voltage, I don't think they make a great deal of difference to the TLC, just lowering the current but not altering the power dissipation a vast amount, though I'm not that clever when it comes to electrons. :smiley:
What about 3 variable voltage regulators, LM317 for example? One for each colour, providing the exact voltage required over 3 rails. They're cheap enough and the circuits are fairly simple, might greatly reduce the power dissipation from the TLC.