Sinking the rows of a custom LED matrix?

I'm trying to create a large custom LED matrix for use in an art piece, and have come up with a question about current sinking. I'm choosing to use the TLC5940 to supply a PWM signal to 14 columns of LEDs (through some ULN2803's to give enough current to the LEDs).

I was planning on then bringing the row of the LED I want to turn on to LOW using a microcontroller (the Arduino-compatible Teensy++), but I'm curious if the chip can handle it. If every LED of a single row is turned on, wouldn't all that current have to go through the microcontroller to ground? Should I isolate the rows of the LED matrix from my microcontroller (using transistors?)?

Here's my schematic: http://i.imgur.com/2FQYx.png

Yes. ATMega's can only 20mA and maintain a good low. Higher than that, the low level creeps up. At 40+mA the output blows.
Use the ULN2803 to sink the lows, I think it is good for 150mA.
Or a shift register like TCI6B595, good for 500mA I think. (check that at ti.com)

That schematic will not work because 2803s can only sink current not source it. You need top switches to do this and also you need pull ups from the TLC5940.

Ah, thanks! I will use a 2803 to sink the LOWs.

What would you recommend to source the current for the LEDs? The TLC5940 datasheet says that it can sink up to 120mA of current, but with 5 LEDs at 20mA a piece, that's not much overhead for me to feel super comfortable. Plus, the datasheet says it can sink current, not source it.

Well, typically one would a PNP transistro or a P-Channel MOSFET as a control of a current source.

Are you planning to drive one column at a time (single 2803 output low) or 1 row at a time (mix of 2803s high & low, all low for worse case)?

If a single column, then you are good as is, the Row1-5 will a mix of high/low, and 1 2803 output will go low at a time sinking up to 5 LEDs worth of current. Put the current limit resister on the arduino output.

If a single row, then you need a "high side" current buffer on the output of the arduino that can source current for 15 LEDs with say a 20mA current limit resister (so 300mA minimum, I would plan for 450mA so the part is not running at 100%).

I was thinking, for enabling complete rows, (vs columns) that since I can't find PNP equivalents of the NPN-based UL2803, that the 5V going into the LED Anodes be controlled instead.
My thinking is that JPx-2 is the LED Anode, and JPx-1 is the Cathode.
So:
Remove the resisters going up to the 2803s.
Install 2803's between the arduino and JPx-2. Connect a current limit resister from JPx-2(s) up to 5V.
Then to energzize a row, you would let the 2803 output be high.
To disable a row, you would bring the 2803 output low, taking current flow away from the LEDs.
The more I think about it. however, the less I like it - the 2803s would need to be doubled up to pull all the current away, the LED brightnesses would not be consistent with voltage drop across the current limit resistor varying with the # of LEDs that were on.
Using a P-Channel MOSFET with low Rds per Row with current limit resistor per column would be a better solution.

I think this would be a good part

You might want to put a 2803 as a driver in front of it to ensure fast turn on times.

Please be aware that by inverting the signal from the TLC5940 you will never be able to fully turn off the LEDs. This is because of the way the chip works.

I was planning to drive each column one at a time using the TLC5940 to demux a PWM signal from the Teensy.

Each jumper is one LED, note the two pins. Pin 1 of the jumpers are the anodes, while pin 2 of the jumpers are the cathodes.

Is there a version of the 2803/2003 that can SOURCE current instead of sink it? I don't understand - the 2803's datasheet says it is just a Darlington transistor array, and that it can be used to drive LED displays, it makes no mention about only sinking current.

@Grumpy_Mike: Not sure I understand, I wasn't planning on inverting the signal from the TLC5940. I was planning on using it to demux a PWM signal. Also, what do you mean by "top switches" on the 2803's?

Also, what do you mean by "top switches" on the 2803's?

I mean a top switch in place of the 2803. That chip will only pull down or sink current, you need a chip that will supply current or source, these are called top switches or high sided drivers:-

I wasn't planning on inverting the signal from the TLC5940.

That's OK then.

I've come across a pin-compatible version of the 2803 that could work as a high side driver - the 2981. But the problem is that it requires a +20V or +35V power supply. Plus, it doesn't look like its an easy chip to find in stock anywhere.

Would it be a better idea to instead re-design my LED matrix? Is there something simpler (less parts and cheaper) that could be done? Maybe giving constant current to each of the columns and using PWM to switch transistors (using 2803s) on the rows?

But the problem is that it requires a +20V or +35V power supply

No that is wrong it will work on any input voltage up to that.

Would it be a better idea to instead re-design my LED matrix?

Possibly, have you seen my multiplexed TLC5940 project Mini Monome you can extend it to as many chips as you like using a 4:1 multiplex ratio.

Just found the 2981 on DigiKey: http://parts.digikey.com/1/parts/572213-ic-source-driver-8chan-18-dip-udn2981a-t.html

Good thing about the power supply, that makes it easier for me.

I did see your Mini Monome a while ago (I think I still have it bookmarked) - really cool! I wanted to check out the schematic, but it looks like its scaled down, and theres no link to a high-res version. Could you upload or send me a high-res version?

and theres no link to a high-res version

Yes there is.

but all the cathodes in a column should connect together. As the schematic is rather large there is a PDF of it 4 X 4 RGB LED Matrix.pdf available for download,

There is a link in that sentence.

Awww, you mean I have to read? :stuck_out_tongue:

Thanks, that schematic was most helpful. I have redesigned the matrix to use P-channel MOSFETs (FQP27P06 from SparkFun) for high-side switching, and the TLC5940 to sink the columns. In the following schematic, I have flipped the LEDs around, so that Pin 2 (top pin) is the anode, while the bottom pin the cathode.

I'm thinking of going with this P-channel MOSFET from SparkFun, simply because I'll probably be ordering other parts (like the TLC5940) from them as well: P-Channel MOSFET 60V 27A - COM-10349 - SparkFun Electronics

Can you explain the function of the 4.7k resistors going from the Source pin of your MOSFETs to the Gate pins? Is it just a pull-up resistor to keep the Gate from floating, or does it do something else?

Schematic: http://i.imgur.com/r2q5O.png

Is it just a pull-up resistor to keep the Gate from floating, or does it do something else?

Well it is a pull up but it keeps the FET off when the gate is not driven low.

Up until this point I have not used MOSFETs: although I'm sure their architecture and specific uses are a bit different than a transistor, what should I be careful about / aware of as I proceed?

To activate a row, I should bring the Gate of the MOSFET to LOW instead of HIGH, correct? Then I can use the TLC5940 to bring a column LOW, to turn on a specific LED. In this configuration, will I need to invert the PWM signal in my Arduino (just say 255-Desired_Value in the code)?

The datasheet for the TLC5940 says it does 16-bit PWM, whereas the Arduino is capable of 8-bit PWM. Does the TLC5940 library for Arduino handle the translation, or do I need to create some kind of buffer between Arduino and TLC5940?

To activate a row, I should bring the Gate of the MOSFET to LOW instead of HIGH, correct

Yes correct

will I need to invert the PWM signal in my Arduino

No you do not use the arduino PWM at all, just use the TLC to provide the signals.