16x16 Display

I started playing with an Arduino Uno and electronics in general about a week ago, having no experience with hardware or circuits. After testing various sensors and lighting some LEDs, reading lots of forum posts and guides, I managed to get an 8x8 LED matrix to work using two 74HC595 ICs and software multiplexing. I am mostly interested in the digital logic part, and learning about shift registers and multiplexing has been fun. (I have some experience with programming and should be able to handle that part.)

I would like to make a 16x16 display next, using four 8x8 matrices. The ones I am thinking of buying (http://elektronik-lavpris.dk/files/sup2/M2881SURWAS530A2.pdf) are common cathode. I would like to know what other components I will need. I have read enough different suggestions for other people with similar projects to end up rather confused: What are my options? What do you recommend?

I currently have four 74HC595 chips and some different components (resistors and a couple of transistors, diodes and capacitors). I have not been able to find the apparently superior TPIC6B595 chip for purchase (in Denmark), so for shift registers I am stuck with the 74HC595.

What kind of component (transistors?) do I need to manage the power? I used eight 220-Ohm resistors for the 8x8 matrix -- is that resistance okay for this project? Is there anything else I will need? And assuming the USB-powered Arduino cannot provide enough current for the 256 LEDs, how can I interface with a wall outlet? Can I solve that problem by powering the Arduino with a power supply (say, http://www.let-elektronik.dk/3023-power-supply-12vdc-2-amp.html) instead of USB? As I said, I have very little experience with circuits/electricity.

Finally: say I wanted to display the time and date on my display. Would I need a dedicated IC -- if so, can you suggest a few models? Would it affect anything in the matrix circuit? And would a few simple buttons/switches and sensors connected to I/O pins affect anything (mainly in regard to power calculations)?

Any help will be greatly appreciated.

They may be called "common cathode" but you can always swap rows and columns to make then common anode.

In a matrix there are rows that are enabled one at a time and columns that are enabled in patterns. Since each column will only have one lit LED at a time you can connect them through a current limiting resistor to a shift register pin. Since rows will have multiple LEDs on you will probably need a transistor to drive more power. If you power the array with 5V you can use either a PNP transistor on the Anode side or an NPN transistor on the Cathode side.

The ShiftPWM library (http://www.elcojacobs.com/shiftpwm/) will give you brightness control over each LED.

One way is to wire up your 4 Common Anode matrixes

like this.
A typical way to drive them would be:

  1. Set up the the 16 cathodes High or low, from the output of 2 74HC595 shift registers for example.
  2. Turn on the anodes for 1 row briefly, like for 1mS. This could be 16 LEDs driven if all cathodes are low, so the PNP transistor driving the row must be capable of sourcing 320mA.
  3. Repeat 1 and 2 for the remaining 15 rows.

If 4 shift registers are used, then 4 SPI.transfer() commands can be sent out very quickly with the data.

If you prefer to rotate the matric 90 degrees, the process is still the same. Set up the cathodes, drive an anode. Repeat.

Not all resistors to the bases of the transistors are shown, but they are required.

The cathodes are only sinking current for 1 LED. The 16 anodes in a row are all sourced together.

Alternate method: Sink 1 cathode, drive 1 anode. Repeat for the remaining 255 LEDs. I think you can see which method would be quicker.

Thanks to both of you for the advice! I will definitely look into the ShiftPWM and SPI library when it comes to programming.

For my 8x8 matrix, I had two cascading shift registers. Can I extend this to four cascading chips, meaning I still only use three output pins on my Arduino? Is that the way to do it?

What kind of NPN/PNP resistors should I be looking at? (It seems there is a lot of them.) A..-, B..- or 2N..-family transistors, or am I on the wrong track entirely? Are transistor arrays rather what I need? I would appreciate a few model numbers that would work for my purposes.

CrossRoads: the schematic seems to suggest transistors for both the rows and the columns. Is that correct? Do I need 32 transistors and 32+16 resistors?

Use PNP transistors for to switch +5V to Anodes or use NPN transistors to switch Cathodes to Ground. You only need them on the lines that will have more than one LED lit at a time. If you turn on a row of 16 LEDs at a time you need to drive that row with 320 mA (20 mA * 16) so you need a transistor that can switch 5V at 320 (or more) mA.

Yes, you should cascade all of your shift registers. You can write to them much faster if you use the SPI hardware instead of data pins and shiftOut().

You could use UDN2981 + 74HC595s in place of the PNP transistors/base resistors.
You could use 74HC595s in place of the NPN transistors/base resistors.

You still need the 16 resistors that connect to the cathodes.

74HC595 is only good for 70mA total package I believe, select resistors that will limit current per LED to 8mA.
If that is not bright enough, switch to TPIC6B595 so you can go full 20mA/LED and 160mA per shift register.

Or NPN transistors controlled by 74HC595 as you said you cannot obtain TPIC6B595.

Isn't this Denmark?

I don't know how that price compares for you. Perhaps 16 of 2N2222 type transistors/270 ohm base, or two ULN2803 is a better cost arrangement for you.

UDN2981

ULN2803

74HC595
http://dk.farnell.com/stmicroelectronics/m74hc595b1r/ic-logic-74hc-register/dp/1607847
NPN 2N2222, qty 10

NPN BC546, qty 5

PNP, qty 1- 320mA, needs to support more current than the NPNs
http://dk.farnell.com/stmicroelectronics/stx817a/transistor-pnp-to-92/dp/1542212

Yes, 2 UDN2981s, or 16 PNP transistors are needed to control the potential 320mA current sourcing to the anodes. No matter what you do on the cathodes.
http://www.allegromicro.com/en/Products/Motor-Driver-And-Interface-ICs/High-and-Low-Side-Drivers/UDx2981-2.aspx
Little more complicated than just an array of eight transistors, but, functionally just an array.

On the cathodes, ULN2803s as current sink buffers are needed with 74HC595 due to '595 total current limitation. Or 16 transistors.
http://www.ti.com/lit/ds/symlink/uln2803a.pdf
Same thing - little more complicated than just an array of eight transistors, but, functionally just an array.

Cathode current limit resistors needed no matter what to avoid burning out the LEDs.

I know what you mean about coming from overseas - I ordered some Newark (Farnell) parts that came to the US from England, cost me extra as well.

As I understand it, I can choose between putting two UDN2981 chips (or equivalently 16 PNP transistors) on the anode side or putting two ULN2803 chips (or equivalently 16 NPN transistors) on the cathode side. Is that correct? Is one option superior to the other -- and why? The ULN2083 chips are certainly less expensive. Are the two chips really just arrays of (eight) transistors in a more convenient form?

CrossRoads: I appreciate the links, I seem to have missed that site in my component search. That being said, the TPIC6B595 in particular is being shipped from a US partner company (which means import taxes and delays associated with our customs department).

Okay, I intend to go with the UDN2981+ULN2803 solution: The output from two of the four cascaded shift registers go through the two UDN2981s and connect with the LED anodes. The output from the other two shift registers go through the two ULN2803s, then through 16 resistors and finally connect with the cathodes. Is that the correct idea? And all components are powered by 5V from the Arduino, which is powered by a computer via USB?

Assuming the LEDs expect 2V power (as per these 8x8 matrices: http://www.let-elektronik.dk/60mm-square-8-8-led-matrix-red.html), what value of resistance should the 16 resistors have? Are 220 ohms about right?

5V - 2V = 3V
3V / 220? = 0.013A (13 mA)

That would be good. You could go as low as 150? (20 mA).

The math could be improved:
The UDN2891 has some voltage drop across it, 1.6V typical
the ULN2803 has some voltage drop, 0.9V typical,
the LED, 2.0 typical.
5 - 1.6 - 2 - 0.9 = 0.5V/20mA = 25 ohm. Typical.

Except the UDN2981 and ULN2803 could also be less, as the typical #s are for 100mA and not 20mA, and the same for the LED.

I would get a 100 ohm pot, connect one leg to a cathode, the wiper to a (digital volt meter) DVM in mA current mode, the other DVM lead to a ULN2803 pin.
Connect UDN2981 to 5V and the ande of the same LED.
Get your meter reading current, dial the pot resistance down to where you're reading 10mA, if not bright enough try 15, don't go past 20 tho.

When you get the current you like, take the pot out and measure resistanc of the leg/wiper you had connected, and then find resistors that are close.

For my peace of mind when ordering the parts, please confirm that the description in my last post sounds like a reasonable setup.

I understand the 220 ohm resistors will likely cause the LEDs to be very dim, but is that the worst that can happen? I like the idea of testing with a potentiometer, I will try that when I have the chips. (If I can find a cheap DVM.)

I confirm.
As you state, worst case the LEDs are dim.
Resistor are cheap, order 25 of several values so you are ready to go when you confirm the value you need.

Here's a nice inexpensive meter, these guys are around.

Good, I will order the parts (including a bunch of different resistors in the 25-220 ohm range) tomorrow and get started. Thank you for the help!