LED Matrix

A friend of mine recently discussed building a display board using discrete LEDs. This display is to indicate different needs/desires for his paralyzed wife.  The board that my friend is building has ten rows of ten LEDs, each one being individually controlled.  This prompted me to discuss one way to design one of these types of status/output boards.  You can find more about the system that my friend is building at Chris Savage’s Savage///Circuits forum (the Savage Circuits forum has been closed, this thread was moved to ZappBot’s forum – http://zappbots.altervista.org/forum/viewtopic.php?f=20&t=133.)

Consider the matrix. Start off with a simple XY matrix with wires running horizontal (for the X axis) and more wires running vertical (for the Y axis.) Now, at each junction, connect an LED with all of the cathodes (the negative sides of the LEDs) connected to the Y axis wires, and the anodes connected to the X axis wires. (And, since a picture is worth a thousand words…)

Next, we will put some signals (positive and negative) onto these wires. Start off with all of the Y-axis wires tied to high and all the X-axis wires tied to low (ground) like this:

 Since current flows from low (negative) to high (positive) (remember, the only thing moving in an electrical circuit is electrons, which have a negative charge, they are attracted to a positive charge – “opposites attract”) and since current can only flow through a diode (including LEDs) from cathode to anode (against the direction of the arrow in the schematic symbol) then no LEDs will be lit – in this example.

Now, if we want to turn on one of the LEDs, we would simply reverse the charges on the X- and the Y-axis for the specific LED that we want to light.

Notice, in the picture to the left, how the second wire from the top has been changed to high, and the second wire from the left has been changed to low. The electrons (current) will flow from the “low” point, at the bottom of the picture, up the wire, and then will be attracted to the “high” on the other side of the diode. Since all of the other diodes have a low on their anode, the current will not be attracted to anything and will not flow through any other diodes. Since the current can flow through the diode in this direction, it will flow through and off to the high point on the left side of the picture. This idea may be expanded, pretty much, indefinitely; to give a matrix as large as you need.

OK, now that we have a matrix, where you can select an individual LED to turn on (and thus back off, too,) we need to be able to control the LEDs with a simple output port from a microcontroller (or computer.)

Consider the lowly 74LS154 – this is a 4-bit binary decoder (or sometimes called a 4-line to 16-line decoder.) You input a 4-bit binary number on the input lines, and one of the 16 output lines (the one corresponding to the binary number that was input) goes low.  Jameco has a copy of the 74LS154 data sheet on their site at: http://www.jameco.com/Jameco/Products/ProdDS/46738FSC.pdf. If you prefer the CMOS 4000 series, you may also use one of the CMOS variants of this ‘154 chip (i.e.: 74C154, 74HC154, 74HCT154, etc.,) check the data sheets for specifics.  You can find the data sheet for the 74HC154 chip here: http://www.nxp.com/documents/data_sheet/74HC_HCT154.pdf.

Now, if you expand the matrix out to 10X10 (100 LEDs, like in your L.I.S.A. panel) and take the outputs from the ‘154 and run them to the bottom of the matrix you will have a ready made circuit for half of your display (remember that each output is high unless selected by the number which you input,) the Y-axis lines. The X-axis is only slightly more complicated: each output line of the ‘154 is high unless selected – we need just the opposite: we need active high, and low if not selected. Enter the inverter:

Whatever is input to this gate is inverted (hence the name.) In other words, if you input a high, then the gate outputs a low, and vice-a-verse. Take each output from the X-axis ‘154 and run it through an inverter and you have the left-side inputs to the matrix. The 74LS04 (data sheet: http://www.jameco.com/Jameco/Products/ProdDS/46316FSC.pdf, or CMOS 74C04 – data sheet: http://www.nxp.com/documents/data_sheet/74HC_HCT04.pdf) chip has six of these inverters on each chip. Thus, two of the ‘154s and three of the ’04s (for a total of 5 chips) will give you the drive needed for your 10X10 matrix. Also, since the ‘154 has chip select inputs, you could expand the display to 16X16 (or 256 LEDs) by not selecting the chips when you want all of the LEDs turned off.

With two 4-bit output ports, one going to each ‘154 you can control each individual LED in a 10X10 matrix by using numbers of 10 (1010b) or higher for the inputs (off the matrix) to turn all LEDs off, and then outputing the specific X- and Y-axis numbers to turn a LED on. If you repeatedly output two or three (or more) sets of numbers, you can fool the eye into believing that multiple LEDs are on at the same time. This is how a television works (at least the old CRT types, I’m not too sure that all of the newer ones work the same) only one pixel is on at any given time, the screen is “refreshed” (redrawn) fast enough that your eyes believe that the picture is totally present.

You will need to be careful about the current that you draw through the LEDs. If you put a 220 ohm (could be up to 470 ohm, pretty loose requirements) resistor on each X-axis line, between the matrix and the inverters, that should take care of most LED requirements (with a +5V supply.)

Leave a Reply

Your email address will not be published. Required fields are marked *