5x7 matrix led display

15
Design and Implementation Of Interfacing Of 5x7 Matrix Led Display To 8051 BY Ami Goswami (IU1241090014) Vatsal Shah (IU1241090055) Department of Electronics & Communication Engineering Indus Institute of Technology 2014-2015

Transcript of 5x7 matrix led display

Page 1: 5x7 matrix led display

Design and Implementation Of

Interfacing Of 5x7 Matrix Led Display To 8051

BY

Ami Goswami (IU1241090014)

Vatsal Shah (IU1241090055)

Department of Electronics & Communication Engineering

Indus Institute of Technology

2014-2015

Page 2: 5x7 matrix led display

INDEX

Abstract ................................................................................................................................................... 3

List of Figures .......................................................................................................................................... 4

List of Table ............................................................................................................................................. 4

Ch. – 1 Introduction ................................................................................................................................ 5

1.1 Introduction ................................................................................................................................ 5

1.2 Objective ..................................................................................................................................... 5

1.3 Scope and Limitation................................................................................................................... 5

Ch. – 2 Review of Related Studies of LED matrix .................................................................................... 6

2.1 Theory of LED dot matrix display ................................................................................................ 6

2.2 Description of LED ....................................................................................................................... 6

2.3 Dot Matrix vs. 7-segment Display ............................................................................................... 6

2.4 Advantages of LED ...................................................................................................................... 7

2.5 Dot Matrix Construction ............................................................................................................. 7

2.6 Why used dot matrix? ................................................................................................................. 7

2.7 Definition of LED Driver .............................................................................................................. 7

Ch. – 3 Design Specifications .................................................................................................................. 8

3.1 What do we need? ...................................................................................................................... 8

3.2 Basic component required .......................................................................................................... 8

3.3 How does it work? ...................................................................................................................... 8

3.4 Hardware Design ......................................................................................................................... 8

3.5 ULN2003A Driver IC .................................................................................................................... 9

3.6 Software Description ................................................................................................................ 10

3.7 Assembly code: ........................................................................................................................ 11

Ch.4 – Procedure and Results ............................................................................................................... 12

4.1 Procedure .................................................................................................................................. 12

4.2 Simulation and results .............................................................................................................. 14

4.3 Conclusion ................................................................................................................................. 14

5 References .................................................................................................................................... 15

Page 3: 5x7 matrix led display

3

Abstract

A 5x7 matrix LED Display board with 8051 microcontroller has been designed. The

LED’s are connected like a matrix with 7 rows of 5 LED’s per each row is designed on a board

to display. For a 5x7 LED matrix, it is impractical to assign one I/O pin per LED, as a 5x7

matrix requires 35 I/O pins. These characters are switched continuously with a delay of

05msec. This design can be extended to number of units by using shift registers to display a

message consisting of many numbers of characters. By controlling the data bits connected to

the LED’s, we can display any character. The 5x7 LED matrix display with 35 LED’s are

arranged in 7 rows and 5 columns structure. The purpose of ULN2003A here is to drive the

column lines of the display. ULN2003A is a high voltage (50V), high current (500mA per

channel) Darlington transistor array. Each IC has 7 channels with individual output clamp

diodes. ULN2003A an active high device, which means logic high must be applied to the input

to make the corresponding output high. The software required for displaying character ‘A’, ‘B’,

‘C’, etc. 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 AT89s51 microcontroller and is

verified by interfacing the microcontroller pins for any given character, a corresponding pattern

of LED is generated and is used to display the character at run time. The application and

advantages that can be used at public transport places like bus stop, railway station, and

airport. Displaying various important messages in hospitals, schools, colleges. In future

development we can use GSM technology to receive the data from remote location.

Page 4: 5x7 matrix led display

4

List of Figures

Figure No. Figure Title Page No.

2.1.1 5X7 LED matrix 9

3.1.1 Interfacing 5x7 matrix LED display to 8051 15

3.1.2 ULN2003A drive IC pin configuration and internal logic diagram. 16

3.1.3 LED display 19

3.7 Simulated circuit of 5X7 Display

List of Table

Table No. Table Title Page No.

3.1 Code table 20

Page 5: 5x7 matrix led display

5

Ch. – 1 Introduction

1.1 Introduction

Visual impact is most effective mode of influencing human’s minds main aim of

advertisements etc. a display device serves this purpose. A display device is a device

for presentation of information for visual reception, acquired, stored, or transmitted in

various form. The display device is use to display the information on machines, clock,

railway departure indicator and many other devices require a simple display of limited

resolution. The display consist of a matrix of lights or mechanical indicator arranged in

rectangular configuration (other shapes are also possible) such that by switching on or

off the text or graphics can be displayed.

Our initial goal was to create a display that would be useful and interactive in order to

attract attention. In the development of our main goal, the modular LED array, we found

that we would be dealing with three major components,

Integrated circuits consisting of microcontroller, resistor array, and LED

driver.

Printed circuit board technologies, as well as software involved in their

design.

Programming in assembly language to drive the microcontroller and scan

through individual row of LED’s with the data needed to produce a message.

For moving a message on display we design a 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 a matrix is designed on a board to display characters.

LED dot matrices are very popular means of displaying information as it allows both

static and animated text and images. Perhaps, you have encountered them at gas

stations displaying the gas prices, or in the public places and alongside

highways, displaying advertisements on large dot matrix panels.

1.2 Objective

The objective of this study is to provide a way of displaying information electronically.

That could result to effectual information dissemination.

1.3 Scope and Limitation

This study is only intended to display information via alphanumeric and commonly used

characters like dot (.), comma (,), etc. which means that it is not capable of showing

animated figures or drawings since the inputs allowed are alphabets, numbers and

special characters only.

Page 6: 5x7 matrix led display

6

Ch. – 2 Review of Related Studies of LED matrix

2.1 Theory of LED dot matrix display

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 5×7 matrix

of LEDs (shown below) would need 35 I/O pins. By wiring all the anodes together in

rows (R1 through R7), and cathodes in columns (C1 through C5), 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 tuned on. Characters can be displayed by fast scanning of either

rows or columns.

FIG.2.1 5X7 LED matrix

2.2 Description of LED Light-emitting diodes (LEDs) are semiconductor devices that illuminate solely by

motion of electrons. When forward-biased, these things emit light. LEDs provide a

cheap and convenient way to display information electronically, fit easily into an

electrical circuit, and are durable.

2.3 Dot Matrix vs. 7-segment Display

LEDs are often arranged in patterns to display information. The 7-segment

configuration of an LED arranged in the form of digit 8 can be restrictive in that it does

not adequately allow the display of some alphanumeric characters. By contrast, the

versatility of a dot matrix arrangement allows an LED unit to display complicated

shapes. A 5x7 LED dot matrix is the appropriate device for displaying characters.

Page 7: 5x7 matrix led display

7

2.4 Advantages of LED

LED advantages are energy efficient, environmental, produce the intended light

and runs cool. It lights up quickly, fully dimmable, operates silently, and has good

color rendering. One of LED savings is on the carbon dioxide (CO2) emission of

power plant in producing electricity, which helps protect Earth. LEDs are even

better that traditional lighting. Factors like energy savings, energy efficiency and

environmental advocacy.

2.5 Dot Matrix Construction

The two dot matrix configurations are the LED matrix with a common anode for LEDs

in a row - all of the anodes in each row is common, and LED with a common cathode

for LEDs in a row – all the cathodes in each row is common.

2.6 Why used dot matrix?

The dot matrix is the most versatile display in our line of LED displays. It is suitable for

any application that requires numeric, alphabetical and symbolic/graphic information

to be displayed. Choose a smaller pixel size for a crisper message and combine

multiple modules for larger displays. Practically, a LED dot matrix is better than

creating a panel composed of single LEDs because a matrix provides proper alignment

and saves a huge amount of soldering.

2.7 Definition of LED Driver

IC drivers are devices that provide the required current and voltage needed to turn

power switching elements on or off such as LED displays filament lamps including5x7

Dot Matrix Display based on the logic output signals of a digital signal processor (DSP)

and microcontroller or other logic device.

The ULN2003 LED driver is a high voltage, high-current Darlington arrays containing

Darlington pairs with common emitter configuration. Each channel rated at500 mA and

can withstand peak currents of 600mA which can drive wide range of loads including

solenoids, relays, DC motors; LED displays filament lamps, thermal print heads and

high power buffers. Suppression diodes are included for inductive load driving.

Page 8: 5x7 matrix led display

8

Ch. – 3 Design Specifications

3.1 What do we need?

Micro controller based interface using ICAT89S51 Display size: 8x34 pixels, (26.5.cm) x (5.5.cm) Input Power: 8 -12V DC, 500mA LED driver interface Crystal Power-On LED indicator Data receiving LED Resistors

3.2 Basic component required

ICAT89S51 Control Circuit Display Board Computer

3.3 How does it work?

We need to dump the code which we have written in C compiler into the ICAT89S51,

and later we assemble the control circuit and fix connectors and also the serial port to

pc. Now we setup the software into computer and when we type the messages in the

computer we get the display. This is how it works.

3.4 Hardware Design :

The Block diagram of 5x7 LED matrix is show in the figure. The 5x7LED matrix display

with35 LED’s are arranged in 7 rows and 5 columns Structure named as display

character as shown in the figure 1. The data is provided to rows and columns through

program loaded in IC1 AT89S51. Now the rows are connected to 89S51 through port

p0.

Page 9: 5x7 matrix led display

9

FIG3.1.1Interfacing 5x7 matrix LED display to 8051

3.5 ULN2003A Driver IC

The purpose of ULN2003A here is to drive the column lines of the display. ULN2003A

is a high voltage (50V), high current (500mA per channel) Darlington transistor array.

Each IC has 7 channels with individual output clamp diodes. ULN2003A an active high

device, which means a logic high must be applied to the input to make the

corresponding output high. The input pins are designated as 1B, 2B, 3B, 4B, 5B, 6B,

7B while corresponding output pins are designated as 1C, 2C, 3C, 4C, 5C, 6C, and

7C. The pin configuration and simplified internal logic of ULN2003A is shown in the

figure below.

FIG.3.1.2 ULN2003A drive IC pin configuration and internal logic diagram.

Page 10: 5x7 matrix led display

10

3.6 Software Description

The software required for displaying characters ‘A’ on the LED matrix. The hex code

is downloaded on to the 89S51 microcontroller and is verified by interfacing the

microcontroller pins to the 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 ‘A’ character were

computed and stored at internal ram address and were transmitted sequentially by

monitoring the TI flag of the SCON register.

Page 11: 5x7 matrix led display

11

3.7 Assembly code:

#include <reg51.h>

VoidMSDelay (unsigned int);

sbit R1=P0^0; //Rows connected with Port P0

sbit R2=P0^1;

sbit R3=P0^2;

sbit R4=P0^3;

sbit R5=P0^4;

sbit R6=P0^5;

sbit R7=P0^6;

sbit C1=P1^0; //Columns connected with Port P1

sbit C2=P1^1;

sbit C3=P1^2;

sbit C4=P1^3;

sbit C5=P1^4;

void main(void)

{ while(1)

{

P1 = 0x01; //To print word “EC”

P0 = 0x80;

MSDelay(5);

P1 = 0x02;

P0 = 0xB6;

MSDelay(5);

P1 = 0x00;

P0 = 0x00;

MSDelay(5);

P1 = 0x08;

P0 = 0x80;

MSDelay(5);

P1 = 0x10;

P0 = 0xBe;

MSDelay(5);

}

}

voidMSDelay(unsigned int time)

{

unsignedinti,j;

for (i=0;i<50;i++)

for (j=0;j<time;j++);

}

Page 12: 5x7 matrix led display

12

Ch.4 – Procedure and Results

4.1 Procedure Suppose, we want to display the word ‘EC’. 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 R1

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,R5 and R7 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.

Fig3.1 Display Device

Fast scanning across the

columns results in a steady

display.

Page 13: 5x7 matrix led display

13

Table No. 3.1 code

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 WORD ‘EC’. A microcontroller’s I/O pin cannot sink this much of

current, so external transistor arrays are required.

ROW\COL C1 C2 C3 C4 C5

R1 1 1 0 1 1

R2 1 0 0 1 0

R3 1 0 0 1 0

R4 1 1 0 1 0

R5 1 0 0 1 0

R6 1 0 0 1 0

R7 1 1 0 1 1

Page 14: 5x7 matrix led display

14

4.2 Simulation and results Simulated circuit to print any word on 5X7 matrix using 8051uC as shown below:

Fig 3.7 Simulated Circuit of 5X7 Display

4.3 Conclusion

The display consists of a dot matrix of lights arranged in a rectangular configuration

such that by switching on or off selected text or graphics can be display. A dot matrix

controller converts instructions from a processor into signals which turns on or off lights

in the matrix so that the required display produced.

Page 15: 5x7 matrix led display

15

5 References

Muhammad Ali Mazidi (2012), The 8051 Microcontroller and Embedded

System, Second Edition, Pearson.

http://www.circuitstoday.com/interfacing-dot-matrix-led-display-to-8051

http://www.goodreads.com/author/show/113686.Muhammad_Ali_Mazidi

http://www.appelsiini.net/2011/how-does-led-matrix-work

http://www.engineersgarage.com/electronic-components/uln2003-

datasheet

http://electronics.stackexchange.com/questions/106568/use-of-uln2003-

for-led-current-drive

http://www.cadsoftusa.com/download-eagle/

http://www.popularmechanics.com/home/improvement/energy-

efficient/everything-you-need-to-know-about-led-light-bulbs-16542040

http://accd.vermont.gov/sites/accd/files/Documents/strongcommunities/cd/

mpg/SampleFinalProjectReport.pdf