You are on page 1of 69

PSZ 19:16 (Pind.

1/07)

UNIVERSITI TEKNOLOGI MALAYSIA


DECLARATION OF THESIS / UNDERGRADUATE PROJECT PAPER AND COPYRIGHT

Author’s full name : MUHAMMAD ZAIRIL BIN MUHAMMAD NOR

Date of birth : 03 AUGUST 1986

Title : HARDWARE DEVELOPMENT OF ATTENDANCE MANAGEMENT USING

PORTABLE RFID READER

Academic Session : 2008/2009

I declare that this thesis is classified as :

CONFIDENTIAL (Contains confidential information under the Official Secret


Act 1972)*

RESTRICTED (Contains restricted information as specified by the


organisation where research was done)*

9 OPEN ACCESS I agree that my thesis to be published as online open access


(full text)

I acknowledged that Universiti Teknologi Malaysia reserves the right as follows :

1. The thesis is the property of Universiti Teknologi Malaysia.


2. The Library of Universiti Teknologi Malaysia has the right to make copies for the purpose
of research only.
3. The Library has the right to make copies of the thesis for academic exchange.

Certified by :

SIGNATURE SIGNATURE OF SUPERVISOR

860803-59-5395 ASSC PROF DR NORAZAN BIN MOHD KASSIM


(NEW IC NO. /PASSPORT NO.) NAME OF SUPERVISOR

Date : Date :

NOTES : * If the thesis is CONFIDENTIAL or RESTRICTED, please attach with the letter from
the organisation with period and reasons for confidentiality or restriction.
 

I declare that I have read this work and in


my opinion this work is adequate in terms of scope and
quality for the purpose of awarding a Bachelor’s Degree of
Electrical Engineering (Telecommunication).”

Signature : ………………………………………………………………
Supervisor : ASSC. PROF. DR. NORAZAN BIN MOHD KASSIM
Date :
HARDWARE DEVELOPMENT OF ATTENDANCE MANAGEMENT
USING PORTABLE RFID SYSTEM

MUHAMMAD ZAIRIL BIN MUHAMMAD NOR

A report submitted in partial fulfilment of the


Requirements for the award of the degree of
Bachelor of Electrical Engineering (Telecommunication)

Faculty of Electrical Engineering

Universiti Teknologi Malaysia

MAY 2009
ii

I declare that this thesis entitled “HARDWARE DEVELOPMENT FOR ATTENDANCE


TAKING USING PROTABLE RFID READER” is the result of my own research except
as cited in the references. This thesis has not been accepted for nay degree and is not
currently submitted in candidature for any other degree.

Signature : ………………………………………………………………
Supervisor : MUHAMMAD ZAIRIL BIN MUHAMMAD NOR
Date :
iii
 

To my beloved father, mother, sister and brothers,


and not forgetting my friends.
iv

ACKNOWLEDMENT

Alhamdulillah to Allah, because of His bless, I can finished my final year project
with good health and cheerful until the last day.

During the process to finish this project, many problems encounter to enhance
knowledge especially in technical managements. However, with the qualities of
integrity and responsibility, I can prepare myself to self-confidence in any technical
problem along with the spirit of teamwork and the cooperation that given by my
supervisor and friends.

I would like to thank a lot to all my friends who gives me idea to solve problem
occurs in this project. I also like to thank my intelligent supervisor, Assc. Prof. Dr.
Norazan B Mohd Kassim that has guided me from the beginning until it finished. This
project cannot be completed without his guidance and support.

Moreover, I did like to thank a lot to my dearest family who gives me a lot of
love and spirit to finish this project till the end.

Lastly, a big thank to my partner, Amirjan B Nawabjan who gives good


cooperation and idea to finish this project. Once again thank to all person that helps me
in this project.
v

ABSTRACT

In UTM, lecturer still used attendance sheet as a system to indicate


student attendance. These give many disadvantages for lecturer and students. This
project use to help lecturer in attendance management for their students. This project
called “Hardware development of attendance management using portable RFID reader”.
This project will function as same as “touch n go” system where all student need to
wave their RFID metric card through RFID reader. Student data will be store temporary
in lecturer flash memory and this stored data will be send through RS 232 to lecturer’s
computer. Finally, the database will manage this data and indicate student attendance at
that particular day. The important part of this project is the storage part where this part
has major responsibility to take data and transfer data in metric card.
vi

ABSTRAK

Di UTM Skudai, pensyarah akan menggunakan helaian kertas yang bertulis


nama dan nombor kad pengenalan pelajar untuk tujuan mengambil kedatangan pelajar
dalam kelas. Sistem ini mempunyai banyak kelemahan samaada pada pihak pensyarah
mahupun pelajar. Projek ini akan membantu pensyarah dalam menguruskan sistem
kedatangan pelajar dalam kelas. Projek ini bertajuk “Hardware development of
attendance management using portable RFID reader”. projek ini berfungsi seperti sistem
“touch n go” di mana semua pelajar harus menyentuh kad identiti pelajar mereka ke atas
pembaca RFID. Data pelajar akan disimpan di dalam komponen simpanan sebelum di
hantar ke komputer pensyarah. Akhir sekali, pengkalan data akan mengurus data
tersebut.
vii

TABLE OF CONTENT

CHAPTER TITLE PAGE

TITLE i
DECLARATION ii
DEDICATION iii
ACKNOWLEDGEMENT iv
ABSTRACT v
ABSTRAK vi
CONTENTS vii
LIST OF FIGURES x
LIST OF TABLES xi

1 INTRODUCTION
1.1 Background 1
1.2 Problem Statement 2
1.3 Objective 3
1.4 Scope of Project 3
1.5 Methodology 4
1.6 Summary of Work 5
1.7 Outline of thesis 6

2 LITERATURE REVIEW

2.1 Introduction 8
2.2 RFID Technology 9
2.2.1 RFID tag 10
viii

2.2.2 Advantages of RFID 12


2.3 Microcontroller 14
2.4 USART 17
2.5 Serial Communication Interface 18
2.6 Programming Tools 19
2.6.1 MikroC 19
2.6.2 AVR Studio 19
2.6.3 Proteus 7: ARES and ISIS 20
2.6.4 PIC Kit 21
2.7 Conclusion 21

3 METHODOLOGY

3.1 Introduction 22
3.2 RFID Reader 23
3.3 Project’s RFID tags 24
3.4 Storage 25
3.5 RS 232 interface circuit 26
3.5.1 MAX 232 26
3.5.2 PIC16F84A 27
3.5.3 RS 232 male connector 28
3.6 Component list and total cost 29

4 RESULT AND DISCUSSION

4.1 Introduction 31
4.2 Project Description 32
4.3 Project Result 32
4.4 Discussion 34

5 CONCLUSION AND RECOMMANDATION

5.0 Introduction 37
5.1 Conclusion 37
ix

5.2 Recommendation 38

REFERENCES 39
APPENDICES 41
x

LIST OF FIGURES

FIGURE NO TITLE PAGE

1.1 Block Diagram of Portable Attendance Scanner 3

using RFID Reader

1.2 Gantt chart for FYP 1 5

1.3 Gantt chart for FYP 2 5

1.4 Flow of project 6

2.1 RFID passive tag 11

2.2 RFID active tag 11

2.3 RFID semi passive tag 12

2.4 RFID reader 13

2.5 Components of an RFID system 14

2.6 PIC 16F84a microcontroller 16

3.1 JBC300EF RFID reader 23

3.2 Passive RFID tags 24

3.3 Size comparison of AT45DB321D 25

3.4 Schematic Diagram of MAX 232 27


xi

3.5.1 Schematic diagram of voltage regulator 27

3.5.2 Schematic Diagram of PIC 16F84A 28

3.6 RS 232 male connector 28

4.1 Real designed of PCB layout 33

4.2 PCB layout designed at ARES 33

4.3 PCB layout for AT45DB321D 34

4.4 Source code for import data from RFID reader 35

4.5 Overall circuit 36


xii

LIST OF TABLES

TABLE NO TITLE PAGE

2.1 RF Spectrum 9

2.2 PIC 16F84A pin description 16

3.1 RS 232 pins assignment (DB9 signal set) 29

3.2 Component list and total cost 29


CHAPTER 1

INTRODUCTION

1.1 Background

On my study at Negeri Sembilan Matriculation College and Universiti Teknologi


Malaysia, both of these institutions still used attendance sheet for a way to take student
attendance. Lecturer will pass the attendance sheet and students have to sign in that
sheet. After the class, lecturer must manage the absent of their student in the class that
day before entering the next class.

This traditional way can be upgrade to the new technology that more suitable
with era of technology nowadays. Today, there are many technologies that can replace
this old fashion of attendance taking. In working field, many company use ‘punch card’
system to collect data of their workers attendance. Other company also used finger print
2
 

technology for this reason. Furthermore, many institutions in Europe used only
software to take the attendance of their student.

RFID technology can be used for identification process by used radio frequency
(RF) as their medium of work. In this project, RFID systems were used to improve the
disadvantages of attendance system used currently. RFID is a technology who
commonly used in many systems currently. Because of that, this project wanted to
develop the used of RFID system in term of attendance management for lecturers.

1.2 Problem Statement

There are many disadvantages occurred when we used the old system of
attendance taking. This old system will take long time utilization. Mean that more time
being used for student in order to sign the attendance sheet. In attendance system used
currently, attendance sheet will go around the class and students will sign on it. This
will take more time for attendance sheet to go around the class. Furthermore, student
attention will disrupt when the attendance sheet came to them or they does not get the
attendance sheet that has been passed.

Sometime, there are several students that always signed the attendance sheet for
their friend and this will give effect on the quality of graduated student in that
institution. Other disadvantage of this way of attendance taking is difficulty of a
lecturer to manage the attendance of their student and sometime a lecturer forget to
3
 

bring the attendance sheet along with them. All of these are the common problem that
happened if the traditional way of attendance taking used.

1.3 Objective

The main aim of this project is to ease lecturer’s work in class attendance
management by using RFID technology. The following are the specific objectives of
this project:

i. To develop the performance in attendance taking using RFID reader


ii. To use application of 125 kHz RFID system in attendance management using
passive RFID reader and tags
iii. To program the flash memory ATMEL AT45DB321D using AVR Studio
iv. To design and program the microcontroller circuit by using PIC167F874A
v. To send the data stored to the PC through USART

1.4 Scope the project

RFID Tag

RFID Reader Storage Interface (RS232)

Figure 1.1: Block Diagram of Portable Attendance Scanner using RFID Reader
4
 

Figure 1.1 shows the block diagram for this project. To achieve the objectives of
this project, several works has to be outlined.

i. The first part of this project is scanner part. This included study about RFID
system that will be used. This project are consists of RFID tags and readers.
ii. The second part is this project mainly used to store the attendance of student in
class.
iii. The last part is interface part between RFID reader and computer using RS232
interface. The compatibility issued need to be considered to make sure all the
data arrived on computer not corrupted.
iv. All data that will be send to lecturer’s computer will be manipulate by software
call Microsoft Visual Basic 6.0.

1.5 Methodology

The methodology of this project commence with a study about scanner that
widely used nowadays. This is included to find the suitable scanner that been used for
this project. In this project, RFID reader will act as a scanner. After that, this project is
also need a study about storage in scanner either internal or external memory. This
memory must also include the networking system for sending data stored in there to the
notebook. Figure 1.2 and 1.3 shows about the schedule for this project during FYP 1 and
FYP 2.
5
 

Weeks 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15

Title of
Project
Literature
Review
Find
Equipment
Presentation
Report
Writing
Figure 1.2: Gantt chart for FYP1

Weeks 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15

Thesis

Literature
Review
Circuit
Development
Troubleshoot

Exhibition

Submit thesis
Figure 1.3: Gantt chart for FYP 2

1.6 Summary of Work

The flows of this project initiate with the tag scanning. RFID tag will act as
student metric card and required to wave tags through RFID reader. Once this tag being
scan, the data of that student will be stored in the storage part. This data will temporary
stored at flash memory. After all of the data stored, this data will be transferred to the
6
 

notebook using RS232. The database


d in the noteboook will maanage all th
he data thatt
being sentt from the portable
p devvice. Figuree 1.4 shows the overall flows of prroject.

Figure 1.4: Flow


F of project

1.7 Ou
utline of Th
hesis

Thhis thesis coonsists of foour chapterrs. In first chapter, it discussed about


a initiall
m statemennt, objectivve, scope of project,
idea of this projecct includinng problem
methodoloogy and sum
mmary of thhis project.
7
 

Chapter 2 will discussed about literature review of this project. It also contains
this basic knowledge of RFID system that consists of tags and readers, microcontroller,
serial communication interface and the description of software which were used in this
project.

Chapter 3 discussed the methodology of project in detailed. This chapter will


focus on the tools, component and software used to accomplish this project.

Chapter 4 described the result and implementation of this project. All the
analysis of project will be discuss in this chapter.

Chapter 5 will provide the conclusion and future recommendation of this project
for anyone who interested to do further study in this project.
CHAPTER 2

LITERATURE REVIEW

2.1 Introduction

This chapter will elaborate about Radio Frequency Identification (RFID)


technology and the basic concept of RFID system which consist of RFID reader and
tags. In this chapter also will explain briefly on microcontroller, serial communication
interface, MicroC software, AVR Studio and Proteus ISIS 7.1 Professional.
9

2.2 RFID Technology

Radio Frequency Identification or known as “RFID” is the new technology that


been used widely nowadays. RFID uses radio waves that are generally between 30 kHz
and 5.8 GHz. RFID can be passive, active or hybrid RF devices that can be used to
identify item based on their frequencies. This RFID can operate at various frequencies,
hence with varying ranges and characteristics. There is a limit for RFID frequencies as
shown in RF spectrum. RFID also can use at certain distance due to their limitation of
frequency. Table 2.1 summarizes the frequency classification in RF system.

Table 2.1: RF Spectrum

Designation Abbreviation Frequencies Free-space


Wavelengths
Very Low Frequency VLF 9 kHz - 30 kHz 33 km - 10 km
Low Frequency LF 30 kHz - 300 kHz 10 km - 1 km
Medium Frequency MF 300 kHz - 3 MHz 1 km - 100 m
High Frequency HF 3 MHz - 30 MHz 100 m - 10 m
30 MHz - 300
Very High Frequency VHF 10 m - 1 m
MHz
Ultra High Frequency UHF 300 MHz - 3 GHz 1 m - 100 mm
Super High Frequency SHF 3 GHz - 30 GHz 100 mm - 10 mm
Extremely High 30 GHz - 300
EHF 10 mm - 1 mm
Frequency GHz
 

RFID is expected to become persistent as its can be used at any technology


systems nowadays. A basic RFID system were consists of base radio
transmitter/receiver or reader, RF tags and the database that record all the data collected
by reader at tags. The RFID reader consists of an antenna, a radio interface, and a
10

control unit to encode the data in RF transponder (tag) and thus to identify any item with
which transponder is associated.

2.2.1 RFID Tag

An RFID tag is a card that can store and transmit data to a RFID reader using
radio waves. Each tag has information programmed in it. Tags can be very thick as
paper sheet. Simplest ones have only antenna and diode. These tags only reflect signals
incoming from transmitters. These are tags that are commonly used in supermarkets and
other places for securing goods from stealing. If signal is reflected, alarm is triggered.
When tag is scanned by seller, it is simply electrically destroyed so it won’t trigger an
alarm.

In this RFID system, tag can be classified into three different types which are
passive, semi passive and active tags. Passive tags are RFID tags that no have on board
power source. The electromagnetic field generated by reader antenna will trigger
passive tag’s power. Reader antenna has to transmit enough power to provide enough
energy to tag so it could to transmit back data. This will cause reading distance become
limited about several centimeters only. This kind of tags is commonly used because it
cheap and has smaller size. This tag usually consists of single IC chip and an antenna
coil which is usually flat. This kind of tags is only operating at frequency below 100
MHz and main energy carried by magnetic field. Figure 2.1 shows example of RFID tag
used in current technology.
11

 
Figure 2.1: RFID passive tag

For active tags, they don’t need to be activated by antenna reader. This kind of
tags was fully powered transmitter. In some cases tags may not need a reader antenna
because it can be configured to interact with each other. Active tag can communicate up
until several kilometers. Main disadvantages of active tags are big size and production
price is higher compared to passive ones. Figure 2.2 shows diagram of active RFID tag.

 
Figure 2.2: RFID active tag

Semi-Passive tags used similar principle as passive tags. Semi-passive tags


differ from passive in that semi passive tags build in with an internal battery for the tag’s
circuitry which allows the tag to complete other functions and which may extend the tag
signal range. Their radio transmission depends on antenna activity. As data processor
had it own power, so all received power can be used for transmitting back the signal
12

which is stronger than passive transducer. This allows increasing communication


distance with quit cheap solution. Figure 2.3 show the diagram of semi passive RFID
tags.

 
Figure 2.3: RFID semi passive tag

2.2.2 Advantages of RFID Reader

RFID technology is an updated technology who replaces bar code system


because the significant range, speed and unattended reading advantages it provide. In
modern technology nowadays, RFID application can be seen around us. This can be
seen at shopping mall when all price tag will include with RFID tag. With that, RFID
reader is use to indicate the price, the location of one product at that shopping mall.

RFID reader has many advantages compared to barcode scanner. For barcode
scanner, line of sight (LOS) needed for reading process while for RFID reader it’s
optional. RFID reader also has durability. These mean that the data from RFID tag can
be read by RFID reader at any condition. It not affected by weather, stain, dirt or partial
ripped. For barcode scanner, if bar coding was damage, the data in that bar coding can’t
be read. This made barcode scanner not very durable. Other than that, data capacity of
RFID reader is better than barcode scanner. It gives advantage in manufacturing sector
so that more data can be store at one RFID tag. Bar code is limited to like 20 characters
13

and for RFID tags can easily 512bits and more. For active RFID reader, we can read and
write a data at it RFID tag. While for barcode scanner, the data cannot be
reprogrammable once it program.

In this project, RFID reader is used to ease software implementation and it


performance. Compare to barcode scanner, RFID has better time utilization. Time
utilization include time that student touch their metric card. By using RFID reader,
process to collect data faster compare to barcode scanner. Students just need to touch
their metric card to RFID reader and other process will be done by database. Compare
to barcode scanner, student has to queue and wait for others scan their card. This will
waste student time and class session at that time. This way is not practical since the
limitation of time of class session. Figure 2.4 show the active (right) and passive (left)
readers.

Figure 2.4: RFID readers

The identification systems consist of tags and readers. This data will be stored at
tags and readers will read the data. The data will be stored and retrieve remotely using
radio waves. Figure 2.5 show about the component used in RFID system.
144

Figure 2.5:
2 Componeents of an RF
FID system

2.3 Miicrocontrolller

A microcontrroller is proogrammablee IC chip that


t controll whole opeeration of a
system. A microocontroller is also knoown as a Microcontro
M oller Unit (MCU).
( A
microconttroller contaain of mem output (I/O)
mory for proogram data.. It consistts of input/o
interface and control processinng unit. Thhe job of input/output
i t (I/O) porrt pins is too
communiccate a micro
ocontroller with
w outsidee circuit.

Miicrocontrolllers mainlyy contain off two prim


mary compoonent; Rand
dom Accesss
Memory (RAM) andd its instru
uction set. RAM is internal loogic circuit that storess
informatioon or data temporarily
t . This infoormation wiill be erasinng as powerr turned offf.
The instruuction set iss a list of co
ommand thaat used to program
p respponding fun
nction. Thee
valid insttruction of a function
n and matcching internnal hardwaare are diffferentiate a
microconttroller with another.
15

Microcontroller is also contain read only memory (ROM), programmable read


only memory (PROM), erasable programmable read only memory (EPROM). The
different between ROM and RAM is the data stored in ROM is permanent even with
loss of power supply. They are used to tell or give command on how microcontroller
should behave.

One of part in microcontroller who takes a role as communicator for


microcontroller is input/output (I/O) port pins. The number of I/O pins per chip varies
greatly, and each I/O pins can be programmed as an input or output. If the output is
heavy loads, then it is necessary to use a driver chip or transistor buffer.

Most of microcontroller contains circuitry to generate system clock. The function


of system clock is to synchronize all operation done by microcontroller. This can be
done by crystal and RC components. Therefore, we can precisely select the operating
speed that suit with application.

In this project, PIC 16F84A was used as microcontroller. PIC 16F84A use to
control bit stream of data coming from flash memory. PIC 16F84A microcontroller
consists of data memory (RAM) and EEPROM. The data memory contains 68 bytes and
64 bytes for EEPROM. There are also 13 I/O pins that user-configured on a pin-to-pin
basis. The features include in this PIC 16F84A:

i. 1024 words of program memory


ii. 14 bit wide instruction word
iii. 8 bit wide data bytes
iv. 4 interrupt sources:
a. External RB0/INT pin
16

b. TMR0 timer overflow


c. PORTB <7:4> interrupt on change
d. Data EEEPROM write complete

Figure 2.6: PIC 16F84A microcontroller

Figure 2.6 shows diagrams of PIC 16F84A microcontroller. Table 2.1 shows pin
description of PIC 16F84A.

Table 2.2: PIC 16F84A pin description

PIN NAME PIN NO. DESCRIPTION


OSC1/CLKIN 16 Oscillator crystal input/external clock source input
OSC2/CLKOUT 15 Oscillator crystal output
MCLR 4 Master clear input/programming voltage input
RA0 17 Bidirectional I/O port
RA1 18 Bidirectional I/O port
RA2 1 Bidirectional I/O port
RA3 2 Bidirectional I/O port
RA4/TOCKI 3 Clock input to TMR0 timer/counter
RB0 6 Bidirectional I/O port. External interrupt pin
RB1 7 TTL input
17

RB2 8 TTL input


RB3 9 TTL input
RB4 10 Interrupt on change pin
RB5 11 Interrupt on change pin
RB6 12 Interrupt on change pin
RB7 13 Interrupt on change pin/serial programming data
VSS 5 Ground reference for logic and I/O pins
VDD 14 Positive supply for logic and I/O pins

2.4 USART (Universal synchronous Asynchronous Transmitter)

USART are also known Serial Synchronous Communication Interface (SCI).


Synchronous operation uses clocks and data line to synchronize all the operation in
systems while for Asynchronous operation, no separate clock being used. Hence, one
pin can be used for transmission and other pins act as reception part. Both transmission
and reception can occur at a same time and this called the full duplex operation.
However, when the serial port is enabled, USART will control both pins and one of
transmission or reception pin can’t be used. USART were commonly used in
asynchronous mode to communicate with PC serial port using RS 232 protocol.
18

2.5 Serial Communication Interface

PC normally used serial protocol to communicate with other devices. Most of


our PC was build in with two serial ports at the back of it. These kinds of protocol were
commonly used for instrumentation, numerous GPIB-compatible devices and data
acquisition in conjunction with a remote sampling device.

Serial communication has two types which are asynchronous and synchronous
communication. Synchronous communication need more complex interface and clock
was sent along with a higher data rate compared to asynchronous communication.
Synchronous communication requires all exchange of communication respond end
without initiating a new communication.

For asynchronous communication, it usually use for a situation where data can be
transmitted from time to time rather than in a steady stream. A telephone conversation
is an example of asynchronous communication since both parties can talk whenever they
want. The difficulty of this communication is at receiver part. At this part, it must have
a way to find the end of conversation of other side so that one of them starts to speak. In
computer communication, this difficulty can be overcome by introduce special bits to
indicate the beginning and the end of each communications.
19

2.6 Programming Tool

The programming tools used in this project are MicroC, Proteus 7 Professional
and AVR Studio.

2.6.1 MikroC

Microchip PIC microcontroller used MicroC as their compiler. This software


comes with rich of tool development for developing applications of embedded systems.
MicroC is build by mikroElektronika.

The compiler allows user to develop and deploy complex application:

i. Write C source code using advanced Code Editor


ii. Use the included MIKROC libraries to dramatically speed up development; data
acquisition, display, variable, conversations, communication
iii. Monitoring program structure, variables and functions in Code Explorer
iv. Inspect program flow and debug executable logic with integrated
v. Debugger; get detailed reports and graphs on statistics, assembly listing and
calling tree

2.6.2 AVR Studio

This software was developing by ATMEL Corporation. AVR Studio is a


development tool for the TA90S series of AVR microcontrollers. AVR Studio enables
20

the user to fully control execution of programs on the AT90S In-circuit Emulator or the
built-in AVR Instruction Set Simulator. AVR Studio supports source level execution of
Assembly programs assembled with Atmel Corporation’s AVR Assembler and C
Programs compiled with IAR Systems’ ICCA90 C Compiler for AVR microcontroller.
AVR Studio runs under Microsoft Windows95 and Microsoft Windows NT.

The key of window of AVR Studio is the Source Window. The source window
gives information about control flow of project. In addition, AVR Studio offers a
number of other windows which enables the user to have a full control of the status of
every element in the execution target. The available windows are:

i. Watch window
ii. Register window
iii. Memory window
iv. Peripheral window
v. Message window
vi. Processor window

2.6.3 Proteus 7: ARES and ISIS

In this project, Proteus ISIS is used to designed a schematic diagram of all circuit
used. ISIS also provides the interactive system level simulator. This software combines
mixed mode circuit simulation, microprocessor models and interactive component
models. ISIS also provides the means to enter the design in the first place, the
architecture of interactive simulation and the system managing the source ad object code
associated with each project.
21

For Proteus ARES, it used to design the PCB (Printed Circuit Board) layout.
This software allows us to design the arrangement of component used at PCB. The
arrangement of component used can be arrange either automatically or manually.
However, it is recommended to arrange the component manually because by doing this,
the compression of space in PCB can be achieve. For this project, there are some
limitations of this software. Some electronic component do not have spice model to put
in the PCB design.

2.6.4 PIC Kit

In order to load the program in the microcontroller, this software was used. This
software will load all program made into internal memory of PIC16F874A. once the
HEX file was created in MicroC, this file then loaded into PIC16F874A using this PIC
Kit.

2.7 Conclusion

From the literature review made, it can be conclude that RFID systems suit with
this project because of their advantages compared to other identification systems. The
entire components used in this project are based on this finding.
 

CHAPTER 3

METHODOLOGY

3.1 Introduction

In this chapter, there will focusing on methodology for this project in detailed.
This chapter also will descript on the component used in overall of this project include
type of RFID reader, tags, storage and RS 232 circuit. Lastly, this chapter will list down
all the price of component used in this project for budget purposes.
233
 

3.2 RF
FID Readerr

In this projectt, RFID reaader JBC3000EF (as shoown at figurre 3.1) was being used.
The readeer is passivee reader. This
T type of
o reader is choose beccause the liimitation off
budget forr this projeect. It onlyy cost RM 2220 per item
m. At firstt, barcode scanner
s wass
used as a scanner in this projectt. From thee research made,
m barcoode scannerr give manyy
disadvantaages as saidd in previouus chapter. From that, this RFID rreader was used in thiss
I commonn notebook or computters, they were
project. In w designn with RS 232 femalee
connector. This RFIID reader iss also usedd serial connnection as ttheir type of
o interface.
With this, RFID readder can easiily connect to the compputer so thee compatibiility issue iss
not a probblem. JBC3300EF RFID
D reader is aalso simply communicaated with th
he computerr
through H
HyperTerminnal. From the
t HyperT
Terminal, th
he serial num
mber of RFID tags cann
be appeareed.

Figu
ure 3.1: JBC300EF RFID reader
r

There are several specifications of


o this RFID
D reader as shown beloow:

• Intterface typee : 9600 baud


b RS232 serial inteerface (outpput only) too
PC
C
• Poower Supplyy : +5VDCC supply
• Exxtra specificcation : Buzzeer
4
24
 

Bi-collor LED
RS2322 serial cablle (female) cable for PC
C
PS2 foor power source
• Reeading rangee : 7 cm
• Reesponse time : 0.1s

3.3 Prroject’s RFIID tags

RF
FID tag thatt had been used
u g which has no internall
in thiss project is passive tag
power sup
pply. The frequency
fr ussed for this tag was 125
5 kHz. This tag can bee read at thee
distance aabout 7 cm from
f the RF
FID reader. After tagss being scann, the data will
w be storee
at storage part. Figurre 3.2 shows RFID tag that been used
u in this pproject.

Figure
F 3.2: Paassive RFID tags

 
5
25
 

3.4 Stoorage

Alll the data that


t being read
r from tags
t will bee stored in flash mem
mory. In thiss
project, fllash memory that beeen used is ATMEL model
m AT4
45DB321D. This flash
h
memory will
w act as a storage paart and the data will teemporary sttored until all the dataa
transferred
d to lecturerr’s computeer. Actually
y, the datab
base of this project willl contain alll
the data oof student include nam
me, metric card’s num
mber, RFID
D serial num
mber and a
record of student’s atttendance. But
B in hardw
ware part, the
t data givven by this storage
s partt
is a rough data and th
his data willl be manipu
ulated by thee software ppart of this project.
p Thee
d in storagee will be traansferred to RS 232 intterface circuuit in serial. Figure 3.3
data stored 3
show the comparison
c n in term of size betweeen AT45DB
B321D and ccoin 5 cent.

Figure 3.3: Size comparison of AT


T45DB321D

These are some descrription abou


ut this flash memory

• DATAFLA
ASH, 32MB
B, SERIAL
L, 2.7V, 45D
DB321
• Memory Type
T :Flash
h, NOR
• Interface Type
T :Seriall, SPI
• Memory Size
S :32Mb
bit
• Memory :8K x 512Byte paages
26
 

• Case Style :SOIC


• Temperature :-40°C to + 85°C
• Termination Type :SMD
• Voltage, Supply Max :2.6V
• Voltage, Vcc :2.7V
• Foperating :66MHz

The software that been used to programmed this AT45DB321D is AVR Studio.
AVR Studio command is very hard to understand. All the source code had to be done
independently. This project failed to work because of source code that been
programmed not meet description of the project (take and deliver data). In future
reasearch, this type of flash memory is not recommended because that need high level of
programming.

3.5 RS 232 interface circuit

This part of project used to link between storage part and lecturer’s computer.
This circuit can be divided into three part; PIC 16F84A, MAX 232, and RS 232 male
Connector.

3.5.1 MAX 232

This part is used to convert data from serial binary data signal into TTL signal.
As known, all digital devices required TTL logic level to operate. All capacitor in this
circuit used to overcome noise problem since this unwanted signal will affected whole
system of this project.
27
7
 

Figure 3.4:: Schematic D


Diagram of MAX
M 232[12]

3.5.2 PIIC 16F84A

Thhis part act as


a microcon
ntroller that control all the data givven from flaash memory
y
through M m this PIC, MikroC software was used. Sourrce code forr
MAX 232. To program
this PIC quit nce the data that want to
q easy sin o be transm
mitted is a ro
ough data. Only
O need to
o
program is
i how the data
d going to be take aand transmitted. Therre are somee supporting
g
circuit forr this contro wer supply.
oller circuit such as volltage regulaator, to provvide 5 V pow
This voltaage regulato
or used to drop
d voltagee from 9V battery
b (DC
C supply) to
o 5V supply
y
voltage 3.5.1 show th
he shematicc diagram foor voltage regulator paart. Figure 3.5.2 show
w
matic diagram
the schem m of PIC 16
6F84A. In thhis figure, crystal
c and capacitor C5
C and C6 iss
used to generate
g sy
ystem clock
k about 20M
MHz sincee all operattion need to
t be donee
synchronizely.

 
Figgure 3.5.1: Scchematic diaggram of volta
age regulator [11]
28
8
 

 
Figure 3.5.2: Schematic D
Diagram of PIIC 16F84A[12]

3.5.3 S 232 male connector


RS

Figuree 3.6: RS 2322 male connecctor [12]

Fig
gure 3.6 sh
how the RS 232 male connector. It consists of nine pin
ns. This RS
S
232 is a sstandard thaat describe about
a the physical
p inteerface and pprotocol forr low speed
d
communiccation betw
ween computters and rellated devicees. RS 232 male conneector can bee
plugged sstraight into
o PC serial port. The pin
p connecttion used inn RS 232 is
i shown ass
table 3.1.
29
 
Table 3.1: RS 232 pins assignment (DB9 signal set)[11]

PIN 1 INPUT DATA CARRIER DETECT (DCD)


PIN 2 INPUT RECEIVED DATA (RXD)
PIN 3 OUTPUT TRANSMITTED DATA (TXD)
PIN 4 OUTPUT DATA TERMINAL READY (DTR)
PIN 5 SIGNAL GROUND
PIN 6 INPUT DATA SET READY (DSR)
PIN 7 OUTPUT REQUEST TO SEND (RTS)
PIN 8 INPUT CLEAR TO SEND (CTS)
PIN 9 INPUT RING INDICATOR (RI)

Normal PC hardware may only need to connect transmitter, reciever and ground
connection to operate.

3.6 Component list and total cost

From the finding, all the component had to be short listed to calculate total cost
of this project. Table 3.2 show the all the component list with their price per item.

Table 3.2: Component list and total cost

No Component Price per Unit (RM) Quantity Price (RM)


1 RFID Reader 220.00 1 220.00
2 RFID Tag 5.00 5 25.00
3 PIC16F874A 25.00 1 25.00
4 Voltage regulator 1.20 1 1.20
5 LED 0.20 2 0.40
6 MAX232 1 Stor FKE
7 Crystal 20 MHz 3.50 1 3.50
30
 

11 Push Button 0.40 2 1.80


12 Resistor 0.05 6 0.30
13 Capacitor 0.20 6 1.20
14 RS 232 Connector 0.50 2 1.00
15 Solder Wire 3.00 1 3.00
16 Battery 9V 7.20 1 7.20
TOTAL 289.60
CHAPTER 4

RESULT AND DISCUSSION

4.1 Introduction

This chapter will show about the result that obtained in this project and some
discussion regarding on how to avoid problem appeared during process of finishing this
project. Discussion held by referring the objectives of this project.
32
 

4.2 Project description

As mention before, the objective of this project is to develop attendance taking


performance by using RFID reader. The function of RFID reader is to take data from
RFID tags and save it into flash memory. For the flash memory part, the data will be
sending in series to RS 232 circuit. RS 232 were consists of two main part that is MAX
232 and PIC16F874A. MAX 232 will change the serial signal into TTL signal that
recognize by PIC16F874A. Microcontroller will manipulate this data and send the data
to PC through RS 232 connector.

4.3 Project result

By using Proteus ARES, the schematic diagram of RS 232 circuit for this project
was implemented into PCB layout. Figure 4.1 shows the PCB layout for RS 232 circuit.
The process was completed using thi steps.

i. Print designed of PCB layout on art paper


ii. Iron the empty PCB and art paper together using laminating machine
iii. Put the ironed PCB in cold water
iv. Clean the PCB board by removing the art paper
v. Arc the PCB board with acid (arching process)
333
 

Figurre 4.1: Real deesigned of PC


CB layout

PIIC microcontroller circuit


c waas also coontained aat this PC
CB design.
Programm
ming for PIC
C16F7874A
A was simpple since onnly rough data
d need to
o be sent to
o
computer.

Figuree 4.2: PCB layyout designed at ARES

Thhis softwarre also ussed to dessign the PCB


P layouut for flassh memoryy
AT45DB3321D. Figuure 4.2 show
w the desiggn of PCB layout
l for thhe flash meemory. Thee
reason to separate th
his part from
m RS 232 part
p is this flash
f memoory is very sensitive to
o
handle. T
This device also
a has electrostatic seensitivity chharacteristicc.
34
4
 

Figuree 4.3: PCB layyout for AT45DB321D

4.4 Diiscussion

Thhis project was


w divided
d into two parts;
p hardw
ware part an
nd softwaree part. Thee
main funcction of hard
dware part is to take aand send daata to the coomputer. Fiirst idea forr
this project is to usse barcode scanner ass scanner part
p but afteer several research, itt
founded th
hat RFID sy
ystem was more
m reliable compared
d to barcodde system. In
I hardwaree
development, it not only needss us to stu
udy about hardware
h onnly. It alsso needs uss
mastering all about software su
uch as AV
VR Studio and
a MicroC
C in order to program
m
hardware component used.

In this projeect, AVR Studio is used to program


p AT
TMEL flassh memory
y
321D. Flassh memory has to be programmed
AT45DB3 p d on how thhey take the data from
m
RFID read
der and tran
nsmit the dada
d in serial to MAX
X 232. In this prograamming, thee
35
 

entire source code window function as to be studied. The whole function of source code
is shown at appendix A. For this project, programming to take data from RFID was
failed. The source code to call the function of taking data is unsuccessfully done.

Figure 4.4: Source code for import data from RFID reader

Figure 4.4 shows the source code used to import data from RFID reader. To
define size of data coming from RFID reader, it can be done by writing the address size
as shown in the figure. Then, when the size of data being defined, SPI (Serial Parallel
Interface) driver also must be define in order for flash memory to communicate with
RFID reader. When the pointer pointed at command “SPID_SendCommand”, SPI
36
6
 

driver willl communicate with th


he address given in eaarly commaand (RFID reader) and
d
hat address. If SPI drivver failed to
read the ddata from th o communiccate with RFID
R reader,
error funcction defined. This is the most im
mportant paart for this pproject. In this
t project,
the addresss defined for RFID reader
r is failed
fa mmunicate with SPI driver. Thee
to com
address of RFID reaader can be
b known as
a we open
n HyperTerrminal wind
dow in ourr
personal computer.
c B
Because of the
t failure of
o communiicating SPI driver with
h address forr
RFID reaader, this project
p failled to worrk. Overalll source ccode to prrogramming
g
AT45DB3
321D can bee seen at ap
ppendix.

Thhis kind of flash mem


mory is not recommend
ded in furthher researcch since thee
programm
ming of this flash mem
mory requireed high leveel programm
mer to solv
ve it. Sincee
the main part
p of this project failled to work
k, this projecct not workking as in th
he objectivee
being men
ntion beforee. Figure 4.5 show thee final resultt of this proj
oject.

Figure 4.5: O
Overall circuit
 

CHAPTER 5

CONCLUSION AND RECOMMENDATION

5.0 Introduction

This chapter will be focusing on the conclusion and future recommendation of this
project. Future recommendation is used for further research if they any person or student wanted
to continue this project.

5.1 Conclusion

In this era of technology, RFID systems were widely used in many identification systems.
This project only contributes on small part of the RFID application that can be used to take
attendance effectively. Even though much upgraded technology of identification system used
that provide more security such as eye detection identification technology and thumbprint

 
38

identification technology, this project still can be used in small institutes, laboratory, schools,
and other related places because this project come with lower price.

This project failed to work and further research is recommended to overcome lacks of
attendance management system used now. This project can help lecturer in maintaining
attendance management. If the project success, it will ease lecturer work in management of
attendance talking.

5.3 Recommendation

Right now, USB (Universal Serial Bus) is a famous interface technology. For future
development, it recommended to use this type of interface instead using RS 232 serial interface.
Even though the USB protocol is hard to understand, it gives more advantages rather than serial
interface. The data rates of USB are much higher if compared with serial interface. Second
recommendation is to use RFID antenna to replace flash memory part. By using RFID antenna,
it gives easier scanned for student to scan their metric card. It will work as a same principle of
“Smart Tag” system. Student only has to passing through RFID reader and their name will be
recorded.

In future, the researcher also needs to consider about the security of this system. This
system is not secure enough when there are students who scan metric card for their friend who
didn’t come.

 
REFERENCES

Books and Journals

1) Damith C. Ranasinghe, Daniel W. Engels, Peter H. Cole, “Low-Cost RFID


Systems: Confronting Security and Privacy”, University of Adelaide, USA, 2004
2) Stephen A. Weis, Sanjay E. Sarma, Ronald L. Rivest, Daniel W. Engels,
“Security and Privacy Aspects of Low-Cost Radio Frequency Identification
Systems”, Massachusetts Institute of Technology, Cambridge, USA, 2004.
3) Patrick J. Sweeney, “RFID for dummies”, Indianapolis, Wiley Pub, 2005.
4) Klaus Finkenzeller, “RFID handbook: radio-frequency identification
fundamentals and applications”, John wiley, Chichester, 1999.
5) Stephen B. Miles, Sanjay E. Sarma, John R. Williams, “RFID technology and
applications”, Cambridge University Press, UK, 2008.

Thesis

6) Khoo Hui Ang , “RFID based employee attendance system”, Universiti


Teknologi Malaysia, Skudai, 2006.
7) Sarahanis Ahmad, “Electronic attendance using RFID”, Universiti Teknologi
Malaysia, Skudai, 2006.
8) Bong Khong Lee, “RFID Technology Enhanced Car Security System”,
Universiti Teknologi Malaysia, Skudai, 2006.
9) Wan Noormaheran Wan Hussin, “Security entry system using RFID system”,
Universiti Teknologi Malaysia, Skudai, 2006.
10) Nur Aimi Bt Mohd Abdul Rashid, “Classroom Attendance Using RFID”,
Universiti Teknologi Malaysia, Skudai, 2008.
11) Zaiton Bt Abu Bakar, “RFID Gate Security”, Universiti Teknologi Malaysia,
Skudai, 2008.
40
 

Internet

12) Protel schematic of RS 232 circuit


electronic-engineering.ch/microchip/projects/rs_test/RS232-interface.pdf
13) Examining the Elements of a Basic RFID System
http://www.dummies.com/WileyCDA/DummiesArticle/id-2990.html
14) 32-megabit 2.7-volt DataFlash AT45DB321D
www.atmel.com/dyn/resources/prod_documents/doc3597.pdf
15) MAX232, MAX232I (Rev. L), Texas Instruments, Revise 2004.
www.tl.com/datasheet/max232.pdf
16) PIC 16F84A datasheet, Microchip technology, 2001
ww1.microchip.com/downloads/en/devicedoc/35007b.pdf 
41
 

APPENDICES
Source for AVR Studio

//--------------------------------------------------------------------------------------------------------
// Headers
//-------------------------------------------------------------------------------------------------

#include "at45.h"
#include <board.h>
#include <utility/assert.h>

#include <string.h>

//-------------------------------------------------------------------------------------------------------
// Internal definitions
//--------------------------------------------------------------------------------------------------

/// Number of dataflash which can be recognized.


#define NUMDATAFLASH (sizeof(at45Devices) / sizeof(At45Desc))

//------------------------------------------------------------------------------------------------------
// Local variables
//---------------------------------------------------------------------------------------------------

/// indicate if the device is configured as binary page or not.


static unsigned char configuredBinaryPage;

//-----------------------------------------------------------------------------------------------------
// Internal variables
//---------------------------------------------------------------------------------------------------

static const At45Desc at45Devices[] = {

{ 8192, 1, 528, 10, 0x34, "AT45DB321D"},

};
//--------------------------------------------------------------------------------------------------------
// Exported functions
//--------------------------------------------------------------------------------------------------

/// Initializes an AT45 instance and configures SPI chip select register. Always returns 0.
/// \param pAt45 Pointer to the At45 instance to initialize.
/// \param pSpid Pointer to the underlying SPI driver.
/// \param spiCs Chip select value to connect to the At45.
//--------------------------------------------------------------------------------------------------------

unsigned char AT45_Configure(At45 *pAt45, Spid *pSpid, unsigned char spiCs)


{
SpidCmd *pCommand;

// Sanity checks
ASSERT(pSpid, "AT45_Configure: pSpid is 0.\n\r");
ASSERT(pAt45, "AT45_Configure: pAt45 is 0.\n\r");

// Initialize the At45 instance


pAt45->pSpid = pSpid;
pAt45->pDesc = 0;
memset(pAt45->pCmdBuffer, 0, 8);

// Initialize the spidCmd structure


pCommand = &(pAt45->command);
pCommand->pCmd = pAt45->pCmdBuffer;
pCommand->callback = 0;
pCommand->pArgument = 0;
pCommand->spiCs = spiCs;

return 0;
}
//-------------------------------------------------------------------------------------------------
/// This function returns 1 if the At45 driver is not executing any command; otherwise it
returns 0.
/// \param pAt45 Pointer to an At45 instance.
//--------------------------------------------------------------------------------------------------
unsigned char AT45_IsBusy(At45 *pAt45)
{
return SPID_IsBusy(pAt45->pSpid);
}

//-------------------------------------------------------------------------------------------------
/// Sends a command to the dataflash through the SPI. The command is identified by its
command code and the number of bytes to transfer (1 + number of address bytes +
number of dummy bytes). If data needs to be received, then a data buffer must be
provided. This function does not block; its optional callback will be invoked when the
transfer completes.

/// \param pAt45 Pointer to an At45 driver instance.


/// \param cmd Command code.
/// \param cmdSize Size of command code + address bytes + dummy bytes.
/// \param pData Data buffer.
/// \param dataSize Number of data bytes to send/receive.
/// \param address Address at which the command is performed if meaningful.
/// \param callback Optional callback to invoke at end of transfer.
/// \param pArgument Optional parameter to the callback function.
//--------------------------------------------------------------------------------------------------------

unsigned char AT45_SendCommand(


At45 *pAt45,
unsigned char cmd,
unsigned char cmdSize,
unsigned char *pData,
unsigned int dataSize,
unsigned int address,
SpidCallback callback,
void *pArgument)
{
SpidCmd *pCommand;
const At45Desc *pDesc = pAt45->pDesc;
unsigned int dfAddress = 0;

ASSERT(pAt45, "AT45_Command: pAt45 is 0.\n\r");


ASSERT(pDesc || (cmd == AT45_STATUS_READ),
if (AT45_IsBusy(pAt45)) {

return AT45_ERROR_LOCK;
}

// Compute command pattern


pAt45->pCmdBuffer[0] = cmd;

// Add address bytes if necessary


if (cmdSize > 1) {

ASSERT(pDesc, "AT45_Command: No descriptor for dataflash.\n\r");


if (!configuredBinaryPage) {
dfAddress =
((address / (pDesc->pageSize)) << pDesc->pageOffset)
+ (address % (pDesc->pageSize));
}
else {
dfAddress = address;
}
// Write address bytes
if (pDesc->pageNumber >= 16384) {

pAt45->pCmdBuffer[1] = ((dfAddress & 0x0F000000) >> 24);


pAt45->pCmdBuffer[2] = ((dfAddress & 0x00FF0000) >> 16);
pAt45->pCmdBuffer[3] = ((dfAddress & 0x0000FF00) >> 8);
pAt45->pCmdBuffer[4] = ((dfAddress & 0x000000FF) >> 0);

if ((cmd != AT45_CONTINUOUS_READ) && (cmd != AT45_PAGE_READ))


{

cmdSize++;
}
}
else {

pAt45->pCmdBuffer[1] = ((dfAddress & 0x00FF0000) >> 16);


pAt45->pCmdBuffer[2] = ((dfAddress & 0x0000FF00) >> 8);
pAt45->pCmdBuffer[3] = ((dfAddress & 0x000000FF) >> 0);
}
}

// Update the SPI Transfer descriptors


pCommand = &(pAt45->command);
pCommand->cmdSize = cmdSize;
pCommand->pData = pData;
pCommand->dataSize = dataSize;
pCommand->callback = callback;
pCommand->pArgument = pArgument;

// Send Command and data through the SPI


if (SPID_SendCommand(pAt45->pSpid, pCommand)) {

return AT45_ERROR_SPI;
}

return 0;
}

//---------------------------------------------------------------------------------------------------
/// This function returns the At45Desc structure corresponding to the device connected
/// It automatically initializes pAt45->pDesc field structure.
/// This function shall be called by the application before AT45_SendCommand.
/// Returns 0 if successful; Otherwise, returns AT45_ERROR_LOCK if the At45
/// driver is in use or AT45_ERROR_SPI if there was an error with the SPI driver.
/// \param pAt45 Pointer to an AT45 driver instance.
/// \param status Device status register value.
//----------------------------------------------------------------------------------------------------
const At45Desc * AT45_FindDevice(At45 *pAt45, unsigned char status)
{
unsigned int i;
unsigned char id = AT45_STATUS_ID(status);

// Check if status is all one; in which case, it is assumed that no device


// is connected
if (status == 0xFF) {

return 0;
}

// Look in device array


i = 0;
pAt45->pDesc = 0;
while ((i < NUMDATAFLASH) && !(pAt45->pDesc)) {

if (at45Devices[i].id == id) {

pAt45->pDesc = &(at45Devices[i]);
}
i++;
}
configuredBinaryPage = AT45_STATUS_BINARY(status);
return pAt45->pDesc;
}

//--------------------------------------------------------------------------------------------------------
/// This function returns the pagesize corresponding to the device connected
/// \param pAt45 Pointer to an AT45 driver instance.
//--------------------------------------------------------------------------------------------------
unsigned int AT45_PageSize(At45 *pAt45)
{
unsigned int pagesize = pAt45->pDesc->pageSize;
if(((pAt45->pDesc->hasBinaryPage) == 0) || !configuredBinaryPage){
return pagesize;
}
return ((pagesize >> 8) << 8);
}
1 2 3 4

PIC16F84 MAX232
D (Direction seen from controller) D
VDD
VDD
R1 XT1 VSS
C4
16k C3
4.000 MHz 10u
C1 C2 10u
S1 10p VDD 10p

16
2
6
SW-PB VSS VSS

14
U1
C5 13 12

V+

VCC
V-
IC_PIC1 RS232 TXD R1 IN R1 OUT PIC RXD
RS232 8 9 5V
16 15 RS232 DTR R2 IN R2 OUT 5V DTR

VDD
VSS 4n7 OSC1/CLKIN OSC2/CLKOUT 11 14
4 7 PIC TXD T1 IN T1 OUT RS232 RXD
MCLR RB1 5V 10 7 RS232
17 8 5V DSR T2 IN T2 OUT RS232 DSR
C PIC TXD RA0 RB2 1 4 C

GND
18 9 C1+ C2+
RA1 RB3 3 5
5V DSR 1 10 C1 - C2 -
RA2 RB4
2 11
RA3 RB5 C6 MAX232CPE(16) C7
5V DTR 3 12
RA4/T0CKI RB6 10u 10u
VSS

15
6 13
PIC RXD RB0/INT RB7
PIC16F84-04/P(18)
5

VSS
VDD
VDD VSS
VDD
C8
DSR and DTR signals are not used in
100n
B VSS RS232 my RS232 routines, but are drawn for
completion. These signals are necessary C9
B
VSS
(Direction seen from host) for hardware handshaking, whilst my 100n
routines perform no handshaking. The
RS232 DTR MAX232 has two output and two input VSS
RS232 TXD VSS channels, specified to transmit up to 120
kbps depending on the type used.
RS232 RXD
RS232 DSR
1
6
2
7
3
8
4
9
5

Title
PIC-RS232 Interface using MAX232
A A
Written by Date
SUB1 20-Aug-2003
Peter Luethi
DB9 Revision Page
Dietikon, Switzerland 1.01 1 of 1

1 2 3 4
  
 
       

SLLS047L − FEBRUARY 1989 − REVISED MARCH 2004

D Meets or Exceeds TIA/EIA-232-F and ITU MAX232 . . . D, DW, N, OR NS PACKAGE


Recommendation V.28 MAX232I . . . D, DW, OR N PACKAGE
(TOP VIEW)
D Operates From a Single 5-V Power Supply
With 1.0-mF Charge-Pump Capacitors C1+ 1 16 VCC
D Operates Up To 120 kbit/s VS+ 2 15 GND
D Two Drivers and Two Receivers C1− 3 14 T1OUT
C2+ 4 13 R1IN
D ±30-V Input Levels
R1OUT
C2− 5 12
D Low Supply Current . . . 8 mA Typical VS− 6 11 T1IN
D ESD Protection Exceeds JESD 22 T2OUT 7 10 T2IN
− 2000-V Human-Body Model (A114-A) R2IN 8 9 R2OUT
D Upgrade With Improved ESD (15-kV HBM)
and 0.1-mF Charge-Pump Capacitors is
Available With the MAX202
D Applications
− TIA/EIA-232-F, Battery-Powered Systems,
Terminals, Modems, and Computers

description/ordering information
The MAX232 is a dual driver/receiver that includes a capacitive voltage generator to supply TIA/EIA-232-F
voltage levels from a single 5-V supply. Each receiver converts TIA/EIA-232-F inputs to 5-V TTL/CMOS levels.
These receivers have a typical threshold of 1.3 V, a typical hysteresis of 0.5 V, and can accept ±30-V inputs.
Each driver converts TTL/CMOS input levels into TIA/EIA-232-F levels. The driver, receiver, and
voltage-generator functions are available as cells in the Texas Instruments LinASIC library.

ORDERING INFORMATION
ORDERABLE TOP-SIDE
TA PACKAGE†
PART NUMBER MARKING
PDIP (N) Tube of 25 MAX232N MAX232N
Tube of 40 MAX232D
SOIC (D) MAX232
Reel of 2500 MAX232DR
0°C to 70°C
Tube of 40 MAX232DW
SOIC (DW) MAX232
Reel of 2000 MAX232DWR
SOP (NS) Reel of 2000 MAX232NSR MAX232
PDIP (N) Tube of 25 MAX232IN MAX232IN
Tube of 40 MAX232ID
SOIC (D) MAX232I
−40°C
−40 C to 85
85°C
C Reel of 2500 MAX232IDR
Tube of 40 MAX232IDW
SOIC (DW) MAX232I
Reel of 2000 MAX232IDWR
† Package drawings, standard packing quantities, thermal data, symbolization, and PCB design
guidelines are available at www.ti.com/sc/package.

Please be aware that an important notice concerning availability, standard warranty, and use in critical applications of
Texas Instruments semiconductor products and disclaimers thereto appears at the end of this data sheet.

LinASIC is a trademark of Texas Instruments.


      !"#   $"%&! '#( Copyright  2004, Texas Instruments Incorporated
'"! !  $#!! $# )# #  #* "#
'' +,( '"! $!#- '#  #!#&, !&"'#
#-  && $##(

POST OFFICE BOX 655303 • DALLAS, TEXAS 75265 1


  
 
       

SLLS047L − FEBRUARY 1989 − REVISED MARCH 2004

Function Tables

EACH DRIVER
INPUT OUTPUT
TIN TOUT
L H
H L
H = high level, L = low
level

EACH RECEIVER
INPUT OUTPUT
RIN ROUT
L H
H L
H = high level, L = low
level

logic diagram (positive logic)


11 14
T1IN T1OUT

10 7
T2IN T2OUT

12 13
R1OUT R1IN

9 8
R2OUT R2IN

2 POST OFFICE BOX 655303 • DALLAS, TEXAS 75265


  
 
       

SLLS047L − FEBRUARY 1989 − REVISED MARCH 2004

absolute maximum ratings over operating free-air temperature range (unless otherwise noted)†
Input supply voltage range, VCC (see Note 1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . −0.3 V to 6 V
Positive output supply voltage range, VS+ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . VCC − 0.3 V to 15 V
Negative output supply voltage range, VS− . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . −0.3 V to −15 V
Input voltage range, VI: Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . −0.3 V to VCC + 0.3 V
Receiver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ±30 V
Output voltage range, VO: T1OUT, T2OUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . VS− − 0.3 V to VS+ + 0.3 V
R1OUT, R2OUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . −0.3 V to VCC + 0.3 V
Short-circuit duration: T1OUT, T2OUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Unlimited
Package thermal impedance, θJA (see Notes 2 and 3): D package . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73°C/W
DW package . . . . . . . . . . . . . . . . . . . . . . . . . . 57°C/W
N package . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67°C/W
NS package . . . . . . . . . . . . . . . . . . . . . . . . . . . 64°C/W
Operating virtual junction temperature, TJ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150°C
Storage temperature range, Tstg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . −65°C to 150°C
† Stresses beyond those listed under “absolute maximum ratings” may cause permanent damage to the device. These are stress ratings only, and
functional operation of the device at these or any other conditions beyond those indicated under “recommended operating conditions” is not
implied. Exposure to absolute-maximum-rated conditions for extended periods may affect device reliability.
NOTES: 1. All voltages are with respect to network GND.
2. Maximum power dissipation is a function of TJ(max), θJA, and TA. The maximum allowable power dissipation at any allowable
ambient temperature is PD = (TJ(max) − TA)/θJA. Operating at the absolute maximum TJ of 150°C can affect reliability.
3. The package thermal impedance is calculated in accordance with JESD 51-7.

recommended operating conditions


MIN NOM MAX UNIT
VCC Supply voltage 4.5 5 5.5 V
VIH High-level input voltage (T1IN,T2IN) 2 V
VIL Low-level input voltage (T1IN, T2IN) 0.8 V
R1IN, R2IN Receiver input voltage ±30 V
MAX232 0 70
TA Operating free-air temperature °C
MAX232I −40 85

electrical characteristics over recommended ranges of supply voltage and operating free-air
temperature (unless otherwise noted) (see Note 4 and Figure 4)
PARAMETER TEST CONDITIONS MIN TYP‡ MAX UNIT
VCC = 5.5 V, All outputs open,
ICC Supply current 8 10 mA
TA = 25°C
‡ All typical values are at VCC = 5 V and TA = 25°C.
NOTE 4: Test conditions are C1−C4 = 1 µF at VCC = 5 V ± 0.5 V.

POST OFFICE BOX 655303 • DALLAS, TEXAS 75265 3


  
 
       

SLLS047L − FEBRUARY 1989 − REVISED MARCH 2004

DRIVER SECTION

electrical characteristics over recommended ranges of supply voltage and operating free-air
temperature range (see Note 4)
PARAMETER TEST CONDITIONS MIN TYP† MAX UNIT
VOH High-level output voltage T1OUT, T2OUT RL = 3 kΩ to GND 5 7 V
VOL Low-level output voltage‡ T1OUT, T2OUT RL = 3 kΩ to GND −7 −5 V
ro Output resistance T1OUT, T2OUT VS+ = VS− = 0, VO = ±2 V 300 Ω
IOS§ Short-circuit output current T1OUT, T2OUT VCC = 5.5 V, VO = 0 ±10 mA
IIS Short-circuit input current T1IN, T2IN VI = 0 200 µA
† All typical values are at VCC = 5 V, TA = 25°C.
‡ The algebraic convention, in which the least-positive (most negative) value is designated minimum, is used in this data sheet for logic voltage
levels only.
§ Not more than one output should be shorted at a time.
NOTE 4: Test conditions are C1−C4 = 1 µF at VCC = 5 V ± 0.5 V.

switching characteristics, VCC = 5 V, TA = 25°C (see Note 4)


PARAMETER TEST CONDITIONS MIN TYP MAX UNIT
RL = 3 kΩ to 7 kΩ,
SR Driver slew rate 30 V/µs
See Figure 2
SR(t) Driver transition region slew rate See Figure 3 3 V/µs
Data rate One TOUT switching 120 kbit/s
NOTE 4: Test conditions are C1−C4 = 1 µF at VCC = 5 V ± 0.5 V.

RECEIVER SECTION

electrical characteristics over recommended ranges of supply voltage and operating free-air
temperature range (see Note 4)
PARAMETER TEST CONDITIONS MIN TYP† MAX UNIT
VOH High-level output voltage R1OUT, R2OUT IOH = −1 mA 3.5 V
VOL Low-level output voltage‡ R1OUT, R2OUT IOL = 3.2 mA 0.4 V
Receiver positive-going input
VIT+ R1IN, R2IN VCC = 5 V, TA = 25°C 1.7 2.4 V
threshold voltage
Receiver negative-going input
VIT− R1IN, R2IN VCC = 5 V, TA = 25°C 0.8 1.2 V
threshold voltage
Vhys Input hysteresis voltage R1IN, R2IN VCC = 5 V 0.2 0.5 1 V
ri Receiver input resistance R1IN, R2IN VCC = 5, TA = 25°C 3 5 7 kΩ
† All typical values are at VCC = 5 V, TA = 25°C.
‡ The algebraic convention, in which the least-positive (most negative) value is designated minimum, is used in this data sheet for logic voltage
levels only.
NOTE 4: Test conditions are C1−C4 = 1 µF at VCC = 5 V ± 0.5 V.

switching characteristics, VCC = 5 V, TA = 25°C (see Note 4 and Figure 1)


PARAMETER TYP UNIT
tPLH(R) Receiver propagation delay time, low- to high-level output 500 ns
tPHL(R) Receiver propagation delay time, high- to low-level output 500 ns
NOTE 4: Test conditions are C1−C4 = 1 µF at VCC = 5 V ± 0.5 V.

4 POST OFFICE BOX 655303 • DALLAS, TEXAS 75265


  
 
       

SLLS047L − FEBRUARY 1989 − REVISED MARCH 2004

PARAMETER MEASUREMENT INFORMATION


VCC

R1OUT RL = 1.3 kΩ
R1IN
or
or
Pulse R2OUT See Note C
R2IN
Generator
(see Note A)

CL = 50 pF
(see Note B)

TEST CIRCUIT

≤10 ns ≤10 ns

3V
90% 90%
Input 50% 50%
10% 10%
0V
500 ns
tPLH
tPHL
VOH
Output 1.5 V 1.5 V
VOL
WAVEFORMS
NOTES: A. The pulse generator has the following characteristics: ZO = 50 Ω, duty cycle ≤ 50%.
B. CL includes probe and jig capacitance.
C. All diodes are 1N3064 or equivalent.

Figure 1. Receiver Test Circuit and Waveforms for tPHL and tPLH Measurements

POST OFFICE BOX 655303 • DALLAS, TEXAS 75265 5


  
 
       

SLLS047L − FEBRUARY 1989 − REVISED MARCH 2004

PARAMETER MEASUREMENT INFORMATION


T1IN or T2IN T1OUT or T2OUT
Pulse
Generator EIA-232 Output
(see Note A)
CL = 10 pF
RL
(see Note B)

TEST CIRCUIT
≤10 ns ≤10 ns
3V
90% 90%
Input 50% 50%
10% 10%
0V
5 µs
tPLH
tPHL

90% VOH
90%
Output
10% 10%
VOL
tTHL tTLH

0.8 (V –V ) 0.8 (V –V )
OH OL OL OH
SR + or
t t
TLH THL
WAVEFORMS

NOTES: A. The pulse generator has the following characteristics: ZO = 50 Ω, duty cycle ≤ 50%.
B. CL includes probe and jig capacitance.

Figure 2. Driver Test Circuit and Waveforms for tPHL and tPLH Measurements (5-µs Input)

Pulse
Generator EIA-232 Output
(see Note A)
3 kΩ CL = 2.5 nF

TEST CIRCUIT

≤10 ns ≤10 ns
Input
90% 90%
10% 1.5 V 1.5 V 10%
20 µs
tTLH
tTHL

VOH
3V 3V
Output
−3 V −3 V
VOL

6V
SR +
t or t
THL TLH

WAVEFORMS
NOTE A: The pulse generator has the following characteristics: ZO = 50 Ω, duty cycle ≤ 50%.

Figure 3. Test Circuit and Waveforms for tTHL and tTLH Measurements (20-µs Input)

6 POST OFFICE BOX 655303 • DALLAS, TEXAS 75265


  
 
       

SLLS047L − FEBRUARY 1989 − REVISED MARCH 2004

APPLICATION INFORMATION
5V

+
CBYPASS =1µF

16
C3† 1 µF
VCC
1 2
C1+ 8.5 V
C1 1 µF 3 VS+
C1−
4 6
VS− −8.5 V
C2+
C2 1 µF 5 C4 1 µF
C2− +

11 14
EIA-232 Output
From CMOS or TTL
10 7
EIA-232 Output
12 13
EIA-232 Input
To CMOS or TTL
9 8
EIA-232 Input
0V
15

GND
† C3 can be connected to VCC or GND.
NOTES: A. Resistor values shown are nominal.
B. Nonpolarized ceramic capacitors are acceptable. If polarized tantalum or electrolytic capacitors are used, they should be
connected as shown. In addition to the 1-µF capacitors shown, the MAX202 can operate with 0.1-µF capacitors.

Figure 4. Typical Operating Circuit

POST OFFICE BOX 655303 • DALLAS, TEXAS 75265 7

You might also like