tlc5926 best option for controlling many rgb leds?

controlling several leds with 1 picaxe

Hi.
I am looking to find the best solution to control 5 rgb leds with 1 picaxe.
I know that ways to do this have been discussed many times, I am not asking for ways to do this! I am asking the experts here for their advice on the BEST way to do this.
I am working on a prototype for a product I am planning on selling, so this method needs to be the least expensive, but still be able to do what I need it to do.

I simply need to be able to control 5 rgb leds. They do not need to be able to "fade" (by fade I mean change brightness... for example the color orange fading in and out).
But they do need to be able to flash on and off and obviously pwm for different colors.

I am thinking as of right now that my best option is the tlc5940 however if anyone knows of a less expensive alternative, please let me know.
I have been quoted ~3.88 usd per piece for 1000 pieces for this chip.

I have also come across the tlc5926 chip which seems to be less expensive (1.74 usd/piece for 1000 of them). A glance at the datasheet makes me think that this chip would work fine, however I am very very new at electronics and don't trust my judgement just yet. It also makes me nervous that searches for other people using this chip for projects have come up as almost nothing.
Why is everyone using the tlc5940 rather than the less expensive tlc5926?


I'm hoping that people with experience with this topic will be able to help me make the best decision for my project.
thanks
 
Last edited:
I have done more searching, and it seems like the tlc5947 will actually work better. It has more outputs (24) and is less expensive.
does anyone have any experience with these or reasons why it wouldnt work? thanks
 

premelec

Senior Member
So many possibilities! If you can see how to load information to it and it has sufficient current sinking for your application fine! If you need code already written and you can't find it for this chip but can for another that's certainly a consideration.... and then there's the small footprint soldering which may or may not be a problem for you... whatever works!
 

JoeFromOzarks

Senior Member
The TLC5947 has a single current reference resistor (Riref) common to all outputs. How will that work with your RGB's?

I've not played with it yet, just ordered but I'm looking at the W2RF002RF by OMRON ("LED Lighting Drivers LED Driver for Gaming 24 Channel 7x7mm Pkg,") it requires a resistor for each output. (I'm wanting to push 16 RGB's and the allowed space isn't much greater than what the RGB's occupy. :) About the same price.

Premelec is 100% right on, tiny little things to solder. :)


:) joe

(I'm trying one of these too: PCA9626 (24-bit Fm+ I2C-bus 100 mA 40 V LED driver) in a HVQFN-48 package.)
 
Last edited:

MikeAusP

Member
. . . . I simply need to be able to control 5 rgb leds. They do not need to be able to "fade" (by fade I mean change brightness... for example the color orange fading in and out).
But they do need to be able to flash on and off and obviously pwm for different colors. . . . .
So you need to control 15 LEDs . . . but how much current through each ???

So you only need to switch the R, G and B in each LED On/Off.

Since these ICs have a 4096-step dimming ability, they're a bit of overkill. An on-off driver is all you need, although I can't imagine they'd be much cheaper if you're happy with this current range

The 5926 and 5940 can drive each of 16 LEDs to 120mA - the 5947 can only go to 30mA for 24 LEDs.

The 5940 has Dot Compensation to allow equalisation of brightness of an array, the others don't.
 
I still need to fade the r,g,b for each LED to make different colors. I just meant that say I choose orange (which is a pwm of ~ 255red, 60green, 0blue) I dont need that LED (which is now orange) to fade in and out.

I got quoted 0.6usd per piece by a company for the tlc5947 for 1000 pieces. This seems extremely low, so I will order some samples and test this thing out, but if it works well sweet!
 

westaust55

Moderator
Have a look at the WS2801 (for 1 RGB led) and the WS2803 (for 6 RGB LEDs) as options.
There are threads about these on this forum.

Both chips allow 256 levels for each of the three channels by which you can select colour and brightness.
 
Last edited:

gbrusseau

Senior Member
To answer your question plasmaninjaa, the TLC5926 will not vary the brightness of the LEDs so you can't create a lot of colors. You can get 6 different colors though.
red, green, blue, red-green, blue-green, and red-blue. Not sure what the colors will look like though. For example the red-blue color might look mostly blue with a slight hint of violet. The blue-green will probably look mostly white. See what I'm getting at. If thats good enough for you then it will work, otherwise the TLC5940 will allow you to get much more creative with the color schemes. Keep in mind that this project will look best when you use "true color" LEDs. They're a lot more expensive, but they will really make a big difference in the number of different colors you can create. I have used the TLC5940 on several projects.
You should be able to get a better deal than what you mentioned per 1000. Give Newark Electronic a call.
 
Last edited:
have you used the tlc5947? it is 24 channels and is alot cheaper! I got quoted 0.6usd per piece.
I need the channels to be able to fade so that I can achieve many colors, not just on off achieving 6 colors.
 
Hi westaust55,
Thanks for your reply. I have read into the ws2803 and tried to understand as much as I could from this thread http://www.picaxeforum.co.uk/showthread.php?23145-WS2803&highlight=WS2803

I think this might be a better solution for me. I'm hoping to be able to daisychain 2 of these together for 36 channels.
However, its going to be quite a mission figuring it all out. haha sometimes I feel like this forum is in a different language. I have SO much to learn about electronics and programming.

Anyways, one quick question before I order a few of those chips and put my eggs in that basket.

I'm assuming the answer is yes from what you said, but this chip will be able to fade to any color?
For example, would I be able to run my code found in this thread? http://www.picaxeforum.co.uk/showthread.php?23887-rgb-color-fading-code
 
Have a look at the WS2801 (for 1 RGB led) and the WS2803 (for 6 RGB LEDs) as options.
There are threads about these on this forum.

Both chips allow 256 levels for each of the three channels by which you can select colour and brightness.
also, I'm assuming this chip wouldnt need to have another picaxe or MPU running the timing like the TLCxxx's seem to need?
 

westaust55

Moderator
@plasma,

Yes the WS2301 and WS2803, can be controlled to vary gradually (fade) the colours of the RGB LED’s.
For each RGB LED there are three bytes of data, one per primary colour. With a value of 0 that channel/primary colour is off and at 255 it is at maximum brightness.

Say you want to go from red to blue then in steps/increments:
Code:
FOR increment = 0 TO 255
  Blue_channel3 = increment
  Red_channel3 = 255 – increment
  Green_channel3 = 0  ; always off as not required for a red to blue transition
  GOSUB SendAllChannelData ; a separate subroutine as per previous threads
NEXT increment
You cannot address one channel independently so all channel (18 channels for 1 x WS2803) data must be held in RAM (scratchpad is good for and X2 part) and after adjusting the desired channels to reflect the next step in a sequence, you must send all data to the 18 channels per WS2803 chip.

The WS2801 and WS2803 have internal PWM control and there is no need for extra chips.
 
Last edited:

gbrusseau

Senior Member
The TLC5947 also has internal PWM and needs no extra chip. The WS2803 looks like a better choice as far as controling it with simpler code as long as your LEDs don't draw more than 30ma. One of your main concerns is cost though. The WS2803 looks a little pricey. You might also consider an external FRAM memory chip to hold lots of data if the device is free standing without a PC or other external device feeding data to the LED controller.
 
Last edited:
The TLC5947 also has internal PWM and needs no extra chip. The WS2803 looks like a better choice as far as controling it with simpler code as long as your LEDs don't draw more than 30ma. One of your main concerns is cost though. The WS2803 looks a little pricey. You might also consider an external FRAM memory chip to hold lots of data if the device is free standing without a PC or other external device feeding data to the LED controller.
seeing as how this is for something I plan on selling (I hope upwards of thousands), cost is definitely my biggest concern. I have been quoted less than 0.50 usd however on the ws2803, which is a bit less then the tlc5947.
However, seeing as I would need 2 ws2803 chips and only 1 tlc5947 chips, that might be the deciding factor.

The LED's wont need to draw anything over 20ma, so that shouldnt be a concern.

I did not know that the ws2803 needed to use RAM though. I know little about that, other than RAM means memory. Some trial code that I have run with the picaxe's show that I am running close to the memory limit solely with the code itself. Would this mean that I would have even less memory by using the RAM?

I've discussed the design of my project at length with you, what would you suggest me doing?
The most of the rgb LED'S actually dont even need to fade from one color to another, they just need to turn on or off as a specific color (with exception to 1 of the RGB led's and the two 12v RGB LED strips which will need to fade from color to color) so that makes 9 channels that need to fade gradually.

Do you think I will need an external FRAM memory chip? And if so, which one would you suggest and how difficult would this be to implement into the design?

Thank you again so much for the help
 

westaust55

Moderator
I did not know that the ws2803 needed to use RAM though. I know little about that, other than RAM means memory.
Some trial code that I have run with the picaxe's show that I am running close to the memory limit solely with the code itself.
Would this mean that I would have even less memory by using the RAM?

The need for RAM memory to save the data is not restricted to the WS2803. The TLC5947 is no different and you will also nee RAM whether as vairables, general RAM memory or for X2 parts scratchpad memory to hold the values for the current channel data so you can update and resend the entire data stream for each update to the RGB LED colours.

Your program is stored in Program (Flash) memory within the PICAXE chip. There is also EEPROM memory to store data that changes infrequently and considerable RAM for most purposes. The RAM comprises the part used for the pre-defined variables, more typically located in the memory map immediately above the pre-defined variables (access with PEEK, POKE and for M2 & X2 parts the bptr indirect addressing pointer) and for some PICAXE chips (X1 and X2 parts) there is further RAM referred to as the scratchpad.

You only need one byte per LED driver channel so around 24 or so bytes which is well within the capability of the later PICAXE chips. Whether the colours fade or not you need to send out all data for the WS2803 each update and at a quick look at the TLC5947 that is no different.

I do not think you will need a FRAM chips. Should the need ultimately arise, FRAM chips are available with i2c comms interfacing (just like often used external EEPROMs) and there are PICAXE inbuilt commands so reading from and writing to external FRAM is no different to comms with EEPROM chips - very slightly faster.

Your first step is to make a final decision on which chip to use and then get some basic code working. Then work towards achieving the colour sequences and fading that you want.
 
Last edited:
Your first step is to make a final decision on which chip to use and then get some basic code working. Then work towards achieving the colour sequences and fading that you want.
ok, I will order the ws2803 asap and get back with results/ questions.
I think this chip will work better for me because I have been quoted very low and it seems more user friendly.

Appreciate it!
 

gbrusseau

Senior Member
I was hoping some one like westaust55 would provide a good explanation of the internal EEPROM and scratchpad RAM of different PICAXE's. I agree that the WS2803 is the best choice and in reviewing your requirements, external FRAM memory probably won't be necessary unless you want to get real fancy with color changing schemes.
 
Top