Discuss this article in the Nuts & Volts forums at http://forum.nutsvolts.com.
the LED at that intersection lights up. Don’t do that quite yet,
however, because we still need to add in a bit of support
circuitry; if nothing else, some current-limiting resistors.
For reference, I’ve shown the pin numbers for the device
I’m using. In general, it’s probably more logical in what
follows to call out the rows and columns. Just refer back to
Figure 1 when wiring things up. Of course, if you’re using
another unit, then the pinout could be different and you’ll
need to refer to the appropriate datasheet.
The Basic Configuration
To turn this into a fully functional character display
requires just a handful of common external components.
Figure 2 shows a practical arrangement. Each of the rows is
fed by a current-limiting resistor, and there are seven of these.
The five columns, on the other hand, are controlled by
transistors. Here, we use the ever-popular 2N2222. Think of
these as voltage controlled switches. When a transistor is
turned on, the common cathodes of the selected column are
connected to ground and the chosen LEDs light up. We need
a transistor, naturally, because more than one LED in a
column could be lit. In other words, we might need to sink as
much as 70 mA (assuming 10 mA per LED), and the 2N2222
can easily handle that. Note, however, we must make certain
that only one column is selected at a time. More about that
in a moment.
To aid your understanding, you can breadboard this
affair as-is and test it by applying +5V to various row
and column select inputs. For example, by applying
+5V to resistors R1 and R8, the LED dot in the upper
left-hand corner will light. By the way, did you notice
that this arrangement responds to positive logic? The
transistors have the happy side-effect of inverting the
sense of things. That sure makes life simpler when
trying to sort out bit codes for user-defined characters.
While it’s instructive to see how this works with
jumper wires choosing a row and column, it’s pretty
obvious we’ll want to turn more extensive duties over
to a microcontroller. The currents required by the
matrix LED arrangement in Figure 2 are well within the
capabilities of most modern microcontrollers. Plan on
10 mA per row and less than 1 mA per column. Just
make sure that only one column is chosen at a time.
Otherwise, a row select line would be asked to supply
more than the requisite 10 mA, putting the
microcontroller at risk.
Figure 1. This is the LED arrangement and pinout of the
Ledtech Electronics Corporation LJ7071-22 LED matrix
display. Check your datasheet if using an alternative.
Connect It to a
I like designing with PIC microcontrollers, but the
logic of what we’ll be doing is much the same for AVRs,
Arduinos, and the like. Figure 3 shows how the
ubiquitous PIC16F88 can be pressed into service. With
a couple restrictions, there are essentially two eight-bit
ports at our disposal. Five lines of port A are used to
Figure 2. Drive this single-character display directly with the
PIC circuit of Figure 3. Port A controls the columns,
while port B controls the rows.
May 2013 43