Led Matrix Howto
Led Matrix Howto
Written by nuxie1
Monday, 15 January 2007
An 8x8 array
A 5x7 Display
An 8x8 Display
The most common colors are red, green and yellow. There are also two and three colored versions, with the different colored
LED's sharing a common pin in each row or column and a seperate pin for the corresponding column or row. This allows each
color to be turned on or off individually. When there are two or more colors, the LED's will share a common anode or cathode
(positive or negative respectively).
LED Matrix Information
Written by nuxie1
Monday, 15 January 2007
5x5 Schematic
Here we see that each row connects to that rows cathode or negative leg of the LED's. Correspondingly, each column connects
the anode or positive leg together. Please not that a LED matrix can also be the other way around.
Cycle through each row, turning on the LED's in that row as needed
Cycle through each column, turning on the LED's in that column as needed
It is not possible to control the LED matrix all at once, as all the individual LED's share both their inputs. The way around this is
to use Persistance of Vision. By cycling through each row or column quite fast (~50Hz and above) you should not see any flicker,
and instead see the whole LED matrix display as if it was all working at once.
If we were to choose the first of the two options, we would first ground the first row connection (connection ROW1) and leave
the remaining ROWX connections floating or high.
Then, we would pull each column connection high if we wanted that LED to turn on, or leave it floating or low to keep it off. For
example if we wanted to turn on LED3 and LED5, then with the ROW1 connection pulled low, we would leave COL1, COL2 and
COL4 floating or low, and pull COL3 and COL5 high.
Then after leaving ROW1's displayed LED's on for a set period of time, we would pull ROW1 high or floating and pull ROW2 low.
At the same time, we would pull the corresponding column connections high to turn on the individual LED's in that row.
But how do we control the switching off and on of these connections? The easiest way is with the use of a microcontroller or
microprocessor, as well as some additional circuitry.
LED Matrix Information
Written by nuxie1
Monday, 15 January 2007
When using larger displays, a microcontroller with even more output pins and current drive is needed. We can get around these
requirements by using some additional 74 series logic chips to go between the microcontroller and LED matrix.
A better way to select each row (or column) would be to use a decoder. For any size up to 8x8, a 1-8 decoder such as the
74LS138/74HC138 or 74LS155/74HC155 would do.
These logic chips can takes 3 inputs (A, B, C) from the microcontroller to select one of 8 outputs (Y0,..,Y7). For example,
sending '000' would select output Y0, and sending '100' would select output Y1, etc. Thus only 4 output ports are needed to
control and clear it. Note that this chip uses active-low outputs so when the output is active it corresponds to a low, with all the
other outputs kept high. Depending on how you are using this chip, you may need to use an additional chip to invert the output.
Also note that the current drive is very low, and so something like a darlington array may be needed.
Another option is to use a serial in, parallel out shift register. These work by clocking in 8 bits to set which outputs are on or off.
The 74LS164/74HC164 is a basic shift register which will cause the outputs to shift once each time a new bit is clocked in. This
can be offset by turning off the selected row or column while the new row or columns data is clocked in.
A better option is the 74LS595/74HC595 shift registers, which features an additional storage register so that the new output data
can be clocked in without effecting the previous output.
To use this chip, first you must clock in the required bits using the SER line, with the SCK line used for the clock input. Then once
all 8 bits have been clocked in, the RCK line is used to transfer the data from the storage register to the output register. Then
with the !G input pulled low to enable the outputs, the clocked in data can be used to control a connected LED matrix row or
column. The HC (High Speed CMOS) version has quite a high current drive capability, and can be used to drive a LED matrix
directly.
LED Matrix Information
Written by nuxie1
Monday, 15 January 2007
Each row is connected to an output of the bottom IC1. Each column is connected to an output of the top IC2. I have kept all the
inputs to the two chips seperate except for the enable line, although you could just as well connect the SCK, SCL and RCK inputs
on each chip together.
To use this circuit, you would need to connect the the left inputs to the output ports on a microcontroller. To display something,
you would first clock in the required data to both IC's using the Serial In and Ser_CLK inputs. One IC would have to be set to
turn on just one row or column, with the other set to turn on the required LED's in that row or column as needed.
Then that data would be latched to the output by using the Ser_Latch (RCK) inputs (one of which I forgot to show), and set
Ser_EN low to enable the outputs.
Then you would leave it display that for a small period of time (0.02 seconds for 50 Hertz) and then clock in the next row or
columns data, repeating the whole process.
LED Matrix Information
Written by nuxie1
Monday, 15 January 2007
I am currently working on a PIC18F2550 controller Green and Red LED Matrix display, using 74HC595 chips. Stay tuned for
more info on this.