Date post: | 04-Jun-2018 |
Category: |
Documents |
Upload: | likhitamaringanti |
View: | 220 times |
Download: | 0 times |
of 40
8/13/2019 Updated Main Doc
1/40
Mini-project report Automated Toll Collection with Complex Security System
BRECW, Hyderabad Page 1
Chapter 1
Introduction
1.1 Introduction:
The project aims automated toll collection system using the active RFID tags,
vehicles are made to pass through a sensor system that is embedded on the highway just
before the tollgate. The system will electronically classify the vehicle and calculate the
exact amount to be paid by the vehicle owner, ensuring no pilferage of the toll amount.
1.2 Objective of the project:
The project uses the RFID technology and Embedded Systems to design this
application. The main objective of this project is to design a system that continuously
checks for the RFID and controls the Toll Gate and collects the exact fare from the
owner of vehicle and reduces the man power with accurate toll collection.
This project is a device that collects data from the RFID section, codes the data
into a format that can be understood by the controlling section. This receiving section
controls the direction of the motor and updates the amount as per the command
received from the RFID section.
The objective of the project is to develop a microcontroller based control system. It
consists of a RF Reader and Tag, microcontroller and the robotic arrangement.
1.3Background of the Project:
The software application and the hardware implementation help the
microcontroller read the data from RFID Tag and accordingly change the direction of
the rotation of the motor. The measure of efficiency is based on how fast themicrocontroller can read the data, detect the signal received and change the direction of
the rotation of the motor. The system is totally designed using RFID and embedded
systems technology. The performance of the design is maintained by controlling unit.
8/13/2019 Updated Main Doc
2/40
Mini-project report Automated Toll Collection with Complex Security System
BRECW, Hyderabad Page 2
Chapter 2
Overview of the technologies used
2.1 Embedded Systems:
An embedded system can be defined as a computing device that does a specific
focused job. Appliances such as the air-conditioner, VCD player, DVD player, printer,
fax machine, mobile phone etc. are examples of embedded systems. Each of these
appliances will have a processor and special hardware to meet the specific requirement
of the application along with the embedded software that is executed by the processor
for meeting that specific requirement.The embedded software is also called firm ware. The desktop/laptop
computer is a general purpose computer. You can use it for a variety of applications
such as playing games, word processing, accounting, software development and so on.
In contrast, the software in the embedded systems is always fixed.
Embedded systems do a very specific task, they cannot be programmed to do
different things. Embedded systems have very limited resources, particularly the
memory. Generally, they do not have secondary storage devices such as the CDROM
or the floppy disk. Embedded systems have to work against some deadlines. A specific
job has to be completed within a specific time. In some embedded systems, called real-
time systems, the deadlines are stringent. Missing a deadline may cause a catastrophe-
loss of life or damage to property. Embedded systems are constrained for power. As
many embedded systems operate through a battery, the power consumption has to be
very low.
Some embedded systems have to operate in extreme environmental conditions
such as very high temperatures and humidity.
Following are the advantages of Embedded Systems:
1. They are designed to do a specific task and have real time performance
constraints which must be met.
2. They allow the system hardware to be simplified so costs are reduced.
3. They are usually in the form of small computerized parts in larger devices
which serve a general purpose.
8/13/2019 Updated Main Doc
3/40
Mini-project report Automated Toll Collection with Complex Security System
BRECW, Hyderabad Page 3
4. The program instructions for embedded systems run with limited computer
hardware resources, little memory and small or even non-existent keyboard or
screen.
2.2 Definition of RFID technology:
Radio frequency identification (RFID) is a general term that is used to describe
a system that transmits the identity (in the form of a unique serial number) of an object
wirelessly using radio waves. RFID technologies are grouped under the more generic
Automatic Identification (Auto ID) technologies.
2.3 Introduction to RFID Technology:
In recent years, radio frequency identification technology has moved from
obscurity into mainstream applications that help speed the handling of manufactured
goods and materials. RFID enables identification from a distance and unlike earlier bar-
code technology; it does so without requiring a line of sight. RFID tags support a larger
set of unique IDs than bar codes and can incorporate additional data such as
manufacturer, product type and even measure environmental factors such as
temperature. Furthermore, RFID systems can discern many different tags located in the
same general area without human assistance.
Fig: 2.1 Three different RFID tags they come in all shapes and sizes.
8/13/2019 Updated Main Doc
4/40
Mini-project report Automated Toll Collection with Complex Security System
BRECW, Hyderabad Page 4
Chapter 3
Hardware Implementation of the Project
This chapter briefly explains about the Hardware Implementation of the project.
It discusses the design and working of the design with the help of block diagram and
circuit diagram and explanation of circuit diagram in detail. It explains the features,
timer programming, serial communication, interrupts of P89V51RD2 microcontroller.
It also explains the various modules used in this project.
3.1 Project Design:
The implementation of the project design can be divided in two parts.
Hardware implementation
Firmware implementation
Hardware implementation deals in drawing the schematic on the plane paper
according to the application, testing the schematic design over the breadboard using the
various ICs to find if the design meets the objective, carrying out the PCB layout of
the schematic tested on breadboard, finally preparing the board and testing the designed
hardware.
The firmware part deals in programming the microcontroller so that it can
control the operation of the ICs used in the implementation. In the present work, we
have used the Orcad design software for PCB circuit design, the Keil v3 software
development tool to write and compile the source code, which has been written in the C
language. The Proload programmer has been used to write this compile code into the
microcontroller. The firmware implementation is explained in the next chapter.
The project design and principle are explained in this chapter using the block
diagram and circuit diagram. The block diagram discusses about the required
components of the design and working condition is explained using circuit diagram and
system wiring diagram.
3.1.1 Block Diagram of the Project and its Description:
The block diagram of the design is as shown in Fig 3.1. It consists of power
supply unit, microcontroller, RFID module, Serial communication unit, section and
LCD. The brief description of each unit is explained as follows.
8/13/2019 Updated Main Doc
5/40
8/13/2019 Updated Main Doc
6/40
Mini-project report Automated Toll Collection with Complex Security System
BRECW, Hyderabad Page 6
Fig 3.2 Components of a regulated power supply
3.2.1 Voltage regulator:
As the name itself implies, it regulates the input applied to it. A voltage
regulator is an electrical regulator designed to automatically maintain a constant
voltage level. In this project, power supply of 5V and 12V are required. In order to
obtain these voltage levels, 7805 and 7812 voltage regulators are to be used. The first
number 78 represents positive supply and the numbers 05, 12 represent the required
output voltage levels.
3.3 Microcontrollers:
Microprocessors and microcontrollers are widely used in embedded systems
products. Microcontroller is a programmable device. A microcontroller has a CPU in
addition to a fixed amount of RAM, ROM, I/O ports and a timer embedded all on a
single chip. The fixed amount of on-chip ROM, RAM and number of I/O ports in
microcontrollers makes them ideal for many applications in which cost and space are
critical.
Features of P89V51RD2:
80C51 CPU
5 V operating voltage from 0 MHz to 40 MHz 16/32/64 kB of on-chip flash user code memory with ISP and IAP
Supports 12-clock (default) or 6-clock mode selection via software or ISP
SPI and enhanced UART
PCA with PWM and capture/compare functions
Four 8-bit I/O ports with three high-current port 1 pins (16 mA each)
Three 16-bit timers/counters
Programmable watchdog timer
Eight interrupt sources with four priority levels
Second DPTR register
8/13/2019 Updated Main Doc
7/40
Mini-project report Automated Toll Collection with Complex Security System
BRECW, Hyderabad Page 7
Low EMI mode (ALE inhibit)
TTL- and CMOS-compatible logic levels
Fig 3.3 Pin diagram
3.3.1 Pin description:Vcc: Pin 40 provides supply voltage to the chip. The voltage source is +5V.
GND: Pin 20 is the ground.
Port 0:
Port 0 is an 8-bit open drain bidirectional 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 can 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 bidirectional 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 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. In
addition, P1.0 and P1.1 can be configured to be the timer/counter 2 external count input
(P1.0/T2) and the timer/counter 2 trigger input (P1.1/T2EX), respectively, as shown in
the following table. Port 1 also receives the low-order address bytes during Flash
programming and verification.
8/13/2019 Updated Main Doc
8/40
Mini-project report Automated Toll Collection with Complex Security System
BRECW, Hyderabad Page 8
Table 3.3.1 Description of pins of port 1
Port 2:
Port 2 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 2 outputbuffers 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, Port 2 uses strong internal pull-ups when
emitting 1s. During accesses to external data memory that uses 8-bit addresses (MOVX
@ RI), Port 2 emits the contents of the P2 Special Function Register. The port also
receives the high-order address bits and some control signals during Flash
programming and verification.
Port 3:
Port 3 is an 8-bit bidirectional 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 receives some control signals for Flash programming and verification. Port 3
also serves the functions of various special features of the P89V51RD2, as shown in the
following table.
8/13/2019 Updated Main Doc
9/40
Mini-project report Automated Toll Collection with Complex Security System
BRECW, Hyderabad Page 9
Table 3.3.2 Description of pins of port 3
RST:
Reset input high on this pin for two machine cycles while the oscillator is
running resets the device. This pin drives high for 98 oscillator periods after the
Watchdog times out. The DISRTO bit in SFR AUXR (address 8EH) can be used to
disable this feature. In the default state of bit DISRTO, the RESET HIGH out feature is
enabled.
ALE/PROG (Address Latch Enable) is an 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 oscillatorfrequency and may be used for external timing or clocking purposes. 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 P89V51RD2 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 (VPP)
during Flash programming.
8/13/2019 Updated Main Doc
10/40
Mini-project report Automated Toll Collection with Complex Security System
BRECW, Hyderabad Page 10
XTAL1 Input to the inverting oscillator amplifier and input to the internal clock
operating circuit.
XTAL2 Output from the inverting oscillator amplifier.
Fig 3.3.1 Oscillator connections
Fig 3.3.2 External clock drive configuration
XTAL1 and XTAL2 are the input and output, respectively, of an inverting
amplifier that can be configured for use as an on-chip oscillator. Either a quartz crystal
or ceramic resonator may be used. To drive the device from an external clock source,XTAL2 should be left unconnected while XTAL1 is driven. There are no requirements
on the duty cycle of the external clock signal, since the input to the internal clocking
circuitry is through a divide-by-two flip-flop, but minimum and maximum voltage high
and low time specifications must be observed.
3.4 Special Function Registers:
A map of the on-chip memory area called the Special Function Register (SFR)
space is shown in the following table. It should be noted that not all of the addresses areoccupied and unoccupied addresses may not be implemented on the chip. Read
accesses to these addresses will in general return random data, and write accesses will
have an indeterminate effect.
8/13/2019 Updated Main Doc
11/40
Mini-project report Automated Toll Collection with Complex Security System
BRECW, Hyderabad Page 11
3.5 Memory Organization:
MCS-51 devices have a separate address space for Program and Data Memory.
Up to 64K bytes each of external Program and Data Memory can be addressed.
3.5.1 Program Memory:
If the EA pin is connected to GND, all program fetches are directed to external
memory. On the P89V51RD2, if EA is connected to VCC, program fetches to
addresses 0000H through 1FFFH are directed to internal memory and fetches to
addresses 2000H through FFFFH are to external memory.
3.5.2 Data Memory:
The P89V51RD2 implements 256 bytes of on-chip RAM. The upper 128 bytes
occupy a parallel address space to the Special Function Registers. This means that the
upper 128 bytes have the same addresses as the SFR space but are physically separate
from SFR space.
When an instruction accesses an internal location above address 7FH, the
address mode used in the instruction specifies whether the CPU accesses the upper 128
bytes of RAM or the SFR space. Instructions which use direct addressing access the
SFR space.
For example, the following direct addressing instruction accesses the SFR at
location 0A0H (which is P2). MOV 0A0H, #data
The instructions that use indirect addressing access the upper 128 bytes of
RAM. For example, the following indirect addressing instruction, where R0 contains
0A0H, accesses the data byte at address 0A0H, rather than P2 (whose address is
0A0H).MOV @R0, #data. It should be noted that stack operations are examples of
indirect addressing, so the upper 128 bytes of data RAM are available as stack space.
3.6 Power saving modes of operation:
8051 has two power saving modes. They are:
1. Idle Mode
2. Power Down mode.
The two power saving modes are entered by setting two bits IDL and PD in the
special function register (PCON) respectively.
8/13/2019 Updated Main Doc
12/40
Mini-project report Automated Toll Collection with Complex Security System
BRECW, Hyderabad Page 12
The structure of PCON register is as follows.
PCON: Address 87H
The schematic diagram for 'Power down' mode and 'Idle' mode is given as follows:
Fig 3.6 Schematic diagram for power down and idle mode implementation
3.6.1 Idle Mode:
Idle mode is entered by setting IDL bit to 1 (i.e., IDL=1). The clock signal is
gated off to CPU, but not to interrupt, timer and serial port functions. SP, PC, PSW,
Accumulator and other registers maintain their data during IDLE mode. The port pins
hold their logical states they had at the time Idle was initialized. ALE and PSEN (bar)
are held at logic high levels.
Ways to exit Idle Mode:
1. Activation of any enabled interrupt will clear PCON.0 bit and hence the Idle Mode is
exited. The program goes to the Interrupt Service Routine (ISR). After RETI is
executed at the end of ISR, the next instruction will start from the one following the
instruction that enabled the Idle Mode.
2. A hardware reset exits the idle mode. The CPU starts from the instruction following
the instruction that invoked the Idle mode.
3.6.2 Power Down Mode:
The Power Down Mode is entered by setting the PD bit to 1. The internal clock to the
entire microcontroller is stopped. However, the program is not dead. The Power down
Mode is exited (PCON.1 is cleared to 0) by Hardware Reset only. The CPU starts from
the next instruction where the Power down Mode was invoked. Port values are not
changed/ overwritten in power down mode. Vcc can be reduced to 2V in Power down
8/13/2019 Updated Main Doc
13/40
Mini-project report Automated Toll Collection with Complex Security System
BRECW, Hyderabad Page 13
Mode. However Vcc has to be restored to normal value before Power down Mode is
exited.
Table 3.6 Status of External pins during Idle and Power down Modes
3.7 Programming the FlashParallel Mode:
The P89V51RD2 is shipped with the on-chip Flash memory array ready to be
programmed. The programming interface needs a high-voltage (12-volt) program
enable signal and is compatible with conventional third-party Flash or EPROM
programmers. The P89V51RD2 code memory array is programmed byte-by-byte.
3.7.1 Programming Algorithm:
Before programming the P89V51RD2, the address, data and control signals
should be set up according to the Flash Programming Modes. To program the
P89V51RD2, take the following steps:
1. Input the desired memory location on the address lines.
2. Input the appropriate data byte on the data lines.
3. Activate the correct combination of control signals.
4. Raise EA/VPP to 12V.
5. Pulse ALE/PROG once to program a byte in the Flash array or the lock bits.
The byte write cycle is self-timed and typically takes no more than 50 s. Repeat steps
1 through 5, changing the address and data for the entire array or until the end of the
object file is reached.
3.7.2 Serial Programming Algorithm
To program and verify the P89V51RD2 in the serial programming mode, the
following sequence is recommended:
1. Power-up sequence:
a. Apply power between VCC and GND pins.
b. Set RST pin to H.
If a crystal is not connected across pins XTAL1 and XTAL2, apply a 3 MHz to
33 MHz clock to XTAL1 pin and wait for at least 10 milliseconds.
8/13/2019 Updated Main Doc
14/40
Mini-project report Automated Toll Collection with Complex Security System
BRECW, Hyderabad Page 14
2. Enable serial programming by sending the Programming Enable serial
instruction to pin MOSI/P1.5. The frequency of the shift clock supplied at pin
SCK/P1.7 needs to be less than the CPU clock at XTAL1 divided by 16.
3. The Code array is programmed one byte at a time in either the Byte or Page
mode. The write cycle is self-timed and typically takes less than 0.5 ms at 5V.
4. Any memory location can be verified by using the Read instruction which
returns the content at the selected address at serial output MISO/P1.6.
5. At the end of a programming session, RST can be set low to commence
normal device operation.
Fig 3.7 Programming the flash memory
After Reset signal is high, SCK should be low for at least 64 system clocks
before it goes high to clock in the enable data bytes. No pulsing of Reset signal is
necessary. SCK should be no faster than 1/16 of the system clock at XTAL1.
For Page Read/Write, the data always starts from byte 0 to 255. After the
command byte and upper address byte are latched, each byte thereafter is treated as
data until all 256 bytes are shifted in/out. Then the next instruction will be ready to bedecoded.
8/13/2019 Updated Main Doc
15/40
Mini-project report Automated Toll Collection with Complex Security System
BRECW, Hyderabad Page 15
Chapter 4
Radio Frequency Identification
4.1 RFID principles:
Many types of RFID exist, but at the highest level, we can divide RFID devices
into two classes: active and passive.
Fig 4.1 RFID devices
1. Active tags require a power source i.e., they are either connected to a powered
infrastructure or use energy stored in an integrated battery. In the latter case, a
tags lifetime is limited by the stored energy, balanced against the number of
read operations the device must undergo. However, batteries make the cost,
size, and lifetime of active tags impractical for the retail trade.
2. Passive RFID is of interest because the tags dont require batteries or
maintenance. The tags also have an indefinite operational life and are small
enough to fit into a practical adhesive label. A passive tag consists of three
parts: an antenna, a semiconductor chip attached to the antenna and some form
of encapsulation. The tag reader is responsible for powering and communicating
with a tag. The tag antenna captures energy and transfers the tags ID (the tags
chip coordinates this process). The encapsulation maintains the tags integrity
and protects the antenna and chip from environmental conditions or reagents.
4.2 RFID Technology and Architecture:Before RFID can be understood completely, it is essential to understand how
Radio Frequency communication occurs.
RF (Radio Frequency) communication occurs by the transference of data over
electromagnetic waves. By generating a specific electromagnetic wave at the source, its
effect can be noticed at the receiver far from the source, which then identifies it and
thus the information.
8/13/2019 Updated Main Doc
16/40
8/13/2019 Updated Main Doc
17/40
Mini-project report Automated Toll Collection with Complex Security System
BRECW, Hyderabad Page 17
4.4 RFID Design Approach:
Two fundamentally different RFID design approaches exist for transferring
power from the reader to the tag: magnetic induction and electromagnetic (EM) wave
capture. These two designs take advantage of the EM properties associated with an RF
antennathe near field and the far field. Both can transfer enough power to a remote
tag to sustain its operationtypically between 10W and 1 mW, depending on the tag
type.
4.4.1Near-field RFID:
Faradays principle of magnetic induction is the basis of near-field coupling
between a reader and tag. A reader passes a large alternating current through a reading
coil, resulting in an alternating magnetic field in its locality. If this voltage is rectified
and coupled to a capacitor, a reservoir of charge accumulates, which you can then use
to power the tag chip.
Tags that use near-field coupling send data back to the reader using load
modulation. Because any current drawn from the tag coil will give rise to its own small
magnetic fieldwhich will oppose the readers fieldthe reader coil can detect this as
a small increase in current flowing through it. This current is proportional to the load
applied to the tags coil (hence load modulation).
Thus, if the tags electronics applies a load to its own antenna coil and varies it
over time, a signal can be encoded as tiny variations in the magnetic field strength
representing the tags ID. The reader can then recover this signal by monitoring the
change in current through the reader coil.
Fig 4.4 Near power mechanism of RFID tags operating at less than 10MHz
The range for which we can use magnetic induction approximates to c/2f,
where c is a constant (the speed of light) and f is the frequency. Thus, as the frequency
of operation increases, the distance over which near-field coupling can operate
8/13/2019 Updated Main Doc
18/40
Mini-project report Automated Toll Collection with Complex Security System
BRECW, Hyderabad Page 18
decreases. A further limitation is the energy available for induction as a function of
distance from the reader coil. The magnetic field drops off at a factor of 1/r3, where r is
the separation of the tag and reader, along a center line perpendicular to the coils
plane. These design pressures have led to new passive RFID designs based on far-field
communication.
4.5 RFID Module and Principle of working:
RFID Reader Module, are also called as interrogators. They convert radio
waves returned from the RFID tag into a form that can be passed on to Controllers,
which can make use of it. RFID tags and readers have to be tuned to the same
frequency in order to communicate. RFID systems use many different frequencies, but
the most common and widely used & supported by our Reader is 125 KHz.
Fig 4.5 RFID module
An RFID system consists of two separate components: a tag and a reader. Tags
are analogous to barcode labels and come in different shapes and sizes. The tag
contains an antenna connected to a small microchip containing up to two kilobytes of
data. The reader or scanner functions similarly to a barcode scanner. However, while a
barcode scanner uses a laser beam to scan the barcode, an RFID scanner uses
electromagnetic waves. To transmit these waves, the scanner uses an antenna that
transmits a signal communicating with the tags antenna. The tags antenna receives
data from the scanner and transmits its particular chip information to the scanner.
The data on the chip is usually stored in one of two types of memory. The most
common is Read-Only Memory (ROM), as its name suggests, read-only memory
cannot be altered once programmed onto the chip during the manufacturing process.
The second type of memory is Read/Write Memory, though it is also programmed
during the manufacturing process, it can later be altered by certain devices.
8/13/2019 Updated Main Doc
19/40
Mini-project report Automated Toll Collection with Complex Security System
BRECW, Hyderabad Page 19
4.6 Features of RFID:
4.6.1 Reading collocated tags:
One commercial objective of RFID systems is to read and charge for all tagged
goods in a standard supermarket shopping cart as it is pushed through an instrumentedcheckout aisle. Such a system would speed up the checkout process and reduce
operational costs.
Enabling a distributed memory revolution
Another distinguishing feature of modern RFID is that tags can contain far more
information than a simple ID. They can incorporate additional read only or read-write
memory, which a reader can then further interact with. Read-only memory might
contain additional product details that dont need to be read every time a tag is
interrogated but are available when required. For example, the tag memory might
contain a batch code, so if some products are found to be faulty, the code can help find
other items with the same defects.
Tag memory can also be used to enable tags to store self-describing
information. Although a tags unique ID can be used to recover its records in an online
database, communication with the database might not always be possible. For example,
if a package is misdirected during transportation, the receiving organization might not
be able to determine its correct destination. Additional destination information written
into the tag would obviate the need and cost of a fully networked tracking system.
4.6.2 Privacy concerns:
RFID has received much attention in recent years as journalists, technologists
and privacy advocates have debated the ethics of its use. Privacy advocates are
concerned that even though many of the corporations considering RFID use for
inventory tracking have honorable intentions, without due care, the technology might
be unwittingly used to create undesirable outcomes for many customers.
4.6.3 Application Areas:
RFID, Radio Frequency Identification is a technology, which includes wireless
data capture and transaction processing. Proximity (short range) and Vicinity (long
range) are two major application areas where RFID technology is used. Track and trace
applications are long range or vicinity applications. This technology provides additional
functionality and benefits for product authentication. Access control applications are
Short range or proximity type of applications. Agile Sense Technologies is focused on
8/13/2019 Updated Main Doc
20/40
Mini-project report Automated Toll Collection with Complex Security System
BRECW, Hyderabad Page 20
delivering innovative, high value RFID solutions assisting companys track assets,
people and documents. Agile Sense provides robust and complete RFID solutions built
On top of its extensible middleware/ framework for Government, Healthcare,
Manufacturing and Aerospace industries.
4.6.4 Current and Potential Uses of RFID:
4.6.4.1 People Tracking:
People tracking system are used just as asset tracking system. Hospitals and
jails are most general tracking required places. Hospital uses RFID tags for tracking
their special patients. In emergency patient and other essential equipment can easily
track. It will be mainly very useful in mental care hospitals where doctors can track
each and every activity of the patient. Hospitals also use these RFID tags for locating
and tracking all the activities of the newly born babies.
The best use of the people tracking system will be in jails. It becomes an easy
tracking system to track their inmates. Many jails of different US states like Michigan,
California, and Arizona are already using RFID-tracking systems to keep a close eye on
jail inmates.
4.6.4.2 Healthcare:
Patient safety is a big challenge of healthcare vertical. Reducing medication
errors, meeting new standards, staff shortages, and reducing costs are the plus points of
use of RFID solutions. RFID wristbands containing patient records and medication
history address several of these concerns.
4.6.4.3 Promotion tracking:
Manufacturers of products sold through retailers promote their products by
offering discounts for a limited period on products sold to retailers with the expectation
that the retailers will pass on the savings to their customers. However, retailers
typically engage in forward buying, purchasing more product during the discount
period than they intend to sell during the promotion period. Some retailers engage in a
form of arbitrage, reselling discounted product to other retailers, a practice known
as diverting. To combat this practice, manufacturers are exploring the use of RFID tags
on promoted merchandise so that they can track exactly which product has sold through
the supply chain at fully discounted prices.
8/13/2019 Updated Main Doc
21/40
Mini-project report Automated Toll Collection with Complex Security System
BRECW, Hyderabad Page 21
4.6.5 Manufacturing:
RFID has been used in manufacturing plants for more than a decade. It's used to
track parts and work in process and to reduce defects, increase throughput and manage
the production of different versions of the same product.
4.7 Serial Communication:
The main requirements for serial communication are:
1. Microcontroller
2. PC
3. RS 232 cable
4. MAX 232 IC
5. HyperTerminal
When the pins P3.0 and P3.1 of microcontroller are set, UART which is inbuilt
in the microcontroller will be enabled to start the serial communication.
Timers:
The 8051 has two timers: Timer 0 and Timer 1. They can be used either as
timers to generate a time delay or as counters to count events happening outside the
microcontroller.
Both Timer 0 and Timer 1 are 16-bit wide. Since the 8051 has an 8-bit
architecture, each 16-bit timer is accessed as two separate registers of low byte and
high byte. Lower byte register of Timer 0 is TL0 and higher byte is TH0. Similarly
lower byte register of Timer1 is TL1 and higher byte register is TH1.
TMOD (timer mode) register:
Both timers 0 and 1 use the same register TMOD to set the various operation
modes. TMOD is an 8-bit register in which the lower 4 bits are set aside for Timer 0
and the upper 4 bits for Timer 1. In each case, the lower 2 bits are used to set the timer
mode and the upper 2 bits to specify the operation.
GATE :
Every timer has a means of starting and stopping. Some timers do this by
software, some by hardware and some have both software and hardware controls. The
timers in the 8051 have both. The start and stop of the timer are controlled by the way
8/13/2019 Updated Main Doc
22/40
8/13/2019 Updated Main Doc
23/40
Mini-project report Automated Toll Collection with Complex Security System
BRECW, Hyderabad Page 23
In serial communication, the data is sent one bit at a time. The 8051 has serial
communication capability built into it, thereby making possible fast data transfer using
only a few wires.
The fact that serial communication uses a single data line instead of the 8-bit
data line instead of the 8-bit data line of parallel communication not only makes it
cheaper but also enables two computers located in two different cities to communicate
over the telephone.
Serial data communication uses two methods, asynchronous and synchronous.
The synchronous method transfers a block of data at a time, while the asynchronous
method transfers a single byte at a time. With synchronous communications, the two
devices initially synchronize themselves to each other, and then continually send
characters to stay in sync. Even when data is not really being sent, a constant flow of
bits allows each device to know where the other is at any given time. That is, each
character that is sent is either actual data or an idle character. Synchronous
communications allows faster data transfer rates than asynchronous methods, because
additional bits to mark the beginning and end of each data byte are not required. The
serial ports on IBM-style PCs are asynchronous devices and therefore only support
Asynchronous serial communications .Asynchronous means "no synchronization", and
thus does not require sending and receiving idle characters. However, the beginning
and end of each byte of data must be identified by start and stop bits. The start bit
indicates when the data byte is about to begin and the stop bit signals when it ends. The
requirement to send these additional two bits causes asynchronous communication to
be slightly slower than synchronous however it has the advantage that the processor
does not have to deal with the additional idle characters.
There are special IC chips made by many manufacturers for serial data
communications (universal asynchronous receiver-transmitter) and USART(universal
synchronous-asynchronous receiver-transmitter). The 8051 has a built-in UART.
In the asynchronous method, the data such as ASCII characters are packed
between a start and a stop bit. The start bit is always one bit, but the stop bit can be one
or two bits. The start bit is always a 0 (low) and stop bit (s) is 1 (high). This is called
framing.
The rate of data transfer in serial data communication is stated as bps (bits per
second). Another widely used terminology for bps is baud rate. The data transfer rate of
8/13/2019 Updated Main Doc
24/40
8/13/2019 Updated Main Doc
25/40
Mini-project report Automated Toll Collection with Complex Security System
BRECW, Hyderabad Page 25
Interfacing max232 with microcontroller:
Fig 4.7.3.1 Interfacing MAX232 with microcontroller
4.7.4 SCON (serial control) register:
The SCON register is an 8-bit register used to program the start bit, stop bit anddata bits of data framing.
Table 4.7.2 Functions of SCON register
SM0 SCON.7 Serial port mode specifier
SM1 SCON.6 Serial port mode specifier
SM2 SCON.5 Serial port mode specifier
REN SCON.4 Set or Cleared by software to
enable or disable reception
TB8 SCON.3 Not widely used
RB8 SCON.2 Not widely used
TI SCON.1 Transmit interrupt flag. Set by
hardware at the beginning of
the stop bit in mode 1. Must
be cleared by software.
RI SCON.0 Receive interrupt flag. Set by
hardware at the beginning of
the stop bits in mode 1. Must
be cleared by software.
8/13/2019 Updated Main Doc
26/40
Mini-project report Automated Toll Collection with Complex Security System
BRECW, Hyderabad Page 26
Table 4.7.3 Modes of Operation of SCON register
SM0 SM1 Mode Of Operation
0 0 Serial Mode 0
0 1 Serial Mode 1, 8-bit data,
1 stop bit, 1 start bit
1 0 Serial Mode 2
1 1 Serial Mode 3
Of the four serial modes, only mode 1 is widely used. In the SCON register,
when serial mode 1 is chosen, the data framing is 8 bits, 1 stop bit and 1 start bit, which
makes it compatible with the COM port of IBM/ compatible PCs. And the most
important is serial mode 1 allows the baud rate to be variable and is set by Timer 1 of
the 8051. In serial mode 1, for each character a total of 10 bits are transferred, where
the first bit is the start bit, followed by 8 bits of data and finally 1 stop bit.
8051 Interface with any External Devices using Serial Communication:
Fig: 4.7.4 8051 Interface with any external devices using serial communication
8/13/2019 Updated Main Doc
27/40
Mini-project report Automated Toll Collection with Complex Security System
BRECW, Hyderabad Page 27
4.8 Switches and Pushbuttons:
This is the simplest way of controlling appearance of some voltage on
microcontrollers input pin. There is also no need for additional explanation of how
these components operate.
Fig 4.8 Switches and Push button
This is about something commonly unnoticeable when using these components in
everyday life. It is about contact bounce, a common problem with mechanical switches.
If contact switching does not happen so quickly, several consecutive bounces can be
noticed prior to maintain stable state. The reasons for this are: vibrations, slight rough
spots and dirt. Anyway, this whole process does not last long (a few micro- or
milliseconds), but long enough to be registered by the microcontroller. Concerning the
pulse counter, error occurs in almost 100% of cases.
Fig 4.8.1 Connection between reset pin and micro controller
The simplest solution is to connect simple RC circuit which will suppress each
quick voltage change. Since the bouncing time is not defined, the values of elements
are not strictly determined. In the most cases, the values shown on figure are sufficient.
If complete safety is needed, radical measures should be taken. The circuit (RS
flip-flop) changes logic state on its output with the first pulse triggered by contact
bounce. Even though this is more expensive solution (SPDT switch), the problem is
definitely resolved. Besides, since the condensator is not used, very short pulses can be
also registered in this way. In addition to these hardware solutions, a simple software
8/13/2019 Updated Main Doc
28/40
Mini-project report Automated Toll Collection with Complex Security System
BRECW, Hyderabad Page 28
solution is also commonly applied. When a program tests the state of some input pin
and finds changes, the check should be done one more time after certain time delay. If
the change is confirmed, it means that switch (or pushbutton) has changed its position.
The advantages of such solution are: it is free of charge, effects of disturbances are
eliminated and it can be adjusted to the worst-quality contacts.
4.8.1 Switch Interfacing with 8051:
In 8051 PORT 1, PORT 2 & PORT 3 have internal 10k Pull-up resistors
whereas this Pull-up resistor is absent in PORT 0. Hence PORT 1, 2 & 3 can be directly
used to interface a switch whereas we have to use an external 10k pull-up resistor for
PORT 0 to be used for switch interfacing or for any other input. Figure 4.8 shows
switch interfacing for PORT 1, 2 & 3.Shows switch interfacing to PORT 0.
Fig: 4.8.2 Switch interfacing with ports
For any pin to be used as an input pin, a HIGH (1) should be written to the pin
if the pin will always to be read as LOW.In the above figure, when the switch is not
pressed, the 10k resistor provides the current needed for LOGIC 1 and closure of
switch provides LOGIC 0 to the controller PIN.
4.9 Liquid Crystal Display:
LCD stands for Liquid Crystal Display. LCD is finding wide spread use replacing
LEDs (seven segment LEDs or other multi segment LEDs) because of the following
reasons:
1.
The declining prices of LCDs.
2. The ability to display numbers, characters and graphics. This is in contrast to
LEDs, which are limited to numbers and a few characters.
3. Incorporation of a refreshing controller into the LCD, thereby relieving the CPU
of the task of refreshing the LCD. In contrast, the LED must be refreshed by the
CPU to keep displaying the data.
4. Ease of programming for characters and graphics.
8/13/2019 Updated Main Doc
29/40
Mini-project report Automated Toll Collection with Complex Security System
BRECW, Hyderabad Page 29
These components are specialized for being used with the microcontrollers,
which means that they cannot be activated by standard IC circuits. They are used for
writing different messages on a miniature LCD.
Fig 4.9 LCD display
A model described here is for its low price and great possibilities most frequently
used in practice. It is based on the HD44780 microcontroller (Hitachi) and can display
messages in two lines with 16 characters each. It displays all the alphabets, Greek
letters, punctuation marks, mathematical symbols etc. In addition, it is possible to
display symbols that user makes up on its own. Automatic shifting message on display
(shift left and right), appearance of the pointer, backlight etc. are considered as useful
characteristics.
4.9.1 Pins Functions:
There are pins along one side of the small printed board used for connection to
the microcontroller. There are total of 14 pins marked with numbers (16 in case the
background light is built in). Their function is described in the table below:
Table 4.9.1 LCD pin description
FunctionPin
NumberName
Logic
StateDescription
Ground 1 Vss - 0V
Power supply 2 Vdd - +5V
Contrast 3 Vee - 0Vdd
Control of
operating
4 RS0
1
D0 D7 are interpreted as
commands
D0D7 are interpreted as data
5 R/W0
1
Write data (from controller to
LCD)
Read data (from LCD to
controller)
8/13/2019 Updated Main Doc
30/40
Mini-project report Automated Toll Collection with Complex Security System
BRECW, Hyderabad Page 30
6 E
0
1
From 1 to
0
Access to LCD disabled
Normal operating
Data/commands are transferred
to LCD
Data/ commands
7 D0 0/1 Bit 0 LSB
8 D1 0/1 Bit 1
9 D2 0/1 Bit 2
10 D3 0/1 Bit 3
11 D4 0/1 Bit 4
12 D5 0/1 Bit 5
13 D6 0/1 Bit 6
14 D7 0/1 Bit 7 MSB
4.9.2 LCD screen:
LCD screen consists of two lines with 16 characters each. Each character
consists of 5x7 dot matrix. Contrast on display depends on the power supply voltage
and whether messages are displayed in one or two lines. For that reason, variable
voltage 0-Vdd is applied on pin marked as Vee. Trimmer potentiometer is usually used
for that purpose. Some versions of displays have built in backlight (blue or green
diodes). When used during operating, a resistor for current limitation should be used
(like with any LE diode).
Fig 4.9.2 LCD screen
4.9.3 LCD Basic Commands:
All data transferred to LCD through outputs D0-D7 will be interpreted as
commands or as data, which depends on logic state on pin RS:
RS = 1 - Bits D0 - D7 are addresses of characters that should be displayed. Built
in processor addresses built in map of characters and displays corresponding
8/13/2019 Updated Main Doc
31/40
Mini-project report Automated Toll Collection with Complex Security System
BRECW, Hyderabad Page 31
symbols. Displaying position is determined by DDRAM address. This address
is either previously defined or the address of previously transferred character is
automatically incremented.
RS = 0 - Bits D0 - D7 are commands which determine display mode.
Table 4.9.3 Description of LCD commands
Command RS RW D7 D6 D5 D4 D3 D2 D1 D0Execution
Time
Clear display 0 0 0 0 0 0 0 0 0 1 1.64mS
Cursor home 0 0 0 0 0 0 0 0 1 x 1.64mS
Entry mode set 0 0 0 0 0 0 0 1 I/D S 40uS
Display on/off control 0 0 0 0 0 0 1 D U B 40uS
Cursor/Display Shift 0 0 0 0 0 1 D/C R/L x X 40uS
Function set 0 0 0 0 1 DL N F x X 40uS
Set CGRAM address 0 0 0 1 CGRAM address 40uS
Set DDRAM address 0 0 1 DDRAM address 40uS
Read BUSY flag (BF) 0 1 BF DDRAM address -
Write to CGRAM or
DDRAM1 0 D7 D6 D5 D4 D3 D2 D1 D0 40uS
Read from CGRAM or
DDRAM 1 1 D7 D6 D5 D4 D3 D2 D1 D0 40uS
4.9.4 LCD Connection:
Depending on how many lines are used for connection to the microcontroller,
there are 8-bit and 4-bit LCD modes. The appropriate mode is determined at the
beginning of the process in a phase called initialization. In the first case, the data are
transferred through outputs D0-D7 as it has been already explained. In case of 4-bit
LED mode, for the sake of saving valuable I/O pins of the microcontroller, there are
only 4 higher bits (D4-D7) used for communication, while other may be left
unconnected.
8/13/2019 Updated Main Doc
32/40
Mini-project report Automated Toll Collection with Complex Security System
BRECW, Hyderabad Page 32
Consequently, each data is sent to LCD in two steps: four higher bits are sent
first (that normally would be sent through lines D4-D7), four lower bits are sent
afterwards. With the help of initialization, LCD will correctly connect and interpret
each data received. Besides, with regards to the fact that data are rarely read from LCD
(data mainly are transferred from microcontroller to LCD) one more I/O pin may be
saved by simple connecting R/W pin to the Ground. Even though message displaying
will be normally performed, it will not be possible to read from busy flag since it is not
possible to read from display.
4.9.5 LCD Initialization :
Once the power supply is turned on, LCD is automatically cleared. This process
lasts for approximately 15mS. After that, display is ready to operate. The mode of
operating is set by default. This means that:
1. Display is cleared
2. Mode
DL = 1 Communication through 8-bit interface
N = 0 Messages are displayed in one line
F = 0 Character font 5 x 8 dots
3. Display/Cursor on/off
D = 0 Display off
U = 0 Cursor off
B = 0 Cursor blink off
4. Character entry
ID = 1 Addresses on display are automatically incremented by 1
S = 0 Display shift off
Automatic reset is mainly performed without any problems. If for any reason
power supply voltage does not reach full value in the course of 10mS, display will start
perform completely unpredictably. If voltage supply unit cannot meet this condition or
if it is needed to provide completely safe operating, the process of initialization by
which a new reset enabling display to operate normally must be applied.
Algorithm according to the initialization is being performed depends on whether
connection to the microcontroller is through 4- or 8-bit interface. All left over to be
done after that is to give basic commands and of course- to display messages.
8/13/2019 Updated Main Doc
33/40
Mini-project report Automated Toll Collection with Complex Security System
BRECW, Hyderabad Page 33
Fig4.9.4: Procedure on 8-bit initialization
Chapter 5
Firmware Implementation of the project design
8/13/2019 Updated Main Doc
34/40
Mini-project report Automated Toll Collection with Complex Security System
BRECW, Hyderabad Page 34
This chapter briefly explains about the firmware implementation of the project.
The required software tools are discussed in section 5.1. Section 5.2 shows the flow
diagram of the project design. It presents the firmware implementation of the project
design.
5.1 Software Tools Required:
Keil v3, Proload are the two software tools used to program microcontroller.
The working of each software tool is explained below in detail.
5.1.1 Programming Microcontroller:
A compiler for a high level language helps to reduce production time. To
program the P89V51RD2 microcontroller the Keil v3 is used. The programming is
done strictly in the embedded C language. Keil v3 is a suite of executable, open
source software development tools for the microcontrollers hosted on the Windows
platform.
The compilation of the C program converts it into machine language file (.hex).
This is the only language the microcontroller will understand, because it contains the
original program code converted into a hexadecimal format. During this step there are
some warnings about eventual errors in the program. This is shown in Fig 4.1. If there
are no errors and warnings then run the program, the system performs all the required
tasks and behaves as expected the software developed. If not, the whole procedure will
have to be repeated again. Fig 5.2 shows expected outputs for given inputs when run
compiled program.
One of the difficulties of programming microcontrollers is the limited amount
of resources the programmer has to deal with. In personal computers resources such as
RAM and processing speed are basically limitless when compared to microcontrollers.
In contrast, the code on microcontrollers should be as low on resources as possible.
5.1.2 Keil Compiler:
Keil compiler is software used where the machine language code is written and
compiled. After compilation, the machine source code is converted into hex code which
is to be dumped into the microcontroller for further processing. Keil compiler also
supports C language code.
8/13/2019 Updated Main Doc
35/40
Mini-project report Automated Toll Collection with Complex Security System
BRECW, Hyderabad Page 35
Fig 5.1: Compilation of source Code
Fig 5.2: Running of the compiled program
8/13/2019 Updated Main Doc
36/40
Mini-project report Automated Toll Collection with Complex Security System
BRECW, Hyderabad Page 36
Fig 5.3: Flow chart of Electronic toll collection
8/13/2019 Updated Main Doc
37/40
Mini-project report Automated Toll Collection with Complex Security System
BRECW, Hyderabad Page 37
Chapter 6
Results and Discussions
6.1 Results:
Fig 6.1 Electronic toll collection system
The implementation of RFID Toll Plaza using microcontroller is done
successfully. The communication is properly done without any interference between
different modules in the design. Design is done to meet all the specifications and
requirements. Software tools like Keil U vision Simulator, Flash Magic to dump the
8/13/2019 Updated Main Doc
38/40
Mini-project report Automated Toll Collection with Complex Security System
BRECW, Hyderabad Page 38
source code into the microcontroller, Orcad Lite for the schematic diagram have been
used to develop the software code before realizing the hardware.
The performance of the system is more efficient. Reading the tag and verifying
the tag information with the already stored data and perform the specified task is the
main job of the microcontroller. The mechanism is controlled by the microcontroller.
Circuit is implemented in Orcad and implemented on the microcontroller board.
The performance has been verified both in software simulator and hardware design.
The total circuit is completely verified functionally and is following the application
software. It can be concluded that the design implemented in the present work provide
portability, flexibility and the data transmission is also done with low power
consumption.
6.2 Working procedure:
Toll Plaza using RFID is basically an embedded system that makes the things
easy in the toll gate fare collection during the time of toll collection. The project uses
the wireless technology RFID and embedded systems to implement the application.
In this project, the necessary and, up to an extent, the sufficient material, the
vehicle has to carry the tag (RFID tag with the voters details).
RFID tag of the vehicle is the tag that stores the details of the vehicle like the
vehicle name and price of the vehicle etc. At the toll plaza, when asks to open toll gate
to show his tag, he has to bring this card near the RFID reader. The RFID reader reads
the data present in the tag.
Since the aim of the project is to provide security and make the task easy, the
system initially stores the details of the vehicle. Thus, the system after reading the card
(RFID tag), it compares this data with the already stored data in the systems memory.
The details present in the card will be displayed on the LCD.
If this data is present in the systems database and matches with any of the
details, the system allows the vehicle to pass the vehicle from the toll gate. If the data
does not match with any of the details of the systems database, the system immediately
rejects and displays the information.
8/13/2019 Updated Main Doc
39/40
Mini-project report Automated Toll Collection with Complex Security System
BRECW, Hyderabad Page 39
6.3 Advantages:
Cost effective
Low power consumption
No line-of-sight contact necessary Speed of an RFID system (almost less than 100ms)
Bidirectional communication
Reliability in tough environments
6.4 Applications:
There are many applications related to RFID. Some of them are
People tracking
Asset tracking
Document tracking
Government library
Health care
6.5 Future Scope of the project:
In the short term, the greater the fraction of automated lanes, the lower will be the
cost of operation (once the capital costs of automating are amortized). In the long term,
the greater the relative advantage that registering and turning one's vehicle into an
electronic-toll one provides, the faster cars will be converted from manual-toll use to
electronic-toll use, and therefore the fewer manual-toll cars will drag down average
speed and thus capacity. Some of the benefits for drivers include
fewer and shorter queues at toll plazas by increasing toll booth service rates
faster and more efficient servicethe customer does not need to stop or have
toll fees on hand
The ability to pay by keeping a balance on the customers account or charging a
registered credit card
8/13/2019 Updated Main Doc
40/40
Mini-project report Automated Toll Collection with Complex Security System
6.6 References:
1.
http://www.rfidjournal.com/faq
2. http://www.technovelgy.com/ct/Technology-Article.asp
3. http://csrc.nist.gov/publications/nistpubs/800-98/SP800-98_RFID-2007.pdf
4. www.ieee.org
5. http://www.taltech.com/TALtech_web/resources/intro-sc.html
6. http://focus.ti.com/lit/ds/symlink/max232.pdf
7. http://www.microdigitaled.com/8051/Software/keil_tusstorial.pdf
8.
Microprocessor and Microcontroller book by S.V. Altaf9. www.keil.com/dd/docs/datashts/philips/p89v51rd2.pdf
http://www.rfidjournal.com/faqhttp://www.technovelgy.com/ct/Technology-Article.asphttp://csrc.nist.gov/publications/nistpubs/800-98/SP800-98_RFID-2007.pdfhttp://www.ieee.org/http://www.taltech.com/TALtech_web/resources/intro-sc.htmlhttp://www.taltech.com/TALtech_web/resources/intro-sc.htmlhttp://www.ieee.org/http://csrc.nist.gov/publications/nistpubs/800-98/SP800-98_RFID-2007.pdfhttp://www.technovelgy.com/ct/Technology-Article.asphttp://www.rfidjournal.com/faq