Вы находитесь на странице: 1из 56

Automatic Traffic Boom Barrier System using RFID

AUTOMATIC TRAFFIC BOOM


BARRIER SYSTEM USING RFID
Project submitted in partial fulfillment of the requirements for the degree of
Bachelor of Technology
In
Electronics and Communication Engineering

Submitted by:
Ritesh Kumar : 11011237
Ritu Nanda : 11005800
Anjali Sharma : 11115291
Akash Kumar Saini : 11004843

Under the supervision of


Bhaktapriya Mohapatra

Department of Electronics and Communication Engineering


Lovely Professional University
Phagwara 144411, Punjab

i
Automatic Traffic Boom Barrier System using RFID

DECLARATION

We hereby declare that the project entitled “Automatic Traffic Boom Barrier System using
RFID” is an authentic record of our own work carried out as requirements of Capstone Project
for the award of degree of B.Tech in Electronics and Communication Engineering Department
from Lovely Professional University, Phagwara, under the guidance of Asst. Prof.
Bhaktapriya Mohapatra during January to April, 2014. We also cited the reference about the
texts/figures/tables from where they have been taken and the project has not formed the basis for
the award of any degree, associate ship, fellowship or any other similar titles.

Ritesh Kumar
Ritu Nanda
Anjali Sharma
Akash Kumar Saini

ii
Automatic Traffic Boom Barrier System using RFID

CERTIFICATE

LOVELY PROFESSIONAL UNIVERISTY


Phagwara

This is to certify that the Thesis entitled, ‘AUTOMATIC TRAFFIC BOOM BARRIER
SYSTEM USING RFID’ submitted by Ritesh Kumar, Ritu Nanda, Akash Kumar Saini and
Anjali Sharma in partial fulfillment of the requirements for the award of Bachelor of
Technology Degree in Electronics and Communication Engineering at LOVELY
PROFESSIONAL UNIVERSITY is an authentic work carried out by them under my
supervision. To the best of my knowledge and belief the matter embodied in the thesis has not
been submitted by them to any other University/Institute for the award of any Degree/Diploma.

Signature of Supervisor

Date: Name & Designation

iii
Automatic Traffic Boom Barrier System using RFID

ACKNOWLEDGEMENT

This project in itself is an acknowledgement to the inspiration, drive and the technical assistance
contributed to it by many people. It would have never seen the light of day without the help and
guidance that it received from them.

Firstly, we would like to express our sincere thanks and deepest regards to our guide Sir
Bhaktapriya Mohapatra, Assistant Professor, Department of Electronics and
Communication Engineering, Lovely Professional University, who has been the constant
source of motivation for the successful completion of this work. We thank him for giving us the
opportunity to work under him and helping us realize our full potential.

We thank our parents for their emotional support and constant encouragement which helped us
strive and move forward. Last but not the least we would like to thank all our friends for their
support, for all the thoughtful and stimulating discussions that encouraged us to think outside the
box.

Ritesh Kumar
Ritu Nanda
Anjali Sharma
Akash Kumar Saini

iv
Automatic Traffic Boom Barrier System using RFID

ABSTRACT

Automatic Traffic Boom Barrier System using RFID implemented on 8051 microcontroller. This
is a very useful application of RFID (Radio-frequency identification) and is very commonly used
in institutes, offices, homes and so on. An RFID system consists of a reader device and a
transponder. A transponder or tag has a unique serial number which is identified by the reader.
Here RFID has been interfaced with AT89S52 to provide secured access. The relevant messages
are also displayed on a 16x2 LCD.

The aim of our project is to design a system, which automatically identifies an approaching vehicles
if the vehicle belongs to the authorized person, it automatically opens the boom barrier and closes it
when the vehicle has passed. These translate to reduced traffic congestion and help in lower fuel
consumption. This is very important advantage of this system.

RFID automated access for door controller in buildings, departments, rooms, secured closets and
cabinets is very cost effective and secure to use. Many people do not realize how easy it is to
implement card access systems such as card access door or doors using RFID readers and RFID
Cards or Key fobs for Secured Access Control Management. You can even use smart readers for
computer rooms and securing individual computers.

v
Automatic Traffic Boom Barrier System using RFID

CONTENTS
CHAPTER 1: Introduction Page No.

1.1 Motivation……………………………………………...3
1.2 Objective………...……………………………………..3
1.3 Project Organization…………………………………...4
1.4 Problem Statement……………………………………..4

CHAPTER 2: Boom Barrier

2.1 Introduction………………………………………….....6

2.2 Block Diagram………………………………………....7

2.3 Circuit Operation…………………………………….....8

2.4 Circuit Description……………………………………..8

2.5 Principle of Operation………………………………...12

2.6 Flow Chart………………………………………….....15

CHAPTER 3: Hardware Description

3.1 Components and Equipment used in the Project…….17


3.2 Specifications…………………………………….…..25
3.3 Complete Circuit Diagram……………………….…..32

CHAPTER 4: Software Simulation

4.1 Software Requirement………………………………...34


4.2 Circuit Diagram………….…………………….….......39

vi
Automatic Traffic Boom Barrier System using RFID

4.3 Virtual Terminal………………………….…….……39


4.4 Difficulties Faced…….…………....…………….......40
4.5 Photos of the Demo.…………………………………41

CHAPTER 5: Conclusion and Applications

5.1 Conclusion………………………………………...…43
5.2 Applications and Utilities…………………..…….….43
5.3 Future Scope…………………………..………….….45
5.4 Appendix I (List of Abbreviation)..……………….…46
5.5 References……………………...………………….…47

vii
Automatic Traffic Boom Barrier System using RFID

List of figures
Figure no: Title Page No.
Fig 1 Power Circuit…………………………………………9
Fig 2 LM7805……………………………………………....9
Fig 3 Card with RFID Chip ……………………………...14
Fig 4 RFID Reader…………………………………...……19
Fig 5 LCD Display………………………………………...22
Fig 6 AT89S52…………………………………………….26
Fig 7 Max 232……………………………………………..30
Fig 8 Hyper Terminal………………...……………………35
Fig 9 Virtual Port Emulator…………..……………………36
Fig 10 Keil Snapshot………………………………………..38
Fig 11 Proteus Snapshot...…………………………………..39
Fig 12 Virtual Terminal……………………………………..40
Fig 13 Project Snapshot……………………………………..41

viii
Automatic Traffic Boom Barrier System using RFID

List of tables

Table No: Title Page No.


Table 1 Component Used…………………………………..17
Table 2 LCD Pin Description………………………………22
Table 3 List OF LCD Commands………………………….24
Table 4 Max 232 Pin Description…………………………..31

ix
Automatic Traffic Boom Barrier System using RFID

CHAPTER 1
Introduction about the Project

1
Automatic Traffic Boom Barrier System using RFID

INTRODUCTION

RFID Module

RFID technology is based on the concept of magnetic coupling, which is the principle that
current flowing in one circuit can induce current flow in another circuit through a magnetic field
generated in the space between the circuits. In passive RFID, there are two major components:
the reader and the mobile tag.

The reader has two main functions: the first is to transmit a carrier signal, and the second is to
receive a response from any tags in proximity of the reader. A tag needs to receive the carrier
signal, modify it in some way corresponding to the data on the card, and retransmit the modified
response back to the reader.
In modern passive RFID devices, the tag consists of a small integrated circuit (that performs the
modulation) and an antenna. The benefit of passive RFID is that it requires no internal power
source; the circuit on the tag is actually powered by the carrier signal. Thus, the carrier signal
transmitted from the reader must be considerably large so that the response can be read even
from the card.

As shown in the above block diagram RFID systems are classified according to the properties of
the data carrier called a transponder or tag. The two major classes of RFID transponders are
active and passive.

2
Automatic Traffic Boom Barrier System using RFID

1.1 Motivation

The main motivation has been derived from the requirement of automatic system for the opening
and closing of boom barrier. Boom gates are typically found at level (rail)
crossings, drawbridges, parking facilities, checkpoints and entrances to restricted areas. They are
also the usual method for controlling passage through toll booths, and can also be found on
some freeway entrance ramps which are automatically controlled to drop to restrict traffic in the
event of accident cleanup or road closures without the need to dispatch road workers or law
enforcement to use a vehicle to block the way. Some boom gates are automatic and powered,
others are manually operated. Manual gates are sometimes hung in the manner of a normal gate
(i.e. hinged horizontally). In some places, boom gates are installed across suburban streets as
a traffic calming measure, preventing through traffic, while allowing authorized vehicles such
as emergency services and buses to take advantage of the shorter and more direct route

1.2 Objective

The main objective of this project is to design a RFID based Automatic Boom Barrier using 8051
microcontroller (AT89S52). This boom barrier works upon the RFID technology, the users are
provided with RFID card, these cards are read by the reader and recognized by the system. The
users are provided with a card with a unique code inside it. When this card comes in the range of
the reader it is activated and transmit the unique code to the RFID system. The authorized person
are allowed to pass the gate and the user which are not authorized for them the gate does not
open. In fact access based entrance and exits using access smart technology is rapidly becoming
the way of the future for many businesses, government buildings, hospitals, museums and other
establishments requiring secured but easy to control access solutions. Access based systems use
either 125 kHz RFID or 13.56 MHz RFID readers, cards and key fobs.

3
Automatic Traffic Boom Barrier System using RFID

Features:
 Low power requirement.
 Excellent characters appearance.
 Reliability.
 Lower cost.

1.3 Project Organization

The definition and the basic components of RFID has been discussed in chapter 2.Section 2.2
deals with the block diagram of complete automatic boom barrier system. Along with this, the
entire operation of the circuit, circuit description and the operation of the circuit have been
analyzed in detail in sections 2.3, 2.4 and 2.5. The hardware description of the circuit has been
discussed in chapter 3. Chapter 4 shows the software simulation results of the boom barrier using
Proteus, Keil compiler, hyper terminal and virtual serial port emulator. Finally, we conclude the
complete work in chapter 5, including the applications and utilities.

1.4 Problem Statement


The main purpose of the construction of this project automatic Boom Barrier using RFID is to
reduce the congestion due to traffic caused by the different vehicles. Therefore a person
operating this barrier is required which can check the identification of each and every person
who want to pass the barrier , but this is very time consuming instead of using a person to
operate this barrier we have developed a system which will automatically recognize the
authorized person and grant access to him by opening the gate. This technology is very
beneficial since it saves the lot of time and human effort to come every time and check whether
the person is authorized or not. RFID automatically recognized the person which are to be
granted access and which are not to be grant access.

4
Automatic Traffic Boom Barrier System using RFID

CHAPTER 2
How Boom Barrier Works

5
Automatic Traffic Boom Barrier System using RFID

2.1 Introduction
Radio-frequency identification (RFID) is an automatic identification method, relying on storing
and remotely retrieving data using devices called RFID tags or transponders. The technology
requires some extent of cooperation of an RFID reader and an RFID tag. An RFID tag is an
object that can be applied to or incorporated into a product, animal, or person for the purpose of
identification and tracking using radio waves. Some tags can be read from several meters away
and beyond the line of sight of the reader.

2.1.1 What is RFID?


A basic RFID system consists of three components:
a) An antenna or coil
b) A transceiver (with decoder)
c) A transponder (RF tag)

Electronically programmed with unique information. There are many different types of RFID
systems out in the market. They are categorized according to their frequency ranges. Some of the
most commonly used RFID kits are as follows:
1) Low-frequency (30 KHz to 500 KHz)
2) Mid-Frequency (900 KHz to 1500MHz)
3) High Frequency (2.4GHz to 2.5GHz)

These frequency ranges mostly tell the RF ranges of the tags from low frequency tag ranging
from 3m to 5m, mid-frequency ranging from 5m to 17m and high frequency ranging from 5ft to
90ft. The cost of the system is based according to their ranges with low-frequency system
ranging from a few hundred dollars to a high-frequency system ranging somewhere near 5000
dollars.

6
Automatic Traffic Boom Barrier System using RFID

2.2 Block Diagram

7
Automatic Traffic Boom Barrier System using RFID

2.3 Circuit Operation

The RFID tag is used as an identity for a particular user. If the identity (serial number of the tag)
of the user is matched with the one already stored in this system, he gets immediate access
through it. This RFID based Automatic Boom Barrier also has many additional features. For
example, a new user can register him with the system. A registered user can also withdraw his
entry from the system. These features can be accessed by pressing a tactile switch connected to
the microcontroller.

In beginning, the user is prompted to scan his tag or ID. The serial code of the tag is identified by
the reader module and is sent to AT89S52 for checking. If the ID is matched by the
microcontroller, the user gets the access. On the contrary, if the tag is not identified, a message
(‘Wrong ID’) is displayed on LCD screen.

When an RFID tag comes in this range, the reader detects it and sends a unique code of the tag
serially. This serial code, consisting of 12 bytes, is received by the microcontroller. This code is
treated as an ID for the user and is stored as an array in the microcontroller. If the ID is matched
with this code, the user is granted access though the system.

2.4 Circuit Description


2.4.1 Designing
The main intension of this project is to design a RFID based Automatic Boom Barrier using 8051
microcontroller (AT89S52). In order to fulfill this application there are few steps that have been
performed i.e.

1) Designing the power supply for the entire circuitry.


2) Selection of microcontroller that suits our application.
3) Selection of LCD
4) Selection of MAX 232
5) Selection of RFID MODULE
Complete studies of all the above points are useful to develop this project.

8
Automatic Traffic Boom Barrier System using RFID

2.4.2 Power Supply Section


In-order to work with any components basic requirement is power supply. In this section there is
a requirement of one voltage level i.e. 5V DC power supply.

Fig 1 Power circuit

Fig 2: LM7805

9
Automatic Traffic Boom Barrier System using RFID

7805 is a voltage regulator integrated circuit. It is a member of 78xx series of fixed linear
voltage regulator ICs. The voltage source in a circuit may have fluctuations and would not give
the fixed voltage output. The voltage regulator IC maintains the output voltage at a constant
value. The xx in 78xx indicates the fixed output voltage it is designed to provide. 7805 provides
+5V regulated power supply.

Components needed for this circuit are:

Diodes - 1N4004

C1 - 1000uF

C2 - 0.1uF

C3 - 0.1uF

C4 - 1000uF

Regulator - 7805

Indicator - LED

Resistor 330Ω

Step down transformer

2.4.3 Selection of Microcontroller


As we know that there so many types of micro controller families that are available in the
market.
Those are
1) 8051 Family
2) AVR microcontroller Family
3) PIC microcontroller Family
4) ARM Family
Basic 8051 family is enough for our application; hence we are not concentrating on higher end
controller families. In order to fulfill our application basic that is AT89S52 controller is enough.

10
Automatic Traffic Boom Barrier System using RFID

We select AT89S52 controller because of inbuilt ISP (in system programmer) option. There are
minimum six requirements for proper operation of microcontroller. Those are:

 power supply section


 pull-ups for ports (it is must for PORT0)
 Reset circuit
 Crystal circuit
 ISP circuit (for program dumping)
 EA/VPP pin is connected to Vcc.

PORT0 is open collector that’s why we are using pull-up resistor which makes PORT0 as an I/O
port. Reset circuit is used to reset the microcontroller. Crystal circuit is used for the
microcontroller for timing pluses. In this project we are not using external memory that’s why
EA/VPP pin in the microcontroller is connected to Vcc that indicates internal memory is used for
this application.

2.4.4 Selection of LCD


A liquid crystal display (LCD) is an electronically-modulated optical device shaped into a thin,
flat panel made up of any number of color or monochrome pixels filled with liquid crystals and
arrayed in front of a light source (backlight) or reflector.

2.4.5 Selection of MAX 232


The MAX232 IC is used to convert the TTL/CMOS logic levels to RS232 logic levels during
serial communication of microcontrollers with PC. The controller operates at TTL logic level (0-
5V) whereas the serial communication in PC works on RS232 standards (-25 V to + 25V). This
makes it difficult to establish a direct link between them to communicate with each other. The
intermediate link is provided through MAX232. It is a dual driver/receiver that includes a
capacitive voltage generator to supply RS232 voltage levels from a single 5V supply. Each
receiver converts RS232 inputs to 5V TTL/CMOS levels. These receivers (R1 & R2) can accept
±30V inputs. The drivers (T1 & T2), also called transmitters, convert the TTL/CMOS input level

11
Automatic Traffic Boom Barrier System using RFID

into RS232 level. The transmitters take input from controller’s serial transmission pin and send
the output to RS232’s receiver. The receivers, on the other hand, take input from transmission
pin of RS232 serial port and give serial output to microcontroller’s receiver pin. MAX232 needs
four external capacitors whose value ranges from 1µF to 22µF.

2.4.6 Selection of RFID Module


Radio-frequency identification (RFID) is a technology that uses communication through the use
of radio waves to exchange data between a reader and an electronic tag attached to an object, for
the purpose of identification and tracking.

2.5 Principle of Operation

2.5.1 How Does RFID Works?


A Radio-Frequency Identification system has three parts:
 A scanning antenna

 A transceiver with a decoder to interpret the data

 A transponder - the RFID tag - that has been programmed with information. The
scanning antenna puts out radio-frequency signals in a relatively short range. The RF
radiation does two things:
 It provides a means of communicating with the transponder (the RFID tag) AND

 It provides the RFID tag with the energy to communicate (in the case of passive RFID
tags).

This is an absolutely key part of the technology; RFID tags do not need to contain batteries, and
can therefore remain usable for very long periods of time (maybe decades). The scanning
antennas can be permanently affixed to a surface; handheld antennas are also available. They can
take whatever shape you need; for example, you could build them into a door frame to accept
data from persons or objects passing through.

12
Automatic Traffic Boom Barrier System using RFID

When an RFID tag passes through the field of the scanning antenna, it detects the activation
signal from the antenna. That "wakes up" the RFID chip, and it transmits the information on its
microchip to be picked up by the scanning antenna.

In addition, the RFID tag may be of one of two types. Active RFID tags have their own power
source; the advantage of these tags is that the reader can be much farther away and still get the
signal. Even though some of these devices are built to have up to a 10 year life span, they have
limited life spans. Passive RFID tags, however, do not require batteries, and can be much smaller
and have a virtually unlimited life span.

RFID tags can be read in a wide variety of circumstances, where barcodes or other optically read
technologies are useless.

 The tag need not be on the surface of the object (and is therefore not subject to wear)

 The read time is typically less than 100 milliseconds

 Large numbers of tags can be read at once rather than item by item.

2.5.2 RFID Tag


An RFID tag is a microchip combined with an antenna in a compact package, the packaging is
structured to allow the RFID tag to be attached to an object to be tracked. "RFID" stands for
Radio Frequency Identification.

The tag's antenna picks up signals from an RFID reader or scanner and then returns the signal,
usually with some additional data (like a unique serial number or other customized information).
RFID tags can be very small - the size of a large rice grain. Others may be the size of a small
paperback book.

13
Automatic Traffic Boom Barrier System using RFID

Fig: 3: Card With RFID Chip

14
Automatic Traffic Boom Barrier System using RFID

2.6 Flow Chart

15
Automatic Traffic Boom Barrier System using RFID

CHAPTER 3
Hardware Description

16
Automatic Traffic Boom Barrier System using RFID

3.1 Components and Equipment used in the Project

The main hardware components used in the project are illustrated in the block diagram. We
chose Microcontroller 8051, 16*2 LCD display, motor and the RFID reader and tags as
shown in the above block diagram. These are the list of all the components used in this
project.

Table 1: Components Used

Components Specification
RFID Reader 125KHz
Microcontroller 8051(AT89S52)
LCD Display 16*2 Display
RFID card/tags --
Motor DC Geared Motor
Resistors --
Capacitors --
Crystal oscillators 12 MHz
LED --
LM7805 +5V as output
L293D Motor Driving IC

3.1.1 RFID Module

Radio frequency identification (RFID) technology is a non-contact method of item identification


based on the use of radio waves to communicate data about an item between a tag and a reader. It
uses the unlicensed spectrum space of the electromagnetic radio wave frequency and this band is
the Industrial Scientific Medical (ISM) range.

17
Automatic Traffic Boom Barrier System using RFID

It was introduced back in the 1960s but has taken long to become a mainstream technology. This
is attributed to the fact that RFID is not as cheap as the traditional labeling technologies like the
barcode, though it offers added value in read rates and data storage per label. Stanford propounds
that considering an Electronic Product Code (EPC) tag is underestimating its capabilities. An
EPC tag can contain data amounting up to 96 bytes, for example, the GID-96 hexadecimal coded
EPC.

The technology originated from the military to identify aircrafts friend or foe and is now used in
race timing, manufacturing processes, animal tracking and in the supply chain. The technology
can also be used in toll collection at toll gates or automatic boom barrier and this enables the
tracking of vehicles as well as the goods they carry, in real time.

Location tests done prove that RFID is the best technology for tracking items in motion. The
technology enables remote storage and retrieval of data and this is why developments towards
wireless identification point towards low-bandwidth systems like RFID.

The RFID data is stored on tags which respond to the reader by transforming the energy of
radiofrequency queries from the reader (or transceiver), and sending back the information they
enclose. A computer hosting a specific RFID application pilots the reader and processes the data
it sends. The ability of RFID to read objects in motion and out of the line-of-sight is its major
advantage. The tags can be read under harsh conditions of temperature, chemicals and high
pressure.

RFID has the potential to change an organization’s ability to get real time information on the
location of asserts and even personnel. The use of RFID technology reduces operational costs by
reducing the need for human operators in systems that collect information and in revenue
Collection. In manufacturing, a tagged product or part can be traced and this gives better
Visibility and the bottlenecks in automated manufacturing processes can be easily identified.

18
Automatic Traffic Boom Barrier System using RFID

Fig 4: RFID Reader

3.1.2 Microcontrollers

Microcontrollers as the name suggests are small controllers. They are like single chip computers
that are often embedded into other systems to function as processing/controlling unit. For
example the remote control you are using probably has microcontrollers inside that do decoding
and other controlling functions. They are also used in automobiles, washing machines,
microwave ovens, toys ... etc., where automation is needed.
Embedded system means the processor is embedded into the required application. An embedded
product uses a microprocessor or microcontroller to do one task only. In an embedded system,
there is only one application software that is typically burned into ROM. Example: printer,
keyboard, video game player
Microprocessor - A single chip that contains the CPU or most of the computer
Microcontroller - A single chip used to control other devices

3.1.3 Microprocessor vs. Microcontroller

Microprocessor:

 CPU is stand-alone, RAM, ROM, I/O, timer are separate


 Designer can decide on the amount of ROM, RAM and I/O ports.

19
Automatic Traffic Boom Barrier System using RFID

 Expensive
 Versatility general-purpose
Microcontroller:
 CPU, RAM, ROM, I/O and timer are all on a single chip
 Fix amount of on-chip ROM, RAM, I/O ports
 For applications in which cost, power and space are critical
 Single-purpose

Different Microcontrollers Configuration

20
Automatic Traffic Boom Barrier System using RFID

3.1.4 MAX 232


The MAX232 IC is used to convert the TTL/CMOS logic levels to RS232 logic levels during
serial communication of microcontrollers with PC. The controller operates at TTL logic level (0-
5V) whereas the serial communication in PC works on RS232 standards (-25 V to + 25V). This
makes it difficult to establish a direct link between them to communicate with each other.

The intermediate link is provided through MAX232. It is a dual driver/receiver that includes a
capacitive voltage generator to supply RS232 voltage levels from a single 5V supply. Each receiver
converts RS232 inputs to 5V TTL/CMOS levels. These receivers (R & R ) can accept ±30V inputs.
1 2

The drivers (T & T ), also called transmitters, convert the TTL/CMOS input level into RS232 level.
1 2

3.1.5 Liquid Crystal Display (LCD)


A liquid crystal display (LCD) is a thin, flat panel used for electronically displaying
information such as text, images, and moving pictures. Its uses include monitors for computers,
televisions, instrument panels, and other devices ranging from aircraft cockpit displays, to every-
day consumer devices such as video players, gaming devices, calculators, and telephones.

Among its major features are its lightweight construction, its portability and its ability to be
produced in much larger screen sizes than are practical for the construction of cathode ray tube
(CRT) display technology. Its low electrical power consumption enables it to be used in battery-
powered electronic equipment.

It is an electronically-modulated optical device made up of any number of pixels filled with


liquid crystals and arrayed in front of a light source (backlight) or reflector to produce images in
color or monochrome. The earliest discovery leading to the development of LCD technology, the
discovery of liquid crystals, dates from 1888

21
Automatic Traffic Boom Barrier System using RFID

3.1.5.1 Pin Description

FIG 5: LCD Display

LCD Pin Configuration

Table 2: LCD Pin description

PIN SYMBOL I/O DESCRIPTION

1 VSS -- Ground

2 VCC -- +5V power supply

3 VEE -- Power supply to control contrast

4 RS I RS=0 to select command register

RS=1 to select data register

22
Automatic Traffic Boom Barrier System using RFID

5 R/W I R/W=0 for write

R/W=1 for read

6 EN I/O Enable

7 DB0 I/O The 8-bit data bus

8 DB1 I/O The 8-bit data bus

9 DB2 I/O The 8-bit data bus

10 DB3 I/O The 8-bit data bus

11 DB4 I/O The 8-bit data bus

12 DB5 I/O The 8-bit data bus

13 DB6 I/O The 8-bit data bus

14 DB7 I/O The 8-bit data bus

15 VCC -- +5v power supply

16 VSS -- Ground

VCC, VSS and VEE:


While VCC and VSS provide +5V and ground respectively, VEE is used for controlling LCD
contrast.

RS (REGISTER SELECT):
There are two important registers inside the LCD. When RS is low (0), the data is to be treated as a
command or special instruction (such as clear screen, position cursor, etc.). When RS is high (1), the
data that is sent is a text data which should be displayed on the screen. For example, to display the
letter "T" on the screen you would set RS high.

23
Automatic Traffic Boom Barrier System using RFID

RW (READ/WRITE):
The RW line is the "Read/Write" control line. When RW is low (0), the information on the data bus
is being written to the LCD. When RW is high (1), the program is effectively querying (or reading)
the LCD. Only one instruction ("Get LCD status") is a read command. All others are write
commands, so RW will almost be low.

EN (ENABLE):
The EN line is called "Enable". This control line is used to tell the LCD that you are sending it data.
To send data to the LCD, your program should first set this line high (1) and then set the other two
control lines and/or put data on the data bus. When the other lines are completely ready, bring EN
low (0) again. The 1-0 transition tells the 44780 to take the data currently found on the other control
lines and on the data bus and to treat it as a command.

D0-D7 (DATA LINES):


The 8-bit data pins, D0-D7 are used to send information to the LCD or read the content of the LCD’s
internal registers. To display letters and numbers, we send ASCII codes for the letters A-Z, a-z and
numbers 0-9 to these pins while making RS=1. There are also instruction command codes that can be
sent to the LCD to clear the display or force the cursor to the home position or blink the cursor. We
also use RS=0 to check the busy flag bit to see if the LCD is ready to receive the information. The
busy flag is D7 and can be read when R/W = 1 and RS=0, as follows: if R/W = 1, RS = 0. When
D7=1 (busy flag = 1), the LCD is busy taking care of internal operations and will not accept any new
information. When D7 = 0, the LCD is ready to receive new information.

Table 3: List OF LCD Commands


CODE (HEX) COMMAND TO LCD INSTRUCTION REGISTER

1 CLEAR DISPLAY SCREEN

2 RETURN HOME

24
Automatic Traffic Boom Barrier System using RFID

4 DECREMENT CURSOR(SHIFT CURSOR TO LEFT)

6 INCREMENT CURSOR(SHIFT CURSOR TO RIGHT)

5 SHIFT DISPLAY RIGHT

7 SHIFT DISPLAY LEFT

8 DISPLAY OFF,CURSOR OFF

A DISPLAY OFF,CURSOR ON

C DISPLAY ON,CURSOR OFF

E DISPLAY ON CURSOR BLINKING

F DISPLAY ON CURSOR BLINKING

10 SHIFT CURSOR POSITION TO LEFT

14 SHIFT CURSOR POSITION TO RIGHT

18 SHIFT THE ENTIRE DISPLAY TO THE LEFT

1C SHIFT THE ENTIRE DISPLAY TO THE RIGHT

80 FORCE CURSOR TO BEGINNING OF 1ST LINE

C0 FORCE CURSOR TO BEGINNING OF 2ND LINE

8 2 LINES AND 5x7 MATRIX

3.2 Specifications

3.2.1 AT89S52

AT89S52 is an 8-bit microcontroller and belongs to Atmel's 8051 family. AT89S52 has 8KB of
Flash programmable and erasable read only memory (PEROM) and 256 bytes of RAM. It can be
erased and program to a maximum of 1000 times. In 40 pin AT89S52, there are four ports
25
Automatic Traffic Boom Barrier System using RFID

designated as P , P , P and P . All these ports are 8-bit bi-directional ports, i.e., they can be used
1 2 3 0

as both input and output ports. Except P0 which needs external pull-ups, rest of the ports have

internal pull-ups. When 1s are written to these port pins, they are pulled high by the internal pull-
ups and can be used as inputs. These ports are also bit addressable and so their bits can also be
accessed individually.

Port P0 and P2 are also used to provide low byte and high byte addresses, respectively, when

connected to an external memory. Port 3 has multiplexed pins for special functions like serial
communication, hardware interrupts, timer inputs and read/write operation from external
memory. AT89S52 has an inbuilt UART for serial communication. It can be programmed to
operate at different baud rates. Including 3 timers &eight interrupt sources.

3.2.2 Pin Configuration

Fig 6: AT89S52

26
Automatic Traffic Boom Barrier System using RFID

3.2.3 Features
 8K Bytes of In-System Reprogrammable Flash Memory
 Endurance: 1,000 Write/Erase Cycles
 Fully Static Operation: 0 Hz to 24 MHz
 Three-level Program Memory Lock
 256 x 8-bit Internal RAM
 32 Programmable I/O Lines
 Three 16-bit Timer/Counters
 Eight Interrupt Sources
 Programmable Serial Channel
 Low-power Idle and Power-down Modes

3.2.4 Pin Description


VCC
Supply voltage.

GND
Ground.

Port 0
Port 0 is an 8-bit open-drain bi-directional I/O port. As an output port, each pin can sink eight TTL
inputs. When 1s are written to port 0 pins, the pins can be used as high impedance inputs. Port 0 may
also be configured to be the multiplexed low order address/data bus during accesses to external
program and data memory. In this mode P0 has internal pull-ups. Port 0 also receives the code bytes
during Flash programming, and outputs the code bytes during program verification. External pull-ups
are required during program verification.

Port 1
Port 1 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 1 output buffers can
sink/source four TTL inputs. When 1s are written to Port 1 pins they are pulled high by the internal

27
Automatic Traffic Boom Barrier System using RFID

pull-ups and can be used as inputs. As inputs, Port 1 pins that are externally being pulled low will
source current (IIL) because of the internal pull-ups. Port 1 also receives the low-order address bytes
during Flash programming and verification.

Port 2
Port 2 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 2 output buffers can
sink/source four TTL inputs. When 1s are written to Port 2 pins they are pulled high by the internal
pull-ups and can be used as inputs. As inputs, Port 2 pins that are externally being pulled low will source
current (IIL) because of the internal pull-ups. Port 2 emits the high-order address byte during fetches
from external program memory and during accesses to external data memory that uses 16-bit
addresses (MOVX @ DPTR). In this application, it uses strong internal pull-ups when emitting 1s.
During access to external data memory that uses 8-bit addresses (MOVX @ RI), Port 2 emits the
contents of the P2 Special Function Register. Port 2 also receives the high-order address bits and
some control signals during Flash programming and verification.

Port 3
Port 3 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 3 output buffers can
sink/source four TTL inputs. When 1s are written to Port 3 pins they are pulled high by the internal
pull-ups and can be used as inputs. As inputs, Port 3 pins that are externally being pulled low will
source current (IIL) because of the pull-ups. Port 3 also serves the functions of various special
features of the AT89C51 as listed below:

Port Pin Alternate Functions


P3.0 RXD (serial input port)
P3.1 TXD (serial output port)
P3.2 INT0 (external interrupt 0)
P3.3 INT1 (external interrupt 1)
P3.4 T0 (timer 0 external input)
P3.5 T1 (timer 1 external input)
P3.6 WR (external data memory write strobe)
P3.7 RD (external data memory read strobe)
Port 3 also receives some control signals for Flash programming and verification.

28
Automatic Traffic Boom Barrier System using RFID

RST
Reset input. A high on this pin for two machine cycles resets the device.

ALE/PROG
Address Latch Enable output pulse for latching the low byte of the address during accesses to
external memory. This pin is also the program pulse input (PROG) during Flash programming. In
normal operation ALE is emitted at a constant rate of 1/6 the oscillator frequency, and may be used
for external timing or clocking purposes. Note, however, that one ALE pulse is skipped during each
access to external Data Memory. If desired, ALE operation can be disabled by setting bit 0 of SFR
location 8EH. With the bit set, ALE is active only during a MOVX or MOVC instruction. Otherwise,
the pin is weakly pulled high. Setting the ALE-disable bit has no effect if the microcontroller is in
external execution mode.

PSEN
Program Store Enable is the read strobe to external program memory. When the AT89C51 is
executing code from external program memory, PSEN is activated twice each machine cycle, except
that two PSEN activations are skipped during each access to external data memory.

EA/VPP
External Access Enable. EA must be strapped to GND in order to enable the device to fetch code
from external program memory locations starting at 0000H up to FFFFH. Note, however, that if lock
bit 1 is programmed, EA will be internally latched on reset. EA should be strapped to VCC for
internal program executions. This pin also receives the 12-volt programming enable voltage during
Flash programming, for parts that require 12-volt VPP.

XTAL1
Input to the inverting oscillator amplifier and input to the internal clock operating circuit.

XTAL2
Output from the inverting oscillator amplifier.

29
Automatic Traffic Boom Barrier System using RFID

3.2.5 MAX 232

The MAX232 IC is used to convert the TTL/CMOS logic levels to RS232 logic levels during
serial communication of microcontrollers with PC. The controller operates at TTL logic level (0-
5V) whereas the serial communication in PC works on RS232 standards (-25 V to + 25V). This
makes it difficult to establish a direct link between them to communicate with each other.
The intermediate link is provided through MAX232. It is a dual driver/receiver that includes a
capacitive voltage generator to supply RS232 voltage levels from a single 5V supply. Each
receiver converts RS232 inputs to 5V TTL/CMOS levels. These receivers (R1 & R2) can accept

±30V inputs. The drivers (T1 & T2), also called transmitters, convert the TTL/CMOS input level

into RS232 level. The transmitters take input from controller’s serial transmission pin and send
the output to RS232’s receiver. The receivers, on the other hand, take input from transmission
pin of RS232 serial port and give serial output to microcontroller’s receiver pin. MAX232 needs
four external capacitors whose value ranges from 1μF to 22μF.

3.2.6 Pin Diagram

Fig 7: Max 232

30
Automatic Traffic Boom Barrier System using RFID

3.2.7 Pin Description

Table 4: Max 232 Pin description

31
Automatic Traffic Boom Barrier System using RFID

3.3 Complete Circuit Diagram

32
Automatic Traffic Boom Barrier System using RFID

CHAPTER 4
Software Simulation

33
Automatic Traffic Boom Barrier System using RFID

4.1 Software Requirements


 HyperTerminal
 Virtual Serial Port Emulator
 KEIL C COMPILER
 PROTEUS

4.1.1 HyperTerminal
HyperTerminal is a computer networking assistance program for the Microsoft Windows
operating system from version 3.1 to Vista. From Windows versions 3.1 to XP, HyperTerminal
was included free. It was not included with Windows Vista and Windows 7, but was available to
be purchased separately from another company.

HyperTerminal was designed to remotely connect to other computers as well as to provide


diagnostic tools to the local computer system. HyperTerminal is a text-based program, as
opposed to a graphical one. Thus, it uses text commands to perform functions. One of its most
common functions is to connect to remote computers, including Telnet sites, online bulletin
board services (BBSs), file transfer protocol (FTP) sites, online services, and other computers.
These connections are made either through a modem or an Ethernet connection.

4.1.1.1 How to run Hyper Terminal (Windows XP)?


1. Click Start, Programs, and then Accessories
2. Within accessories double-click Hyper Terminal (If you do not see Hyper terminal,
click the communications folder and then click Hyper Terminal). If you are unable
to locate Hyper Terminal, it may not be installed.

34
Automatic Traffic Boom Barrier System using RFID

Fig 8: HyperTerminal

4.1.2 Virtual Serial Port Emulator

VSPE is intended to help software engineers and developers to create/debug/test applications that
use serial ports. It is able to create various virtual devices to transmit/receive data. Unlike regular
serial ports, virtual devices have special capabilities: for example, the same device can be opened
more than once by different applications, that can be useful in many cases. With VSPE you are
able to share physical serial port data for several applications, expose serial port to local network
(via TCP protocol), and create virtual serial port device pairs and so on.

Key features

 Virtual device: connector


 Virtual device: data splitter
 Virtual device: pair
 Mapper device

35
Automatic Traffic Boom Barrier System using RFID

 User mode device: TcpServer


 User mode device: TcpClient
 User mode device: Serial Redirector
 User mode device: UDP Manager
 User mode device: Bridge
 Python scripting system
 x86 and x86_64 processor architecture support
 VSPE API (C/C++ header and static library) for native language developers
 VSPE API Python bindings for Python developers
 Embedded HTTP server
 Data monitoring

Requirements

 Operating system: Windows 2000, XP, Vista (32/64), Windows 7

Fig9: Virtual Port Emulator

36
Automatic Traffic Boom Barrier System using RFID

4.1.3 Keil C Compiler


The Keil C51 C Compiler for the 8051 microcontroller is the most popular 8051 C compiler in
the world. It provides more features than any other 8051 C compiler available today.

The C51 Compiler allows you to write 8051 microcontroller applications in C that, once
compiled, have the efficiency and speed of assembly language. Language extensions in the C51
Compiler give you full access to all resources of the 8051.

The C51 Compiler translates C source files into locatable object modules which contain full
symbolic information for debugging with the µVision Debugger or an in-circuit emulator. In
addition to the object file, the compiler generates a listing file which may optionally include
symbol table and cross reference information.

Features

 Nine basic data types, including 32-bit IEEE floating-point,


 Interrupt functions may be written in C,
 Full use of the 8051 register banks,
 Complete symbol and type information for source-level debugging,
 Use of AJMP and ACALL instructions,
 Bit-addressable data objects,
 Built-in interface for the RTX51 Real-Time Kernel,
 Support for dual data pointers on Atmel, AMD, Cypress, Dallas Semiconductor, Infineon,
Philips, and Triscend microcontrollers,
 Support for the Philips 8xC750, 8xC751, and 8xC752 limited instruction sets,
 Support for the Infineon 80C517 arithmetic unit.

Keil development tools for the 8051 Microcontroller Architecture support every level of software
developer from the professional applications engineer to the student just learning about
embedded software development. The industry-standard Keil C Compilers, Macro Assemblers,
Debuggers, Real-time Kernels, Single-board Computers, and Emulators support all 8051
derivatives and help you get your projects completed on schedule.

37
Automatic Traffic Boom Barrier System using RFID

Fig 10: Keil Snapshot

4.1.4 PROTEUS
Proteus 7.0 is a Virtual System Modeling (VSM) that combines circuit simulation, animated
components and microprocessor models to co-simulate the complete microcontroller based
designs.
This is the perfect tool for engineers to test their microcontroller designs before constructing a
physical prototype in real time. This program allows users to interact with the design using on-
screen indicators and/or LED and LCD displays and, if attached to the PC, switches and buttons.
One of the main components of Proteus 7.0 is the Circuit Simulation.

38
Automatic Traffic Boom Barrier System using RFID

4.2 Circuit Diagram

Fig 11: Proteus Snapshot

4.3 Virtual Terminal


The PROTEUS Virtual Terminal connects directly to the design under test and displays that data
in a virtual terminal in the simulation environment. The COMPIM device connects to the
design’s serial data and sends it to the Windows host serial port. So in its intended use, the
simulated design’s serial data can been seen at the host’s physical com port. In order to capture
the simulated design serial data, one would then need to physically connect a PC or other device
to the host running PROTEUS.

39
Automatic Traffic Boom Barrier System using RFID

The main features of the model are as follows:


 Fully bi-directional - received serial data is displayed as ASCII characters whilst key
presses are transmitted as serial ASCII data.

 Simple two wire serial data interface: RXD for received data and TXD for transmitted
data.

 Simple two wire hardware handshake interface: RTS for ready-to-send and CTS for
clear-to-send.

 Baud rate from 300 TO 57,600 baud.

Fig 12: Virtual Terminal

4.4 Difficulties Faced


The main difficulty faced during this project is simulation of the project on the software. Since
RFID is not available in PROTEUS so to run an RFID on the software was quiet tricky part. So
to overcome this problem we have to use few software and a virtual terminal, which is a function
available in Proteus. By this function we can see the data that are coming at that particular line.

40
Automatic Traffic Boom Barrier System using RFID

Instead of using a RFID we made a virtual port (PORT0) by the use of a software “Virtual Port
Emulator”, so by creating a virtual port we can input the data form the keyboard, since the data
that need to be transmitted is a 12 byte code, so we used our keyboard as an interface to input the
data instead of using an RFID.

We also need to use another tool HyperTerminal this software provide a platform to user to input
the data to the serial port virtually. So by this software we can input the data and that data will be
on the serial port which we have created using Virtual Port Emulator. In Proteus instead of using
RFID we have used “compins” which act as a serial port and that will act as a RFID in which we
can enter the data through keyboard.

4.5 Photos of the Demo

Fig 13: Project Snapshot

41
Automatic Traffic Boom Barrier System using RFID

CHAPTER 5
Conclusion and Applications

42
Automatic Traffic Boom Barrier System using RFID

5.1 Conclusion

The RFID based Boom Barrier is an advance and reliable technique which can be used anywhere
and for multiple purposes. It’s a cheap and easy way to provide security and access to the
authorized person. The accuracy and the proper working of the system can be assured by using a
better RFID such as 13MHz or above which can read/ detect the authorized card even at large
distances. So by using these techniques there are less wastage of time in opening and closing of
gate and also it provide a reliability that only authorized person can get in, no matter who the
person is gate will only open when the person has the right card.

Now days RFID based boom barrier are widely used in many places such as schools, offices,
parking system, universities etc.

5.2 Applications and utilities

There are various applications of RFID and some of them are listed below.

 Automatic toll tax Collection: Similarly we are using an RFID to open and Close
of a Boom Barrier, so this barrier can also be used at the Toll Gate and the every user
should be assigned a unique code using an RFID card which is automatically sensed by
the reader and automatic payment could be done. This process can save a lot of time.

 Security System: RFID can also be used to provide security to the doors and lockers
at home at offices or any other place. The RFID tags are very small and can be installed
anywhere such as card or key fobs.

 Attendance system: RFID system can also be used as an attendance system at


Offices, schools or any other place where it is requires. Because of its cheap cost and
efficient use it is a perfect thing to implement.

43
Automatic Traffic Boom Barrier System using RFID

 Agriculture: Tracking the movements of animals via RFID is probably one of the first
areas where this technology was used. Farm management systems can be extremely
expensive, but monitoring the health of animals is essential for any modern day farmer.
Ensuring the correct feed is provided to a specific individual among a herd of hundreds
can be extremely time consuming. With RFID this can be achieved automatically and
cost effectively, with information sent back to central database in real time to show which
animals are healthy.

 Waste Disposal: Since 2006 a small number of UK councils have introduced an RFID
waste management system called BinBug. BinBug monitors the amount of disposable
waste from British households with an RFID embedded wheelie bin. As the tag passes
the sensor on the refuse truck it records the ID, weight and location once it is unloaded.
Controversy arose when some councils decided to introduce these without notifying the
residents and the predictable uproar ensued as many believed this was the beginning of a
new tax on waste. A project from MIT took this further and tracked individual piece of
waste that were tagged with RFID chips. Called Trash Track the data was then
transformed into the visualisations seen in the video below.

 Clothes: A student from Sweden's renowned Hyper Island developed this concept for
WESC clothing. Rather than embedded the chip into your skin the more socially
acceptable option is to allow brands to insert chips into specific items of clothing. The
WESC example is interesting as it provides a glimpse into how some of this technology
will be used by brands to further establish their values through partnerships, experiential
marketing and social networks.

44
Automatic Traffic Boom Barrier System using RFID

5.3 Future Scope

RFID based Boom Barrier is very beneficial and time saving technique to reduce the
congestion for a traffic management system in colleges, hospitals, industries and
organizations. There are various improvement that can be done on this particular project
which will surely make it an ideal project which could be implemented almost
everywhere.
Different sensors can be installed in this, which will monitor the movement of the vehicle
to reduce the traffic.
By making some advancement these types of systems can be installed even at the entry
gate for people from which they enter.
Collection of toll, it has not still been properly implemented everywhere but in future it
will surely be implemented at each and every toll to reduce the big amount of traffic that
passes by each day and will surely save a lot of time.

45
Automatic Traffic Boom Barrier System using RFID

5.4 Appendix

List Of abbreviations

RFID Radio Frequency Identification Device

RF Radio Frequency

LCD Liquid Crystal Display

ID Identity

ISP In System Programmer

TTL Transistor-Transistor Logic

CMOS Complementary Metal Oxide Semiconductor

ISM Industrial Scientific Medical

ROM Read Only Memory

UART Universal Asynchronous Receiver /Transmitter

I/O Input-Output

RX Receiver Pin

TX Transmitter Pin

LED Light Emitting Diode

46
Automatic Traffic Boom Barrier System using RFID

5.5 References

1. The 8051 Microcontroller and Embedded Systems, Muhammad Ali Mazidi,

Janice Gillispie Mazidi, Rolin D. McKinlay, Second Edition

2. http://www.engineersgarage.com/microcontroller/8051projects/simple-toll-

plaza-rfid-interface-at89c51-circuit

3. http://en.wikipedia.org/wiki/Boom_barrier

4. http://en.wikipedia.org/wiki/Radio-frequency_identification

5. http://electronics.howstuffworks.com/gadgets/high-tech-gadgets/rfid3.htm

6. http://www.circuitstoday.com/interfacing-dc-motor-to-8051

7. http://www.engineersgarage.com/microcontroller/8051projects/stepper-

motor-interfacing-with-8051-microcontroller-circuit4

8. http://www.rakeshmondal.info/L293D-Motor-Driver

9. http://fos.cmb.ac.lk/esl/how-to-make-a-working-rs232-ttl-level-converter-

using-max232/

10.http://www.technovelgy.com/ct/technology-article.asp

11.http://www.youtube.com/watch?v=gwkju6f2Twk

12.http://www.verious.com/tutorial/how-to-use-virtual-terminal-in-proteus-isis/

13.http://www.instructables.com/id/Make-a-simple-12-volt-power-supply/

14.http://www.simonsothcott.com/2011/11/what-is-rfid-10-examples-of-

rfid.html

47

Вам также может понравиться