LED Project Guidance

Hello,

I’m just starting a project, and I have some idea what I’m going to need, but there are a few details that I’m not sure about that I’m hoping the forum can help fill in. Here is the project:

4 - strings of 20 RGB LEDs (80 LEDs)

-Each of the 4 strings will be driven independently

-Within a string each color will be driven independently

-Using PWM for dimming/color effects

1 - string of 8 White LEDs

-On Constantly no PWM needed

This project needs to be portable.

Here is what I know I need so far:

1x SparkFun LED Driver Breakout - TLC5940 (16 Channel)

80x LED - RGB Clear Common Anode COM-10820

4x PicoBuck LED Driver

1x FemtoBuck LED Driver

Three questions:

  1. Will the PicoBuck LED driver work with common anode RGB LEDs? If not what can I use to drive a string of 20 RGB LEDs with PWM?

  2. I guess I need some kind of microcontroller to program the LED Driver Breakout. What microcontroller would be best suited for this application?

  3. Can you think of anything else I would need?

Thanks for the help!

Cheers!

Hi SanityVacuum,

Unfortunately, the PicoBuck cannot drive common cathode or common anode LEDs or LED strings so it will not work for this project. If your project permits it, you may want to look into using addressable LEDs instead like the Through-Hole LEDs we discuss in our [WS2812 Hookup Guide. We also carry strips of these LEDs to simplify wiring everything up that you can cut to individual segments for your 20-LED strips.

Addressable LEDs will allow you to have a dedicated power supply to drive the LEDs and you only need one data line to control an entire string since the WS2812 boosts the signal on the DOUT line. The rest of that Hookup Guide linked above will be helpful for selecting a power supply, microcontroller and code to power and control the LEDs.

If you need to use PWM to control color and brightness for this project, I would recommend taking a look at the [SparkFun TLC5940 Breakout.

I hope this helps you find the right parts for your project. If you have any follow-up questions about this project, please reply to this post and we would be happy to help as much as we can.](SparkFun LED Driver Breakout - TLC5940 (16 Channel) - BOB-10616 - SparkFun Electronics)](https://learn.sparkfun.com/tutorials/ws2812-breakout-hookup-guide#addressable-through-hole-led)

Hi TS-Mark,

Thanks for your reply, and your advice. I’ve decided to use an Arduino Pro Mini, and 8 TLC5940 boards to drive 40 RGB LEDs with with PWM for color control, and brightness. As well as 5 strings of 3 regular LEDs (in series). Requiring a total of 125 TLC5940 channels.

I’ve made some good progress hooking up, and running the GitHub examples with a single TLC5940 board as practice. Unfortunately I’ve run into a troubling problem. I’ve attached a picture that shows my connections for the TLC5940 board for reference. The numbers represent the pins on the Arduino Pro Mini, and there are 16 LEDs hooked up to the PWM outputs.

Here are the voltages of the batteries in the picture :

TCL VCC : 3.3V

LED VCC: 12V

The problem I’m having is that when LED VCC is set to 12 volts there is no way to turn off the LEDs. Setting the PWM value to 0 does not turn off the LED, varying the PWN value varies the brightness slightly but it never gets very dim, and never turns off. I also blew two LEDs likely due to over current. I was able to resolve the problem when I hooked the LED VCC to 3.3V. Then setting LEDs to 0 turns them off as they are supposed to, and I’m able to vary the brightness as expected. So it seems that the TLC5940 is not coping with the 12V power. What I don’t understand is the datasheet says that the TCL5940 can support LED voltages up to 17V. So I feel like I must be doing something wrong. I didn’t include any resistors in series with the LEDs because I was under the impression that the constant current sink made them unnecessary.

So I’m not entirely sure what I’m doing wrong. My power source for the LEDs is 12V, and expected to be able to drive all of my LEDs off of it. Ca you offer any insight into what I may be doing wrong?

Thanks for the assistance.

tlc5940.jpg

I am a bit confused by your circuit schematic here. Where are you applying the 12V in this circuit? The Vcc line is intended to be a power rail for your attached components (LEDs, Servos, etc.) as well as a power input for the TLC5940 regulated to 5V. I think the issue may be related to how you are powering the LEDs here but I would need a better look at your circuit to be sure. Try running your 12V supply through the Vcc pin and see if that resolves the issue. If not, let me know and I can try and replicate your circuit to see what else we may be missing here.

Edit: After talking with another rep here we think the issue might be related with the pull-up resistors on the output channels. A quick suggestion would be to remove one of those pull-up resistors if you are able to and see if that fixes the issue. What we think is happening is when you are “turning off” that channel you’re not dropping the voltage to 0 but instead is dropping to the difference between your two voltages (~8.7V) so you’re still getting current passing through the channel that is enough to keep the LED powered up. That would explain why when you drop that voltage to 3.3V, the issue goes away.

Hi Mark,

Thanks for the information! Removing the pull up resistors did the trick. I’m now able to drive the LEDs with 12V over the full range of brightness. This is good progress. The project is starting to take shape, I’m able to manipulate a single TLC5940 board with 16 LEDs, now it’s just a matter of scaling it to 8 boards with 40 RGB LEDs, 5 UV LEDs, and 3 orange LEDs.

I’ll keep updating as I make progress

Thanks!

OK, I’ve run into a new problem. I’ve daisy chained 4 TLC5940s together for a total of 64 channels. For some reason I can only initialize/control the first 21 channels. I am unable to initialize/control the last 43 channels. I’ve verified this behavior is the same across two different sets of daisy chains, so I don’t think it’s a hardware issue.

Has anyone seen this behavior before? Any idea what might get this working? Below is my code. I attempt to initialize all channels to 0, and I attempt to set all channels to 0. This succeeds in turning off channels 0-20, but channels 21-63 appear to be randomly on or off…essentially uncontrolled.

#include <SparkFun_Tlc5940.h>

#include <tlc_config.h>

#ifdef NUM_TLCS

#undef NUM_TLCS

#define NUM_TLCS 4

#endif

#define C_NUM_CHANS NUM_TLCS*16

void setup() {

Tlc.init(0); //Initialize all channels to 0

}

void loop() {

for (int i=0; i < C_NUM_CHANS; i++) {

Tlc.set(i,0); //Set all channels to 0

}

Tlc.update();

}

Is there anything else in tlc_config.h that needs to be overridden other than NUM_TLCS?

As far as I can tell, you should only need to adjust NUM_TLCS and make sure you have an IREF resistor for each TLC in the chain. I would recommend trying [this example and either using the #undef command to switch the NUM_TLCS or just set it manually by editing the tlc_config.h file. That code should work with multiple TLCs chained together so long as you adjust the NUM_TLCS line so that will be a good sanity check you can work from.](SparkFun_TLC5940_Arduino_Library/examples/BasicUse/BasicUse.pde at V_1.0.0 · sparkfun/SparkFun_TLC5940_Arduino_Library · GitHub)

Hi Mark,

I tried that example, and verified that I’m able to control more than just channels 0-20, but after channel 20 the control is random where some channels work, and some do not. Some lights flash like they are supposed to others just stay on. The channels aren’t shorted out, because they all turn off when BLANK is asserted. It just seems like the data is getting corrupted as it moves through the TLCs, and they aren’t being configured right.

How long are your data wires? Long wires could be corrupting the data.

Can you post some photos of your setup?

Hi Chris,

I’ve attached pictures of my setup. I’ve measured the input/output voltages of SIN/SCLK for all 4 of the TLC5940’s. Here is what I saw

SCLK:

Output Mini Arduino Pro = 20mV

Output TLC1 = 20mV

Output TLC2 = 20mV

Output TLC3 = 20mV

SOUT:

Output Mini Arduino Pro = High: 2.3V Low: 37mV

Output TLC1 = High : 600mV Low: 37mV

Output TLC2 = High : 595mV Low: 37mV

Output TLC3 = High : 595mV Low: 37mv

Obviously there’s a dramatic difference in the SOUT voltage of the Mini Arduino Pro , and the SOUT of the TLC5940’s. Do you have any idea why the voltage would be so much lower coming out of the TLCs? I’ve attached pictures showing the wiring connections. The wires connecting the Mini Arduino Pro to the first TLC5940 are 8 inch jumpers. The subsequent TLCs are soldered directly together.

Here are the soldering connections for TCLs 2-4

I’ve also verified that each TLC VCC pin is at 5V, and all grounds are connected together.

I figured out the problem.

For some reason

#ifdef NUM_TLCS

#undef NUM_TLCS

#define NUM_TLCS 4

#endif

was not overriding the #define NUM_TLCS in tlc_config.h. This caught me by surprise because I also tried excluding the default tlc_config.h, and replacing it with my own with a modified NUM_TLCS. This obviously didn’t work either. However, when I went into the actual library, and modified the tlc_config.h directly that seems to of done the trick.

Not sure why I’m unable to override the #define, but at least I’ve found a way past it.

Thanks for the support.

Mark you called it about editing the tlc_config.h manually. I tried creating my own tlc_config_mod.h with my own values, and included that in my project, but I guess there must be references to the original tlc_config.h throughout the library. So the only way to really make this work is to edit the tlc_config.h manually. So thank you so much for the solution!!!

I’m still a little confused why I’m not able to override the define in my code. I’ve done similar things in the past. If anyone knows of a way to change NUM_TLCS without modifying the library I would love a suggestion. Editing libraries on a case by case basis doesn’t seem like the best approach.

That’s great to hear you finally nailed down the issue! I am not 100% positive, but it may be related to how the TLC_Config.h file is set up with an #ifndef call for TLC_CONFIG_H so if you are not defining that in your code, it reverts to the default config header file in the library. It may also just be that this library, in particular, was written specifically with a section of that configuration header file to be edited by the user instead of modifying it in the code itself.

I may be off here but I think that is why overriding the #define NUM_TLCS is not working the way you are setting it up. Let us know if you have any other questions or issues with the TLC5940 and we’d be happy to help.

Do you have multiple directories with a tlc_config.h? You may be editing the wrong one.