Mini project report on

4 Character 5x7 LED Matrix Display

Submitted by

Agarwal Vikas, MTech II, CEDT

K.Sreenivasulu M.E (Micro) II, CEDT


5 x7 LED matrix Display

A four (4) Character 5x7 matrix LED Display board with 8051 microcontroller and shift Registers has been designed. This product finds applications like Moving message sign, Message crawler, Scrolling message, message display, etc. A dot-matrix display contains 5x7 dots (LED’s), the LED’s are connected like a matrix with 7 rows of 5 LED’s per each row and 4 such matrix are designed on a board to display 4 characters. For a 4 character 5x7 LED matrix, it is impractical to assign one I/O pin per LED, as a four-unit, 5x7 matrix requires 35 x 4 = 140 I/O pins. Such a display scheme requires controller with large number of I/O’s, can cause higher power dissipation and is not easily scalable. Multiplexing can be used to reduce the number of I/O pins, with only a small increase in the external hardware, such as Shift Registers. By using the Shift register mode (mode 0 of serial port communication) of 8051 microcontroller and scanning the displays at faster rate, we can build LED matrix message display with less number of I/O pins. This idea is used in this design of 5x7 LED matrix Display. Common Anode display structure is used in this design, and the anode supply required for LED’s is switched through PNP transistors to select the appropriate matrix to display the given character. These 4 characters are switched continuously with a delay of 40msec. This design can be extended to number of units by using only 5 shift registers and a buffer to display a message consisting of many number of characters. By controlling the data bits connected to the LED’s, we can display any character. The idea of multiplexing is to switch the VCC for the common anode of selected matrix and set the data on the seven rows (for 35 LED’s) using 5 serial shift registers. The multiplexing frequency must be greater than 25 Hz else the LED’s starts to flicker. The scanning of matrix goes as follows, first set the rows data on the 7 rows by transmitting 5 bytes of data corresponding to the character to be displayed using microcontroller by operating it in Mode 0 of serial port communication (8 bit shift register mode). This data is latched on to the 5 shift registers and 35 output bits from this shift registers is connected to the 35 LED’s of each matrix. Then by activating ‘0’ control on the base of the selected matrix PNP transistor with rest other matrix transistor bases kept at logic ‘1’level we can display the given character. Now these selected matrix LED’s (dots) will lit, wait 40 msec, then switch off the selected matrix, now transmit the next character data (5 bytes), and set the second matrix ‘on’, wait for 40 msec again, and repeat the process for other characters. If you repeat this sequence very fast, you will see the 4 characters data appear on the display (refresh frequency 40 - 70Hz is sufficient). The idea is to let a text scroll over the LED dot-matrix displays. Each LED matrix is driven

for a brief period before switching to the next matrix. Because of a visual phenomenon termed persistence of vision, rapid switching between matrix produces the illusion that all characters are ‘ON’ at the same time. Each matrix must be updated often enough (30-40 times/sec) to avoid LED flickering. The same idea can be extended to scroll a character by building one character on the display and scanning the columns very fast, and let say each 20 times (20 frames) scroll it one position to the left, this will give the effect of a walking text across the dot-matrix display. So first build one frame, repeat this 20 times, and after that, read the data one address later, if you do this 4 times the character scroll from right to left on the display.
Hardware Description:

The Block diagram of 5x7 LED matrix is show in the figure. The four 5x7 LED matrix display with 140 LED’s are arranged in 7 rows and 5 columns structure named as display 1-4 as shown in the figure 1. The 35 data bits are provided through five-74F595 Shift Registers U2-U6. The first shift register U2 is fed with the RXD output pin from the external microcontroller board. The Qs output from U2 feeds the next shift register U3 and so on for I/O expansion in serial mode. All these 5 shift registers run through a same serial clock from TXD pin of the microcontroller. The latch clock, Reset signals required for the shift registers are derived through Port1 of microcontroller. For multiplexing these 4 displays the control bits C1-C4 are provided by another shift register (U7), with character control clock, character control data signals are derived through Port1 and this register uses the same latch signal of U2-U6 Ic’s. The displays1-4 are switched through 4 PNP transistors (Q1-Q4) controlled using C1-C4 control signals form the shift register U7. The 74HCT244(U1) octal buffer IC provides the required driving capability for the input signals. The board design is carried out in modular structure with 4 matrix displays, 6 shift registers, a buffer and two 9pin connectors (J1 and J2). Two connectors are used to cascade connection of multiple such boards to display large number of characters, J1 connector acts as input connector and J2 functions as output connector for such extension. Thus by using a single microcontroller with only 6 I/O pins we can construct a large character display board with this design. The PCB design has been carried out on a double layer board of size 22.5cm X 7.4 cm.
Software Description:

The software required for displaying 4 characters ‘CEDT’ on the LED matrix, with a delay between each character display has been developed in assembly of 8051. The hex code is downloaded on to the 89F51 microcontroller and is verified by interfacing the microcontroller pins to the J1 pins of the board. For any given character, a corresponding pattern of LED is generated and is used to display the character at run time. The equivalent data bytes required for the

display of ‘CEDT’ message were computed and stored at internal ram address and were transmitted sequentially by monitoring the TI flag of the SCON register. The TI flag is set at the end of each byte transmission. These 5 bytes are transmitted and latched on to the 5 shift registers. After latching the data, required character from the display matrix is selected through U7 shift register. Then a delay of 260 msec is programmed between the character displays. This entire process is repeated in an
infinite loop for continuous display of this 4 characters. The software program is listed.

; Software code for displaying 'CEDT' on a single 5x7 LED matrix . org 00h ; start code from reset location 00h mov IE,#00h ; Disable all interrupt mov SCON,#00h ; Mode 0 ; Lookup table for 4 charcter data at 50h location mov 50h,#00h ; 5 data bytes for character 'C' mov 51h,#80h mov 52h,#73h mov 53h,#0eh mov 54h,#00h mov 55h,#00h ; 5 data bytes for character 'E' mov 56h,#0fch mov 57h,#0fh mov 58h,#0feh mov 59h,#07h mov 5ah,#00h ; 5 data bytes for character 'D' mov 5bh,#78h mov 5ch,#0efh mov 5dh,#07dh mov 5eh,#07h mov 5fh,#060h ; 5 data bytes for character 'T' mov 60h,#0efh mov 61h,#0bdh mov 62h,#0f7h mov 63h,#06h loop3: mov r3,#04 ; set r3 counter for 4 to display 4 characters mov r0,#50h ; point r0 to the begining of lookup tbale at 50h loop2: mov r2,#05 ; set r2 counter to 5 for sending 5 data bytes/character loop1: clr P1.0 ; Make latch bit low clr SCON.1 ; clear TI bit of SCON register mov sbuf,@r0 ; transmit byte at location pointed by r0 wait2: jnb SCON.1,wait2 ; poll for TI bit to monitor the end of byte transmission inc r0 ; increment the data byte pointer clr SCON.1 ; clear TI bit of SCON register djnz r2,loop1 ; jump to loop1 for sending next byte setb p1.0 ; set the latch bit high

acall delay ; call delay loop between the display of characters djnz r3,loop2 ; jump to loop2 to display another character sjmp loop3 ; jump to loop3 to keep the display sequence infinite loop ; Delay subroutine delay: mov r6,#20 wait: mov r4,#255 wait1: mov r5,#255 here: djnz r5,here djnz r4,wait1 djnz r6,wait ret end

; 260 msec delay loop

Sign up to vote on this title
UsefulNot useful