Ozirock's Projects

"A person who never made a mistake never tried anything new" - Albert Einstein

LED Matrix

Members Area




Useful Tools



Recent Videos

2795 views - 0 comments
2319 views - 0 comments
2253 views - 0 comments

Newest Members




What is an LED Matrix?

An LED matrix is a form of dot matrix display based on LEDs. To control 5x7 LEDs would take an awful lot of transistors and a microcontroller with an awful lot of pins to control however this is not the case. In an LED matrix the cathode legs of the LEDs are connected to create rows and the anode legs are connected to create columns or vice versa depending on the orientation you happen to be looking at it in. This means that by connecting one column of anodes to your positive and one row of cathodes to ground you can light one LED i.e. the one where the row and column meet. As can be seen in the image below


Sounds great so you try to wire up a character for example "A" and you get a rectangle, disaster!! Well not really all you need to do is turn one LED on at a time but do it so fast they they never appear to go off at all, simple.

This is all great but how do I figure out my resistance values for my LEDs in each row or column to prevent them being at different brightnesses? Well that is actually very simple, because only one LED is ever really on a any given time you simply design for one LED. You can find a nice tool I like to use for this here

Getting the frequency right

An important factor in designing your LED matrix display is to make sure the LEDs are flashing so fast that the human eye can't detect them. Anything over 50 Hz should be okay but the faster you can manage the better. The main thing to remember though is that the frequency is how many times each row turns on and off in a second (or column depending on your code). As an example if you have 5 rows and each has a 10ms delay that means you have a period of 50ms or 0.05s therefore frequency is 1/period meaning refresh rate is 20Hz and will most likely flicker visibly.

Wiring it up to a microcontroller

This again is no more complicated that wiring up to an individual LED except you have to control the cathode side of the LED also. I would usually switch an LED on and off using an NPN transistor between the cathode and ground and usually a 1k Ohm resistor between the base and the output pin of the PIC microcontroller (just happens to be the microcontroller I use, any will do). On the anode side for this I would prefer to use a PNP transistor between the anode and the positive line, you could just power it straight from the pins if the current drawn wasn't greater than 20mA but I'd prefer to use the transistor and I would suggest you do the same, transistors are a lot cheaper than microcontrollers. The matrix I got for this is a Knightbright TA12-11GWA in which the LEDs have a max forward current of 20mA which is just on the limit of the PIC capability but its up to yourself. 

Here is the diagram for a serial LED matrix driver which I should be creating soon enough and when I do I'll post a video of it in action here. I think it will come in handy for making a voltmeter with an LED display in future or a scrolling message. This should give you an idea of how I would wire it up. 


Serial LED matrix driver

Click to view full size 

More to come

I should have a video and a wiring diagram up when I get time, if you have any questions not answered here please ask in the forum and I can update this page,  thanks.