Circuit Design for Large LED matrix

I'm designing a large (500-700) common anode RGB LED matrix that i'm hoping to run with my arduino and a number of TLC5940s. The setup will run off of two LiPo 4000mAh batteries. I'm planning to minimize chip costs by multiplexing a matrix through some of the 5940s, but i'm running into some conceptual issues.
I understand the arduino likely doesn't have the processing power to constantly update essentially 1500+ leds, but was hoping that I might be able to instead write still images to the matrix and update portions of the display infrequently/as needed.

Assuming this is possible, how should I wire a transistor setup such that to accommodate the varying current flow as different numbers of LEDs are left on/switched off? Also, do I need resistors on each LED or just at the ends of the rows/columns?

The X/Y arrangement will have some impact the electronics needed.
You may have to break it down into several smaller matrices that you address one after the other in order to keep current flows reasonable,
which would go along with your model.

How many rows do you envision each '5940 driving?
25 x 25 is 525 LEDs, with RGB is like 75 x 25 (75 columns, 25 rows).
Do some calculating, how many rows can be multiplexed before flickering becomes noticeable?
I assume you'll have enough '5940's to handle all the columns.
5 will do 80 columns, so not too bad, 26 LEDs.
25 rows, say 24 row so are using 3 shift registers for column selection. Still not too bad.
Then clock a 1 thru the shift register to enable the rows 1 by 1. 25mS on time each row would yield 40 frames/second. Should flicker free. (Movies used to be 24 fps).

Common anode LEDs because the '5940 is current sink device, can have 78 LEDs on at once worst case.
Each one drawing 20mA, need to switch on/off nearly 1.6A.
8 AH of battery (running in parallel, yes?) will last a little while. ATMega will be happy at 16 MHz, maybe act a little flakey when voltage drops under ~3.8.

Need to find some nice logic level P-channel MOSFET with low Rds (for example, if had 25mOhm Rds, then will dissipate ~40mW when turned on).

I don't know why, but MOSFETs with Low Rds that will run cool are pricey and have largish Gate capacitance:

Make sure to use shift registers with decent current drive, like74ACT164, 24mA output, to make sure MOSFET turns on/off nice & crisply.

Maybe surface mount is cheaper. Are you doing up a PCB for all these LEDs?

Would suggest using SPI for fast tranfers out the '5940s.
Can shift out 10 bytes really quick with hardware based SPI, vs way longer using software controlled shiftout.

Also, do I need resistors on each LED or just at the ends of the rows/columns?

The TLC5940s are constant current output, you need no extra resistors.

However I would not multiplex any more than 4 to 1 because of the brightness drop.

Here is my project using one TLC5940

http://www.thebox.myzen.co.uk/Hardware/Mini_Monome.html

I'm designing a large (500-700) common anode RGB LED matrix

You are being very naive if you think you can simply scale up a matrix to this size, it is a complex project, you need to know about supply decoupling and signal integrity. I would strongly recommend you to start with something of a more sensible size.

Let me see if i can wrap my head around this...

Assuming the design is approximately 80 RGB columns by 5 rows of anodes (or something similar to that), from a Hz standpoint, the arduino would be able to effectively multiplex through the 5940s?
I have a bunch of 595s lying around, would those be a suitable chip to control the rows?
I'm pretty unknowledgeable about how to use the transistors...connect the base to the shift registers for the columns, emitter to the anodes, and collector to the power source?

You are being very naive if you think you can simply scale up a matrix to this size, it is a complex project, you need to know about supply decoupling and signal integrity. I would strongly recommend you to start with something of a more sensible size.

I'm intending to start with an 8x8 matrix and scale up. I know there are a lot of things im probably not even considering, which is why i'm posting here for some guidance. I was thinking of using a voltage regulator from the power source to the 5940s, but haven't accounted for the brightness drop over additional multiplex LEDs. Is there a way to remedy this, or would the best option be to split the display into a number of smaller matrices?

but haven't accounted for the brightness drop over additional multiplex LEDs. Is there a way to remedy this,

The simplest way is to increase the current as most LEDs can withstand a higher pulse current than continuous current. However, you then run the risk that if the multiplexing stalls for any reason your LEDs burn out.

Have you seen my page on the subject?
http://www.thebox.myzen.co.uk/Workshop/LED_Matrix.html

Haha, i've seen most of your other pages but not that one, oddly enough. I'll have to study it more closely but it looks like what I need to design a transistor switch for the rows.

Does the 5940 have a maximum amount of current it can pull and sink to the LEDs or could I theoretically hang 10+ lights off each pin and provide a high current for minimal brightness drop over the array?

but not that one, oddly enough.

It only went up a few weeks ago.

Does the 5940 have a maximum amount of current it can pull

Yes 120mA with a 5V supply. But running that much could lead you to power dissipation problems if you have a high anode voltage.

could I theoretically hang 10+ lights off each pin

No, it's a constant current output so you can't wire LEDs in parallel, they won't share nicely. You can put several in series but there is a maximum of 17 volts for the anode supply. You can get higher if you use a fet, look for (google) application note SLVA280.

I'll draw up a crude schematic to see if i'm on the right track with my thinking and post it here later today.

CrossRoads:
Need to find some nice logic level P-channel MOSFET with low Rds (for example, if had 25mOhm Rds, then will dissipate ~40mW when turned on).

I don't know why, but MOSFETs with Low Rds that will run cool are pricey and have largish Gate capacitance:
http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=MTP50P03HDLGOS-ND

Those look nice, but very expensive...would I be able to get away with using something like a ULN2803 to switch the anodes?

would I be able to get away with using something like a ULN2803 to switch the anodes?

No they only sink current you need something that will source it, these are sometimes called a high sided driver.

The TLC5940 is nice, but pricey and has limited total power and current capacity. You might want to look at the shiftpwm library, http://www.elcojacobs.com/shiftpwm/. It claims to handle up to 768 LEDs from one Arduino. With some modifications, you could change it to use 4:1 multiplexing, reducing the number of shift registers and series resistors you need by a factor of 4. However, it appears to me that to stay within the ratings of the 74HC595 (i.e. 70mA through the ground or Vcc pin), you would need to buffer each output of the shift register using e.g. a 2n7000 mosfet or a bipolar transistor and base resistor (a ULN2803D might also be a possibility, but the higher saturation voltage makes it harder to get the LED current right).

To switch the anodes, if you're looking at 4:1 multiplexing with nearly 800 leds, then you have nearly 200 leds per switch, which is 4A if you drive them at 20mA. The mosfet suggested by CrossRoads would be ideal - they're a bit pricey, but you'll only need 4 of them.

your post is the answer to my prayers! I had originally purchased about 100 595s for this project but, unfortunately, did not do enough research and came to the conclusion that the arduino CPU didn't have the power to control upwards of 500 LEDs through the shift registers. If this library works it would be awesome! Could you please explain what you mean by 4:1 multiplexing and what sort of modifications would be necessary to achieve it?

Say you have 640 LEDs. The straightforward solution with shiftpwm would be to use 40 shift registers, giving 40x16 = 640 outputs. You would need a separate driver transistor or mosfet (unless you run the LEDs at very low current) and LED series resistor per output.

Using 4:1 multiplexing, you would use just 10 shift registers, giving 160 outputs. Each output, driver and series resistor would be connected to the cathodes of 4 LEDs. The anodes of those LEDs each go to a different column line. So each of the 4 column lines is connected to 160 anodes. The 4 column lines are driven high one at a time by 4 P-channel mosfets.

To program the display, you start by activating the first column signal. Then you use shiftpwm to control the 160 LEDs connected to that column, for 1/4 of the frame time. Then you deactivate that column signal and repeat for the second column; and so on.

So in this example, multiplexing costs you 4 P-channel mosfets and reduces the brightness, but saves you 20 shift registers, 480 low-side drivers and 480 series resistors. It should also make wiring the LED matrix easier.

Alright I think I follow. I was under the impression that for multiplex matrices the transistors/resistors were only necessary from the output pin of the shift register to each row/column, not each individual LED. That seems to be incorrect, so what exactly is the correct method for wiring a matrix like this?

Also why 40X16 if each register has 8 outputs?

I'm playing with the shiftPWM library right now on a couple individual LEDs right now and it's awesome. thanks for the link!

There is a thread for ShiftPWM(http://arduino.cc/forum/index.php/topic,66988.0.html). Near the end is a library that he has released in that thread for using the same shifting technique for a matrix (ShiftMatrixPWM). I am waiting on more hardware to be delivered to do further testing but so far it seems to support up to 1024 LED's. This can be achieved in a 64x16 Matrix at 50Hz with 32 levels of brightness.

Not sure if this is helpfull to you. As I am not sure how you are trying to configure your matrix. But it uses the same internal controls as the ShiftPWM system. To get the above 64x16 matrix would be 2 x SR's for rows and 8 x SR's for columns. In the setup I am making I will be using MBI5026 chips which are 16-channel Constant current sinks but use the same serial input.

mschn:
Alright I think I follow. I was under the impression that for multiplex matrices the transistors/resistors were only necessary from the output pin of the shift register to each row/column, not each individual LED. That seems to be incorrect, so what exactly is the correct method for wiring a matrix like this?

That is correct, however the rows and columns we are talking about are the number as treated for multiplexing. Using a 4:1 multiplex, you have 4 columns and 160 rows to get 640 LEDs. So 160 transistors and LED series resistors. As Mike says, if you go for more than 4:1 then maintaining sufficient brightness is a bigger problem.

mschn:
Also why 40X16 if each register has 8 outputs?

My mistake, I was forgetting that the 74HC595 has only 8 outputs, not 16. So it should be 80x8 in the non-multiplexed case, or 20x8 if using 4:1 multiplexing.

Just a note of caution, the author of the shiftpwm library has only tried it physically using 10 shift registers. If you want to extend it to the maximum the software will support you are going to have to buffer the clock and latch signals with say one buffer driving every 10 shift registers.

Does anyone know if his numbers listed for maximum outputs are treating each RGB as one output or as the R G and B separately?

I think i'll be able to multiplex an array using 4:1 multiplexing and under 10 shift registers, however the number of LEDs may still be pushing 700, so i'm not sure whether or not that would required a buffer(?).

I'm in the process of drawing up a schematic for my circuit that i'll post here if someone would be willing to look over it for me.

I've attached a rather crude drawing of how i'm envisioning this circuit.

The transistors supplying the columns will be those suggested by CrossRoads (http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=MTP50P03HDLGOS-ND). I didn't show in the drawing but assume that the 595s are wired correctly for input from the arduino.

Am i on the right track with this?

I think what you're after is this. I show it connected to the SPI pins with individual CS/latch lines for fast access to every register using:
digitalWrite(CSreg1, LOW);
SPI.transfer (reg1, data1);
digitalWrite(CSreg1, HIGH);

repeat 8 times...
(add pullups to SCL (clear), and connect G(output enable) to ground.
write the 8 vertical bytes, put out +5 from the MOSFET, on to next row ...

Does anyone know if his numbers listed for maximum outputs are treating each RGB as one output or as the R G and B separately?

Each output is a separate colour component.

Mschn - you need PNP transistors for the multiplexing switchers, connecting NPN in an emitter follower mode is not going to cut it.