Map with CC RGB LEDs. Multiplexing Common Cathode over TLC5940

I'll start this by apologizing for the vast level of noobosity in the incoming questions. This is my first real project and I'm using it for the office, so I'd like to make it as simple to build as possible so we can make it a team building exercise. :smiley:

I have a project where I am trying to light up a map using about 60 RGB LEDs. The LEDs will be plugged into various areas of the map and will all be lit up at the same time, just using different colors to indicate status. Eventually, I'll control these over ethernet, but I'm not worrying about that just yet.

I've been doing a lot of research (not enough apparently) and it seems that I have two best options. Using the CC LED and mutiplexing or using CA LED and running far more wires than I would prefer to.

The majority of the tutorials I have read are focused on CA LEDs because the most common library people use doesn't support CC that I can tell, however, I have seen many of you state that over the years you have figured out how to do this via multiplexing. I've gotten some great tips on doing this outside of Arduino using other TLC5940 libraries, however, I want to build this direction from Arduino until I know a bit more of what I'm doing.

I'm not very good at reading schematics yet, however If i could just find something as simple as http://tlc5940arduino.googlecode.com/svn/wiki/images/breadboard-arduino-tlc5940_close.png I should be able to get it wired up. I've read that you use MOSFET somehow, but I'm not real clear on what that even is to be honest. If I can get even 2 RGB LEDs mutliplexed together and driven from the TCL5940, I'm pretty sure I could get the rest of the way. Hopefully power wont be an issue. I've read that this chip can be easily fried, so I dont want to mess anything up. I have 5 currently with 5 on the way, so if I need to do it with CA and non multiplex I can, but it just seems like way too many wires.

My idea goes as follows:
Hook up arduino to breadboard and TLC5940
Place each LED on the map
Bend each LED and run a wire connecting each color in a circle (i think this is multiplexing), see diagram http://dl.dropbox.com/u/4099132/baddiagram.PNG
Use PWM to control the color of the lights individually, being able to light all 60 at once any one of 3 colors.

Please shoot some holes in this, I only have 50 CC and 50 CA LEDs and 5-10 TLC5940, I want to get on the right track before committing to buying more parts to finish the prototype and then the final product. I've read through lots of posts on the forums on the subject, and I already have an idea of which experts will end up replying, humbling seeking your wisdom!

You can't use common cathode LEDs with a TLC5940, don't even think of trying. It is common anode or separate RGB LEDs only.
Edit - just thought of a way of doing it.

however If i could just find something as simple as

If you are doing this sort of magnitude of project you have to be able to read a schematic. You can't stay in kindergarten forever.

Basically this project has 64 RGB LEDs multiplexed using three TLC5940 chips, but it is not simple:-
http://www.thebox.myzen.co.uk/Hardware/Hexome.html

I love to prove people wrong even if it is only me.
Yes to drive a common cathode RGB LED on a TLC5940 you just have to connect the cathode to the chip output, and then switch each colour anode in turn in a multiplexed manor.
It is late here in the UK now. I will post some diagrams of how to do this in the morning.

Grumpy_Mike:
I love to prove people wrong even if it is only me.
Yes to drive a common cathode RGB LED on a TLC5940 you just have to connect the cathode to the chip output, and then switch each colour anode in turn in a multiplexed manor.
It is late here in the UK now. I will post some diagrams of how to do this in the morning.

Thanks Grumpy_Mike! I've seen a lot of your posts on TLC5940 (and read through the Hexome/mini monome) and was hoping you'd weigh in here as well. Glad to know there is a way to do it over CC. My main concern is having more wires than I actually need and increasing the complexity of the project. When I first started this project, I was planning to use shift registers. With 52 lights in the project, I assumed I would need (52*(3 anodes+1 cathode)) 208 wires, so 26 shift registers seemed a bit much. Then I moved onto the 5940s, but without multiplexing I'll still need a lot of connections back to the breadboard.

If this project is easier and will still require the same amount of 5940s and wires using multiplexed CA, I'm not opposed, I have 50 of each at the moment. Sometimes my spacial awareness gets a bit off when I look at the grid multiplexing examples since my LEDS will be spaced so far around the map.

Grumpy_Mike:

however If i could just find something as simple as

If you are doing this sort of magnitude of project you have to be able to read a schematic. You can't stay in kindergarten forever.

I'll certainly put a bit more effort into it. The one for the mini Monome is pretty straight forward.

Thanks for looking into it :slight_smile:

Well the basic idea is to apply a high sided drive multiplex to each colour. In the diagram I have shown P-channel FETs but you can use PNP transistors or a 2981 or a VN750-E.
I have only shown 7 LEDs on the diagram but you get the idea.
The main difference from normal multiplexing being that you have a 3 to 1 multiplex duty cycle instead of the normal power of two.

Therefore the multiplexing software will have to be changed to reflect this, that is to only switch on one of three drive outputs instead of one in four.
I suppose you could extend it to two banks of each colour to give a 6:1 duty cycle but I think that is stretching it a bit far.

The pinout shown for the TLC5940 is for the multiplexing library I hacked together from an early version of the "official" one, and is to be found in this project:-
http://www.thebox.myzen.co.uk/Hardware/Mini_Monome.html

Here the LEDs position and RGB values are together in the memory buffer. That is the first LED has it's RGB value then the second and so on. With this method all the red values will be together in the first (in this case 24) bytes of the buffer, followed by the green and then the blue.

TLC chips can be cascaded and you will need four chips for 64 RGB LEDs, as opposed to the three for the Hexome, but they will be brighter because of the multiplex ratio.

Common Cathode Mux.pdf (30.8 KB)

Now -thats- a schematic I can sink my teeth into, very straight forward :smiley: Thanks for the great detail.

Is there any reason that I should be doing this project by multiplexing CA instead of CC? I certainly don't want to make it any more difficult than it needs to be, however reducing the number of wires (back to the board) and TLC5940s is definitely a concern for making it easy to follow. I've set up the 5940 examples using CA, if I could just turn http://tlc5940arduino.googlecode.com/svn/wiki/images/breadboard-arduino-tlc5940_close.png into something multiplexed to require less wires, I'd be okay with using CA LEDs instead.

Is there any reason that I should be doing this project by multiplexing CA instead of CC?

Well apart from that is what you asked in your thread no.
Multiplexing with common anode is what I did in the Hexome and in the mini Monome Mini Monome

As multiplexing with the TLC5940 chip involves switching a positive supply to something, with common anode LEDs that something has to be a separate LED with the different colours going to different TLC chip pins. This is the more flexible because it allows you arrange what on / off ratio of multiplexing you want and also if like the Hexome you have one chip for each colour it allows the chips to be set at different currents to achieve a white balance directly in hardware.
With common cathode you are forced to switch the individual colours and put one LED through one TLC chip pin.

if I could just turn http://tlc5940arduino.googlecode.com/svn/wiki/images/breadboard-arduino-tlc5940_close.png into something multiplexed to require less wires,

Start off by looking at the schematic of that and seeing how it relates to the physical layout. It is not at all a difficult skill going from a schematic to physical layout. Once you have done one or two it will be second nature. It is very easy to spot errors in a schematic and it is virtually impossible to do this with a physical layout picture.

Grumpy_Mike:

Is there any reason that I should be doing this project by multiplexing CA instead of CC?

Well apart from that is what you asked in your thread no.
Multiplexing with common anode is what I did in the Hexome and in the mini Monome Mini Monome

As multiplexing with the TLC5940 chip involves switching a positive supply to something, with common anode LEDs that something has to be a separate LED with the different colours going to different TLC chip pins. This is the more flexible because it allows you arrange what on / off ratio of multiplexing you want and also if like the Hexome you have one chip for each colour it allows the chips to be set at different currents to achieve a white balance directly in hardware.
With common cathode you are forced to switch the individual colours and put one LED through one TLC chip pin.

if I could just turn http://tlc5940arduino.googlecode.com/svn/wiki/images/breadboard-arduino-tlc5940_close.png into something multiplexed to require less wires,

Start off by looking at the schematic of that and seeing how it relates to the physical layout. It is not at all a difficult skill going from a schematic to physical layout. Once you have done one or two it will be second nature. It is very easy to spot errors in a schematic and it is virtually impossible to do this with a physical layout picture.

Thanks for all the info. You've helped clear up a good bit of the details I had remaining. Hopefully I'll put it to good use in the form of a tutorial for similar projects. 8)