large matrix using tlc5940 and 74hc595/uln2003A

I am actually planning to build 2 matrix 8x12 rgb. I was planning to do with using tlc5940 to drive the columns and some shifts registers 74hc595 for the rows (using uln2003). The schematic of what I am planning to do is attached to the post. It is a simple project (quite long yes, but simple in my mind) for two kind of board on a wall (plus a third one for arduino and all the associated electronics necessary (power supply or whatever).

I am planning of having several choices of animation on those matrix, include random color chases, an audio spectrum analyser as this onehttp://elm-chan.org/works/akilcd/report_e.html or anything else much or less related (color selection based on temperature, etc).

Do you see any flaws in the schematics (yes the rows and colomns are swaped and there is only 12 leds instead of 96, but beside that)?

Is an arduino uno is gonna be able to handle all this? Should I use a separated microcontroller such as the one used by rainbowduino to help arduino?

Thanks in advance

matrice_v0.pdf (21.4 KB)

Sorry this will not work. The 2003 chip will only sink current it will not source it. You need a high sided driver or a PNP transistor or P-channel FET to supply the multiplexed current. Also If you are planning to multiplex the TLC5940 greater than 4:1 then the LEDs will be very dim indeed.

I'm clearly new with electronics as you can see. Are darlington arrays always used to sink current (I guess that yes)?

What is the reason that makes the limit of 1/4 for multiplexing with tlc5940, as other would go up to 1/8? Would it be the same for the all the other alternatives?

Thanks!

Skipping the fact that the setup would clearly suck a lot of power, would using lot of tlc5940 to control individually each led simplify everything?

I also read from another post that using pwm along with multiplexing ain't such a good idea... any suggestion for driving large matrix (here 2 matrix of 96 rgb leds...)?

It is completely doable. Just pulled my coat out again to do some testing and improvements on it.

http://rgbledcoat.blogspot.com/

What is the reason that makes the limit of 1/4 for multiplexing with tlc5940, as other would go up to 1/8?

It is just in the experiments I have tried then the dimming of multiplexing gets too much at values over 4:1. Even at this value the LEDs are not nearly as bright.
PWM while multiplexing is perfectly possible as long as the multiplexing is synchronises to the PWM.

It is completely doable.

I agree it is doable, it's just not very good, unless you change your definition of good.

Grumpy_Mike:
It is just in the experiments I have tried then the dimming of multiplexing gets too much at values over 4:1. Even at this value the LEDs are not nearly as bright.
PWM while multiplexing is perfectly possible as long as the multiplexing is synchronises to the PWM.

If you are using the same current for each LED as you would if they were always on, that is absolutely true. However most LEDs can accept a much higher current at 1/8th duty cycle without burning out and can therefore be sufficiently bright. For example, The LEDs in my coat are rated at 30ma normally, and 80ma at 1/10th duty cycle. I'm currently pushing about 50ma at 1/8th duty and have had no issues. In fact, I have had to drop the max PWM level in my code in order to reduce brightness on some patterns.

That said, I do think that ischbe should be looking at the technical specifications for each component he intends to use. Instead of the uln2003, or FETs, you could easily use just the Shift Register and some sufficiently powerful NPN transistors. I used TIP120s, but that was mostly because I had them on hand and they can handle 5A.

However most LEDs can accept a much higher current at 1/8th duty cycle without burning out and can therefore be sufficiently bright.

Yes I do know this (count the posts). There is also the problem of flicker with a lower duty cycle and the way it eats CPU time.

Aren't NPN transistor used to sink current? In my case the shift registers are used to source current, so if my understanding is good I do need a PNP... am I right?

I am thinking of using CSD25401Q3 as mosfet. Is it viable (seems to me)?

csd25401q3.pdf (387 KB)

Yes at a first look that FET looks fine for boosting the current sourced from your shift register. Remember that when you fit the FET then a logic zero will source current and a one will cut it off.

Damn, haven't look enough on the data sheet and just learned what is a SON 3x3 socket... Can't seem to find a socket for that (don't you know any?).

Actually looking for a standard TO-92 pnp transistor but I was trying to figure out what is the maximum rise up and fall down time that is recommended for this kind of application. Or is any of the pnp transistor going to fit?

Also, how can I calculate the typical resistance given that this I going to be 8 RGB leds grounded by the tlc5940? Do I use the maximum value? (20mA * 3 * numbers of leds?)

Hi there, I'm trying to do a similar thing as above posters.

I have an ebay 8x8 bicolor (R/G) LED matrix which is common anode rows, with separate cathodes for each color column (8 anodes, 16 cathodes). So i thought a TLC5940 should be perfect to drive the cathodes, with multiplexing for the rows. I've only got a little experience with the hardware/electronics side, but does this seem to be a good idea:

For SPI interface, the 595 and 5940 can share a bus, correct? The 595 will simply pass the first bits on to the TLC and keep the last 8 for itself.
Arduino =(MOSI)=> SIN 74HC595 SOUT => TLC5940

As far as current sourcing, I'm still a little flaky on the exact difference between NPN and PNP and why you'd want one over the other.
595 output (HIGH = turn this row on) => BASE of 2N3904 NPN transistor.
The Collector of this transistor will be connected to +5V
the Emitter of the transistor will be connected to the corresponding anode row of the LED matrix.
No current will be allowed through the transistor while its base is driven LOW by the 595.

Thus the 5940 will be able to light up any LED in that row by pulling the cathodes to ground in its own time.
Each shiftout will change the row data in the 5940 at the same time that we change the column choice in the 595.

Is my transistor theory correct?

As far as maximum current and duty cycle, I'd assume that worst-case, one entire row is on (20mA * 16 = 320mA) so the NPN needs to deliver up to 400mA 1/8th of the time, which the 2N3904 should be able to handle no problem, right?

As far as PWM goes, since this is only a Red/Green display I'm not trying to get 24-bit color :slight_smile: I'll tackle that part when I get to it.
Data clocking to the either 595 or 5940 can happen at basically maximum speed (16Mhz?) which should leave PLENTY of wiggle room for other software without introducing display flicker.

grumpy mike just said that for more than 1/4 the display will be muck dim, so you should maybe separate it in two...

I'm not worried about brightness--- as a prototype i've wired up just one color of the display (8 anodes / 8 cathodes) to a MAX7219 and it is plenty bright with the built-in 1/8 multiplexing that the MAX chip does. so my biggest question is simply about my transistor theory. is this the correct method of utilizing an NPN transistor? note that i've got zero formal electronics training, I just soak up internet info like a sponge :slight_smile:

Arduino ==> 74HC595 ==> BASE of (2N3904 NPN) COLLECTOR <== +5v
v
EMITTER ==> ANODE (LED ROW) CATHODE ==> TLC5904

will this produce the necessary current sourcing for the LED row? Arrows should show direction of conventional current flow.

also just surfing internet for the infos, but I guess you need a pnp, as npn is for sinking the current as I do understand

I just soak up internet info like a sponge

Pity you have not soaked up any information about:-

  1. Resistors - you need them to limit base current.
  2. The difference between a common emitter and common collector circuit.
  3. The use of PNP transistors in place of NPN transistors.
    Apart from that - spot on.

Grumpy_Mike:
3) The use of PNP transistors in place of PNP transistors.

NPN in place of PNP?

Yes sorry, original post corrected.

  1. resistors had slipped my mind. would 10k be appropriate for limiting base current?
  2. what is the difference between a common emitter and common collector circuit? why exactly must NPN transistors sink current while PNP source it? my limited understanding of electrical theory was that current is current regardless of the exact physical distribution of the load. what's the reason for the difference between the following:

Vcc--switch--load--ground
Vcc--load--switch--ground

  1. so you say PNP should be used... what would be the correct implementation?

74HC595 (output active low) <== 10kR <== BASE (PNP transistor) EMITTER <== +5V
V
COLLECTOR ==> ANODE (LED) CATHODE ==> TLC5940