Vous êtes sur la page 1sur 5

LED Matrix Scanning

Functional Description

LED matrix displays provide flexibility to display text, graphics, animations, and video, and
therefore, they have become a popular mean of displaying information these days. You can see
them at gas stations displaying the gas prices, or in the public places displaying information, and
alongside highways displaying advertisements on large dot matrix panels. In a dot matrix display,
multiple LEDs are wired together in rows and columns. This is done to minimize the number of
pins required to drive them. For example, a 8×8 matrix of LEDs (shown below) would need 64
I/O pins, one for each LED pixel. By wiring all the anodes together in rows (R1 through R8), and
cathodes in columns (C1 through C8), the required number of I/O pins is reduced to 16. Each
LED is addressed by its row and column number. In the figure below, if R4 is pulled high and C3
is pulled low, the LED in fourth row and third column will be turned on. Characters can be
displayed by fast scanning of either rows or columns. This tutorial will discuss the method of
column scanning.

Structure of a 8x8 LED dot matrix

Consider a LED matrix used is of size 5×7. We will learn how to display still characters in a
standard 5×7 pixel format. The figure below shows which LEDs are to be turned on to display
the English alphabet ‘A’. The 7 rows and 5 columns are controlled through the microcontroller
pins. We will first select the column C1 (which means C1 is pulled low in this case), and
deselect other columns by blocking their ground paths (one way of doing that is by pulling C2
through C5 pins to logic high). Now, the first column is active, and you need to turn on the LEDs
in the rows R2 through R7 of this column, which can be done by applying forward bias voltages
to these rows. Next, select the column C2 (and deselect all other columns), and apply forward
bias to R1 and R5, and so on. Therefore, by scanning across the column quickly (> 100 times per
second), and turning on the respective LEDs in each row of that column, the persistence of vision
comes in to play, and we perceive the display image as still.
The table gives the logic levels to be applied to R1 through R7 for each of the columns in order
to display the alphabet ‘A’. Row values of each column for displaying the alphabet A

Scanning across the columns and feeding with appropriate row values

You should have noted that across each row, one pin is sourcing the current for only one LED at
a time, but a column pin may have to sink the currents from more than one LED. For example,
the column C1 should be able to sink the currents from 6 LEDs while displaying the alphabet
‘A’. A microcontroller’s I/O pin cannot sink this much of current, so external transistor arrays are
required. Here it’s using ULN2803A IC which has eight built-in Darlington transistor arrays
(below image). The inputs of ULN2803A are active high. This means the input pins must be
supplied with logic high in order to bring the corresponding output pins to ground. The
schematic of the Darlington transistor array inside the ULN2803A chip is shown below.
Pin diagram and schematic of ULN2803A (Darlington transistor arrays)

Circuit Description
Here in this project, the Column side is used to source the current and the ROW side used to sink
the LED current. Eight 220R resistors are connected in series with columns C1 through C8 to
limit the current through the LEDs. Then these columns are driven by QA through QH pins of
74H595 serial to parallel shift register. The rows are connected to the eight outputs of ULN2803.

The corresponding eight input pins of ULN2803A IC are controlled by P1.0 through P1.7 pins of
8051 microcontroller. The microcontroller will, therefore, scan across the row by sending
appropriate bits to PORT1. For example, setting P1.0 to 1 and clearing P1.1 through P1.7 bits,
will select the first row. The microcontroller will wait for about 1 ms before switching to the next
row. At each row, the microcontroller will output the corresponding column value through the
74H595 serial to parallel shift register to turn on the appropriate LEDs in the column that are
required to display the specific character. The switching between rows is fast enough to deceive
the human eyes and a steady character is displayed.

In this project, it’s requiring a mono-color LED matrix display board that consists 256
LEDs arranged in 8 rows and 32 columns. The heart of this display unit is a P89V51RD2 (a 8051
variant) microcontroller which receives data from the Master Unit through a Zigbee Wireless
medium and display on the LED matrix with the help of 4 74HC595 shift registers.

Four, 8×8 square LED display modules are arranged in a linear fashion to construct an 8-
row X 32-column display matrix. They are common-row-cathode type, which means the
cathodes of all the LEDs in each individual row are interconnected, and therefore each row pin is
supposed to sink currents from eight LEDs in that row. The similar row pins of all 4 modules are
further connected together and are fed to the the output sinks of an ULN2803 IC, which consists
of 8 Darlington arrays. Now each output pin of ULN2803 is a sink for 32 (=8×4) LEDs in that
particular row. Since ULN2803 can sink current up to 500 mA per pin, the current per LED is
limited to 500/32 = ~15 mA.

The anode terminals of LEDs are accessible through column pins. Since we are going to apply
row scanning technique each column pin needs to source current for only one LED, as only one
row is active in that column at a time. The columns are driven by the outputs of a 32-bit serial-in-
parallel-out arrangement constructed by cascading four 74HC595 ICs. The 74HC595 device is an
8-bit serial-input and parallel/serial output shift register. The serial output feature allows
cascading of multiple 74HC595 devices. From engineering point of view, 74HC595 may not be a
good choice as column drivers because they are not meant for sourcing current for LEDs. But
several experiments have shown that they can drive LEDs reasonably bright, and therefore can
be used as column drivers in an LED matrix project like this.

The microcontroller used in this project is a P89V51RD2 (a 8051 variant). PORT1 provides
ground path for individual rows (cathode) through the ULN2803 darlington pair array, whereas
P3.4,P3.5 & P3.6 pins are used to control the Data, SH_CP, and ST_CP lines of the cascaded
shift registers. For the display data transfer a Zigbee wireless module is connected to the
microcontroller’s UART RX & TX (pins 10 & 11) which saves the received information into the
I2C based EEPROM .
74H595 for Controlling 32 LEDs in the Column with 3 pins
The 74HC595 shift register has an 8 bit storage register and an 8 bit shift register. Data is
written to the shift register serially, & then latched onto the storage register. The storage register
then controls 8 output lines. The figure below shows the 74HC595 pinout.

Pin 14 (DS) is the Data pin. On some datasheets it is referred


to as “SER”. When pin 11 (SH_CP or SRCLK on some
datasheets) goes from Low to High the value of DS is stored
into the shift register and the existing values of the register are
shifted to make room for the new bit.

Pin 12 (ST_CP or RCLK on some datasheets) is held low whilst


data is being written to the shift register. When it goes High the
values of the shift register are latched to the storage register
which are then outputted to pins Q0-Q7.

The timing diagram below demonstrates how you would set the
Q0-Q7 output pins to 11000011, assuming starting values of
00000000.

Each 74H595 can control 8 LEDs. In order to control more (32 LED in this project) each
74H595’s Q7’(pin9) is cascaded to the next IC’s DS pin.

Vous aimerez peut-être aussi