Top Banner
RFID BASED SECURITY SYSTEM 1 PROJECT ON RFID based Security System N.M.A.M.I.T,Nitte
45
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Rfid Final Report

RFID BASED SECURITY SYSTEM 1

PROJECT ON

RFID based Security System

N.M.A.M.I.T,Nitte

Page 2: Rfid Final Report

RFID BASED SECURITY SYSTEM 2

ACKNOWLEDGEMENT

We are extremely indebted and grateful to our project guide

Mrs.Nayana.P.Shetty, Assistant Professor, department of Electrical and Electronics,

N.M.A.M.I.T, Nitte for her unwavering support, excellent guidance and invaluable help

rendered during the entire duration of the project.

We express our gratitude to Professor K.Vasudeva Shettigar, Head of

Department, Electrical and Electronics for allowing us to use the required facilities.

We also take this opportunity to thank Mr. Pradeep Kumar, Senior lecturer,

Department of Electrical and Electronics for his timely guidance and constant support.

Finally, we thank the teaching and non-teaching staff of our department, our

friends and well-wishers and all those who have directly or indirectly helped us during

the duration of the project.

Project Associates

N.M.A.M.I.T,Nitte

Page 3: Rfid Final Report

RFID BASED SECURITY SYSTEM 3

CONTENTS

N.M.A.M.I.T,Nitte

Page 4: Rfid Final Report

RFID BASED SECURITY SYSTEM 4

ABSTRACT

Industries, offices and many business enterprises have certain sensitive areas

which require more security than others, where the entry should be restricted to a few

authorized persons only.

There are many advantages of a RFID based security system that merits the

expense of it. The technology can be used to secure access to various parts of a

building. There will be a record of individuals that have accessed these areas. This way

if there any concerns or security has been breached, we would know which individuals

to question.

We have made use of AT8051/52 microcontroller to interface and control the

different components of our project which are the RFID reader, GSM module, LCD

display and a dc motor. The system also consists of a door, whose opening and closing

is controlled by the dc motor.

Our project is concerned not only with limiting access to authorized personnel

but also detects and alert about attempts at unauthorized intrusions. When a card is

detected by the RFID reader it sends a signal to the microcontroller and if the card is

valid, microcontroller opens the door. The GSM module SIM 300 then sends a message

with card no and time of entry to a pre-designated mobile number. If however an attempt

to forcefully open the door is made, or if there is a malfunction in the door, the GSM

module instantly sends an alert message to the mobile number.

N.M.A.M.I.T,Nitte

Page 5: Rfid Final Report

RFID BASED SECURITY SYSTEM 5

Chapter 1

ATMEL 89S52

INTRODUCTION TO 8052 MICROCONTROLLER:

Fig 1.1 8052 Pin diagram

Description

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

bytes of Flash programmable and erasable read only memory (PEROM). The device is

manufactured using Atmel’s high-density non-volatile memory technology and is

compatible with the industry-standard 80C51 and 80C52 instruction set and pin out. The

on-chip Flash allows the program memory to be reprogrammed in-system or by a

conventional non-volatile memory programmer. By combining a versatile 8-bit CPU with

Flash on a monolithic chip, the Atmel AT89S52 is a powerful microcomputer which

provides a highly-flexible and cost-effective solution to many embedded control

applications.

N.M.A.M.I.T,Nitte

Page 6: Rfid Final Report

RFID BASED SECURITY SYSTEM 6

Features of 8052:

• Compatible with MCS-51™ Products

• 8K Bytes of In-System Reprogrammable Flash Memory

• Endurance: 1,000 Write/Erase Cycles

• Fully Static Operation: 0 Hz to 24 MHz

• Three-level Program Memory Lock

• 256 x 8-bit Internal RAM

• 32 Programmable I/O Lines

• Three 16-bit Timer/Counters

• Eight Interrupt Sources

• Programmable Serial Channel

• Low-power Idle and Power-down Modes

PIN DESCRIPTION:

VCC

Supply voltage.

GND

Ground.

Port 0

Port 0 is an 8-bit open drain bi-directional I/O port. As an output port, each pin can sink

eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as high

impedance inputs.

Port 0 can also be configured to be the multiplexed low order address/data bus during

accesses to external program and data memory. In this mode, P0 has internal pull-ups.

Port 0 also receives the code bytes during Flash programming and outputs the code

bytes during program verification. External pull-ups are required during program

verification.

Port 1

Port 1 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 1 output buffers

can sink/source four TTL inputs. When 1s are written to Port 1 pins, they are pulled high

by the internal pull-ups and can be used as inputs. As inputs, Port 1 pins that are

N.M.A.M.I.T,Nitte

Page 7: Rfid Final Report

RFID BASED SECURITY SYSTEM 7

externally being pulled low will source current (IIL) because of the internal pull-ups. In

addition, P1.0 and P1.1 can be configured to be the timer/counter 2 external count input

(P1.0/T2) and the timer/counter 2 trigger input (P1.1/T2EX), respectively, as shown in

the following table. Port 1 also receives the low-order address bytes during Flash

programming and verification.

Port 2

Port 2 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 2 output buffers

can sink/source four TTL inputs. When 1s are written to Port 2 pins, they are pulled high

by the internal pull-ups and can be used as inputs. As inputs, Port 2 pins that are

externally being pulled low will source current (IIL) because of the internal pull-ups. Port

2 emits the high-order address byte during fetches from external program memory and

during accesses to external data memory that uses 16-bit addresses (MOVX @ DPTR).

In this application, Port 2 uses strong internal pull-ups when emitting 1s. During

accesses to external data memory that uses 8-bit addresses (MOVX @ RI), Port 2 emits

the contents of the P2 Special Function Register. Port 2 also receives the high-order

address bits and some control signals during Flash programming and verification.

Port 3

Port 3 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 3 output buffers

can sink/source four TTL inputs. When 1s are written to Port 3 pins, they are pulled

high by the internal pull-ups and can be used as inputs. As inputs, Port 3 pins that are

externally being pulled low will source current (IIL) because of the pull-ups. Port 3 also

serves the functions of various special features of the AT89S51, as shown in the

following table. Port 3 also receives some control signals for Flash programming and

verification.

N.M.A.M.I.T,Nitte

Page 8: Rfid Final Report

RFID BASED SECURITY SYSTEM 8

Table 1.1

Port Pins Alternate Function

P 3.0 RXD(serial input port)

P 3.1 TXD(serial output port)

P 3.2 INT0 (external interrupt 0)

P 3.3 INT1(external interrupt 1)

P 3.4 T0(Timer 0 external input)

P 3.5 T1(Timer 1external input)

P 3.6 WR (external data memory write strobe)

P 3.7 RD (external data memory read strobe)

RST

Reset input. A high on this pin for two machine cycles while the oscillator is running

resets the device.

ALE/PROG

Address Latch Enable is an output pulse for latching the low byte of the address during

accesses to external memory. This pin is also the program pulse input (PROG) during

Flash programming. In normal operation, ALE is emitted at a constant rate of 1/6 the

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

AT89C52 is executing code from external program memory, PSEN is activated twice

N.M.A.M.I.T,Nitte

Page 9: Rfid Final Report

RFID BASED SECURITY SYSTEM 9

each machine cycle, except that two PSEN activations are skipped during each access

to external data memory.

EA/VPP

External Access Enable. EA must be strapped to GND in order to enable the device to

fetch code from external program memory locations starting at 0000H up to FFFFH.

Note, however, that if lock bit 1 is programmed, EA will be internally latched on reset EA

should be strapped to VCC for internal program executions. This pin also receives the

12-volt programming enable voltage (VPP) during Flash programming when 12-volt

programming is selected.

XTAL1

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

XTAL2

Output from the inverting oscillator amplifier.

Interrupts

The AT89C52 has a total of six interrupt vectors: two external interrupts (INT0 and

INT1), three timer interrupts (Timers 0, 1, and 2), and the serial port interrupt. Each of

these interrupt sources can be individually enabled or disabled by setting or clearing a

bit in Special Function Register IE. IE also contains a global disable bit, EA, which

disables all interrupts at once. In the AT89C51, bit position IE.6 and IE.5 are

unimplemented. User software should not write 1s to these bit positions, since they may

be used in future AT89 products. Timer 2 interrupt is generated by the logical OR of bits

TF2 and EXF2 in register T2CON. Neither of these flags is cleared by hardware when

the service routine is vectored to. In fact, the service routine may have to determine

whether it was TF2 or EXF2 that generated the interrupt, and that bit will have to be

cleared in software. The Timer 0 and Timer 1 flags, TF0 and TF1, are set at S5P2 of

the cycle in which the timers overflow. The values are then polled by the circuitry in the

N.M.A.M.I.T,Nitte

Page 10: Rfid Final Report

RFID BASED SECURITY SYSTEM 10

next cycle. However, the Timer 2 flag, TF2, is set at S2P2 and is polled in the same

cycle in which the timer overflows.

Table 1.2

(MSB) (LSB)

EA - ET2 ES ET1 EX1 ET0 EX0

Enable Bit = 1 enables the interrupt.

Enable Bit = 0 disables the interrupt.

BLOCK DIAGRAM

The AT89C52 provides the following standard features: 8K bytes of Flash, 256 bytes of

RAM, 32 I/O lines, three 16-bit timer/counters, a six-vector two-level interrupt

architecture, a full-duplex serial port, on-chip oscillator, and clock circuitry. In addition,

the AT89C52 is designed with static logic for operation down to zero frequency and

supports two software selectable power saving modes. The Idle Mode stops the CPU

while allowing the RAM, timer/counters, serial port, and interrupt system to continue

functioning. The Power-down mode saves the RAM contents but freezes the oscillator,

disabling all other chip functions until the next hardware reset.

N.M.A.M.I.T,Nitte

Page 11: Rfid Final Report

RFID BASED SECURITY SYSTEM 11

Fig 1.2: Block Diagram of 89S52 microcontroller

N.M.A.M.I.T,Nitte

Page 12: Rfid Final Report

RFID BASED SECURITY SYSTEM 12

Chapter: 2

RFID

2.1 INTRODUCTION TO RFID

RFID stands for Radio Frequency Identification. RFID is one member in the family of

Automatic Identification and Data Capture (AIDC) technologies and is a fast and reliable

means of identifying objects. There are two main components: The Interrogator (RFID

Reader) which transmits and receives the signal and the Transponder (tag) that is

attached to the object. An RFID tag is composed of a miniscule microchip and antenna.

RFID tags can be passive or active and come in a wide variety of sizes, shapes, and

forms. Communication between the RFID Reader and tags occurs wirelessly and

generally does not require a line of sight between the devices. An RFID Reader can

read through most anything with the exception of conductive materials like water and

metal, but with modifications and positioning, even these can be overcome. The RFID

Reader emits a low-power radio wave field which is used to power up the tag so as to

pass on any information that is contained on the chip. In addition, readers can be fitted

with an additional interface that converts the radio waves returned from the tag into a

form that can then be passed on to another system, like a computer or any

programmable logic controller. Passive tags are generally smaller, lighter and less

expensive than those that are active and can be applied to objects in harsh

environments, are maintenance free and will last for years. These transponders are only

activated when within the response range of an RFID Reader. Active tags differ in that

they incorporate their own power source, whereas the tag is a transmitter rather than a

reflector of radio frequency signals which enables a broader range of functionality like

programmable and read/write capabilities.

N.M.A.M.I.T,Nitte

Page 13: Rfid Final Report

RFID BASED SECURITY SYSTEM 13

Figure2.1 A Typical RFID System

2.2 RFID APPLICATION:

RFID is used for many applications such as: Automated electronic toll stations which

can identify vehicles passing through without having to stop and then debits their

account. Identify and monitor railcars and containers. RFID tags help farmers track their

farm animals, and is used in wildlife conservation. Also helps to identify our animal

companions if they should ever become lost. Customers can pay for their fuel at the

pump with just a wave of their key tag. An increase in demand has been seen for

security applications such as homeland security, employee identification, gaining

entrance and controlling access of vehicles to buildings, gated communities, corporate

campuses and airports. Some other current uses for RFID include waste management,

automating parking and managing traffic, the dispensing of all types of products,

providing ski lift access, the tracking of library books and more. Major growth in the

future of RFID will come from real-time location systems (RTLS), asset management,

baggage handling and cash less payment systems. Business segments such as retail,

logistics, warehousing and manufacturing will greatly benefit from an increase in supply

chain visibility that RFID can create.

N.M.A.M.I.T,Nitte

Page 14: Rfid Final Report

RFID BASED SECURITY SYSTEM 14

2.3 RFID FREQUENCIES

Radio waves are the carriers of data between the reader and tags. The approach

generally adopted for RFID communication is to allocate frequencies depending on

application. The frequencies used cover a wide spectrum.

These specified bands are

Very long wave 9 - 135 kHz

Short wave 13.56 MHz

UHF 400-1200 MHz

Microwave 2.45 and 5.8 GHz

The allocation of frequencies is regulated by government agencies, requiring care in

considering RFID applications in different countries. Efforts at standardization should

avert these problems. The many varied applications will work their best at different

frequencies; therefore, it is important to understand the requirements before selecting a

particular type of RFID system. The most common uses of low frequency systems are in

security access, asset tracking and animal identification. They generally have short

reading ranges and lower system costs. High-frequency systems are used for such

applications as railroad car tracking and automated toll collection. They offer long

reading ranges and high reading speeds. This higher performance usually entails higher

costs. The power level of the interrogator and the power available within the tag to

respond will determine the reading range that can be achieved in an RFID system. Like

the restrictions on carrier frequencies there are legislative constraints on power levels.

Environmental conditions, particularly at the higher frequencies, can also influence the

range of communication.

2.4 RFID HARDWARE

This RFID Reader is having 3 stages

a) RFID Reader Chip.

b) Pic Microcontroller to decode the data into Serial o/p.

c) Rs232 to convert signal into TTL (Transistor-Transistor Logic) to RS232.

N.M.A.M.I.T,Nitte

Page 15: Rfid Final Report

RFID BASED SECURITY SYSTEM 15

Figure 1.2 Block Diagram of RFID Reader NSK 125 kHz

2.5 DATA Transmission in ASCII Standard

Data read from the tag is Manchester encoded. The Manchester encoded data is

decoded to ASCII (American Standard Code for Information Interchange) standard.

Decoded data is sent to the UART serial interface for wired communication with the host

systems. ASCII data format is shown below:

N.M.A.M.I.T,Nitte

Page 16: Rfid Final Report

RFID BASED SECURITY SYSTEM 16

For Example, If The card Shown Above is placed on the Reader,

UART Data Will be 159 48659

Parity |---8BIT--|-------16BIT---------------|Parity

Wigend O/p Will be 1 1001 1111 1011 1110 0001 0011 0

2.6 Data Transmission in Wiegand26 Standard

The reader module supports the Wiegand standard that gives the Wiegand encoded

output. This output comprises 3 bytes of data. It will be indicated as low pulse on data

line if it is a Data 1 signal and low pulse on the zero line if it is a Data 0 signal.

Figure 2 shows the pattern of data bits sent by the reader. This timing pattern falls within

the Wiegand guidelines as prescribed by the SIA’s Access Control Standard Protocol for

the 26-bit Wiegand Reader Interface (a Pulse Width time between 20 μS and 100 μS,

and a Pulse Interval time between 200 μS and 20 mS).

The Data 1 and Data 0 signals are held at logic high level (above the Voh level) until

the reader is ready to send a data stream. The reader places the data as asynchronous

low-going (negative) pulses (below the Vol level) on the Data 1 or Data 0 lines to

transmit the data stream to the access control panel (the “saw-teeth” in Figure 2).The

Data 1 and Data 0 pulses do not overlap or occur simultaneously.

The composition of the open existing industry standard 26- bit Wiegand format contains

8 bits for the facility code field and 16 bits for the ID number field. Mathematically these

8 facility code bits allow a total of 256 (0 to 255) facility codes, while the 16 ID number

bits allow a total of only 65,536 (0 to 65,535) individual ID’s within each facility code.

N.M.A.M.I.T,Nitte

Page 17: Rfid Final Report

RFID BASED SECURITY SYSTEM 17

CHAPTER 3

GSM ( Global System for Mobile Communications)

3.1 INTRODUCTION TO GSM:

GSM (Global System for Mobile communication) is a digital mobile telephony system

that is widely used in Europe and other parts of the world. GSM uses a variation of time

division multiple access (TDMA) and is the most widely used of the three digital wireless

telephony technologies (TDMA, GSM, and CDMA). GSM digitizes and compresses

data, then sends it down a channel with two other streams of user data, each in its own

time slot. It operates at either the 900 MHz or 1800 MHz frequency band.GSM module

consists of a GSM modem assembled together with power supply circuit and

communication interfaces (like RS-232, USB, etc) for computer. The MODEM is the

soul of such modules.

3.2 GSM MODEM:

GSM MODEM is a class of wireless MODEM devices that are designed for

communication of a computer with the GSM network. It requires a SIM (Subscriber

Identity Module) card just like mobile phones to activate communication with the

network. Also they have IMEI (International Mobile Equipment Identity) number similar

to mobile phones for their identification. A GSM/GPRS MODEM can perform the

following operations:

1. Receive, send or delete SMS messages in a SIM.

2. Read, add, search phonebook entries of the SIM.

3. Make, Receive, or reject a voice call.

The MODEM needs AT commands, for interacting with processor or controller, which

are communicated through serial communication. These commands are sent by the

controller/processor. The MODEM sends back a result after it receives a command.

Different AT commands supported by the MODEM can be sent by the

processor/controller/computer to interact with the GSM cellular network.

N.M.A.M.I.T,Nitte

Page 18: Rfid Final Report

RFID BASED SECURITY SYSTEM 18

3.3 AT COMMANDS:

AT commands are used to control MODEMs. AT is the abbreviation for Attention. These

commands come from Hayes commands that were used by the Hayes smart modems.

The Hayes commands started with AT to indicate the attention from the MODEM. The

dial up and wireless MODEMs (devices that involve machine to machine

communication) need AT commands to interact with a computer. These include the

Hayes command set as a subset, along with other extended AT commands.

AT commands with a GSM/GPRS MODEM or mobile phone can be used to access

following information and services:

1. Information and configuration pertaining to mobile device or MODEM and SIM

card.

2. SMS services.

3. MMS services.

4. Fax services.

5. Data and Voice link over mobile network.

The Hayes subset commands are called the basic commands and the commands

specific to a GSM network are called extended AT commands.

To Send SMS using AT commands

Some advanced GSM modems like WaveCom and Multitech, support the SMS text

mode. This mode allows us to send SMS messages using AT commands, without the

need to encode the binary PDU field of the SMS first. This is done by the GSM modem

To check if GSM phone or modem supports SMS text mode

To check if the modem supports this text mode, we can try the following command:

AT+CMGF=1 <ENTER>

If the modem responds with "OK" this mode is supported. Using this mode it is only

possible to send simple text messages. It is not possible to send multipart, Unicode,

data and other types of messages.

N.M.A.M.I.T,Nitte

Page 19: Rfid Final Report

RFID BASED SECURITY SYSTEM 19

Setting up the modem

If the modem contains a SIM card with is secured with a PIN code, we have to enter this

pin code first:

AT+CPIN="0000" <ENTER> (replace 0000 with relevant PIN code).

After setting the PIN code, wait some seconds before issuing the next command to give

the modem some time to register with the GSM network.

To send messages

To send SMS message, we type the following command:

AT+CMGS="+918123007390" <ENTER>

The modem will respond with:

>

The message text can be send using the <CTRL>-<Z> key combination:

Hello World! <CTRL-Z>

After some seconds the modem will respond with the message ID of the message,

indicating that the message was sent correctly:

+CMGS: 62

The message will arrive on the mobile phone.

N.M.A.M.I.T,Nitte

Page 20: Rfid Final Report

RFID BASED SECURITY SYSTEM 20

CHAPTER 4

RFID BASED SECURITY SYSTEM

4.1 INTRODUCTION TO RFID BASED SECURITY SYSTEM:

The main objective of our project is to allow the entry of authorized persons.

The person wanting access should swipe his RFID Card in front of the RFID reader

which is at the entrance of the room. The serial number of the tag will be send to the

microcontroller where it will be compared with the number stored in the system memory.

If the number matches, the microcontroller will initiate the DC motor to open the door. At

the same time the GSM module will send a message with serial number and time of

entry to the predesignated number (security personnel).

In case the card swiped is invalid then “invalid user” message will be displayed

on the LCD. If same invalid card is swiped again an alert message will be sent to the

security. The GSM is able to notify the security personnel in case of door malfunction

and forceful entry.

4.2 BLOCK DIAGRAM OF RFID BASED SECURITY SYSTEM

Figure 4.1 BLOCK DIAGRAM OF RFID BASED SECURITY SYSTEM

N.M.A.M.I.T,Nitte

Page 21: Rfid Final Report

RFID BASED SECURITY SYSTEM 21

The block diagram of our project is as shown above. It consists of the following units:

a) Microcontroller.

b) RFID.

c) GSM.

d) DC MOTOR.

e) LCD.

f) IR sensor and Relays.

4.3 INTERNAL CONNECTIONS OF RFID BASED SECURITY SYSTEM

Figure 4.2 INTERNAL CONNECTIONS OF RFID BASED SECURITY SYSTEM

N.M.A.M.I.T,Nitte

Page 22: Rfid Final Report

RFID BASED SECURITY SYSTEM 22

4.4 CONSTRUCTION

The RFID based security system consists of Microcontroller, LCD display, GSM, RFID,

Motor, IR sensor, Relays and power supply circuit. The power supply circuit consists of

the transformer of rating 230/12 volts &1amps, a bridge rectifier, an IC7805 whose

terminal one is connected with the positive end of the bridge rectifier, and terminal two is

connected to the negative output terminal of the bridge rectifier. Between terminal 1 and

terminal 2 a 1000 micro farads capacitor is connected. The output from the third terminal

of the IC7805 is given to the 40th pin of the microcontroller. The 8052 needs oscillator

section for its function. Here the oscillator section comprises of crystal of 11.0592 MHz

connected between the 18th and 19th pins of the microcontroller. The 33 pico farads

capacitor is connected the terminal 18th and 19th, further both are extended to ground

through pin 20th (ground). The reset pin 9th is connected to a Vcc through a 10 micro

farad capacitor. The negative end of the capacitor is connected to ground through 10

kilo ohm resistor. The LCD is connected to the port 2 of the microcontroller, and the

Enable, RS, R/W, are then connected to the 17 th, 15th, and 16th pin respectively. The

12v DPDT relay is used to connect the two serial input devices GSM and RFID.

Between the relay and the microcontroller two transistors configuration is used in which

the base of the first transistor is connected with microcontroller through a 2.2 kilo ohms

resistor, and the second transistor base is connected to the first transistor emitter

terminal. Further the collectors of both the transistor are shorted and the emitter of the

second transistor is connected with the ground. Through the 1 kilo ohm resistor and a

LED the shorted collector connection is given to the relay. Max232 is connected with the

microcontroller. The 1st and 3rd, 4th and 5th are shorted using 10 micro farads capacitor.

Pin 2nd and 16th are shorted using 10 micro farads capacitor and connected with Vcc.

Pin 6th and 15th are shorted using 10 microfarad between them and connected to the

ground. The pin 12th and 11th are connected to the 10th and 11th pin of the microcontroller

which is RXD and TXD respectively. Further the 13th and 14th pin of the MAX232 is

connected to the DPDT relay which is R1in and T1out respectively. Internal diagram

consists of IR sensor for sensing the obstacle. The output pin of the IR sensor is

connected to the 4th pin of the microcontroller, and Vcc and ground of the IR sensor is

connected to Vcc and ground of the microcontroller respectively. A 12volt DC Motor is

connected in the circuit for opening and closing of the door. The motor is rotated in

clockwise and anticlockwise direction depending on polarity of the supply. To supply the

N.M.A.M.I.T,Nitte

Page 23: Rfid Final Report

RFID BASED SECURITY SYSTEM 23

motor we have connected it with two 12volts SPDT relay. Whose NC and NO are sorted

and connected to the negative and positive of the 9volt battery supply. To provide safety

to the microcontroller pin the relay is connected with two transistor configurations with

the microcontroller. Both the relay (relay1& relay2) is connected to the microcontroller

through one such transistor configuration and connected to the pin 1st and 2nd of the

microcontroller.

N.M.A.M.I.T,Nitte

Page 24: Rfid Final Report

RFID BASED SECURITY SYSTEM 24

CHAPTER 5

LCD INTERFACING WITH MICROCONTROLLER (89C52)

Figure 5.1 LCD Interfacing to the Microcontroller 89c52

A 16x2 LCD is interfaced to microcontroller 89c52, which is used to display the message

“SWIPE THE CARD” initially when the gate is closed.

The message “VALID USER” is displayed when the valid tag is detected by RFID, and

after that a message of “WELCOME” is displayed. A message of “INVALID USER” is

displayed when the invalid card is flashed. When due to some reason the door gets

stuck or it doesn’t respond then a message of “DOOR PROBLEM” is displayed and

finally, if a person tries to open the door by force then a message of “FORCEFUL

ENTRY” is displayed.

N.M.A.M.I.T,Nitte

Page 25: Rfid Final Report

RFID BASED SECURITY SYSTEM 25

The pins of the port 2 of microcontroller from 2.0 to 2.7 are connected to D0 to D7 of

LCD respectively. The pin 1 is ground and pin 2 is for VCC connection to supply 5 volts

to the LCD display. The pin 15 of LCD is connected to VCC and pin 16 is connected to

ground for controlling the light of the LCD display. The two pins pin1 and pin 3 of the

LCD is shorted with each other using 1k ohm resistor to control the contrast of the LCD.

The 8 pins of port 2 of the microcontroller are used to send data or command to LCD.

There are two very important registers inside the LCD. The RS pin is used for their

selection as follows. If RS=0, the instruction command code register is selected,

allowing the user to send a command such as clear display, cursor at home, etc. If RS =

1 the register is selected, allowing the user to send data to be displayed on the LCD.

The RS pin 4 of the LCD is connected to port 3 pin 3.5 of microcontroller.

R/W input allows the user to write information to the LCD or read information

from it. R/W = 1 when reading; R/W = 0 when writing. The R/W pin 5 of LCD is

connected to the port 3 pin 3.6 of the microcontroller.

The enable pin used by the LCD to latch information presented to its data pins.

When data is supplied to data pins, a high to low pulse must be applied to this pin in

order for the LCD to latch in the data present at data pins. This pulse must be minimum

of 450 ns wide. The 8 bit data pins, D0-D7, are used to send information to the LCD or

read the contents of the LCD’s internal registers. To display letters and numbers, we

send ASCII codes for the letters A-Z, a-z and numbers 0-9 to these pins while making

RS=1. There are also instruction command codes that can be sent to the LCD to clear

the display or force the cursor to the home position or blink the cursor. The enable pin 6

of the LCD is connected to the port 3 pin 3.7 of the microcontroller.

N.M.A.M.I.T,Nitte

Page 26: Rfid Final Report

RFID BASED SECURITY SYSTEM 26

CHAPTER 6

RFID AND GSM INTERFACING:

Fig 6.1: Interfacing of RFID and GSM

Our project has two serially communicating devices the GSM module and the RFID

reader. Since the microcontroller has only one set of pins TXD and RXD for serial

communication. We have used a 5V, DPDT relay for connecting the two devices.

A MAX232 IC is used to serially interface the devices with the microcontroller. Pin

11(T1in) and pin 12(R1out) of MAX232 are connected to the pin P3.1 (TXD) and P3.0

(RXD) of the microcontroller. While the pin 14(T1out) and 13(R1in) of MAX232 are

connected to the two common pins of the DPDT relay.

N.M.A.M.I.T,Nitte

Page 27: Rfid Final Report

RFID BASED SECURITY SYSTEM 27

The RFID reader is connected to the NC pins of the relay while the GSM module is

connected to the NO pins of the DPDT relay.

Initially the RFID reader is connected to microcontroller through the normally closed

contact of the relay. Microcontrollers have internal pull up resistor. Hence when a port

pin is high the output current flows through this internal pull up resistor. 8051 have an

internal pull up of 10 kilo ohms, hence the maximum output will be 0.5mA.However this

current is not sufficient to drive the transistor into saturation and turn ON the relay.

Hence an external pull up resistor is used.

Whenever 8051 microcontroller is turned ON initially the controller is in reset state and

all the pins are HIGH which would result in turning ON the relay every time the power is

turned ON or if there is a power fluctuation. To avoid this problem transistor Q2 is added

between controller and Q1. Basically transistor Q2 acts an inverter. So when a HIGH is

applied from the controller the transistor Q2 turns ON so the base of Q1 gets ‘0’ and Q1

turns OFF, so the relay turns OFF and when a LOW is applied from the controller the

transistor Q2 turns OFF and the base of Q1 gets high voltage from the base of R2,the

transistor Q1 turns ON turning ON the relay. The contact now shifts from the normally

closed contacts of the relay to the normally open, connecting the GSM module to the

microcontroller.

N.M.A.M.I.T,Nitte

Page 28: Rfid Final Report

RFID BASED SECURITY SYSTEM 28

CHAPTER 7MOTOR INTERFACING:

Fig7.1: Motor interfacing

We use a 12 volt 150 rpm DC motor for opening and closing of the door. To make the

door open and close we need to rotate motor in clockwise and anticlockwise direction,

for this purpose we are using two 12 volt SPDT relay. We have used two transistor

N.M.A.M.I.T,Nitte

Page 29: Rfid Final Report

RFID BASED SECURITY SYSTEM 29

connections between microcontrollers and relay so that whenever microcontroller is

turned ON initially the controller is in reset state and all the pins are HIGH which would

result in turning ON the relay every time the power is turned ON or if there is a power

fluctuation. To avoid this problem transistor q2 is added between controller and q1.

Basically transistor q2 acts an inverter. So when a HIGH is applied from the controller

the transistor q2 turns ON so the base of q1 gets ‘0’ and q1 turns OFF, so the relay

turns OFF and when a LOW is applied from the controller the transistor q2 turns OFF

and the base of q1 gets high voltage, the transistor q1 turns ON turning ON the relay.

We have used two such configurations to rotate the motor. The relay 1 is connected to

Pin 1.0 and relay 2 is connected to Pin 1.1 of microcontroller.

Here normally open terminal of both relays are shorted to each other, as well as

normally closed terminal of both the relays are also shorted. The normally open terminal

of the relays are connected to the positive of the supply and normally closed are

connected to the negative of the supply.

When relay 1 is energized the motor terminal t1 gets connected to the positive of

the supply and terminal t2 to negative of the supply. In this case the motor runs in the

forward direction and when the relay 2 is energized the motor polarity gets interchanged

and it rotates in the reverse direction, which leads to the opening and closing of the

door.

N.M.A.M.I.T,Nitte

Page 30: Rfid Final Report

RFID BASED SECURITY SYSTEM 30

MERITS AND DEMERITS

MERITS:

DEMERITS:

RFID technology used in access control system operates at a shorter range of few

centimeters, but is vulnerable to skimming and eavesdropping albeit a shorter distance.

Rogue devices can access data using standard, inexpensive lab equipment.

Tags are evolving quickly in complexity, power and flexibility. However all

types of tag share a critical vulnerability to rogue RFID readers. A rogue reader can read

a tag, record information that may be confidential, it can also write new, potentially

damaging information to the tag, or it can kill the tag. In each of these cases the tags

respond as if the RFID reader (rogue reader) was authorized, as the rogue reader

appears like any other RFID reader. This capability has broad implications.

N.M.A.M.I.T,Nitte

Page 31: Rfid Final Report

RFID BASED SECURITY SYSTEM 31

IMPROVEMENTS AND APPLICATIONS

IMPROVEMENTS:

Further improvements can be made to enhance the features and functionality of

the system. Some features that can be implemented are:

1. We can maintain a record of the entries made into the restricted site in a database

using computers.

2. A back up power supply would be another possible feature that could be added for

continuous operation of the security system, to avoid failure due to power outages.

3. Besides we can also trigger an alarm to notify an attempt of intrusion.

4. We can also provide or add a camera, which operates when an attempt made to

forcefully enter is detected. This would help in identifying the trespasser.

APPLICATIONS:

The system is optimized for usage in R&D wings of major industrial concerns and

scientific research labs, which demand limited access to personnel.

Besides this system could be used on office doors and museums to prohibit the

entry of unauthorized people.

It can also find applications in the domestic environment, provided the user has

an aptitude towards it.

N.M.A.M.I.T,Nitte

Page 32: Rfid Final Report

RFID BASED SECURITY SYSTEM 32

CONCLUSIONS:

The system design and software implementation has proven to be effective and

efficient. Besides the adoption of RFID technology along with GSM for providing security

is feasible & reliable and has proven potential in varying conditions. It provides access

only to the required people, keeps track of the people entering the site, detects and

warns the security personnel in case of attempts being made at trespassing, besides

detecting door malfunctioning and communicating the same. In doing so it has met the

stated objectives of our project.

However it must also be stated that, in this project we have tried to implement a

very basic form of security in the modern world. Additional security features and

improvements to this system must be made to make the system more dependable and

full proof. With the cost constraints and other limitations, we have succeeded in pushing

the project towards completion by meeting our objectives.

N.M.A.M.I.T,Nitte