Sunteți pe pagina 1din 80

AN ADVANCED SECURITY SYSTEM ON TOLL PLAZA

CHAPTER 1: INTRODUCTION

1.1 INTRODUCTION
In the developing countries we have seen a lot of crime happening at the bridges and
highways. Specially, during evening and midnight many occurrence like- hijacks, murders
etc. are commonly taking place. However, those criminals easily get escaped from the crime
zone and victims lose their valuable assets including cars, jewelries etc. Although the
presence of police, sometimes it gets difficult for them to identify the right vehicle and stop
it for the checking. Most of the cases those vehicles pass the toll booth area by giving toll
amount and no one can identify the criminals. To avoid those problems we have built an
advanced security system which is integrated with the automated RFID based tolling system.
This system will not let the criminals pass the toll booth area even after paying the toll
amount. Thus, the crime rates at highways and bridges can be reduced. The overall system is
user friendly, fast responsive and convenient for the developing countries. By implementing
this system in the highways and bridges, primary steps can be taken to resist a criminal or
any sort of crime. As the data of each vehicle owner should be recorded in the database
previously, so when any information of that vehicle owner is needed by the authority or
police, it can be easily found from the database to ease the investigation process.

In this introductory chapter, we consider some important decisions that must be made at the
start of any embedded project:
 What is Embedded Systems?
 The choice of processor.
 The choice of programming language.

1.1.1 What is an Embedded System?

An embedded system is an application that contains at least one programmable


computer (typically in the form of a microcontroller, a microprocessor or digital signal
processor chip) and which is used by individuals who are, in the main, unaware that the
system is computer-based.
Typical examples of embedded applications that are constructed using the techniques
discussed in this book include:
 Mobile phone systems (including both customer handsets and base stations).

Department of ECE, VBIT Page No:1


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

 Automotive applications (including braking systems, engine-management units,


steer-by-wire systems and cruise control applications).
 Domestic appliances (including dishwashers, televisions, washing machines,
Microwave ovens, garage door controllers).
 Aerospace applications (including flight control systems, engine controllers,
Auto pilots and passenger in-flight entertainment systems).
 Medical equipment (including anesthesia monitoring systems, ECG monitors, drug
delivery systems and MRI scanners).
 Defence systems (fighter aircraft control systems, radio systems missile guidance
systems).

1.1.2 Which processor are using?

The 8051 device is very different. It is a well-tested design, introduced in its original
form by Intel in 1980 (Figure 1.1). The development costs of this device have now been
fully recovered, and prices of modern 8051 devices now start at less than US $1.00. At this
price, you get a performance of around 1 million instructions per second, and 256 bytes of
on-chip RAM. You also get 32 port pins and a serial interface. The 8051’s profile (price,
performance, available memory, serial interface) match the needs of many embedded
systems very well. As a result, it is now produced in more than 400 different forms by a
diverse range of companies including Philips, Infineon, Atmel and Dallas. Sales of this vast
family are estimated to have the largest share (around 60%) of the microcontroller market as
a whole, and to make up more than 50% of the 8-bit microcontroller market. Versions of the
8051 are currently used in a long list of embedded products, from children’s toys to
automotive systems.

1.1.3 Which programming language are using?

Having decided to use an 8051 processor as the basis of your embedded system, the
next key decision that needs to be made is the choice of programming language. In order to
identify a suitable language for embedded systems, we might begin by making the following
observations.
Computers (such as microcontroller, microprocessor or DSP chips) only accept
instructions in ‘machine code’ (‘objects code’). Machine code is, by definition, in the
language of the computer, rather than that of the programmer. Interpretation of the code by
the programmer is difficult and error prone.

Department of ECE, VBIT Page No: 2


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

1.2 PROPOSED METHOD

In the developing countries we have seen a lot of crime happening at the bridges and
highways. Specially, during evening and midnight many occurrence like- hijacks ,thefts,
murders etc. are commonly taking place. To avoid those problems we have built an advanced
security system By implementing this system in the highways and bridges, primary steps can
be taken to resist a criminal or any sort of crime. As the data of each vehicle owner should
be recorded in the database previously, so when any information of that vehicle owner is
needed by the authority or police, it can be easily found from the database to ease the
process.

The basic model of the system has been developed by using RFID system and GSM
module Whenever a vehicle will enter the toll collection booth area, the reader will
immediately scan the tag identify the type of that vehicle and deduct the toll amount from
the vehicle owner's prepaid based account. And the message will be sent to vehicle owner
and by seeing that message he has reply to system as ($S) and the gate will be opened.

If any other person driving the vehicle means vehicle will be thefted and the vehicle
passing through the toll booth the message will be received by owner and he reply as ($N)
to the system. the system will alert and horn the alarm and again system sends a message as
UNKNOWN PERSON USING By using this method we can give a 100% security to the
vehicle and the controlling of the system is in owners hand

1.3 DIFFERENCE B/W MC AND MP


General-purpose microprocessors contains
 No RAM
 No ROM
 No I/O PORT

Department of ECE, VBIT Page No: 3


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

Fig 1.1: Block Diagram Of MP

Microcontroller has
 CPU (microprocessor)
 RAM
 ROM
 I/O ports
 Timer
 ADC and other peripherals

Fig 1.2: Block Diagram Of MC


General-purpose microprocessors
 Must add RAM, ROM, I/O ports, and timers externally to make them functional
 Make the system bulkier and much more expensive
 Have the advantage of versatility on the amount of RAM, ROM, and I/O ports
Microcontroller
 The fixed amount of on-chip ROM, RAM, and number of I/O ports makes them ideal
for many applications in which cost and space are critical
 In many applications, the space it takes, the power it consumes, and the price per unit
are much more critical considerations than the computing power

1.4 CRITERIA FOR CHOOSING MC

Meeting the computing needs of the task at hand efficiently and cost effectively
 Speed
 Power consumption
 The amount of RAM and ROM on chip
 The number of I/O pins and the timer on chip
 How easy to upgrade to higher performance or lower power-consumption versions

Department of ECE, VBIT Page No: 4


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

 Cost per unit

CHAPTER 2: BLOCK DIAGRAM

Power supply
LCD

AT89S52
MICRO BUZZER
MAX232
RFID CONTROLLER
L293D MOTOR

Crystal
oscillator

MAX232 GSM

Fig 2.1: Block Diagram

Department of ECE, VBIT Page No: 5


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

2.1 CIRCUIT DIAGRAM

Fig 2.2: Circuit Diagram

Department of ECE, VBIT Page No: 6


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

2.2 8051 MICROCONTROLLER

Overview

The 8051 family of micro controllers is based on an architecture which is highly


optimized for embedded control systems. It is used in a wide variety of applications from
military equipment to automobiles to the keyboard on your PC. Second only to the Motorola
68HC11 in eight bit processors sales, the 8051 family of microcontrollers is available in a
wide array of variations from manufacturers such as Intel, Philips, and Siemens.

2.2.1 The 8051 Family

In 1981, Intel Corporation introduced an 8-bit microcontroller called the 8051. This
microcontroller had 128 bytes of RAM, 4K bytes of on-chip ROM, two timers, one serial
port, and four ports (each 8-bits wide) all on a single chip. The 8051 is an 8-bit processor,
meaning that the CPU can work on only 8 bits of data at a time. Data larger than 8 bits has to
broken into 8-bit pieces to be processed by the CPU.

The 8051 has a total of four I/O ports, each 8 bits wide. Although the 8051 can have a
maximum of 64K bytes of on chip ROM, many manufacturers have put only 4K bytes on
the chip. There are different flavors of the 8051 in terms of speed and amount of on-chip
ROM, but they are all compatible with the original 8051 as far as the instructions are
concerned. The various members of the 8051 family are 8051 microcontroller, 8052
microcontroller and 8031 microcontroller.

The basic architecture consists of the following features:


 an eight bit ALU
 32 discrete I/O pins (4 groups of 8) which can be individually accessed
 two 16 bit timer/counters
 full duplex UART
 6 interrupt sources with 2 priority levels
 128 bytes of on board RAM

Department of ECE, VBIT Page No: 7


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

Internal Block Diagram:

Fig 2.3: Internal block diagram

8051 PIN Diagram:

Fig: 2.4 Pin diagram

Department of ECE, VBIT Page No: 8


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

VSS
Reset – RST
Crystal - XTAL [1, 2]
External device interfacing – EA, ALE, PSEN, WR, RD
I/O Port – P0 [7: 0], P1 [7:0], P2 [7:0], P3 [7:0]
P3 is shared with control lines – Serial I/O RxD, TxD,

– External Interrupts INT0, INT1

– Counter control T0, T1

P0 and P2 are multiplexed with Address and Data bus

2.2.2 About Ports And Pins

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 up’s. Port 0 also receives the code bytes during Flash programming, and outputs
the code bytes during program verification. External pull up’s are required during program
verification.

Port 1:

Port 1 is an 8-bit bi-directional I/O port with internal pull up’s. 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 up’s 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 up’s. 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 up’s. 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 up’s and can be used as inputs. As inputs, Port 2 pins that are

Department of ECE, VBIT Page No: 9


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

externally being pulled low will source current (IIL) because of the internal pull up’s. 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 accesses 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 up’s. 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 up’s 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 up’s. Port 3 also
receives some control signals for Flash programming and verification.

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

Department of ECE, VBIT Page No: 10


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

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, for parts that require 12-volt
VPP.

2.2.3 At89s52 Microcontroller

 Compatible with MCS®-51 Products


 8K Bytes of In-System Programmable (ISP) Flash Memory
 Endurance: 10,000 Write/Erase Cycles
 4.0V to 5.5V Operating Range
 Fully Static Operation: 0 Hz to 33 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
 Full Duplex UART Serial Channel
 Low-power Idle and Power-down Modes
 Interrupt Recovery from Power-down Mode
 Watchdog Timer • Dual Data Pointer
 Power-off Flag • Fast Programming Time
 Flexible ISP Programming (Byte and Page Mode)

Description

The AT89S52 is a low-power, high-performance CMOS 8-bit microcontroller with 8K


bytes of in-system programmable Flash memory. The device is manufactured using Atmel’s
high-density nonvolatile memory technology and is compatible with the indus-try-standard
80C51 instruction set and pinout. The on-chip Flash allows the program memory to be
reprogrammed in-system or by a conventional nonvolatile memory pro-grammer. By
combining a versatile 8-bit CPU with in-system programmable Flash on a monolithic chip,
the Atmel AT89S52 is a powerful microcontroller which provides a highly-flexible and cost-

Department of ECE, VBIT Page No: 11


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

effective solution to many embedded control applications. The AT89S52 provides the
following standard features: 8K bytes of Flash, 256 bytes of RAM, 32 I/O lines, Watchdog
timer, two data pointers, three 16-bit timer/counters, a six-vector two-level interrupt
architecture, a full duplex serial port, on-chip oscillator, and clock circuitry. 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.

Program Memory

If the EA pin is connected to GND, all program fetches are directed to external
memory. On the AT89S52, 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.

Data Memory

The AT89S52 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. Instructions that use indirect addressing access the upper 128 bytes of
RAM.

2.3 ADDRESSING MODES


The CPU can access data in various ways, which are called addressing modes:

Immediate:

The source operand is a constant the immediate data must be preceded by the pound
sign, “#”.It can load information into any registers, including 16-bit DPTR register.
DPTR can also be accessed as two 8-bit registers, the high byte DPH and low byte DPL.
We can use EQU directive to access immediate data.

Register:

Department of ECE, VBIT Page No: 12


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

Use registers to hold the data to be manipulated. The source and destination registers
must match in size. The movement of data between Rn registers is not allowed.

Direct:

It is most often used the direct addressing mode to access RAM locations 30 – 7FH.
The entire 128 bytes of RAM can be accessed. The register bank locations are accessed by
the register names.

Register indirect:

A register is used as a pointer to the data, only register R0 and R1 are used for this
purpose.R2 – R7 cannot be used to hold the address of an operand located in RAM. When
R0 and R1 hold the addresses of RAM locations, they must be preceded by the “@”.The
advantage is that it makes accessing data dynamic rather than static as in direct
addressing mode, looping is not possible in direct addressing mode.

Indexed:

Indexed addressing mode is widely used in accessing data elements of look-up table
entries located in the program ROM. The instruction used for this purpose is

MOVC A,@A+DPTR

Use instruction MOVC, “C” means code,The contents of A are added to the 16-bit register
DPTR to form the 16-bit address of the needed data.

2.4 TIMER PROGRAMMING

The 8051 has two timers/counters, they can be used either as, Timers to generate a
time delay or as Event counters to count events happening outside the microcontroller
.Both Timer 0 and Timer 1 are 16 bits wide Since 8051 has an 8-bit architecture, each 16-
bits timer is accessed as two separate registers of low byte and high byte. Accessed as low
byte and high byte the low byte register is called TL0/TL1 and the high byte register is
called TH0/TH1.

Department of ECE, VBIT Page No: 13


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

Fig 2.5: TMOD Registers

Both timers 0 and 1 use the same register, called TMOD (timer mode), to set the various
timer operation modes.
The lower 4 bits are for Timer 0
The upper 4 bits are for Timer 1
In each case,
The lower 2 bits are used to set the timer mode
The upper 2 bits to specify the operation

Department of ECE, VBIT Page No: 14


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

Table 2.1: TMOD Operating Modes

Timers Of 8051 Do Starting And Stopping By Either Software Or Hardware Control

 In using software to start and stop the timer where GATE=0


 The start and stop of the timer are controlled by way of software by the TR (timer
start) bits TR0 and TR1
 The SETB instruction starts it, and it is stopped by the CLR instruction
 These instructions start and stop the timers as long as GATE=0 in the TMOD register
 The hardware way of starting and stopping the timer by an external source is achieved by
making GATE=1 in the TMOD register

The Following Are The Characteristics And Operations Of Mode1:

 It is a 16-bit timer; therefore, it allows value of 0000 to FFFFH to be loaded into the
timer’s register TL and TH
 After TH and TL are loaded with a 16-bit initial value, the timer must be started. This is
done by SETB TR0 for timer 0 and SETB TR1 for timer 1.
 After the timer is started, it starts to count up. It counts up until it reaches its limit of
FFFFH, When it rolls over from FFFFH to 0000, it sets high a flag bit called TF (timer
flag) each timer has its own timer flag: TF0 for timer 0, and TF1 for timer 1 this timer
flag can be monitored When this timer flag is raised, one option would be to stop the
timer with the instructions CLR TR0 or CLR TR1, for timer 0 and timer 1, respectively.
 After the timer reaches its limit and rolls over, in order to repeat the process TH and TL
must be reloaded with the original value, and TF must be reloaded to 0.

To Generate A Time Delay

Department of ECE, VBIT Page No: 15


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

 Load the TMOD value register indicating which timer (timer 0 or timer 1) is to be used
and which timer mode (0 or 1) is selected.
 Load registers TL and TH with initial count value
 Start the timer
 Keep monitoring the timer flag (TF) with the JNB TFx, target instruction to see if it is
raised. Get out of the loop when TF becomes high.
 Stop the timer.
 Clear the TF flag for the next round.
 Go back to Step 2 to load TH and TL again.

2.5 INTERRUPT PROGRAMMING

An interrupt is an external or internal event that interrupts the microcontroller to


inform it that a device needs its service. A single microcontroller can serve several devices
by two ways.

Interrupts:

Whenever any device needs its service, the device notifies the microcontroller by
sending it an interrupt signal, upon receiving an interrupt signal, the microcontroller
interrupts whatever it is doing and serves the device. The program which is associated with
the interrupt is called the interrupt service routine
(ISR) or interrupt handler

Polling:

The microcontroller continuously monitors the status of a given device when the
conditions met, it performs the service. After that, it moves on to monitor the next device
until every one is serviced. Polling can monitor the status of several devices and serve each
of them as certain conditions are met. The polling method is not efficient, since it wastes
much of the microcontroller’s time by polling devices that do not need service

Upon activation of an interrupt, the microcontroller goes through the following steps:

 It finishes the instruction it is executing and saves the address of the next instruction
(PC) on the stack.
 It also saves the current status of all the interrupts internally (i.e.: not on the stack).

Department of ECE, VBIT Page No: 16


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

 It jumps to a fixed location in memory, called the interrupt vector table that holds the
address of the ISR.
 The microcontroller gets the address of the ISR from the interrupt vector table and
jumps to it
 It starts to execute the interrupt service subroutine until it reaches the last instruction of
the subroutine which is RETI (return from interrupt)
 Upon executing the RETI instruction, the microcontroller returns to the place where it
was interrupted
First, it gets the program counter (PC) address from the stack by popping the top two bytes
of the stack into the PC Then it starts to execute from that address.

Six Interrupts Are Allocated As Follows

 Reset – power-up reset.


 Two interrupts are set aside for the timers: one for timer 0 and one for timer 1.
 Two interrupts are set aside for hardware external interrupts P3.2 and P3.3 are for the
external hardware interrupts INT0 (or EX1), and INT1 (or EX2).
 Serial communication has a single interrupt that belongs to both receive and transfer.
Upon reset, all interrupts are disabled (masked), meaning that none will be responded to
by the microcontroller if they are activated.
 The interrupts must be enabled by software in order for the microcontroller to respond to
them
 There is a register called IE (interrupt enable) that is responsible for enabling
(unmasking) and disabling (masking) the interrupts.

To Enable An Interrupt, We Take The Following Steps:

1. Bit D7 of the IE register (EA) must be set to high to allow the rest of register to take effect.
2. The value of EA
If EA = 1, interrupts are enabled and will be responded to if their corresponding bits in IE
are high.
If EA = 0, no interrupt will be responded to, even if the associated bit in the IE register is
high.

Department of ECE, VBIT Page No: 17


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

The Timer Flag (Tf) Is Raised When The Timer Rolls Over

In polling TF, we have to wait until the TF is raised. The problem with this method is
that the microcontroller is tied down while waiting for TF to be raised, and can not do
anything else.

Using interrupts solves this problem and, avoids tying down the controller. If the
timer interrupt in the IE register is enabled, whenever the timer rolls over, TF is raised, and
the microcontroller is interrupted in whatever it is doing, and jumps to the interrupt vector
table to service the ISR. In this way, the microcontroller can do other until it is notified that
the timer has rolled over.

The 8051 Has Two External Hardware Interrupts

 Pin 12 (P3.2) and pin 13 (P3.3) of the 8051, designated as INT0 and INT1, are used as
External hardware interrupts
 The interrupt vector table locations 0003H and 0013H are set aside for INT0 and INT1
 There are two activation levels for the external hardware interrupts
Level trigged
Edge trigged

In the level-triggered mode, INT0 and INT1 pins are normally high

 If a low-level signal is applied to them, it triggers the interrupt


 Then the microcontroller stops whatever it is doing and jumps to the interrupt vector
table To service that interrupt
 The low-level signal at the INT pin must be removed before the execution of the last
Instruction of the ISR, RETI; otherwise, another interrupt will be generated
 This is called a level-triggered or level activated interrupt and is the default mode upon
Reset of the 8051

To make INT0 and INT1 edge triggered interrupts, we must program the bits of the TCON
register

 The TCON register holds, among other bits, the IT0 and IT1 flag bits that determine

Department of ECE, VBIT Page No: 18


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

Level- or edge-triggered Mode of the hardware interrupt


 IT0 and IT1 are bits D0 and D2 of the TCON register
 They are also referred to as TCON.0 and TCON.2 since the TCON register is bit
addressable

Department of ECE, VBIT Page No: 19


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

Table 2.2: TCON Registers

In the 8051 there is only one interrupt set aside for serial communication

 This interrupt is used to both send and receive data


 If the interrupt bit in the IE register (IE.4) is enabled, when RI or TI is raised the 8051
Gets interrupted and jumps to memory location 0023H to execute the ISR
 In that ISR we must examine the TI and RI flags to see which one caused the interrupt
And respond accordingly
 The serial interrupt is used mainly for receiving data and is never used for sending data
Serially

This is like getting a telephone call in which we need a ring to be notified. If we need
to make a phone call there are other ways to remind ourselves and there is no need for
ringing However in receiving the phone call, we must respond immediately no matter what
we are doing or we will miss the call.

The TCON register holds four of the interrupt flags; in the 8051 the SCON register has
the RI and TI flags

Table 2.3: Interrupt Flag Bits

When the 8051 is powered up, the priorities are assigned according to the following

 In reality, the priority scheme is nothing but an internal polling sequence in which the
8051 polls the interrupts in the sequence listed and Responds accordingly.

Department of ECE, VBIT Page No: 20


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

Table 2.4: Interrupt Priority Upon Reset

We can alter the sequence of interrupt priority by assigning a higher priority to any one of the
interrupts by programming a register called IP.

Table 2.5: Interrupt Priority Registers

In the 8051 a low-priority interrupt can be interrupted by a higher-priority interrupt


but not by another low priority interrupt. Although all the interrupts are latched and kept
internally, no low-priority interrupt can get the immediate attention of the CPU until the
8051 has finished servicing the high-priority interrupts

2.6 SERIAL PROGRAMMING

8051 has two pins that are used specifically for transferring and receiving data
serially. These two pins are called TxD and RxD and are part of the port 3 group (P3.0 and

Department of ECE, VBIT Page No: 21


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

P3.1).These pins are TTL compatible; therefore, they require a line driver to make them
RS232 compatible. To allow data transfer between the PC and an 8051 system without any
error, we must make sure that the baud rate of 8051 system matches the baud rate of the
PC’s COM port.

SBUF Register:

This is an 8-bit register used solely for serial communication. For a byte data to be
transferred via the TxD line, it must be placed in the SBUF register. The moment a byte is
written into SBUF, it is framed with the start and stop bits and transferred serially via the
TxD line. SBUF holds the byte of data when it is received by 8051 RxD line. When the bits
are received serially via RxD, the 8051 defames it by eliminating the stop and start bits,
making a byte out of the data received, and then placing it in SBUF.

SCON Register:

SCON is an 8-bit register used to program the start bit, stop bit, and data bits of data
framing, among other things.

Table 2.6: SCON Register

Table 2.7: Serial Port Mode

Department of ECE, VBIT Page No: 22


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

SM0, SM1: They determine the framing of data by specifying the number of bits per

Character and the start and stop bits.

SM2: This enables the multiprocessing capability of the 8051.


REN (receive enable): It is a bit-addressable register. When it is high, it allows 8051 to
receive data on RxD pin. If low, the receiver is disables (transmit interrupt). When 8051
finishes the transfer of 8-bit character. It raises TI flag to indicate that it is ready to transfer
another byte. TI bit is raised at the beginning of the stop bit RI (receive interrupt). When
8051 receives data serially via RxD, it gets rid of the start and stop bits and places the byte
in SBUF register. It raises the RI flag bit to indicate that a byte has been received and should
be picked up before it is lost. RI is raised halfway through the stop bit.

CHAPTER 3: SYSTEM REQUIREMENTS

3.1 POWER SUPPLY

Fig 3.1: Power Supply

3.1.1 Transformer

Transformer is a device that converts the one form energy to another form of energy
like a transducer.

Department of ECE, VBIT Page No: 23


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

Fig 3.2: Transformer

Basic Principle

A transformer makes use of Faraday's law and the ferromagnetic properties of an iron
core to efficiently raise or lower AC voltages. It of course cannot increase power so that if
the voltage is raised, the current is proportionally lowered and vice versa.

Fig 3.3: Basic Principle

Transformer Working

Department of ECE, VBIT Page No: 24


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

A transformer consists of two coils (often called 'windings') linked by an iron core, as
shown in figure below. There is no electrical connection between the coils, instead they are
linked by a magnetic field created in the core.

Fig 3.4: Basic Transformer

Transformers are used to convert electricity from one voltage to another with minimal
loss of power. They only work with AC (alternating current) because they require a changing
magnetic field to be created in their core. Transformers can increase voltage (step-up) as
well as reduce voltage (step-down).

Alternating current flowing in the primary (input) coil creates a continually changing
magnetic field in the iron core. This field also passes through the secondary (output) coil and
the changing strength of the magnetic field induces an alternating voltage in the secondary
coil. If the secondary coil is connected to a load the induced voltage will make an induced
current flow. The correct term for the induced voltage is 'induced electromotive force' which
is usually abbreviated to induced e.m.f.

Transformers have two great advantages over other methods of changing voltage:

1. They provide total electrical isolation between the input and output, so they can be
safely used to reduce the high voltage of the mains supply.
2. Almost no power is wasted in a transformer. They have a high efficiency (power out /
power in) of 95% or more.

3.1.2 The Bridge Rectifier

A bridge rectifier makes use of four diodes in a bridge arrangement to achieve full-
wave rectification. This is a widely used configuration, both with individual diodes wired as
shown and with single component bridges where the diode bridge is wired internally.

Department of ECE, VBIT Page No: 25


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

Fig 3.5: Bridge Rectifier

Fig 3.6: Bridge Rectification

Operation:
During positive half cycle of secondary, the diodes D2 and D3 are in forward biased
while D1 and D4 are in reverse biased as shown in the fig(a). The current flow direction is
shown in the fig (b) with dotted arrows.

Fig (A)3.7: Positive Half Cycle

Department of ECE, VBIT Page No: 26


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

During negative half cycle of secondary voltage, the diodes D1 and D4 are in forward
biased while D2 and D3 are in reverse biased as shown in the fig(c). The current flow
direction is shown in the fig (c) with dotted arrows.

Fig (B)3.8: Negative Half Cycle

3.1.3 Capacitor Filter

Filter circuits are used to remove unwanted or undesired frequencies from a signal.

3.1.4 Voltage Regulator

A voltage regulator is an electrical regulator designed to automatically maintain a


constant voltage level. It may use an electromechanical mechanism, or passive or active
electronic components. Depending on the design, it may be used to regulate one or more AC
or DC voltages. There are two types of regulator are they.

 Positive Voltage Series (78xx) and


 Negative Voltage Series (79xx)

78xx:’78’ indicate the positive series and ‘xx’indicates the voltage rating. Suppose 7805
produces the maximum 5V.’05’indicates the regulator output is 5V.

79xx:’79’ indicate the negative series and ‘xx’indicates the voltage rating. Suppose 7905
produces the maximum -5V.’05’indicates the regulator output is -5V.

These regulators consists the three pins there are

Pin1: It is used for input pin.

Pin2: This is ground pin for regulator

Department of ECE, VBIT Page No: 27


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

Pin3: It is used for output pin. Through this pin we get the output.

Fig 3.9: Regulator

3.2 RESET CIRCUIT

RESET is an active High input When RESET is set to High, 8051 goes back to the
power on state. The 8051 is reset by holding the RST high for at least two machine cycles
and then returning it low.

Fig 3.10: Reset Circuit

Power-On Reset

- Initially charging of capacitor makes RST High


- When capacitor charges fully it blocks DC.
Manual reset
-closing the switch momentarily will make RST High. After a reset, the program counter is
loaded with 0000H but the content of on-chip RAM is not affected.

3.3 OSCILLATOR CIRCUIT

Department of ECE, VBIT Page No: 28


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

The 8051 uses the crystal for precisely that: to synchronize it’s operation. Effectively,
the 8051 operates using what are called "machine cycles." A single machine cycle is the
minimum amount of time in which a single 8051 instruction can be executed. 8051 has an
on-chip oscillator. It needs an external crystal thats decides the operating frequency of the
8051.This can be achieved in two ways

Fig 3.11: Oscillator Circuit

The crystal is connected to pins 18 and 19 with stabilizing capacitors. 12 MHz


(11.059MHz) crystal is often used and the capacitance ranges from 20pF to 40pF. The
oscillator can also be a TTL clock source connected with a NOT gate as shown

3.4 SERIAL COMMUNICATION

THEORY:
In order to connect micro controller to a modem or a pc to modem a serial port is
used. Serial is a very common protocol for device communication that is standard on almost
every PC. Most computers include two RS-232 based serial ports. Serial is also a common
communication protocol that is used by many devices for instrumentation, numerous GPIB-
compatible devices also come with an RS-232 port. Further more, serial communication can
be used for data acquisition in conjunction with a remote sampling device.

Department of ECE, VBIT Page No: 29


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

The concept of serial communication is simple. The serial port sends and receives
bytes of information one bit at a time. Although this is slower than parallel communication,
which allows the transmission of an entire byte at once, it is simpler and can be used over
longer distances.

Typically, serial is used to transmit ASCII data. Communication is completed using 3


transmission lines: Ground, Transmit, and Receive. Since serial is asynchronous, the port is
able to transmit data on one line while receiving data on another. Other lines are available
for handshaking. The important serial characteristics are baud rate, data bits, stop bits, and
parity. For two ports to communicate, these parameters must match

Baud rate:

It is a speed measurement for communication. It indicates the number of bit transfers


per second. For example, 300 baud is 300 bits per second. When a clock cycle is referred it
means the baud rate. For example, if the protocol calls for a 4800 baud rate, then the clock is
running at 4800Hz. This means that the serial port is sampling the data line at 4800Hz.
Common baud rates for telephone lines are 14400, 28800, and 33600. Baud rates greater
than these are possible, but these rates reduce the distance by which devices can be
separated. These high baud rates are used for device communication where the devices are
located together, as is typically the case with GPIB devices.

Data bits:

Measurement of the actual data bits in a transmission. When the computer sends a
packet of information, the amount of actual data may not be a full 8 bits. Standard values for
the data packets are 5, 7, and 8 bits. Which setting chosen depends on what information
transferred. For example, standard ASCII has values from 0 to 127 (7 bits). Extended ASCII
uses 0 to 255 (8 bits). If the data being transferred is simple text (standard ASCII), then
sending 7 bits of data per packet is sufficient for communication. A packet refers to a single
byte transfer, including start/stop bits, data bits, and parity. Since the number of actual bits
depends on the protocol selected, the term packet is used to cover all instances.

Stop bits:

Stop bit is used to signal the end of communication for a single packet. Typical values
are 1, 1.5, and 2 bits. Since the data is clocked across the lines and each device has its own

Department of ECE, VBIT Page No: 30


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

clock, it is possible for the two devices to become slightly out of sync. Therefore, the stop
bits not only indicate the end of transmission but also give the computers some room for
error in the clock speeds. The more bits that are used for stop bits, the greater the lenience in
synchronizing the different clocks, but the slower the data transmission rate.

Parity:

A simple form of error checking that is used in serial communication. There are four
types of parity: even, odd, marked, and spaced. The option of using no parity is also
available. For even and odd parity, the serial port sets the parity bit to a value to ensure that
the transmission has an even or odd number of logic high bits. If the parity is odd, then the
parity bit is 1, resulting in 3 logic-high bits. Marked and spaced parity does not actually
check the data bits, but simply sets the parity bit high for marked parity or low for spaced
parity. This allows the receiving device to know the state of a bit to enable the device to
determine if noise is corrupting the data or if the transmitting and receiving device clocks
are out

3.4.1 Recommended Standard -232:

About RS-232

Electronic data communications between elements will generally fall into two broad
categories: single-ended and differential. RS232 (single-ended) was introduced in 1962, and
despite rumors for its early demise, has remained widely used through the industry.

The RS232 signals are represented by voltage levels with respect to a system common (power
/ logic ground). The "idle" state (MARK) has the signal level negative with respect to
common, and the "active" state (SPACE) has the signal level positive with respect to

Department of ECE, VBIT Page No: 31


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

common. RS232 has numerous handshaking lines (primarily used with modems), and also
specifies a communications protocol.

The RS-232 interface presupposes a common ground between the DTE and DCE.
This is a reasonable assumption when a short cable connects the DTE to the DCE, but with
longer lines and connections between devices that may be on different electrical busses with
different grounds, this may not be true.

The output signal level usually swings between +12V and -12V. The "dead area"
between +3v and -3v is designed to absorb line noise. In the various RS-232-like definitions
this dead area may vary. For instance, the definition for V.10 has a dead area from +0.3v to
-0.3v. Many receivers designed for RS-232 are sensitive to differentials of 1v or less.

Fig 3.12: DB Connector wire

Table 3.1: Rs-232 Specification

Department of ECE, VBIT Page No: 32


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

3.4.2 Db9 Connector:

The term "DB9" refers to a common connector type, one of the D-Subminiature or D-
Sub types of connectors. DB9 has the smallest "footprint" of the D-Subminiature
connectors, and houses 9 pins (for the male connector) or 9 holes (for the female
connector).DB9 connectors were once very common on PCs and servers. DB9 connectors
are designed to work with the EIA/TIA 232 serial interface standard, which determined the
function of all nine pins as a standard, so that multiple companies could design them into
their products.

Fig 3.13: DB9 Connector (Male And Female)

3.4.3 Types Of The Db9 Connector:

In DB9 connector w have two types of connector


 Male connectors
 Female connectors

Working:

Pin Configuration:

The DB9 (originally DE-9) connector is an analog 9-pin plug of the D-Subminiature
connector family (D-Sub or Sub-D).

The DB9 connector is mainly used for serial connections, allowing for the
asynchronous transmission of data as provided for by standard RS-232 (RS-232C).

Department of ECE, VBIT Page No: 33


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

Fig 3.14: Male And Female Pins

Pin number Name


1 CD - Carrier Detect
2 RXD - Receive Data
3 TXD - Transmit Data
4 DTR - Data Terminal Ready
5 GND - Signal Ground
6 DSR - Data Set Ready
7 RTS - Request To Send
8 CTS - Clear To Send
9 RI - Ring Indicator
Table 3.2: Db9 Connector Pins

If you wanted to do a general RS-232 connection, you could take a bunch of long
wires and solder them directly to the electronic circuits of the equipment you are using, but
this tends to make a big mess and often those solder connections tend to break and other
problems can develop. To deal with these issues, and to make it easier to setup or take down
equipment, some standard connectors have been developed that is commonly found on most
equipment using the RS-232 standards.

These connectors come in two forms: A male and a female connector. The female
connector has holes that allow the pins on the male end to be inserted into the connector.
This is a female "DB-9" connector (properly known as DE9F):

Fig: Female Connector

Department of ECE, VBIT Page No: 34


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

The female DB-9 connector is typically used as the "plug" that goes into a typical
PC. If you see one of these on the back of your computer, it is likely not to be used for serial
communication, but rather for things like early VGA or CGA monitors (not SVGA) or for
some special control/joystick equipment.

And this is a male "DB-9" connector (properly known as DE9M):

Fig: Male Connector

This is the connector that you are more likely to see for serial communications on a
"generic" PC. Often you will see two of them side by side (for COM1 and COM2). Special
equipment that you might communicate with would have either connector, or even one of
the DB-25 connectors listed below.

The wiring of RS-232 devices involves first identifying the actual pins that are being
used. Here is how a female DB-9 connector is numbered:

3.5 LIQUID CRYSTAL DISPLAY

A liquid crystal display (LCD) is a thin, flat display device made up of any number
of color or monochrome pixels arrayed in front of a light source or reflector. It is prized by
engineers because it uses very small amounts of electric power, and is therefore suitable for
use in battery-powered electronic devices.

The surfaces of the electrodes that are in contact with the liquid crystal material are
treated so as to align the liquid crystal molecules in particular direction. This treatment
typically consists of thin polymer layer that is unidirectional rubbed using a cloth (the
direction of liquid crystal alignment is defined by the direction of rubbing). Before applying

Department of ECE, VBIT Page No: 35


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

an electric field, the orientation of the liquid crystal molecules is determined by the alignment
at the surfaces. In a twisted nematic device (still the most common liquid crystal device), the
surface alignment directions at the two electrodes are perpendicular, and so the molecules
arrange themselves in helical structure, or twist. Because the liquid crystal material is
birefringent, light passing through one polarizing filter is rotated by the liquid crystal helix as
it passes through the liquid crystal layer, allowing it to pass through the second polarized
filter

Fig 3.15: LCD


3.5.1 Shapes & Sizes:
Even limited to character-based modules, there is still a wide variety of shapes &
sizes . Line lengths of 8, 16,20,24,32 and 40 are all standard, in one, two and four line
versions.Several different liquid crystal technologies exist. Some modules are available with
back-lighting, so that they can be viewed In dimly-lit conditions. The back-lighting may be
“electro-luminescent,” requiring a high voltage inverter circuit, or simple led illumination.
Few of these features are important, however for experimentation purposes. All types are
capable of displaying the same basic information, so the cheaper types are probably the best
bet initially.

Department of ECE, VBIT Page No: 36


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

Fig 3.16: Types Of LCDS

3.5.2 Connections:

Most LCD modules conform to a standard interface specification. A 14-pin access is


provided (14 holes for solder pin insertion or for an IDC converter) having eight data lines,
three control lines and three power lines.

Fig: Pin Outs Of The Two Basic LCD Formats

On most displays, the pins are numbered on the LCD printed circuit board, but if not
it is quite easy to locate pin1.Since this pin is connected to the ground, it often has a thick
p.c.b track connected to it, and it is generally connected to metal work at same time.
1. Pins 1 &2 are the power supply lines Vss and Vdd. The Vdd pin should be connected

to the positive supply and Vss to the 0V supply or ground.

2. Pin 3 is a control pin, Vee, which is used to alter the contrast of the display. Ideally
this pin should be connected to the variable voltage supply. A preset potentiometer

Department of ECE, VBIT Page No: 37


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

connected between the power supply lines, with its wiper connected to the contrast
pin is suitable in many cases.

3. Pin 4 is a Register Select (RS) line, the first of the three command control inputs.
When the line is low, data bytes transferred to the display are treated as commands,
and data bytes read from the display indicates its status.

4. Pin 5 is the Read/Write (R/W) line. This line is pulled low in order to write
commands or data to the module, or pulled high to read character data or status
information from its register.

5. Pin 6 is the Enable (E) line. This input is used to initiate the actual transfer of
commands or character data between the modules and data lines. When writing to the
display, the data is transferred to the high to low transition of this signal.

6. Pin 7 to 14 are eight data bus lines (D0 to D7).Data can be transferred to and from the
display, either as a single 8-bit byte or two 4-bit “nibbles.”

In the latter case only the upper four data lines (D4 to D7) are used. The 4-bit mode is
beneficial when using a microcontroller, as fewer input/output lines are required.

Table 3.3: Pin out function for LCD types

Department of ECE, VBIT Page No: 38


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

3.6 MAX- 232:


Pin description of MAX 232:

The MAX 232 IC is a 16 pin structure with four capacitors connected internally as shown
following figure,

Fig 3.17: Max 232 Pin Description

As can be seen, the most important pins are from pin7 to pin 14 and pins 15 and 16.

 The pins 16 and 15 are the power supply Vic and the ground respectively which are

Used to drive the circuit and complete the circuit diagram respectively.

 The pins 10 and 11 are the serially transmitted data from the TTL side which is the

RF receiver side and the corresponding outputs for these pins are pin7 and pin14

Respectively on The RS-232 side.

 The pins 8 and 13 are from the RS-232 side and are carried out by pins 9 and 12

Respectively on The TTL side.

Department of ECE, VBIT Page No: 39


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

MAX232:

Max 232 is a communications device used mainly for serial commands to and from
a flash ROM. The MAX232 is an integrated circuit that converts signals from an RS-232
serial port to signals suitable for use in TTL compatible digital logic circuits. The MAX232
is a dual driver/receiver and typically converts the RX, TX, CTS and RTS signals. The
drivers provide RS-232 voltage level outputs (approx. ± 7.5 V) from a single + 5 V supply
via on-chip charge pumps and external capacitors. This makes it useful for implementing
RS-232 in devices that otherwise do not need any voltages outside the 0 V to + 5 V range, as
power supply design does not need to be made more complicated just for driving the RS-232
in this case.

Voltage levels

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


receives a TTL level to convert, it changes a TTL Logic 0 to between +3 and +15V, and
changes TTL Logic 1 to between -3 to -15V, and vice versa for converting from RS232 to
TTL. This can be confusing when you realize that the RS232 Data Transmission voltages at
a certain logic state are opposite from the RS232 Control Line voltages at the same logic
state. To clarify the matter, see the table below. For more information see RS-232 Voltage
Levels.

TTL Voltage to/from


RS232 Line Type & Logic Level RS232 Voltage
MAX232
Data Transmission (Rx/Tx) Logic 0 +3V to +15V 0V
Data Transmission (Rx/Tx) Logic 1 -3V to -15V 5V
Control Signals (RTS/CTS/DTR/DSR) Logic
-3V to -15V 5V
0
Control Signals (RTS/CTS/DTR/DSR) Logic
+3V to +15V 0V
1
Table 3.4: Rs232 Voltages

Description

Department of ECE, VBIT Page No: 40


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

The MAX232 device is a dual driver/receiver that includes a capacitive voltage


generator to supply EIA-232 voltage levels from a single 5-V supply. Each receiver converts
EIA 232 inputs to 5V TTL/CMOS levels. These receivers have a typical threshold of 1.3 V
and a typical hysteresis of 0.5V,and can accept ±30V inputs. Each driver converts
TTL/CMOS input levels into EIA-232 levels. The driver, receiver, and voltage-generator
functions are available as cells in the Texas Instruments. The MAX232 is characterized for
operation from 0°C to 70°C.The MAX232I is characterized for operation from –40°C to
85°C.

Special Features
 Operates With Single 5-V Power Supply & Lin Bi CMOS Process Technology

 Two Drivers and Two Receivers & 30-V Input Levels

 Low Supply Current-8 mA (Typical)

3.7 SIM 800L GSM MODULE

3.7.1 GSM History

GSM is a standard for digital mobile telephony developed in Europe to substitute


the existing analog mobile telephony technology which by that time, was confronted to a
number of problems such as increased demand, capacity, and incompatibility with other
networks.
In 1982, the Conference of European Posts and Telecommunications (CEPT)
established a study group whose objective was to study and develop a public land mobile
system for Europe.
The group responsible for this work was called “Group Special Mobile” (GSM). In
1990, phase I of the GSM specifications was published and in 1991 the commercial service
was started. From that time, GSM gained worldwide popularity and GSM which originally
was an acronym for “Group Special mobile”, was later set to stand for Global System for
Mobile Communication.

3.7.2 GSM Services

Department of ECE, VBIT Page No: 41


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

GSM offers three categories of services. The first category of services is related to
the transportation of data to or from an ISDN terminal. These services are referred to as bearer
services. The second category of services is referred to as Tele-services. This category
includes services such as telephony and SMS. The third category of services is referred to
as supplementary services. This include services such as caller identification, call forwarding,
call waiting, multiparty conversations, and barring of outgoing calls (Scourias, 1994).

3.7.3 Short Messaging Services

Short Messaging Services, in short SMS, is a GSM Tele-service which allows


mobile subscribers to send and receive alphanumeric messages up to 160characters long,
using their mobile phones. When non-Latin alphabets are used, the message length is
reduced to 70 characters. SMS was part of GSM phase 1standard. It is implemented by
adding a node called Short Message Services Center (SMSC) in a GSM network. All
messages from senders are directed to the SMSC before they are forwarded to the recipients, hence
SMS is said to be a store and forward service. SMS’s big advantage is the fact that the message is
transmitted via the signaling channel, leaving the bandwidth free for voice, data and fax calls
(Portolani, 2004).

3.7.4 SIM 800L

The SIM800L module supports quad-band GSM/GPRS network, available for GPRS
and SMS message data remote transmission. The SIM800L communicates with
microcontroller via UART port, supports command including 3GPP TS 27.007, 27.005 and
SIMCOM enhanced AT Commands. It also has built-in level translation, so it can work with
microcontroller of higher voltage than 2.8V default. Besides, the board also supports A-GPS
technique which is called mobile positioning and gets position by mobile network. This
features make it can also be a tracker module.

Features:

 Quad-band 850/900/1800/1900MHz
 GPRS multi-slot class12 connectivity: max. 85.6kbps(down-load/up-load)
 GPRS mobile station class B
 Controlled by AT Command (3GPP TS 27.007, 27.005 and SIMCOM enhanced AT )
 Supports Real Time Clock
 Supply voltage range 3.4V ~ 4.4V

Department of ECE, VBIT Page No: 42


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

 Supports A-GPS
 Supports 3.0V to 5.0V logic level
 Low power consumption, 1mA in sleep mode
 Compact size 23mm x 35mm x 5.6mm
 Micro SIM Card

Fig 3.18: GSM Modem

3.8 RFID TECHNOLOGY:


RFID

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 (see the sidebar), it does so without requiring a line of sight.1 RFID tags (see
figure 1) 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

3.8.1 RFID Reader

Active RFID and Passive RFID technologies, while often considered and evaluated
together, are fundamentally distinct technologies with substantially different capabilities. In
most cases, neither technology provides a complete solution for supply chain asset
management applications. Rather, the most effective and complete supply chain solutions
leverage the advantages of each technology and combine their use in complementary ways.
This need for both technologies must be considered by RFID standards initiatives to
effectively meet the requirements of the user community.

Department of ECE, VBIT Page No: 43


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

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 3.19: RFID Module

Functions
 Supports reading of 64 Bit Manchester Encoded cards
 Pins for External Antenna connection
 Serial Interface (TTL)
 Wiegand Interface also available
 Customer application on request
 Technical Data:
 Frequency: 125 kHz
 Read Range: up to 8 cm
 Power supply: 5V DC (± 5 %)
 Current consumption max. : 60 mA
 Operating temperature: -20 ... +65° C
 Storing temperature: -40 ... +75° C
 Interface: RS232 (TTL), Wiegand and others (on Demand)
 Dimensions (l x w x h): 36 x 18 x 10 mm
 Serial Interface Format: 9600Baud, No Parity, 8 Data bits, 1 Stop bit

3.8.2 RFID Types

Many types of RFID exist, but at the highest level, we can divide RFID devices into two
classes:

Active and passive:

Department of ECE, VBIT Page No: 44


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

Active tags require a power source—they’re either connected to a powered


Infrastructure or use energy stored in an integrated battery. In the latter case, a tag’s lifetime
is limited by the stored energy, balanced against the number of read operations the device
must undergo. One example of an active tag is the transponder attached to an aircraft that
identifies its national origin. Another example is a LoJack device attached to a car, which
incorporates cellular technology and a GPS to locate the car if stolen. However, batteries
However, batteries make the cost, size, and lifetime of active tags impractical for the retail
trade.

Passive RFID is of interest because the tags don’t 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 semi-conductor chip attached to
the antenna, and some form of encapsulation. The tag reader is responsible for powering and
communicating with a tag.

Fig 3.20: RFID Tags


Reason behind choosing rfid:

RFID is 20 times time faster than Barcode and it can scan more number of items
within seconds with more accuracy and without missing any object. Barcode takes more
time to scan each item and it has the chance of missing some items from scanning.

Differences between rfid and a simple barcode system

Many libraries have already installed barcode systems where a barcode is placed in
each book and the LMS (Library Management System) uniquely identifies the book by
reading the barcode, using a barcode scanner. This technology has enabled self service and

Department of ECE, VBIT Page No: 45


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

self return to operate successfully for many years, functions which have since come to be
synonymous with RFID technology.

The main differences between using barcodes or RFID tags are the latter’s ability to
issue multiple items simultaneously and to allow items to be read without having to open
them to find the barcodes. Libraries should consider the volumes of items which will need to
be processed either for self-service and self-return and aim for an RFID/sortation solution
which can cope. Another significant difference between barcode and RFID systems is that
barcodes use standards that can be read by most scanners. While RFID transmission
protocols are well established tags are, at present, not governed by similar standards,
meaning that some tags may only be read by a specific reader

3.8.3 Smart Card:

A smart card is an integrated circuit card that forms a part of a circuit or system
when engaged with a smart card interface. Smart cards are becoming increasingly more
popular for security and personal identification applications. Smart cards have one or more
microcontrollers embedded in them which manage to access and storage of sensitive data
that is actually stored in memory devices on the smart card.

Fig: Smart Card

The smart chip included on a smart card provides a means for secured electronic
transactions and a means for identification. The integrated chip is embedded in the smart
card and operates to process specific transactions. The smart card uses a serial interface and
receives its power from an external source such as a smart card reader.

Smart Card Reader

Smart Card Readers are also known as Card Programmers (because they can write
to a card), card terminals, card acceptance device (CAD) or an interface device (IFD). When
the smart card and the card reader come into contact, each identifies itself to the other by

Department of ECE, VBIT Page No: 46


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

sending and receiving information. If the messages exchanged do not match, no further
processing takes place.

Fig 3.21: Smart Card Reader

Smart card reader working

The reader provides a path for your application to send and receive commands from
the card. There are many types of readers available, such as serial, PC Card, and standard
keyboard models. Unfortunately, the ISO group was unable to provide a standard for
communicating with the readers so there is no one-size-fits-all approach to smart card
communication.

Each manufacturer provides a different protocol for communication with the reader.
 First you have to communicate with the reader.
 Second, the reader communicates with the card, acting as the intermediary before
Sending the data to the card.
 Third, communication with a smart card is based on the APDU format. The card will
process the data and return it to the reader, which will then return the data to its
originating source.

The following classes are used for communicating with the reader:
 ISO command classes for communicating with 7816 protocol
 Classes for communicating with the reader
 Classes for converting data to a manufacturer-specific format
 An application for testing and using the cards for an intended and specific purpose

In our project, the Smart Card Reader communicates with microcontroller through 2
pins namely RX and TX with the help of a Serial Driver. These 2 pins are pin 2, 3 of the 9-
pin connector of Smart Card Reader.

Department of ECE, VBIT Page No: 47


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

Latch:

A latch is an example of a bi-stable multi vibrator, that is, a device with exactly two
stable states. These states are high-output and low-output. A latch has a feedback path, so
information can be retained by the device. Therefore latches can be memory devices, and
can store one bit of data for as long as the device is powered. As the name suggests, latches
are used to "latch onto" information and hold in place. Latches are very similar to flip-flops,
but are not synchronous devices, and do not operate on clock edges as flip-flops do.

Features
 low input load factor (PNP input)
 Hysteresis provided (=400V typically)
 High break down input voltage (V1>=15V)
 Output control input having same phase for 2 circuits
 High fan out, 3-state output

3.9 BUZZER

A buzzer or beeper is an audio signaling device, which may be mechanical,


electromechanical, or piezoelectric. Typical uses of buzzers and beepers include alarm
devices timers and confirmation of user input such as a mouse click or keystroke.

Early devices were based on an electromechanical system identical to an electric bell


without the metal gong. Similarly, a relay may be connected to interrupt its own actuating
current, causing the contacts to buzz. Often these units were anchored to a wall or ceiling to
use it as a sounding board. The word "buzzer" comes from the rasping noise that
electromechanical buzzers made.

A buzzer is a device which makes a buzzing or beeping noise. There are several
kinds; the most basic is a piezoelectric buzzer, which is just a flat piece of piezoelectric
material with two electrodes. This type of buzzer requires some kind of oscillator (or
something more complicated like a microcontroller) to drive it—if you apply a DC voltage
you will just get a click. They are used in places where you need something that emits an
audible tone, but don’t care about high-fidelity sound reproduction, like microwave ovens,
smoke alarms, and electronic toys. They are cheap and can be very loud without using very
much power. They are also very thin, so they can be used in flat objects like “singing”
greeting cards.

Department of ECE, VBIT Page No: 48


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

Fig 3.22: buzzer

Features

 The ps series are high-performance buzzers that employ unimorph piezoelectric


elements and designed for easy incorporation into various circuits.
 They feature extremely low power consumption in comparison to electromagnetic
units.
 Because these buzzers are designed for external excitation, the same part can serve as
both a musical tone oscillator and a buzzer.
 They can be used with automated inserters. Moisture-resistant models are also
available.
 The lead wire type (ps1550l40n) with both-sided adhesive tape installed easily is
prepared.

3.10 MOTOR DRIVER IC


L293D

The L293 is an integrated circuit motor driver that can be used for simultaneous, bi-
directional control of two small motors. Small means small. The L293 is limited to 600 mA,
but in reality can only handle much small currents unless you have done some serious heat

Department of ECE, VBIT Page No: 49


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

sinking to keep the case temperature down. Unsure about whether the L293 will work with
your motor? Hook up the circuit and run your motor while keeping your finger on the chip.
If it gets too hot to touch, you can't use it with your motor. (Note to ME2011 students: The
L293 should be OK for your small motor but is not OK for your gear motor.)

Fig 3.23:
Internal
Diagram of
L293D IC

The L293
comes in a
standard 16-pin, dual-in line integrated circuit package. There is an L293 and an L293D part
number. Pick the "D" version because it has built in fly back diodes to minimize inductive
voltage spikes.

Department of ECE, VBIT Page No: 50


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

The pin out for the L293 in the 16-pin package is shown below in top view. Pin 1 is
at the top left when the notch in the package faces up. Note that the names for pin functions
may be slightly different than what is shown in the following diagrams. The following
schematic shows how to connect the L293 to your motor and the Stamp. Each motor takes 3
Stamp pins. If you are only using one motor, leave pins 9, 10, 11, 12, 13, 14, and 15 empty.

Fig 3.24: Pin Diagram

Assume you have only one motor connected with the enable tied to Stamp Pin 0, and the
two direction controls tied to Stamp Pins 1 and 2.

ENABLE DIRA DIRB FUNCTION


H H L Turn right
H L H Turn left
H L/H L/H Fast stop
L Either either Slow stop

Table 3.5: L293D functions

3.11 DC MOTOR

Department of ECE, VBIT Page No: 51


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

Introduction

Whenever a robotics hobbyist talk about making a robot, the first thing comes to his
mind is making the robot move on the ground. And there are always two options in front of
the designer whether to use a DC motor or a stepper motor. When it comes to speed, weight,
size, cost... DC motors are always preferred over stepper motors. There are many things
which you can do with your DC motor when interfaced with a microcontroller. For example
you can control the speed of motor, you can control the direction of rotation, you can also do
encoding of the rotation made by DC motor i.e. keeping track of how many turns are made
by your motors etc. So you can see DC motors are no less than a stepper motor.

►Working Theory of H-Bridge

The name "H-Bridge" is derived from the actual shape of the switching circuit which
controls the motion of the motor. It is also known as "Full Bridge". Basically there are four
switching elements in the H-Bridge as shown in the figure below.
As you can see in the figure above there are four switching elements named as "High side
left", "High side right", "Low side right", "Low side left". When these switches are turned on
in pairs motor changes its direction accordingly. Like, if we switch on High side left and
Low side right then motor rotate in forward direction, as current flows from Power supply
through the motor coil goes to ground via switch low side right. This is shown in the figure
below.

Fig 3.25: H-Bridge Working

Department of ECE, VBIT Page No: 52


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

Similarly, when you switch on low side left and high side right, the current flows in
opposite direction and motor rotates in backward direction. This is the basic working of H-
Bridge. We can also make a small truth table according to the switching of H-Bridge
explained above.

Truth Table
High Left High Right Low Left Low Right Description
On Off Off On Motor runs clockwise
Off On On Off Motor runs anti-clockwise
On On Off Off Motor stops or decelerates
Off Off On On Motor stops or decelerates
Table 3.6: Motor Functions

As already said, H-bridge can be made with the help of transistors as well as
MOSFETs; the only thing is the power handling capacity of the circuit. If motors are needed
to run with high current then lot of dissipation is there. So head sinks are needed to cool the
circuit.

Now you might be thinking why i did not discuss the cases like High side left on and
Low side left on or high side right on and low side right on. Clearly seen in the diagram, you
don't want to burn your power supply by shorting them. So that is why those combinations
are not discussed in the truth tabl60RPM 12V DC geared motors for robotics applications.
Very easy to use and available in standard size. Nut and threads on shaft to easily connect
and internal threaded shaft for easily connecting it to wheel.

Table 3.7: Dc Motor Modes

Department of ECE, VBIT Page No: 53


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

Fig 3.26: Dc Motor

Features

 60RPM 12V DC motors with Gearbox

 3000RPM base motor

 6mm shaft diameter with internal hole

 125gm weight

 Same size motor available in various rpm

 2kgcm torque

 No-load current = 60 mA(Max), Load current = 300 mA(Max)

CHAPTER 4: SOFTWARE

Department of ECE, VBIT Page No: 54


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

4.1 KEIL SOFTWARE

Introduction

This technical note describes the use of the Keil uVision Integrated Development
Environment in the development of a ‘C’ based, MicroController application. The Keil 8052
compiler package includes uVision2 which is an Integrated Development Environment
(IDE) along with all the utilities you may need to create embedded application programs for
the MicroController family.

4.1.1 Creating A Project

Before writing any C-code, a project associated with our code needs to be created.
This is done by first creating a new folder in the Keil directory in which your project will be
saved. Next the Keil uV2 application can be launched and a new project is created. This is
achieved by completing the following steps.
Create a new project. From the main window, choose the ‘Project’ menu and select ‘New
project’. A new window appears as shown below in Figure 1.

Fig 4.1: Creating New Project

A new window appears as shown in figure 2 below and you are now required to configure
your setup to target the specific MicroController device you wish to use (in this example we

Department of ECE, VBIT Page No: 55


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

will be using the ADuC834) and the output file format generated after the compilation stage.
This is achieved by completing the following steps.

Fig 4.2: Selecting Of MC

Next, you need to configure your target output options. This is done by clicking on the
“options for target” item located in the “project” pull-down menu. Alternatively you can
select this option by clicking on the icon from the ‘compile’ toolbar situated at the top of the
screen and shown in figure 3 below.

A new window appears as shown in figure 4. Enable the option to Create Hex File by ticking
the check-box and pressing ‘OK’ as shown circled in figure 4 below.

Department of ECE, VBIT Page No: 56


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

Fig 4.3: Create Hex File

Now you can begin writing your C program. In the main window, choose the File
pull-down menu and select New. A new window named <text1> will appear on the screen.
Type the C source code that is included in Appendix A of this tech note into the <text1>
window. Once you've typed all the code, again choose the File pull-down menu and select
Save.

Fig 4.4: Target Files

4.1.2 Compiling A C Program

Department of ECE, VBIT Page No: 57


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

Our C code is compiled by selecting ‘Build Target’ from the Project pull-down
menu on the main tool-bar. The compile option can also be initiated by selecting the ‘F7’
special function key or by clicking on the ‘Build Target’ icon in the compile toolbar as
shown in figure 6 below.

If the compilation completes successfully a message indicating that the compile job
has completed with 0 errors will appear in the build dialog screen. Sometimes warnings may
be generated for information purposes to indicate multiple function calls etc. If the resultant
compilation message indicates that there were 1 or more errors, then the output files will not
be created. In this case, the file has been entered incorrectly and clicking directly on any
error message forces uVision to highlight where in the code the error has occurred.

Simulating Your C-Source Code

Another powerful feature of the uVision2 IDE is that it allows you to run your code
in a MicroController specific simulation environment. To start a simulation session you
simply click on the on ‘Start/Stop Debug Session’ option available from the ‘Debug’ pull-
down menu. Alternatively you can press <Cntrl+F7> or the ‘Debug’ icon available in the
‘File’ toolbar
.

Fig 4.5: Debug Process

4.1.3 Creating The Simulation Environment

Department of ECE, VBIT Page No: 58


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

The following steps will allow you to create a generic simulation environment that you
may want to further customize to your own requirements. From the top Debug toolbar, click
on the icon buttons that are shown in figure 8 below which open a Serial I/O peripheral
window as well as a code Performance Analyzer window.
Note: If the ‘Debug’ toolbar does not appear at the top of the screen, simply select the
‘Debug Toolbar’ option available from the ‘View’ pull-down menu.

Fig 4.6: Final Stimulation

4.2 FLASH PROGRAMMER

Introduction

Simple to use & low cost, yet powerful flash microcontroller programmer for the
Atmel 89 series. It will Program, Read and Verify Code Data, Write Lock Bits, Erase and
Blank Check. All fuse and lock bits are programmable. This programmer has intelligent
onboard firmware and connects to the Parallel port. It can be used with any type of computer
and requires no special hardware. All that is needed is a Parallel communication port which
all computers have. All devices also have a number of lock bits to provide various levels of
software and programming protection. These lock bits are fully programmable using this
programmer. Lock bits are useful to protect the progam to be read back from microcontroller
only allowing erase to reprogram the microcontroller. The programmer connects to a host
computer using a standard Parallel LPT port. All the programming “intelligence” is built into

Department of ECE, VBIT Page No: 59


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

the programmer so you do not need any special hardware to run it. Programmer comes with
window based software for easy programming of the devices.

Software

Computer side software called ‘Uploader ver3.1 is executed that accepts the Intel
HEX format file generated from compiler to be sent to target microcontroller. It detects the
hardware connected to the Parallel port.

Software settings

1.Open the Software as Shown Above


2.Select LPT Port - As per your Computer
3.Connect the programmer to computer using Parallel Port cable
4.Switch the power ON ,
5.Indication : During Write command GREEN led Will go ON&OFF VPP raising

Fig 4.7: Flash Programmer

4.3 SOFTWARE CODE

Department of ECE, VBIT Page No: 60


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

# Include <reg52.h>
#include<intrins.h>
#include<string.h>
# include "lcd.h"
# define no_of_cards 4
# define rx_buf_size 12
# define rfid_code_size 15

Sbit mf=p1^1;
Sbit mb=p1^2;
Sbit buzzer=p3^7;
Sbit ab=p1^0;
Unsigned char accesscards[no_of_cards][12]=
{ "050002a09037","440022454a69","4c006f333121","18008e0a1985" };

Unsigned char cardnumber[];


Unsigned char rxbuf[rx_buf_size];
Unsigned char rxcount = 0;
Void test();
Void displayversion();
Void serialinit(void);
Void readcard(void);
Unsigned char checkcard();
Char getval(void);
Unsigned char uccardid = 0;
Int car=1000,bus=1200,lorry=1400,goods=1600;

Void transaction(unsigned char uccardid);


Void transmit(unsigned char *);
unsigned int uichargeamount;
Void serial() interrupt 4

{
if(ri)
{
rxbuf[rxcount] = sbuf;
rxcount++;
if(rxcount >= rx_buf_size+cr_lf_size)
{
rxcount = 0;
}
ri = 0;
}

Department of ECE, VBIT Page No: 61


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

}
unsigned char status;
Void main(void)
{
char i = 0;
ab=0;
serialinit();
init_lcd();
cmd_lcd(0x01);
mf=mb=buzzer=1;
display_lcd("rfid&gsm based");
cmd_lcd(0xc0);
display_lcd("toll gate sys");
delay_ms(1000);

ab=1;
while(1)
{
ab=1;
for(i = 0; i < rx_buf_size; i++)
rxbuf[i] = 0x00;
rxcount = 0;
readcard();
uccardid = checkcard();
init_lcd();
display_lcd("rfid&gsm based");
cmd_lcd(0xc0);
display_lcd("toll gate sys");

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


write_lcd(cardnumber[i]);
delay_ms(500);

init_lcd();
if(uccardid==99)
{
display_lcd("invalid card.... ");
cmd_lcd(0xc0);
display_lcd("try again..... ");
delay_ms(1000);
continue;
}

test();
}

Department of ECE, VBIT Page No: 62


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

}
Char rxuart()
{
If(ri==1)
{
}
Ri=0;
Return sbuf;
}
Void test()
{
Char l=0;
if(uccardid==0)
{
ab=0;
init_lcd();
display_lcd("rno:ts1 name:***");
cmd_lcd(0xc0);
display_lcd("type:car-petrol");

Delay_ms(2000);
cmd_lcd(0x01);
display_lcd("message sending");
delay_ms(1000);
transmit("at+cmgs=");
delay_ms(500);
sbuf='"';
transmit("8466049370");
sbuf='"';
sbuf=oxod;
transmit("for toll collection ");
delay_ms(50);
transmit("rno:ts1 name:***");
delay_ms(50);
transmit("type:car-petrol");
delay_ms(50);
sbuf=0x1a;

cmd_lcd(0x01);
display_lcd("message sent");
delay_ms(2000);
ea=0;
while(rxuart()!='$');

l=rxuart();

Department of ECE, VBIT Page No: 63


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

if(l=='y')
{
if(car>=50)
{
car=car-50;
cmd_lcd(0x01);
display_lcd("toll amount:50");
cmd_lcd(0xc0);
display_lcd("ur balance:");
integer_lcd(car);
cmd_lcd(0x01);
display_lcd("door open");
mf=1;
mb=0;
delay_ms(200);
mf=1;
mb=1;
delay_ms(2000);
mf=0;
mb=1;
delay_ms(200);
mf=1;
mb=1;
delay_ms(200);
}
else
{ cmd_lcd(0x01);
display_lcd("no balance");
}
}
if(l=='n')
{

buzzer=0;
cmd_lcd(0x01);
display_lcd("be alert");
delay_ms(200);
cmd_lcd(0x01);
display_lcd("message sending");
delay_ms(1000);
transmit("at+cmgs=");
delay_ms(500);
sbuf='"';
transmit("8466049370");
sbuf='"';

Department of ECE, VBIT Page No: 64


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

sbuf=oxod;
transmit("unknown person using\r\n ");
delay_ms(50);
delay_ms(50);
sbuf=0x1a;

cmd_lcd(0x01);
display_lcd("message sent");
delay_ms(3000);
buzzer=1;
}
ab=1;

}
if(uccardid==1)
{
ab=0;
init_lcd();
display_lcd("rno:ap2 name:***");
cmd_lcd(0xc0);
display_lcd("type:bus-diesel");

Delay_ms(2000);
cmd_lcd(0x01);
display_lcd("message sending");
delay_ms(1000);
transmit("at+cmgs=");
delay_ms(500);
sbuf='"';
transmit("8466049370");
sbuf='"';
sbuf=oxod;
transmit("for toll collection ");
delay_ms(50);
transmit("rno:ap2 name:***");
delay_ms(50);
transmit("type:bus-diesel");
delay_ms(50);
sbuf=0x1a;

cmd_lcd(0x01);
display_lcd("message sent");
delay_ms(2000);
while(rxuart()!='$');
l=rxuart();

Department of ECE, VBIT Page No: 65


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

if(l=='y')
{
if(bus>=60)
{
bus=bus-60;
cmd_lcd(0x01);
display_lcd("toll amount:60");
cmd_lcd(0xc0);
display_lcd("ur balance:");
integer_lcd(bus);
cmd_lcd(0x01);
display_lcd("door open");
mf=1;
mb=0;
delay_ms(200);
mf=1;
mb=1;
delay_ms(2000);
mf=0;
mb=1;
delay_ms(200);
mf=1;
mb=1;
delay_ms(200);
}
else
{ cmd_lcd(0x01);
display_lcd("no balance");
}
}
if(l=='n')
{
buzzer=0;
cmd_lcd(0x01);
display_lcd("be alert");
delay_ms(200);
cmd_lcd(0x01);
display_lcd("message sending");
delay_ms(1000);
transmit("at+cmgs=");
delay_ms(500);
sbuf='"';
transmit("8466049370");
sbuf='"';
sbuf=oxod;

Department of ECE, VBIT Page No: 66


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

transmit("unknown person using\r\n ");


delay_ms(50);
delay_ms(50);
sbuf=0x1a;
cmd_lcd(0x01);
display_lcd("message sent");
delay_ms(3000);
buzzer=1;
}
ab=1;
}
if(uccardid==2)
{
ab=0;
init_lcd();
display_lcd("rno:ka3 name:***");
cmd_lcd(0xc0);
display_lcd("type:lorry-cng");
Delay_ms(2000);
cmd_lcd(0x01);
display_lcd("message sending");
delay_ms(1000);
transmit("at+cmgs=");
delay_ms(500);
sbuf='"';
transmit("8466049370");
sbuf='"';
sbuf=oxod;
transmit("for toll collection ");
delay_ms(50);
transmit("rno:ka2 name:***");
delay_ms(50);

transmit("type:lorry-cng");
delay_ms(50);
sbuf=0x1a;

cmd_lcd(0x01);
display_lcd("message sent");
delay_ms(2000);
ea=0;
while(rxuart()!='$');
l=rxuart();
if(l=='y')
{

Department of ECE, VBIT Page No: 67


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

if(lorry>=70)
{
lorry=lorry-70;
cmd_lcd(0x01);
display_lcd("toll amount:70");
cmd_lcd(0xc0);
display_lcd("ur balance:");
integer_lcd(lorry);

cmd_lcd(0x01);
display_lcd("door open");
mf=1;
mb=0;
delay_ms(200);
mf=1;
mb=1;
delay_ms(2000);
mf=0;
mb=1;
delay_ms(200);
mf=1;
mb=1;

delay_ms(200);
}
else
{ cmd_lcd(0x01);
display_lcd("no balance");
}
}
if(l=='n')
{
buzzer=0;
cmd_lcd(0x01);
display_lcd("be alert");
delay_ms(200);
cmd_lcd(0x01);
display_lcd("message sending");
delay_ms(1000);
transmit("at+cmgs=");
delay_ms(500);
sbuf='"';
transmit("8466049370");
sbuf='"';
sbuf=oxod;

Department of ECE, VBIT Page No: 68


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

transmit("unknown person using\r\n ");


delay_ms(50);
delay_ms(50);
sbuf=0x1a;

cmd_lcd(0x01);
display_lcd("message sent");
delay_ms(3000);
buzzer=1;
}
ab=1;
}
if(uccardid==3)
{
ab=0;
init_lcd();
display_lcd("rno:tn4 name:***");
cmd_lcd(0xc0);
display_lcd("type:goods-diesel");
Delay_ms(2000);
cmd_lcd(0x01);
display_lcd("message sending");
delay_ms(1000);
transmit("at+cmgs=");
delay_ms(500);
sbuf='"';
transmit("8466049370");
sbuf='"';
sbuf=oxod;
transmit("for toll collection ");
delay_ms(50);
transmit("rno:tn4 name:***");
delay_ms(50);
transmit("type:goods-diesel");
delay_ms(50);
sbuf=0x1a;

cmd_lcd(0x01);
display_lcd("message sent");
delay_ms(2000);
ea=0;
while(rxuart()!='$');
l=rxuart();
if(l=='y')
{

Department of ECE, VBIT Page No: 69


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

if(goods>=80)
{
goods=goods-80;
cmd_lcd(0x01);
display_lcd("toll amount:80");
cmd_lcd(0xc0);
display_lcd("ur balance:");
integer_lcd(goods);

cmd_lcd(0x01);
display_lcd("door open");
mf=1;
mb=0;
delay_ms(200);
mf=1;
mb=1;
delay_ms(2000);
mf=0;
mb=1;
delay_ms(200);
mf=1;
mb=1;
delay_ms(200);
}
else
{ cmd_lcd(0x01);
display_lcd("no balance");
}
}
if(l=='n')
{
buzzer=0;
cmd_lcd(0x01);
display_lcd("be alert");

delay_ms(200);
cmd_lcd(0x01);
display_lcd("message sending");
delay_ms(1000);
transmit("at+cmgs=");
delay_ms(500);
sbuf='"';
transmit("8466049370");
sbuf='"';

Department of ECE, VBIT Page No: 70


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

sbuf=oxod;
transmit("unknown person using\r\n ");

delay_ms(50);
delay_ms(50);
sbuf=0x1a;
cmd_lcd(0x01);
display_lcd("message sent");
delay_ms(3000);
buzzer=1;
}
ab=1;

}
delay_ms(100);
}

Void serialinit(void)
{

tmod = 0x20;
th1 = 0xfd;
scon = 0x50;
tr1 = 1;

Void displayversion()
{
init_lcd();
display_lcd("rfid&gsm based");
cmd_lcd(0xc0);
display_lcd("toll gate sys");
delay_ms(100);
}

Void readcard(void)
{
unsigned char i,j=0;
do
{
}while(rxcount == 0);
delay_ms(20);

Department of ECE, VBIT Page No: 71


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

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


{
cardnumber[i] = rxbuf[i];
}

Unsigned char checkcard()


{
unsigned char i = 0;
unsigned char j = 0;

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


{

for(j = 1; j <rfid_code_size ; j++)


{
if(cardnumber[j] != accesscards[i][j])
break;
if(j == rfid_code_size-1)
return i;
}
}
return 99;
}

void transmit(unsigned char *t_data)


{

While(*t_data!='\0')
{
Sbuf = *t_data;
While(!ti);
ti=0;
T_data++;
}

Department of ECE, VBIT Page No: 72


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

CHAPTER 5: BENEFITS AND CONCLUSION

5.1 WORKING

The Electronic Toll Lanes Are Set Up With The Special Antennas That
Continuously Send Out Signals. These Signals Are Used To Automatically Identify The
Vehicles That Travel By Them. To Use The Electronic Toll Facility, The Driver Needs To
Set Up An Account And Get An Electronic Transponder Fixed In The Vehicle. These
Transponders Commonly Known As The Tags Are Usually Fitted On The Windshields Of
The Vehicles. The Tag Has All The Information Regarding The Patron’s Account. The
Antenna Continuously Sends Out A Radiofrequency (Microwave) Pulse, Which Returns
Only When It Hits A Transponder. These Pulses Are Returned Back From The Transponder
And Are Received By The Antenna. These Microwaves Reflected From The Tags Contain
Information About The Transponder’s Number, Patron’s Account, Balance, Etc. Other
Information Such As Date, Time, And Vehicle Count Could Be Recorded Depending Upon
The Requirement Of The Data Needed By The Toll Agencies. After Encrypting The
Contents Of This Microwave, The Unit Then Uses Fiber-Optic Cables, Cellular Modems Or
Wireless Transmitters To Send It Off To A Central Location, Where Computers Use The
Unique Identification Number To Identify The Account From Which The Cost Of The Toll
Should Be Deducted. ETC System Uses Diverse Technologies For Its Working.

The Working Of The Electronic Toll Collection System With Its Components. These
Components May Vary Depending Upon The Technology Used. As The Vehicle Enters The
Toll Lane, Sensors (1) Detect The Vehicle. The Two-Antenna Configuration (2) Reads A
Transponder (3) Mounted On The Vehicle's Windshield. As The Vehicle Passes

Through The Exit Light Curtain (4), It Is Electronically Classified By The Treadle (5)
Based On The Number Of Axles, And The ETC Account Is Charged The Proper Amount.
Feedback Is Provided To The Driver On An Electronic Sign (6). If The Vehicle Does Not
Have A Transponder, The System Classifies It As A Violator And Cameras (7) Take Photos
Of The Vehicle And Its License Plate For Processing. The Components Of ETC Are
Discussed In The Next Section.

Department of ECE, VBIT Page No: 73


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

Fig 5.1: ETC SYSTEM

5.2 COMPONENTS OF ELECTRONIC TOLL COLLECTION

ETC Systems Deploy Various Communications And Electronic Technologies To


Support The Automated Collection Of Payment At Tollbooths. Collectively, The
Application Of These Technologies Increase System Throughput, Improve Customer
Service, Enhance Safety, And Reduce Environmental Impacts. The Components Of The
ETC Technology Are As Follows:

a. Automatic Vehicle Identification -- The Automatic Vehicle Identification (AVI)


Component Of An ETC System Refers To The Technologies That Determine The
Identification Or Ownership Of The Vehicle So That The Toll Will Be Charged To
The Corresponding Customer.
b. Automatic Vehicle Classification -- Vehicle Type And Class May Have Differentiated
Toll Amount. The Vehicle Type May Include Light Vehicles Like The Passenger Car
Or Heavy Vehicles Like Recreational Vehicles. A Vehicle’s Class Can Be Determined
By The Physical Attributes Of The Vehicle, The Number Of Occupants In The
Vehicle, The Number Of Axles In The Vehicles And The Purpose For Which The
Vehicle Is Being Used At The Time Of Classification (Or Some Combination Of
These Determinants

Department of ECE, VBIT Page No: 74


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

c. Video Enforcement Systems -- When Used For ETC, The Video Enforcement System
(VES) Captures Images Of The License Plates Of Vehicles That Pass Through An
ETC Tollbooth Without A Valid ETC Tag.

Although The Deployment Of These Technologies Makes The Initial Cost Of Installation
Very High, But There Exits Huge Benefits Accompanied With Such High Investment. These
Benefits Are Discussed In The Next Section.

5.3 BENEFITS OF ELECTRONIC TOLL COLLECTION

The Benefits Of The ETC Include:

1. Congestion Reduction -- The Toll Transaction Rate Is Highly Increased Due To The
Use Of ETC Systems. Since The Vehicles Do Not Stop At The Toll Facility, The
Throughput Is Highly Increased. This Has Considerable Effect On The Congestion Of
The Toll Plaza. As The Proportion Of The ETC Users Increases The Congestion In The
Manual As Well As The Automatic Lanes Is Also Reduced. The Average Number Of
Vehicles Waiting In The Queue Reduces And So The Average Waiting Time Is Reduced.

2. Increased Capacity -- It Is Observed That The Capacity Of The Electronic Lane


Increases By Three Fold. The Toll Plaza Would Be Able To Accommodate The
Increasing Traffic Without Requiring Building Additional Lanes.

3. Fuel Saving -- The Deceleration, Acceleration And Idling Is Completely Eliminated.


This Results In Gas Saving For The Patrons Using ETC. Besides The Elimination Of
Acceleration And Deceleration Results In Reduction Of The Operating Cost Of The
Vehicles.

4. Operating Cost Saving -- Over A Period Of Time, The Toll Collecting Cost Is Reduced.
There Is Reduction In The Man-Hour Required As The System Does Not Require Any
Human Interaction For The Toll Transaction.

5. Time Saving -- ETC Users Do Not Stop For Paying Toll, Thus There Is Considerable
Saving In The Travel Time. Besides The Travel Time Reliability Is Increased As The
Travel Time Can Be Estimated Fairly Accurately.

Department of ECE, VBIT Page No: 75


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

6. Emission Control -- Due To The Elimination Of The Acceleration And Idling, Vehicular
Emissions Are Reduced. Though This Benefit Only Effect The Surrounding Area It Is
Seen That There Is An Increase In The Highway Financing By Building Toll Plazas.

7. Enhanced Cash Handing -- There Is No Cash Transaction For The ETC Lane So Cash
Handling Is Reduced So Difficulties With Cash Handling Is Eliminated. Thus Aid In
Enhanced Audit Control By Centralizing User Accounts.

8. Payment Flexibility -- The Patrons Do Not Have To Worry About Searching For Cash
For The Toll Payment. Since The Patrons Set Up Account For ETC Usage It Gives
Customers The Flexibility Of Paying Their Toll Bill With Cash, Check, Or Even Credit
Cards.

9. Enhanced Data Collection -- Information Such As Vehicle Count Over The Time Of
The Day, Date, Time Etc Can Be Obtained Due To The Deployment Of This Technology.
This Helps In Making Decisions Regarding The Pricing Strategies For The Toll
Providers. It Also Helps Planner To Estimate The Travel Time That Aid In Designing
Decisions.

10. Incident Reduction --It Is Observed That There Is Reduction In The Number Of
Incidents Caused Near The Toll Plazas (Gillen, 1999).

With All These Benefits, It Is Evident That There Exists A Lot Of Opportunity Of Research
In Studying The Impacts Of These Benefits Over The ETC Lanes. This Research Will
Address All The Quantifiable Components Of The Benefits On The Integrated Basis.

5.4 DISADVANTAGES OF ETC

1. Every Person Should Hold Or Take That Card And It Is Mandatory For Every Vehicle

Department of ECE, VBIT Page No: 76


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

2. The Implementation Of This System Costs High But It Is More Secure

3. The Implementation Should Take All Over India And Every Vehicle Must Attached
This Tag By Doing This Two Functions This System Is Useful For A Good Way And
It Is A Simple Way To Pay Toll And Security

5.5 APPLICATIONS OF RFID

Asset Tracking:
Static Or In-Motion Assets Tracking Or Locating, Like A Healthcare Facility,
Wheelchairs Or Iv Pumps In, Laptops In A Corporation And Servers In A Data Center, Was
Not So Easy Task.

People Tracking:
People Tracking System Are Used Just As Asset Tracking System. Hospitals And Jails
Are Most General Tracking Required Places.

Document Tracking:
This Is Most Common Problem. Availability Of Large Amount Of Data And Documents
Brings Lots Of Problem In Document Management System. An Rfid Document-Tracking
System Saves Time And Money By Substantially Reducing:

Government Library:
Many Government Libraries Use Barcode And Electromagnetic Strips To Track
Various Assets. Rfid Technology Uses For Reading These Barcodes Unlike The Self-Barcode
Reader Rfid Powered Barcode Reader Can Read Multiple Items Simultaneously.

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.

Department of ECE, VBIT Page No: 77


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

Material Management:
In Construction And Other Related Industries, Materials Are Often The Largest Project
Expenditure. On Large Job Sites, Simply Finding Materials Can Be Problematic. RFID
Solutions Like Jovix Take The Guess Work Out Of The Equation

5.6 RESULT

In the developing countries we have seen a lot of crime happening at the bridges and
highways. Specially, during evening and midnight many occurrence like- hijacks ,thefts,
murders etc. are commonly taking place. To avoid those problems we have built an advanced
security system By implementing this system in the highways and bridges, primary steps can
be taken to resist a criminal or any sort of crime. As the data of each vehicle owner should
be recorded in the database previously, so when any information of that vehicle owner is
needed by the authority or police, it can be easily found from the database to ease the
process

The basic model of the system has been developed by using RFID system and GSM
module Whenever a vehicle will enter the toll collection booth area, the reader will
immediately scan the tag identify the type of that vehicle and deduct the toll amount from
the vehicle owner's prepaid based account. And the message will be sent to vehicle owner
and by seeing that message he has reply to system as ($S) and the gate will be opened

I if any other person driving the vehicle means vehicle will be thefted and the vehicle
passing through the toll booth the message will be received by owner and he reply as ($N)
to the system. the system will alert and horn the alarm and again system sends a message as
UNKNOWN PERSON USING By using this method we can give a 100% security to the
vehicle and the controlling of the system is in owners hand

5.7 FUTURE SCOPE

Designed a system to give complete solution for traffic and transport related
problems such as Toll gate Traffic signal control, traffic rules violation control, parking
Management and special zone alert using the latest RFID technology. It is proposed as a low

Department of ECE, VBIT Page No: 78


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

cost optimized solution using RFID and GSM mobile technology. At the toll plaza, there will
be a large LCD screen for displaying details of the transaction.
At the same time, it will show:
1. 1.Total cost of that road
2. The duration of toll plaza.
3. And the remaining balances after each transaction
4. Embedded System can design for easy to Pay Toll Fees Using RFID and Alcohol sensor
Prevent Accidents on the Highways.
5. Implementation of image processing for centralizes data recording: In our present
concept we are only using the RFID system for vehicle detection. So we can extend
the scope of this concept in other way for centralize data recording. For that purpose we
can use the IR courting at the entry gate which is followed by the Camera which will be
continue sly capturing the images of the vehicles entering into the toll plaza. And the
third step the RFID is collecting the vehicle number. Now when the vehicle passes
through the IR courting it tresses the outline of the vehicle, in the next step the camera
will take the image of the vehicle & followed by the RFID to record the data related
to the vehicle. The load cell weighs the vehicle & classifies it into two categories as
light & heavy vehicle respectively. The whole data collected together & sent to the
centralize server which will store it for stipulated time. This application will help in
detecting the vehicles in the crime cases like terrorism & smuggling of goods & it will
also reduce the load on check posts.
6. Automatic control using RFID system for toll collection powered by compound power
generation from speed breakers and solar cells with GSM technology: a compound
electricity generation system using speed breakers and solar cells to power the whole
automated system and it does not consume electricity from the power utility companies
hence there is no transmission & distribution losses.

REFERENCES

Web Site

Department of ECE, VBIT Page No: 79


AN ADVANCED SECURITY SYSTEM WITH RFID BASED ETC

 www.atmel.com ………………. Microcontroller


 www.google.com
 www.semiconductors.philips.com
 http://www.ripublication.com/irph/ijict_spl/09_ijict v3n8spl.pdf

Journals

 Khadijah Kamarulazizi, Dr.Widad Ismail, “Electronic toll collection system using


passive RFID technology”
 Automatic Toll Gate System Using AdvancedRFID and GSM Technology, S.Nandhini,
P.Premkumar
 Jerry.L and Barbara.C Smart Card Based Toll Gate Automated System
 AUTOMATIC TOLL COLLECTION SYSTEM USING RFID, Aniruddha Kumawat1,
Kshitija Chandramore
 Unified electronic toll collection technology for national highways in India, The
Ministry of Road Transport & Highway Vide Order

Department of ECE, VBIT Page No: 80

S-ar putea să vă placă și