You are on page 1of 13

Door Locking System using RFID

By
Raj Kumar Jarugulla (154223)
Charan Junnu (154224)
Vithal Kaligotla (154225)
Manasa Kanaparthi (154226)

Submitted to:
Dr.K. Prakash
Assistant Professor

Department of Electronics and Communication Engineering


NATIONAL INSTITUTE OF TECHNOLOGY WARANGAL
2018-19
Certificate

This is to certify that the undersigned students of IV/IV B. Tech Section – B, Electronics

and Communication Engineering Branch, have completed their mini project titled - “Door

Locking System using RFID” for the partial fulfillment of ELECTRONIC

INSTRUMENTATION LAB.

Name Roll. no. Signature

Raj Kumar Jarugulla 154223

Charan Junnu 154224

Vithal Kaligotla 154225

Manasa Kanaparthi 154226

Signature of the faculty

(Dr. K. Prakash)
Assistant Professor in ECE

2
Table of Contents

1. Title Page 1

2. Certificate 2

3. Contents 3

4. Abstract 4

5. Theory 5

6. Circuit diagram 6

7. Components Required 6

8. Interfacings 7

9. Code 9

10.Working 12

11.Results and Conclusion 12

12. Applications 13

3
Abstract

RFID (Radio Frequency IDentification) is an automatic identification and data


collection technology which uses the electromagnetic fields in the radio frequency range for
non-contact operation.

It is similar to that of bar codes or magnetic strips i.e. they all provide unique
identification system. The data retrieving operation is also similar to the other two technologies.
RFID devices must be scanned or swiped against their readers for retrieving the data.

The advantage of RFID technology over bar codes or magnetic strips is that RFID
doesn’t need any physical contact as in case of magnetic strips (ATM or credit cards) or needn’t
be placed in a particular position as in case of bar codes.

In this project, an Arduino UNO board is interfaced with an RFID Reader Module in
order to process the data or information retrieved from the RFID Card or Tag.

4
Theory:

RFID:

RFID is an acronym for “radio-frequency identification” and refers to a technology


where digital data encoded in RFID tags or smart labels are captured by a reader via radio
waves. RFID is similar to barcoding in that data from a tag or label are captured by a device
that stores the data in a database. RFID, however, has several advantages over systems that use
barcode asset tracking software. The most notable is that RFID tag data can be read outside the
line-of-sight, whereas barcodes must be aligned with an optical scanner.

RFID belongs to a group of technologies referred to as Automatic Identification and


Data Capture (AIDC). AIDC methods automatically identify objects, collect data about them,
and enter those data directly into computer systems with little or no human intervention. RFID
methods utilize radio waves to accomplish this. At a simple level, RFID systems consist of
three components: an RFID tag or smart label, an RFID reader, and an antenna. RFID tags
contain an integrated circuit and an antenna, which are used to transmit data to the RFID reader.
The reader then converts the radio waves to a more usable form of data. Information collected
from the tags is then transferred through a communications interface to a host computer system,
where the data can be stored in a database and analyzed at a later time.

RFID tag:

An RFID tag consists of an integrated circuit and an antenna. The tag is also composed
of a protective material that holds the pieces together and shields them from various
environmental conditions. The protective material depends on the application. For example,
employee ID badges containing RFID tags are typically made from durable plastic, and the tag
is embedded between the layers of plastic. RFID tags come in a variety of shapes and sizes and
are either passive or active. Passive tags are the most widely used, as they are smaller and less
expensive to implement. Passive tags must be powered up by the RFID reader before they can
transmit data. Unlike passive tags, active RFID tags have an onboard power supply e.g., a
battery, thereby enabling them to transmit data at all times.

5
Circuit Diagram:

Components Required:

• RFID reader

• RFID tag

• Arduino

• Piezo buzzer

• Servo motor

• Breadboard

• Jumper wires

6
Interfacings:

A. RFID Interfacing to ARDUINO:

The pin-to-pin connection of the RFID reader and Arduino is as follows:

• 3.3V is given to the 3.3V pin of Arduino

• RST is given to the digital pin 9

• GND is given to the ground pin of the Arduino

• IRQ is not connected

• MSO is connected to digital pin 12

• MOSI is connected to digital pin 11

• SCK is connected to the digital pin 13

• SDA is connected to the digital pin 10

B. Piezo Buzzer Interface:

The connection of the piezo buzzer is as follows:

• The black wire is connected to the negative railing of the breadboard.

• The red wire is connected to the digital pin 3 of the Arduino.

7
C. Servo Motor Interface:

The connection of the servo wire is as follows:

• The Red wire is connected to the positive railing of the breadboard.

• The Maroon wire is connected to the negative railing of the breadboard.

• The Orange wire is connected to the Digital pin 5.

8
D.LED Interface:

The connection of led 1 is as follows

• Negative or shorter leg is connected to the negative railing of the breadboard

• Positive or longer leg is connected to the digital pin 2

The connection of led 2 is as follows

• Negative or shorter leg is connected to the negative railing of the breadboard

• Positive or longer leg is connected to the digital pin 3

Code:

#include "SPI.h" // SPI library

#include "MFRC522.h" // RFID library

#include<Servo.h>

#define LED1 2

#define LED2 3

Servo myservo;

const int pinRST = 9;

const int pinSDA = 10;

int pos = 0;

byte card1[4] = {74,136,202,131} ;

byte card2[4] = {100,78,83,67};

boolean permission = true;

9
MFRC522 mfrc522(pinSDA, pinRST); // Set up mfrc522 on the Arduino

void setup() {

pinMode(LED1 ,OUTPUT );

pinMode(LED2 ,OUTPUT );

myservo.attach(5);

SPI.begin(); // open SPI connection

mfrc522.PCD_Init(); // Initialize Proximity Coupling Device (PCD)

Serial.begin(9600); // open serial connection

void loop() {

if (mfrc522.PICC_IsNewCardPresent()) { // (true, if RFID tag/card is present ) PICC =


Proximity Integrated Circuit Card

if(mfrc522.PICC_ReadCardSerial()) { // true, if RFID tag/card was read

Serial.print("RFID TAG ID:");

for (byte i = 0; i < mfrc522.uid.size; ++i) { // read id

Serial.print(mfrc522.uid.uidByte[i]); // print id as values

Serial.print(" ");

if (mfrc522.uid.uidByte[3]== card1[3])

{ digitalWrite(LED1,HIGH);

delay(100);
10
digitalWrite(LED1,LOW);

delay(100);Serial.print("STOP");}

else if(mfrc522.uid.uidByte[3]== card2[3])

myservo.write(0); delay(1000);

digitalWrite(LED2,HIGH);

delay(100);

digitalWrite(LED2,LOW);

delay(100);Serial.print("ALLOW "); delay(100);

myservo.write(90); }

Serial.println(); // Print out of id is complete.

11
Working:

This project is simply analogous to lock and key, the only difference here is no physical
contact or swipe is required. Working of this project is as follows

• The reader scans the tag when tag is brought in close proximity to it.

• When a correct card (master key) is scanned, door(motor) is opened for a brief period,
precisely four blinks of green LED, giving the user ample time to pass through, after
that door closes automatically.

• When wrong card is scanned, the door doesn’t open, alert red-light sign is given and
alarm goes off indicating illegal entry.

Results and Conclusion:

In this project, we have implemented Arduino based Door Locking system using RFID.
When a right RFID tag is scanned servo motor rotates 90 degrees i.e. door is opened and green
LED blinks and closes automatically. When a wrong RFID tag is scanned door remains in lock
state, buzzer goes off and red LED blinks. The entry data is logged in a .csv file to keep track
of the entries over time.

12
Applications of RFID:

a. 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.

b. People Tracking:

• People tracking systems are used in jails to track their inmates.

• It will be mainly very useful in mental care hospitals where doctors can track every
activity of the patient. Hospitals also use these RFID tags for locating and tracking all the
activities of the newly born babies.

c. Document tracking:

An RFID document-tracking system saves time and money by substantially reducing:

• Time spent searching for lost document

• The financial and legal impact associated with losing documents.

d. Government Library:

Many government libraries use barcode and electromagnetic strips to track various
assets. RFID powered barcode reader can read multiple items simultaneously. This reduces
queues and increases the number of customers.

e. Healthcare:

RFID wristbands records patient’s medication history and reduces medication errors.

f. Other Applications

• RFID based authentication & Security access system

• Inventory and Livestock management

• Attendance system
13

You might also like