TLC5940 - LED Cube Issues. :-/

Hello All,

I have spent the last couple of months planning, researching and building two 8x8x8 RGB LED Cubes (one more is still under construction) which I had planned on controlling with TLC5940 chips and a chipKIT microcontroller for each cube. I have a 5V external power supply for the LEDs and a 5V - 3.3V DC-DC converter which will power all of the TLC5940s because the chipKit operates on 3.3V logic. I am also using 8 IRF7410 MOSFETs for multiplexing in each cube. I have designed and had manufactured a circuit board for each cube which has inputs to control the TLC chips and the 8 MOSFETs. It has a 3.3V rail for the TLCs and a 5V rail for the MOSFETs.

To keep things simple at first I decided to use the Arduino TLC5940 library along with an Arduino Uno to ensure everything is working properly. I have not even attempted to multiplex yet, I don’t even have the MOSFETs soldered onto the circuit board. I was very excited because the first sketch I ran was the “BasicUse” example in the TLC5940 library. It is supposed to light the LEDs with a “Knight Rider-like effect.” I have no clue what this is supposed to look like haha, but what it showed on my breadboard setup actually matched what the cube was displaying so I figured everything was working fine.

Well, for my next test I wanted to see all the LEDs on one layer just display Red, then Green and then Blue and then repeat the loop over again. This test proved VERY erratic. Sometimes all the colors would be the correct color, but at random brightnesses and some would not be lit at all. After a few loops most of the time the lights would blink very rapidly and in all sorts of random colors… very odd and very scary (especially when you programmed it to only light one color at a time). What I did from here was take out all of the TLC chips except the first two. I ran this program again and it worked, almost fine. The LEDs were in fact all the same color and they did in fact loop through each color. The problem this time though was that a few LEDs were slightly, but noticeably dimmer, and it was always the same LEDs through each loop that stayed dim (even though I know its not the LEDs themselves, I’ve checked). ALSO, after about 6ish loops, which were spaced at 1 second intervals, the loop would all of a sudden loop through each color very fast. Yet another erratic behavior!?

My next test I decided to add two more TLC chips for a total of four. When I ran this same program all of a sudden the LEDs lit with all sorts of random colors. I just gave up at this point, super frustrated, which is why I am here for your expert advice. I have put in countless hours in this project and still have many more, but I am in need of some help before I waste more time looking in the wrong places.

A few things to think about here. I know the cube is constructed properly with no shorts and all the ribbon cable wires are in their proper order. I assume the data transmission is working properly because the “Knight Rider” effect worked with 12 daisy chained TLC5940s and 64 RGB LEDs. I’m praying this issue is de-coupling. I have .1uF capacitors on every IC and a 10uF capacitor for each power rail. I’ve read up a little more on de-coupling and I am considering making the power rail capacitors larger. I have already tried to use a 47uF capacitor and at first it seemed to help tremendously, but I continued on with my tests and the issues seemed to return :-/. I’m considering trying 100uF capacitors next. A picture of the board is attached so please look over and let me know if theres something I’m missing.

Thank you for your help!

Sounds like power supply problems.

Try measuring the voltage, I think fungus might be right. Also without seeing the schematic maybe you are overloading the current capacity of the TLC5940.

I will do tests to ensure the integrity of the power supply. It is a 5V power supply rated for 40A.

I have attached the schematic. I don't believe I am overloading the current capacity of the TLC5940. the LEDs are lined up through every channel R - G - B and I have a 2.2k current limiting resister on the TLC which should limit the current of each channel to a little less than 20mA. Since I am only trying to light one color at a time then only 1/3ish of the channels on each TLC chip will be fully on.

The schematic is a little messy because I had to make a lot of last minute changes and I never expected to show it to anyone haha. All of the outputs on the TLC chips go to banks of ribbon cable connectors which connect the ribbon cable to each lead of every LED. If you order the chips in a line, the last channel is connected to a Red Led, last channel-1 to a Green, last channel-2 to a Blue and so forth. This way the current load should be very uniform over all the chips.

Schematic…

How does the Arduino come into this? Is it powered separately?

It is wired up very similar to this:

http://tlc5940arduino.googlecode.com/svn/wiki/images/breadboard-arduino-tlc5940_close.png

All the power to the circuit board (or breadboard in the link above) is powered from the external power source (5V 40A) which feeds powers to the LEDs and the TLC5940s. At the moment I am just powering the Arduino through USB power from the computer so I can upload new programs on the fly. I DO have all the grounds connected together and I have made sure of that through every iteration.

Hi,

Just took a look at your schematic. It shows you have fan ports placed on the 5V rail. If you are running fans, they can create electrical noise that can cause these types of problems you are experiencing.

I've work on several TLC projects in the past and have run into these types of intermittent problems and unpredictable results before. Almost always it was solved by properly decoupling the all IC's including the MCU. Many MCUs have multiple power inputs so you need to be sure to place a small capacitor at each input. Its actually pretty neat how a properly placed little capacitor can fix and stabalize your circuit and restore your mental health all at once. :)

Your cube will be switching 192 led channels concurrently at almost 20ma each at any given time , I would suggest putting a larger capacitance on the 5v Rail. 10uF or even 47uF seems low.

Thank you for your input! I am currently not running the fans while I am testing. What size capacitor would you recommend? Can you go too large and is 100uF enough?

I also have a question about the power supply. When I am running all the LEDs (192) at full brightness the voltage drops from around 5.2 to 4.2. I am using a switched mode power supply and I have tried both power supplies that I bought together and they both have the same drop. I have an ATX power supply that I converted so I can use it for projects and it experiences about a .6V drop. I have not monitored power supply voltages as closely before as I have now. I was assuming the voltage should stay constant. Should this pose some concern? The more lights I turn on of course the more the voltage drops. My main concern is that I am planning on using this power supply to run three cubes at once. If the voltage drops an entire volt with one cube then I can't imagine what would happen with three. Seeing this drop across three different power supplies makes me think it would be something with my circuit.

Can you go too large and

No. Well yes but all that happens is the power supply will fail to start. That is a function of the supply.

As this is a big supply it might have a sense input, are you using that?

It could just be that lack of decoupling capacitors alone is responsible for the supply dropping. I would also add a big 1000 one across the whole thing.

Alright, that sounds like a very easy problem to fix. I will start throwing capacitors all over the circuit tomorrow haha.

I have looked all over the power supply for a sense input and it looks like it does not have one.

I'm hoping everything works out with better decoupling. I can't tell you how much I have learned about that subject through this project! :D

Thanks for the help!

Hi,

Just noticed in the schematic that the SOUT - Pin 17 on one of the TLCs in the LED driver array is not connected to anything. This one needs a connection back to the MCU.

Bryce1111: When I am running all the LEDs (192) at full brightness the voltage drops from around 5.2 to 4.2. I am using a switched mode power supply and I have tried both power supplies that I bought together and they both have the same drop.

Yes, but:

It has a 3.3V rail for the TLCs and a 5V rail for the MOSFETs.

What is the 3.3V rail doing while all this is happening? According to the spec the minimum supply voltage for the TLCs is 3V. So if you are losing 1V there as well, you might well expect problems.

The 3.3V rail is very consistent. When all the LEDs are lit it takes a voltage dip to 3.27V, but otherwise stays at 3.30V. I have a small DC-DC converter which has a voltage sense line and it seems to work very well.

I have made progress. My only problem right now is that when I have all the LEDs on, sections of them tend to flicker slightly. I'm still attributing this to noise and I'm going to make more efforts to decouple everything better.

During one strange instance only about half of the LEDs were on and I accidentally bumped the GSCLK line with a ground cable and all the LEDs lit right up as I had intended. I wanted to make a note about that.

I have done almost everything I can currently with decoupling. I am currently using a 50v100uF capacitor on each of the power rails and it seems to work a little better than the 16v470uF. I also have a 1000uF 16v cap off the main power supply. I have not made any attempt to decouple the MCU yet because I am still using USB power directly from my computer.

What I have noticed is that the LEDs which are flickering are connected to the TLC chips which are closest to the data transmission lines and power terminals. This must be noise from those I am assuming, will decoupling even help fix that? What is strange is to eliminate the flickering I have attached an alligator clip to the GSCLK line and clipped it onto a spoon which is sitting on my desk haha. How this makes it go away I have no clue, but of course I would like to find a more stable solution.

I have also started multiplexing the cube and it caused no further issues. Its nice to see the entire thing lit up!

Skorn: Just noticed in the schematic that the SOUT - Pin 17 on one of the TLCs in the LED driver array is not connected to anything. This one needs a connection back to the MCU.

No it doesn't.

Hey Gents!

I have great news. I had all the data and control lines for the TLC5940s and the MOSFETS moving through a 16 wire ribbon cable. Well, because I seemed to be having issues with the Gray Scale Clock (GSCLK) line I isolated it by soldiering a spare wire on the pin connection on the bottom of the circuit board and put it in place of the header on the MCU. When I turned on the cube everything lit up perfectly! Apparently I was getting noise from the lines that were very close to this clock line, something important to note for future projects.

Thank you for all the help everyone. Being apart of such a supportive community means a lot!

Bryce1111: Hey Gents!

I have great news. I had all the data and control lines for the TLC5940s and the MOSFETS moving through a 16 wire ribbon cable. Well, because I seemed to be having issues with the Gray Scale Clock (GSCLK) line I isolated it by soldiering a spare wire on the pin connection on the bottom of the circuit board and put it in place of the header on the MCU. When I turned on the cube everything lit up perfectly! Apparently I was getting noise from the lines that were very close to this clock line, something important to note for future projects.

I'm attempting to make a 5x6 RGB matrix and I've had similar problems. 2 out of 6 chips work fine for me independent of their location but when I add a third or more it goes crazy lighting random lights. If i remove my gsclck wire from the circuit and touch it then the sketch somewhat works but with brightness errors and the LED's flicker. Could you explain more in depth how you fixed it?