Controlling 12v RGB ribbon with TLC5940 and ULN2803

I've had some success with using TLC5940 LED driver chips, and ULN2803 darlington arrays to control 12v RGB ribbon (using pull up resistors as described http://arduino.cc/forum/index.php/topic,13926.0.html).

I need to control 10x1m sections of ribbon, which is 30 PWM channels, at about 185mA per channel. This means that using only 4 channels (of the 8 on the ULNs) already puts me above it's 650mA rating. I could scale it out, and use only 1 ULN per section of ribbon, but that means I'll need 10 of them, which seems a bit excessive!

So I'm wondering if ULN2803s are the best things to use, or if there is something more appropriate, ideally also not needing all the extra resistors as well?

Thanks!

A 12V RGB ribbon does not need any resistors, these are already built into the ribbon.

I could scale it out, and use only 1 ULN per section of ribbon, but that means I’ll need 10 of them, which seems a bit excessive!

You are driving a lot of current it is going to be “excessive”

So I’m wondering if ULN2803s are the best things to use,

I said in the other thread that they negate the constant current drivers in the TLC5940.

The resistors aren't current limiting for the LEDs. To be honest, I'm not quite sure what they do, but connecting the TLC output to the ULN input didn't work without one. Putting a 10K one from the ULN input to Vcc as suggested in that thread does work, although the PWM is reversed for some reason, that's not important. (I can easily fix it in software).

I'm using the TLC as a way to get more outputs from the arduino. With it I have 16+ PWM outputs, without it I only have 6. The current limiting bit isn't needed, because as you pointed out, the ribbon has resistors built in.

Are there better devices than the TLC and ULN to use, or is this the best combination?

Other options 74HC595 + ULN2803, I build a project with 72 PWM channels and same 12V ribbon RGB leds: http://coolarduino.wordpress.com/2012/06/21/tears-of-rainbow/

Though, I wish I had this chip before I start project: https://www.sparkfun.com/products/734

Ah, I didn't know you could PWM with the 74HC595, I thought they were just on/off. The link on them at http://arduino.cc/en/Tutorial/ShiftOut doesn't make any mention of PWM. You're project looks pretty cool and is really helpful, thanks! If I'd seen it before I would have just bought the 74HC595. They look simpler to wire up as well.

thanks!

markvr: The resistors aren't current limiting for the LEDs. To be honest, I'm not quite sure what they do, but connecting the TLC output to the ULN input didn't work without one. Putting a 10K one from the ULN input to Vcc as suggested in that thread does work, although the PWM is reversed for some reason, that's not important. (I can easily fix it in software).

I'm using the TLC as a way to get more outputs from the arduino. With it I have 16+ PWM outputs, without it I only have 6. The current limiting bit isn't needed, because as you pointed out, the ribbon has resistors built in.

Are there better devices than the TLC and ULN to use, or is this the best combination?

Check out shiftpwm for pwm on shiftregisters, but it seems to me, you need 185ma per channel, and you need 30 channels, so think you will need some very stout shift registers.

You could use 30 transistors, but I dont know if it would be better.

I cant see your strip, but im pretty sure that those resistors are to limit the current at 12v, which is why they are a 12v strip. Its possible that you have something different than im imagining though.

The TLC and the darlington arrays are both sink devices, they both control the the ground (-) side which is why you are getting the opposite of what you expected to get. (you are sending low to the darlington expecting it to turn on, they work the opposite way, which is why you are getting the opposite results in your PWM). I think if you put an pnp transistor between the TLC and the darlington, it might behave the way you want, but damn thats ugly, and the ULN wouldnt be very useful.

Most of the strip setup that I've seen use mosfets, with 10 strips, it sounds like you will want to use 30 transistors of some type (Im guessing pnp or p-channel)and your tlc.

You can do PWM with shift registers, checkout shiftpwm, its pretty cool, but I think that maybe too much current, since you want to run 185ma on all 30 channels (10 RGB channels). each output on the shift register will need to be able to handle 185ma, and each 8 bit shift register will need to be able to handle 8 times that (1480ma, or about 1.5A)

To be honest, I'm not quite sure what they do, but connecting the TLC output to the ULN input didn't work without one. Putting a 10K one from the ULN input to Vcc as suggested in that thread does work,

What it does is to pull up the signal line. The TLC5940 only pulls down.

although the PWM is reversed for some reason, that's not important. (I can easily fix it in software).

Yes it is important and no you can't fully fix it in software. The TLC5940 never turns the LEDs fully on, it misses a clock pulse due to the way it is clocked in. At full brightness you simply can't tell though. However, if you invert it then the LEDs can never be fully off and so they will always be lit.

You can PWM shift registers but at the expense of using up a lot of your processing power. See:- http://www.elcojacobs.com/shiftpwm/

Yes it is important and no you can't fully fix it in software. The TLC5940 never turns the LEDs fully on, it misses a clock pulse due to the way it is clocked in. At full brightness you simply can't tell though. However, if you invert it then the LEDs can never be fully off and so they will always be lit.

Ah yes, so it doesn't! For my purposes that isn't a problem, it will just mean the colour is very slightly different, but I can see it would cause problems elsewhere.

Given I have the TLCs, and I need as much CPU power as possible (to do FFTs and other audio calculations) TLCs with one ULN per ribbon looks like the best solution.

thanks!

I have not done anything with TLC yet, but I remember I 've been looking into it, and what stops me is complexity in interfacing with TLC5940, there is a library AFAIK based on timer1 (having hardware interrupt running is already not good for audio processing) plus software protocol. So overall CPU load of just interface driver with TLC may be more demanding than hardware based SPI intrface with 74HC595 . I’m curious if someone have performance data for TLC to compare with :

Function shift out 9 bytes ( for 9 shift registers in this project ) approximately in less than 36 usec, or 0.5 usec per one PWM channel. One bit-set in the unrolled loop is about 4.5 cycles.

So overall CPU load of just interface driver with TLC may be more demanding than hardware based SPI intrface with 74HC595

Not when you try and PWM the shift registers it isn't.