Help Hooking Up ULN2803 and 595s to 8x8 Led Matrix

I have a couple of ULN2803 and 595s, and a common cathode 8x8 single color LED matrix.

So far I think I should set it up like this:

But my concern is the current flow through 595 at the top if I turn on all LEDs in a row since 8*20mA = 160 mA which is over the ~35 mA capacity of the 595.

Is this the right way, or is there a more common and easier way of hooking up the LED matrix with the components I currently have?

Thanks,
s3n4te

bump

Any help would be appreciated.

You can get some inspiration from here: http://timewitharduino.blogspot.com/2009/09/buy-led-matrix-shield-kit.html This is a shield for an 8x8 RG common-cathode LED matrix. It uses 2 595 shift registers and ULN 2803 darlington array. The above mentioned LED matrix can be easily replaced with 2 8x8 single color LED matrices, making it for a 16x8 display. Code for the above is available as well.

If the ULN2803 sinks 160 mA to light 8 leds, would that current have to flow through the top 595? Wouldn't that damage it?

is 160 > 70 ? (which is the average 595's total current, with 20-25ma per pin max)

side note, why is it everyone latches onto this one datasheet that seems to be the only maker of 74HC595's with 35ma per pin current? when every other model is more in line with every other cmos 74 series chip

I don't follow you Osgeld...

your sinking 160ma, is that greater than 70ma which is the average max current load a 595 can take (for the whole chip)

if yes then you have problems

(seriously you have answered your own question twice now)

So if I want to light all leds in a row, I have to turn them on really fast one at a time? If that is so, then what is the point of using a ULN2803?

Well, I think you’re discovering why they make LED driver chips now :slight_smile:

You need to replace the top '595 with eight P-channel MOSFET’s that can source high currents. Pulse the first column on (turn on the MOSFET). Then, shift in to the bottom '595 the rows that you want active. The ULN2803 helps because it can sink high currents (higher than the microcontroller can).

After a small amount of time (milliseconds) turn the second column on (turn the first one off of course). Then shift in to the bottom '595 the rows that you want active for that column. Repeat for all 8 columns.

This multiplexing method only has each LED on 1/8 of the time meaning it has to be 8x brighter than usual for the same average brightness as if it were just “on” all the time (hence the need for high instantaneous current).


Check out our new shield: http://www.ruggedcircuits.com/html/gadget_shield.html

This multiplexing method only has each LED on 1/8 of the time meaning it has to be 8x brighter than usual for the same average brightness as if it were just "on" all the time (hence the need for high instantaneous current).

I am not sure what you mean by that...1/8 of what time? Wouldn't the brightness depend on how fast you switch each column?

No, the brightness depends on what percentage of the time each column is on.

Let's consider some precise numbers. Suppose you switch from column to column every millisecond. Column 1 is on for 1 millisecond, then column 2 is on for 1 millisecond, etc.

It takes 8 milliseconds to go over all 8 columns. Then column 1 (or any column) is on for 1/8 of the total time.

Now suppose you switch columns every 10 milliseconds. Column 1 is on for 10 milliseconds, then column 2 for 10 milliseconds, etc.

Now it takes 80 milliseconds to go over all 8 columns, and column 1 is on for 10 milliseconds, so again, 1/8 of the total time.

Obviously you don't want to switch too slow else you will see the LED's flicker.

If you switch too fast then you're wasting power in the switching transistors and there is no point because the human eye can't really see flicker faster than 70 Hz or so (so 10ms would be a good switching time to start with).

-- Check out our new shield: http://www.ruggedcircuits.com/html/gadget_shield.html

So if the regular on brightness is drawing 20 mA, I would have to draw 160 mA per led to get the same brightness. Wouldn't that burn out the LED?

You have to make sure you're not exceeding each LED's absolute maximum rating. Otherwise no, having an LED draw N times the amount of "normal" current 1/Nth of the time is OK because it's the average power that's going to heat up the LED and kill it.

So if your LED can handle 160mA instantaneous current (better is 200mA for a little margin of safety) then yes, you can have it carry 160mA as long as it only does so 1/8 of the time.

-- Check out our new shield: http://www.ruggedcircuits.com/html/gadget_shield.html

Is Max Peak Forward Current the same as instantaneous current?

Yes. Keep to about 80% below that just for safety (higher if you're feeling lucky).

-- Check out our new shield: http://www.ruggedcircuits.com/html/gadget_shield.html

My leds have a Max Peak Forward Current of 75 mA. 80% of that is 60 mA. So does that mean that when multiplexing, the maximum possible brightness of the leds would be equivalent to an led with a constant current of 7.5 mA?

Well, really 6mA if you follow the 80% rule.

Otherwise it sounds like you've got it. If you want higher brightness you can double the number of '595's and turn on two columns at a time. Then each LED will be on 1/4 of the time instead of 1/8 of the time: double the brightness.

-- Check out our new shield: http://www.ruggedcircuits.com/html/gadget_shield.html

What do you mean by double the 595s? I thought p MOSFETs were to replace the top 595 so that it can source enough current for the column?

I mean one '595 for the first 4 columns, another '595 for the second 4 columns. Then, 2 columns out of the 8 would be on at any one time.


Check out our new shield: http://www.ruggedcircuits.com/html/gadget_shield.html