30
PROJECT REPORT ON (Name of the project) SUBMITTED BY SHAIVAL H. JOSHIX00000 ( ) MANGESH M. CHOUGULE ( ) VISHAL J. MANJALY00000 ( ) MAHESH S. NAIR 00000000 ( ) UNDER THE GUIDANCE OF Mr. AMEET MEHTA DEPARTMENT OF ELECTRONICS ENGINEERING PILLAI¶S POLYTECHNI C NEW PANVEL MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION MUMBAI 2010 ± 2011

Student Info Display using 8051 uc

Embed Size (px)

Citation preview

Page 1: Student Info Display using 8051 uc

8/7/2019 Student Info Display using 8051 uc

http://slidepdf.com/reader/full/student-info-display-using-8051-uc 1/30

PROJECT REPORT ON

(Name of the project)

SUBMITTED BY

SHAIVAL H. JOSHI X00000 ( )

MANGESH M. CHOUGULE ( )

VISHAL J. MANJALY 00000 ( )MAHESH S. NAIR 00000000 ( )

UNDER THE GUIDANCE OF

Mr. AMEET MEHTA

DEPARTMENT OF ELECTRONICS ENGINEERING

PILLAI¶S POLYTECHNICNEW PANVEL

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATIONMUMBAI

2010 ± 2011

Page 2: Student Info Display using 8051 uc

8/7/2019 Student Info Display using 8051 uc

http://slidepdf.com/reader/full/student-info-display-using-8051-uc 2/30

Mahatma Education Society¶s

Pillai·s PolytechnicDr. K. M. Vasudevan Pillai¶s Campus, 10, Sector 16, New Panvel,

Navi Mumbai ± 410206, Tel: 27451700 / 27456100

CERTIFICATE

This is to certify that,

Shaival H. Joshi, Mangesh M. Chougule, Vishal J. Manjaly, Mahesh S. Nair have

satisfactorily completed their project work entitled _______________________________ in

Partial fulfillment for the Diploma Course in Electronics Engineering of the Maharashtra

State Board of Technical Education in the department of Electronics Engineering of

Mahatma Education Society¶s, Pillai¶s Polytechnic, New Panvel during the academic year

2010 ± 2011.

(Internal Examiner) (External Examiner)

(Project Guide) (Head of Department) (Principal)

Page 3: Student Info Display using 8051 uc

8/7/2019 Student Info Display using 8051 uc

http://slidepdf.com/reader/full/student-info-display-using-8051-uc 3/30

ACKNOWLDEGMENT

I would like to acknowledge and extend my heartfelt gratitude to the following persons who have

made the completion of this Project possible:

Our guide, Mr. Ameet Mheta , for his vital encouragement and support.

The Arun Pillai, Rajeshwari and Nancy Shuja , for assisting in the project work.

Most especially to my family and friends and to God, who made all things possible.

Page 4: Student Info Display using 8051 uc

8/7/2019 Student Info Display using 8051 uc

http://slidepdf.com/reader/full/student-info-display-using-8051-uc 4/30

Page 5: Student Info Display using 8051 uc

8/7/2019 Student Info Display using 8051 uc

http://slidepdf.com/reader/full/student-info-display-using-8051-uc 5/30

ABSTRACT

The system we introduce before you help you to know the details of your ward merely bypressing your wards roll no. Parents coming to know their wards performance in college

normally face the problem of waiting for long hours to meet their respective class teachers.

By merely interacting with this system the parent can just type the roll no. and get the details of

the student without waiting for the teachers. So they can save their ample time by not waiting for

the professor. This system can not only be used in colleges but also be used in offices for

attendance. This system also provides flexibility for the user.

The only need of the system is that it needs to be updated from time to time. A person needs to

keep the check of the system. This system also remains useful for the staff members as they can

continue their work even if the parents come to know the marks of the student.

Page 6: Student Info Display using 8051 uc

8/7/2019 Student Info Display using 8051 uc

http://slidepdf.com/reader/full/student-info-display-using-8051-uc 6/30

INTRODUCTION

Now-a-days every institution needs automation. As a part of college automation, we havedecided to make this project. Our project allows the user to know the marks and attendance of

their ward without the interference of the college authority. In the hardware side embedded

system has been used. A 40 pin microcontroller is used in this embedded system because of its

compatibility with our hardware . This microcontroller controls the whole hardware. Computers

transfer data in two ways, parallel and serial. To transfer to a device located many meters away,

the serial method is used. In serial communication, data is sent one bit at a time, in contrast to

parallel communication. The 8051 has serial communication capability built into it. The fact that

in serial communication a single data line is used instead of the 8-bit data line of parallel

communication makes it not only much cheaper. There is three ways of transfer: simplex, half

duplex and full duplex. Half duplex happened when data is transmitted one way at a time.

Asynchronous serial data communication is widely used for character-oriented transmission. In

the asynchronous method, each character is placed in between start and stop bits. This is call

framing. In data framing for asynchronous communication, the data, such as ASCII characters

are packed in between a start bit and a stop bit. The rate of data transfer in serial data

communication is stated in bps or baud rate. The RS232 was set to allow compatibility among

data communication equipment made by various manufacturers. RS232 is widely used serial I/O

interfacing standard but it not TTL compatible. In RS232, 1 is represented -3 to -25 V, while 0

bit is +3 to +25 V, making -3 to +3 undefined. For this reason, to connect any RS232 to a

microcontroller system we must use voltage converters such as MAX 232 to convert the TTL

logic level to RS232 voltage level and vice versa.

The PC is a very important ingredient of this system. The codes pressed by the user are serially

transmitted by the microcontroller to the PC via RS 232. A visual basic program controls

MSCOMM and MMCONTROL, continuously polling the serial port for any input, when the

microcontroller receives the first input signal the visual basics program runs the welcome wave

file. It then waits for the codes which are transferred to the text boxes from the input buffer. This

wave file is played by the visual basics program as the output from the sound card of the PC.

Page 7: Student Info Display using 8051 uc

8/7/2019 Student Info Display using 8051 uc

http://slidepdf.com/reader/full/student-info-display-using-8051-uc 7/30

Visual Basic is an ideal programming language for developing sophisticated professional

applications. The use of graphical user interface (GUI) enables user to interact with an

application.

The information needed by the user is stored in a database. Visual basic acts as user interface toaccess the information required by the client.

Page 8: Student Info Display using 8051 uc

8/7/2019 Student Info Display using 8051 uc

http://slidepdf.com/reader/full/student-info-display-using-8051-uc 8/30

LITERATURE SURVEY

This project involved in hardware and software parts. For hardware it is using microcontroller 8051, RS-232, MAX232, DB 9 Connector, keypad, Microcontroller, PCB board and +5v power

supply.

Microcontroller 8051

The 8051 is one of the most popular microcontrollers in use today. Thus, the ability to program

in microcontroller 8051 is an important thing. A microcontroller has a CPU in addition to a fixed

amount of RAM, ROM, I/O ports and a timer all on a single chip. It ideal for many applications

in which cost and space are critical. It also save space of the applications takes, the power it

consumes and the price per unit are much more critical consideration than the computing power.

8051 Serial Communication

Computers transfer data in two ways, parallel and serial. To transfer to a device located many

meters away, the serial method is used. In serial communication, data is sent one bit at a time, in

contrast to parallel communication. The 8051 has serial communication capability built into it.

The fact that in serial communication a single data line is used instead of the 8-bit data line of

parallel communication makes it not only much cheaper. There is three ways of transfer :

simplex, half duplex and full duplex. Half duplex happened when data is transmitted one way at

a time. Asynchronous serial data communication is widely used for character-oriented

transmission. In the asynchronous method, each character is placed in between start and stop

bits. This is call framing. In data framing for asynchronous communication, the data, such as

ASCII characters are packed in between a start bit and a stop bit. The rate of data transfer in

serial data communication is stated in bps or baud rate. The RS232 was set to allow

compatibility among data communication equipment made by various manufacturers. RS232 is

Page 9: Student Info Display using 8051 uc

8/7/2019 Student Info Display using 8051 uc

http://slidepdf.com/reader/full/student-info-display-using-8051-uc 9/30

Page 10: Student Info Display using 8051 uc

8/7/2019 Student Info Display using 8051 uc

http://slidepdf.com/reader/full/student-info-display-using-8051-uc 10/30

relational Microsoft Jet Database Engine with a graphical user interface. Access can be applied

to small projects but scales poorly to larger projects involving multiple concurrent users because

it is a desktop application. Two database access libraries of Component Object Model are

provided : the legacy Data Access Objects, only available with Access and the new ActiveX

Data Objects.

HyperTerminal

It is a program that you can use it to connect to other computers. Telnet sites bulletin board

systems, online services and host computers, using either your modem or a null modem cable.

HyperTerminal is still a useful means of configuring and testing your modem or examining your

connection with other sites. You can use HyperTerminal to transfer large files from a computer

onto your portable computer using a serial port rather than going through the process of setting

your portable computer up on a network.

Page 11: Student Info Display using 8051 uc

8/7/2019 Student Info Display using 8051 uc

http://slidepdf.com/reader/full/student-info-display-using-8051-uc 11/30

HARDWARE DESCRIPTION OF THE SYSTEM

Block Diagram

Our project consist of following hardware

1. Micro controller: To accept the inputs from the keypad to the ports and from there to the

max 232.

2. Max 232

3. Rs232

4. 4X3 Matrix Keypad

5. Personal Computer: To store the data base and to display the details as per the entered

number

Page 12: Student Info Display using 8051 uc

8/7/2019 Student Info Display using 8051 uc

http://slidepdf.com/reader/full/student-info-display-using-8051-uc 12/30

1. MICRO CONTROLLER

In this project we are using 40 pin Atmel 89c51 microcontroller as it was easily compatible with

our hardware.

Page 13: Student Info Display using 8051 uc

8/7/2019 Student Info Display using 8051 uc

http://slidepdf.com/reader/full/student-info-display-using-8051-uc 13/30

The Role Of Micro Controller

Page 14: Student Info Display using 8051 uc

8/7/2019 Student Info Display using 8051 uc

http://slidepdf.com/reader/full/student-info-display-using-8051-uc 14/30

The 8051 is the heart of this system. It controls the operation of various parts of our system.

When key from the keypad is pressed a signal is generated. This signal then passed on to

Max232 from Microcontroller which converts the signal to appropriate voltage and then passed

to the PC via RS232 interface. The number is pressed by the user it is stored in the memory of

the microcontroller. The code stored in the microcontroller is send to the serial port. If any

hardware failure occurs, it is the microcontroller which is taking necessary measures.

The Basic Features

A microcontroller is meant to read data, perform limited calculations on the data and control its

environment based on those calculations. The microcontroller consists of an 8-bit CPU in

addition to RAM of 128 bytes, ROM, parallel I/0, serial I/0, counters, clock circuits etc, the

EEPROM has a memory of 0 to 4kb. There are four register banks with 8 registers each. The

control registers used are TCON, TMOD, SCON, PCON, IP and IE. The program counter is 16

bit while the status word and stack pointer is 8 bit. The 8751 has 4 parallel I/0 ports. Hence the

dual ports of these may be used as general I/O digital lines. A system clock generator using an

external crystal and two external capacitors provide the required clock for the microcontroller.

There are 5 INTERRUPT sources used by 8751 and each can be listed under any of the priority

levels. The 5 interrupts are listed below.

Source Description

Page 15: Student Info Display using 8051 uc

8/7/2019 Student Info Display using 8051 uc

http://slidepdf.com/reader/full/student-info-display-using-8051-uc 15/30

INT 0 Internal Request from P3.2 pin

Timer 0Overflow interrupts from timer 0 activated by

flag TF0.

INT I External request from P3.3pin

Timer I Overflow interrupts from timer I

Serial PortCompletion of transmission and reception of

one serial frame activates TI and RI

2. 4X3 KEYPAD

Keyboards and LCDs are the most widely used input/output devices of the 8051, and a basic

understanding of them is essential. In this section, we first discuss keyboard fundamentals, along

with key press and key detection mechanisms, Then we show how a keyboard is interfaced to an

8051.

Page 16: Student Info Display using 8051 uc

8/7/2019 Student Info Display using 8051 uc

http://slidepdf.com/reader/full/student-info-display-using-8051-uc 16/30

Interfacing the Keyboard to the 8051

At the lowest level, keyboards are organized in a matrix of rows and columns. The CPU accesses

both rows and column through ports; therefore, with two 8-bit ports, an 8*8 matrix of keys can

be connected to a microprocessor. When a key pressed, a row and column connect; otherwise,

there is no connection between row and column. In IBM PC keyboards, a single microcontroller

(consisting of microprocessor, RAM and EPROM, and several ports all on a single chip) takes

care of software and hardware interfacing of keyboard. In such systems it is the function of

Page 17: Student Info Display using 8051 uc

8/7/2019 Student Info Display using 8051 uc

http://slidepdf.com/reader/full/student-info-display-using-8051-uc 17/30

programs stored in the EPROM of microcontroller to scan the keys continuously, identify which

one has been activated, and present it to the motherboard. In this section we look at the

mechanism by which the 8051 scans and identifies the key.

Scanning And Identifying The Key

The rows are connected to an output port and the columns are connected to an input port. If no

key has been pressed, reading the input port will yield 1s for all columns since they are all

connected to high (Vcc) If all the rows are grounded and a key is pressed, one of the columns

will have 0 since the key pressed provides the path to ground. It is the function of the

microcontroller to scan the keyboard continuously to detect and identify the key pressed. How it

is done is explained next.

Grounding Rows And Reading Columns

To detect a pressed key, the microcontroller grounds all rows by providing 0 to the output latch,

and then it reads the columns. If the data read from the columns is D3-D0=1111, no key has been

pressed and the process continues until a key press is detected. However, if one of the column

bits has a zero, this means that a key press has occurred. For example, if D3-D0=1101, thismeans that a key in the D1 column has been pressed. After a key press is detected, the

microcontroller will go through the process of identifying the key. Starting with the top row, the

microcontroller grounds it by providing a low to row D0 only; then it reads the columns. If the

data read is all1s, no key in that row is activated and the process is moved to the next row. It

grounds the next row, reads the columns, and checks for any zero. This process continues until

the row is identified. After identification of the row in which the key has been pressed, the next

task is to find out which column the pressed key belongs to. This should be easy since the

microcontroller knows at any time which row and column are being accessed.

Assembly language program for detection and identification of key activation is given below. In

this program, it is assumed that P1 and P2 are initialized as output and input, respectively.

Program13.1 goes through the following four major stages:

Page 18: Student Info Display using 8051 uc

8/7/2019 Student Info Display using 8051 uc

http://slidepdf.com/reader/full/student-info-display-using-8051-uc 18/30

1. To make sure that the preceding key has been released, 0s are output to all rows at once,

and the columns are read and checked repeatedly until all the columns are high. When all

columns are found to be high, the program waits for a short amount of time before it goes

to the next stage of waiting for a key to be pressed.

2. To see if any key is pressed, the columns are scanned over and over in an infinite loop

until one of them has a 0 on it. Remember that the output latches connected to rows still

have their initial zeros (provided in stage 1), making them grounded. After the key press

detection, it waits 20ms for the bounce and then scans the columns again. This serves two

functions: (a) it ensures that the first key press detection was not an erroneous one due to

spike noise, and(b) the 20ms delay prevents the same key press from being interpreted asa multiple key press. If after the 20-ms delay the key is still pressed, it goes to the next

stage to detect which row it belongs to; otherwise, it goes back into the loop to detect a

real key press

3. To detect which row the key press belongs to, it grounds one row at a time, reading the

columns each time. If it finds that all columns are high, this means that the key press

cannot belong to that row; therefore, it grounds the next row and continues until it finds

the row the key press belongs to. Upon finding the row that the key press belongs to, it

sets up the starting address for the look-up table holding the scan codes (or the ASCII

value) for that row and goes to the next stage to identify the key.

4. To identify the key press, it rotates the column bits, one bit at a time, into the carry flag

and checks to see if it is low. Upon finding the zero, it pulls out the ASCII code for that

key from the look-up table; Otherwise, it increments the pointer to point to the next

element of the look-up table.

While the key press detection is standard for all keyboards, the process for determining which

key is pressed varies. The look-up table method shown in program can be modified to work with

any matrix up to 8X8.

Page 19: Student Info Display using 8051 uc

8/7/2019 Student Info Display using 8051 uc

http://slidepdf.com/reader/full/student-info-display-using-8051-uc 19/30

There are IC chips such as National Semiconductors MM74C923 that incorporate keyboard

scanning and decoding all in one chip. Such chips use combinations of counters and logic gates

(No microcontroller).

3. MAX232

The MAX232 is an integrated circuit that converts signals from an RS-232 serial port to signals

suitable for use in TTL compatible digital logic circuits. The MAX232 is a dual driver/receiver

and typically converts the RX, TX, CTS and RTS signals.

The drivers provide RS-232 voltage level outputs (approx. 7.5 V) from a single + 5 V supply

via on-chip charge pumps and external capacitors. This makes it useful for implementing RS-232

in devices that otherwise do not need any voltages outside the 0 V to + 5 V range, as power

supply design does not need to be made more complicated just for driving the RS-232 in this

case.

The receivers reduce RS-232 inputs (which may be as high as 25 V), to standard

5 V TTL levels. These receivers have a typical threshold of 1.3 V, and a typical hysteresis of

0.5 V.

The later MAX232A is backwards compatible with the original MAX232 but may operate at

higher baud rates and can use smaller external capacitors 0.1 F in place of.

The newer MAX3232 is also backwards compatible, but operates at a broader voltage range,from 3 to 5.5 V. Pin to pin compatible: ICL232, ST232, ADM232, HIN232.

Voltage Levels

Page 20: Student Info Display using 8051 uc

8/7/2019 Student Info Display using 8051 uc

http://slidepdf.com/reader/full/student-info-display-using-8051-uc 20/30

It is helpful to understand what occurs to the voltage levels. When a MAX232 IC receives a TTL

level to convert, it changes a TTL Logic 0 to between +3 and +15 V, and changes TTL Logic 1

to between -3 to -15 V, and vice versa for converting from RS232 to TTL. This can be confusing

when you realize that the RS232 Data Transmission voltages at a certain logic state are opposite

from the RS232 Control Line voltages at the same logic state. To clarify the matter, see the table

below. For more information see RS-232 Voltage Levels.

RS232 Line Type & Logic Level RS232 Voltage TTL Voltage to/from MAX232

Data Transmission (Rx/Tx) Logic 0 +3 V to +15 V 0 V

Data Transmission (Rx/Tx) Logic 1 -3 V to -15 V 5 V

Control Signals (RTS/CTS/DTR/DSR)

Logic 0

-3 V to -15 V 5 V

Control Signals (RTS/CTS/DTR/DSR)

Logic 1+3 V to +15 V 0 V

Interfacing Of Max232 with Microcontroller and RS-232

Page 21: Student Info Display using 8051 uc

8/7/2019 Student Info Display using 8051 uc

http://slidepdf.com/reader/full/student-info-display-using-8051-uc 21/30

4. RS-232

Page 22: Student Info Display using 8051 uc

8/7/2019 Student Info Display using 8051 uc

http://slidepdf.com/reader/full/student-info-display-using-8051-uc 22/30

The main purpose of the RS 232 interface is to act as a serial interface between the

microcontroller and the PC. It provides the voltage compatibility between the TxD and RxD pins

of the microcontroller and the serial port of the PC. The voltage level of the TxD and RxD pins

of the serial port of the PC are 12V. The RS 232 interface therefore provides compatibility

required to interface the computer and the microcontroller

Page 23: Student Info Display using 8051 uc

8/7/2019 Student Info Display using 8051 uc

http://slidepdf.com/reader/full/student-info-display-using-8051-uc 23/30

5. PC

The PC is a very important ingredient of this system. The codes pressed by the user are serially

transmitted by the microcontroller to the PC via RS 232. A visual basic program controls

MSCOMM and MMCONTROL, continuously polling the serial port for any input, when the

microcontroller receives the first input signal the visual basics program runs the welcome wave

file. It then waits for the codes which are transferred to the text boxes from the input buffer. This

wave file is played by the visual basics program as the output from the sound card of the PC.

6. POWER SUPPLY

A power supply is a device that supplies electrical energy to one or more electric loads. The term

is most commonly applied to devices that convert one form of electrical energy to another,

though it may also refer to devices that convert another form of energy (e.g., mechanical,

chemical, solar) to electrical energy. A regulated power supply is one that controls the output

voltage or current to a specific value; the controlled value is held nearly constant despite

variations in either load current or the voltage supplied by the power supply's energy source.

In this project we are using +5 volt regulated power supply.

Page 24: Student Info Display using 8051 uc

8/7/2019 Student Info Display using 8051 uc

http://slidepdf.com/reader/full/student-info-display-using-8051-uc 24/30

Page 25: Student Info Display using 8051 uc

8/7/2019 Student Info Display using 8051 uc

http://slidepdf.com/reader/full/student-info-display-using-8051-uc 25/30

WORKING

CIRCUIT DIAGRAM

Page 26: Student Info Display using 8051 uc

8/7/2019 Student Info Display using 8051 uc

http://slidepdf.com/reader/full/student-info-display-using-8051-uc 26/30

PCB LAYOUT

Page 27: Student Info Display using 8051 uc

8/7/2019 Student Info Display using 8051 uc

http://slidepdf.com/reader/full/student-info-display-using-8051-uc 27/30

The user dials the number from the keypad connected to the 8051 microcontroller. The number

is taken over by the microcontroller after a delay.

The ASCII value of the entered number is given to the microcontroller, which pass this

information to the Max232 driver IC. MAX232 converts this input signal into the appropriate

voltage of RS-232. And finally this is given to the PC via RS-232 interface.

The serial port of the PC is continually polled by the software used such as Visual Basics and

Microsoft Agent program and the received code words are put in the text box from the input

buffer. The received personal identification number (PIN) is compared with the stored data baseto determine the result. The corresponding wave file is played by the sound blaster card.

This process takes place every time when the key is pressed from the keypad when asked.

Page 28: Student Info Display using 8051 uc

8/7/2019 Student Info Display using 8051 uc

http://slidepdf.com/reader/full/student-info-display-using-8051-uc 28/30

Page 29: Student Info Display using 8051 uc

8/7/2019 Student Info Display using 8051 uc

http://slidepdf.com/reader/full/student-info-display-using-8051-uc 29/30

CONCLUSION

This embedded system provides a total information student by just entering the number. Thissystem comprises of simple hardware consisting of microcontroller 8051 family , MAX232 IC ,

RS-232 and 4X3 matrix keypad. Microcontroller is the heart of this system and controls the

hardware part.

Visual basic is used for software development. Visual Basic is an ideal programming language

for developing sophisticated professional applications. The use of graphical user interface (GUI)

enables user to interact with an application.

Hardware section is interfaced with the PC using RS-232. The PC is a very important ingredient

of this system. The codes pressed by the user are serially transmitted by the microcontroller to

the PC via RS 232. A visual basic program controls MSCOMM and MMCONTROL,

continuously polling the serial port for any input, when the microcontroller receives the first

input signal the visual basics program runs the welcome wave file. It then waits for the codeswhich are transferred to the text boxes from the input buffer. This wave file is played by the

visual basics program as the output from the sound card of the PC.

This project has an advantages such as paper saving, user friendly, simple construction, working

and no requirements of authority every time. This project can be improvised with the

implementation of interactive voice response system

Page 30: Student Info Display using 8051 uc

8/7/2019 Student Info Display using 8051 uc

http://slidepdf.com/reader/full/student-info-display-using-8051-uc 30/30

REFERENCES

1.

http://homepage.ntlworld.com/alanet.marshall1/WS-page/X1CNC/X1CNCpage2.htm 2. http://en.wikipedia.org/wiki/Microcontroller

3. http://www.datasheetcatalog.org/datasheets/134/411652_DS.pdf

4. http://www.datasheetcatalog.org/datasheet/texasinstruments/max232.pdf

5. http://dspace.unimap.edu.my/dspace/bitstream/123456789/2976/5/Literature%20review.pdf