Handling several 5x7 matrices

Hey there,

I'm currently planing a radio (DCF77) controlled LED clock with a friend of mine. Nothing totally new, I know. My "prototype" is working fine with the DCF BN 641138 receiver (available at Conrad), 3 5x7 Kingbright TC12-11HWA matrices controlled by 5 74HC595 shift registers (luckily I've never encountered lots of issues other people have posted here).

For the final design we want to display the current time using 4 big (something around 5-6 cm high) 7-segement LEDs and additional data such as the current date or signal health using a series of those 5x7 LED matrices. We are planing to use up to 16 of the small 5x7 matrices. Now we are running into the following 2 issues (and maybe more which are hidden to my rather limited knowledge of electronics):

  • The current drawn by such a big number of LEDs is way to high for the USB powered arduino. So I think of adding an external power supply but I don't know how. What external power supply should I use (voltage, current) and how do I connect it to my setup. My assumption is that I need a power supply with 5V voltage (in order to work with the 595) and current high enough for both the segement display and the LED matrix and use the appropriate current limiting resistor to avoid blowing up the hardware. About the wiring: I assume the ground of the arduino and the external power supply have to be the same. The arduino ist still connected to the latch, clock and data pins of the shift registers but the Vcc is taken from the external power supply?
  • The brightness of the LEDs of the 5x7 matrices is insufficient for bright lightning conditions. At the moment I use a 1/5 duty cycle for each of the 3 matrices, so a maximum number of 21 LEDs is on at a time. The brightness strongly varies if one LED or all LEDs are on. Is there a way to compensate this effect (either by software or hardware) without using the very expensive LED drivers like the MAX 7219 or equivalents? Buy 16 of them would be way to expensive for us.

I'd be glad if someone could give us some hints for the project and answer my questions and concerns :) If any further data about the used parts or the planned setup is necessary just ask for it.

Hawkes: The brightness of the LEDs of the 5x7 matrices is insufficient for bright lightning conditions. At the moment I use a 1/5 duty cycle for each of the 3 matrices, so a maximum number of 21 LEDs is on at a time. The brightness strongly varies if one LED or all LEDs are on. Is there a way to compensate this effect (either by software or hardware) without using the very expensive LED drivers like the MAX 7219 or equivalents? Buy 16 of them would be way to expensive for us.

Your datasheet for the 5x7 matrix states that the LEDs have a luminous intensity of 1400 ucd (pico candela) at 10ma. A decent LED like these is 15000 mcd (micro candela) at what I assume is its 30ma rating. In other words, it's not so much your power but rather your LEDs.

I'm not suggesting it would be fun to wire up 16 x 5 x 7 discrete LEDs but rather that you should shop around for a different matrix to use.

First of all, thank your for your reply.

This would definitely increase the overall brightness but would not solve the inequal brightness problem.That is not that a big problem and shouldn't be that visible with a higher luminous intensity.

This leaves me with the problem of the higher overall current. Do you have some rough guidance for me how to establish a proper external power supply for the LEDs while still using the 74HC595. In fact I'm willing to replace the 595ers but LED driver ICs are still no option for me as the required number is way too high (and so is the price of about 6-7 € each).

The brightness strongly varies if one LED or all LEDs are on.

This is almost certainly due to the circuit you are using, can you post a schematic so we can see where you went wrong.

Hi,

I've build a schematic with fritzing.

As fritzing doesn't have LED matrices in the size I'm using I've left 'em out. The matrix pins are connected with the shift register outputs in now specified order. I've connected them in a way to keep the wires as short as possible and least confusing.

The latch pin (arduino pin 7) is connected with all ST_CP pins on the 595ers. The clock pin (arduino pin 8) is connected to all SH_CP pins on the 595ers and the data pin (arduino pin 12) is connected to the DS pin of the first 595er and the Q7' pin of the first 595er is connected to the DS pin of the second 595er and so on. OE is connected to ground on all 595ers and MR to high (+5V) on all 595ers. I've left those ports out on the schematics.

DCF77-Schematics_Steckplatine.svg|0x0

Can you do a real schematic, one where you don't have to have a toy program to read it. Can you dump it out as a jpeg? It is a schematic we need to see not a physical layout diagram.

I can export it as JPEG if you want (Is SVG a problem?). I still haven't found an easy to use editor which has all the components I need. I can handdraw it, if that helps ;)

The wiring is as described in my last post. Nothing special. Wires from the 3 arduino pins to latch, clock and data. MR to +5V and OE to ground. The other pins are simply connected to the matrix pins. Nothing magical.

The "toy" program also does the schematic and an board layout (yeah, not perfect, but still ...)

Anyhow, Hawkes; click on the "schematic" tab on the top and you get the box and line drawing that GrumpMike needs to comment. You may want to use PDF as the export file format.

Is SVG a problem

Well that file you posted launched my SVG reader but showed nothing, so in this case yes it is a problem sorry.

I was able to read the SVG but as Grumpy mike said its pretty hard to understand esp since the chips aren't labelled :-) Try the schematic in fritzing, but if that does not work you know sometimes a good old pen and piece of paper is the fastest (take a photo of it). And sometimes you'll find your own error when drawing it out!

Cheers! Andrew

Okay, sorry :wink: I’ve created a schematics with fritzing now and attached it as PDF and JPEG.

It shows the wiring of the DCF77 receiver (which is working fine) and two shift registers. I’ve wired the first one completely except for the matrix (as there is no matrix part in fritzing) and connected the Q7’ pin to the DS pin of the second. This repeats for all 5 SRs, so i left out the rest. The single LED I’ve added is just a “placeholder” for the missing matrix. Each matrix has 14 pins of which 12 are connected to the SRs in no special order.

Schematics.pdf (457 KB)

Hi Hawkes,

In your schematic, Q1 sources the current to drive the LEDs and Q0 "sinks" it. This will work AS DRAWN, but in your OP you state that the problem is when more LEDs are on. The problem is that the 74HC595 can only "source" 35mA (try to find this fact in the spec as practice for future projects; hint its under table 4. Limiting values). So as soon as you are driving a few LEDs you are exceeding this maximum. Luckily for you instead of smoking your 595 it simply refused to give the current. However, you should consider the 595s you used to be "marginal" now -- if something wierd is going on, swap them out!

To figure out your max current, multiple the # of LEDs in a "row" by the current draw per LED. So for example I think you said 21 LEDs at 20ma = 420mA. The solution is to drive your "sources" through a power transistor that can deliver that current. It should be a "high side" (PNP or P-type transistor) so you can put your LED "load" on the cathode side. Something like the PNP TIP125 would certainly work (overkill). Or you can hunt for something smaller (750mA to 1amp would work fine). Search digikey for "PNP transistor".

You would connect the base of the PNP to a resistor then to the 74HC595. Connect the PNP to +5v and to each LED anode. Now it will work backwards in code... a "high" (1) or "high impedence" value is "off", a low value is on due to the nature of the PNP transistor (see wikipedia).

WRT your power supply, you can add your own linear regulator pretty easily. A 7805 will work for example -- just check its current rating as I forget off the top of my head. Or buy a "regulated" DC 5v wall wart power supply. This has the disadvantage that it won't power the Arduino through its Vin. But it will work directly through to 5v header, if you really trust that the power supply really is regulated!

Cheers! Andrew

Hi Andrew,

thanks a lot.

Now just one question: If I wire all the anodes to a NPN resister which base is connected over a resistor to the 595ers and cathode to +5V from the external power supply over the emitter to the LED anode (with another resistor to protect the LEDs) , do the cathodes go directly to ground? If yes, how do I control which column/row should be on or off?

I think I didn’t quite get your idea, sorry. Could you explain it a little more.

There is a great schematic system called pen and paper. That has the symbols for all components in in. You then photograph it and post it. But as Hawkes said, that is the wrong way to wire up a matrix, it simply will not work like that.

I offered a handdrawn ;) But my schematic above should be sufficient to see the problem.

Do you have another suggestion how it could work?

No if you are driving a matrix with a shift register you need to source a lot more current or sink a lot more current than you can with a shift register. So you need an extra driver in the form of a high sided drive. You can use PNP transistors or p-channel FETs to do this on each row driver.

@Hawkes: are you still confused or did the other posts help?

@grumpy_mike: I can't tell whose posts your comment that it would not work refers to... mine or the OP

I've understood the problem regarding the current and the SRs but I'm still confused with the correct wiring of the PNPs so I can control each LED of the matrix individually. Will this work for a higher number of matrizes?

so I can control each LED of the matrix individually

No you don't do this when driving a matrix, you connect all the anodes together in one row and drive that row with the PNP transistor. The point about a matrix is that you use fewer lines to control a lot of LEDs.

But my schematic above should be sufficient to see the problem

But it is not as we still don't know how the whole matrix is wired, four or five LEDs will suffice, but you have not drawn enough.