Você está na página 1de 34

CHAPTER 1

INTRODUCTION
1.1 Overview

Radio-frequency identification (RFID) uses electromagnetic fields to


automatically identify and track tags attached to objects. The tags contain
electronically-stored information. Passive tags collect energy from a nearby RFID
reader's interrogating radio waves. Active tags have a local power source (such as a
battery) and may operate hundreds of meters from the RFID reader. Unlike a
barcode, the tag need not be within the line of sight of the reader, so it may be
embedded in the tracked object. RFID is one method for Automatic Identification
and Data Capture (AIDC). RFID tags are used in many industries, for example, an
RFID tag attached to an automobile during production can be used to track its
progress through the assembly line; RFID-tagged pharmaceuticals can be tracked
through warehouses; and implanting RFID microchips in livestock and pets allows
for positive identification of animals.

In 1945, Léon Theremin invented a listening device for the Soviet Union which
retransmitted incident radio waves with the added audio information. Sound waves
vibrated a diaphragm which slightly altered the shape of the resonator, which
modulated the reflected radio frequency. Even though this device was a covert
listening device, rather than an identification tag, it is considered to be a predecessor
of RFID because it was passive, being energized and activated by waves from an
outside source. Similar technology, such as the IFF transponder, was routinely used
by the allies and Germany in World War II to identify aircraft as friend or foe.
Transponders are still used by most powered aircraft. Another early work exploring
RFID is the landmark 1948 paper by Harry Stockman, who predicted that
considerable research and development work has to be done before the remaining
basic problems in reflected-power communication are solved, and before the field of
useful applications is explored."

1
A radio-frequency identification system uses tags, or labels attached to the objects
to be identified. Two-way radio transmitter-receivers called interrogators or readers
send a signal to the tag and read its response. RFID tags can be either passive, active
or battery-assisted passive. An active tag has an on-board battery and periodically
transmits its ID signal. A battery-assisted passive (BAP) has a small battery on board
and is activated when in the presence of an RFID reader. A passive tag is cheaper
and smaller because it has no battery; instead, the tag uses the radio energy
transmitted by the reader. However, to operate a passive tag, it must be illuminated
with a power level roughly a thousand times stronger than for signal transmission.
That makes a difference in interference and in exposure to radiation.

Tags may either be read-only, having a factory-assigned serial number that is used
as a key into a database, or may be read/write, where object-specific data can be
written into the tag by the system user. Field programmable tags may be write-once,
read-multiple; "blank" tags may be written with an electronic product code by the
user. RFID tags contain at least three parts: an integrated circuit that stores and
processes information and that modulates and demodulates radio-frequency (RF)
signals; a means of collecting DC power from the incident reader signal; and an
antenna for receiving and transmitting the signal. The tag information is stored in a
non-volatile memory. The RFID tag includes either fixed or programmable logic for
processing the transmission and sensor data, respectively. An RFID reader transmits
an encoded radio signal to interrogate the tag. The RFID tag receives the message
and then responds with its identification and other information. This may be only a
unique tag serial number, or may be product-related information such as a stock
number, lot or batch number, production date, or other specific information. Since
tags have individual serial numbers, the RFID system design can discriminate among
several tags that might be within the range of the RFID reader and read them
simultaneously.

There are many reasons why RFID door locks make a lot of sense. Using these
door locks is really easy and the best part is that one does not need to worry about
any security issues in the long term. There is always a very good attention to detail
in the first place. The quality is always among the very best, and one gets to retain a

2
really impressive experience each time. By using this type of locks, one basically
doesn’t have to worry about anything else. The locks are automatic and they can
easily be adapted to the way residential system works. It’s an incredible opportunity
that will deliver stellar results in the long term.

Remember that RFID locks are focused on ease of use. They work great for
commercial properties and residential ones too. And one is always free to choose
when and how one wants to handle everything based on the needs and expectations.
It really works to the advantage if we use these type of locks, because we do not need
to worry about protecting the business ever again. It’s definitely worth of our time
and effort, which is exactly what we need to take into account! RFID locks are
inexpensive, and the best part is that one doesn’t need to worry about maintenance
either. The quality is always among the very best out there, and the attention to detail
is incredible to begin with.

3
CHAPTER 2

LITERATURE SURVEY

Radio Frequency Identification (RFID) technology utilizes the electromagnetic fields


for data transfer in order to perform automatic detection and tracking of tags or tags of
objects. It can provide ways to design and implement relatively inexpensive systems
particularly for security aspects. In this paper, they have proposed a digital access control
system that can be employed to a protected area where none but people with authenticated
credentials can enter. In fact, they have implemented the system in the server room of an
educational Institute to test its efficiency as well as expenditure.[1] The implemented
system comprises of digital door lock which is unlock able in real time to ensure secured
access specifying activation, authentication and validation of users prior to bringing the
RFID card close to the reader. The entire system is associated with a central client-server
sub-system to ensure and maintain the overall system integrity. Associated sub-system
also generates a log report to maintain check-in and check-out status of visitors in
accordance with the primary credentials of each. The concept taken from this paper is
that radio frequency identification technology utilizes the electromagnetic fields for data
transfer in order to perform automatic detection and tracking of tags or tags of object.
The advantage of this concept is that it is secure and efficient.

The system proposed is a door unlocking system containing multiple doors any of
which can be used to access a certain zone e.g. a laboratory or library. The system is
implemented using a central server which contains a central database gathering all the
information about the authorized personnel. The hardware components required are
RFID reader, passive RFID tags, wireless transmitter & receiver (433 MHz) and an
Arduino microcontroller.[2] Software assistance of Arduino IDE and Processing
Development Environment (PDE) are required for control. The advantage of this system
is that the data collected is stored in cloud server and this makes the system much
efficient. On the other hand the disadvantages of the system is that the transmitters are
slow and a large amount of capital is required to maintain the database.

4
In day to day life, security of an object or property plays a major role. Nowadays,
security is the major threat faced by most of the organizations; hence security is gaining
more importance in these days. This paper gives a survey on various automatic
identification and access control mechanisms that have been used over the years to
prevent unauthorized access. In olden days, for high security zones like locker rooms for
banks, military sites etc, traditional lock systems or passwords were employed. But this
solution was not secure.[3] Due to the advancements in technology RFID cards were
used. A lot of research is going on various automatic door lock systems and can expect
more secure systems in the upcoming years. This paper gives us a survey on various
automatic identification and access control mechanisms that have been used over the
years to prevent unauthorized access. The conclusion drawn from the survey is that RFID
tags are one of the most secure way to prevent unauthorized access. The RFID model is
too simplistic and uses a local database to store data.

In spite of the availability of digital password lockers and advanced door locks,
hacking the lock code by an unauthorized person has become a plain-sailing task. Various
electronic locks are currently available in the market based on Password, Biometrics,
OTP, Cryptography, Wireless and IoT. Every system has its own advantages and
disadvantages where one system overcomes the limitations of other. The existing systems
provide only single factor authentication that leads to less secure system.[4] Thus, a
secure door locking system with two-factor authentication and multiple encryptions
using RFID, which can activate, authenticate, and validate the user and unlock the door
in real time for secure access has been proposed. The main objective is to design and
implement a digital security system which can deploy in critical zone where only
authorized person can be entered.

Security is a vital concern around the world and it has been major threat for all
confidential departments. This work is based on Arduino and is used for the security
purpose. Arduino is an open source computer hardware and software company, project,
and user community that designs and manufactures single-board microcontrollers and
microcontroller kits for building digital devices and interactive objects that can sense and
control objects in the physical and digital world.[5] The project's products are distributed
as open-source hardware and software, which are licensed under the GNU Lesser General

5
Public License (LGPL) or the GNU General Public License (GPL),permitting the
manufacture of Arduino boards and software distribution by anyone. Arduino boards are
available commercially in preassembled form, or as do-it-yourself (DIY) kits. The boards
feature serial communications interfaces, including Universal Serial Bus (USB) on some
models, which are also used for loading programs from personal computers. The
microcontrollers are typically programmed using a dialect of features from the
programming languages C and C++. In addition to using traditional compiler toolchains,
the Arduino project provides an integrated development environment (IDE) based on the
Processing language project. Arduino uses an ATmega328 microcontroller. As security
is very essential now a day, so by using this project only the authorized person will be
allowed to enter by entering the correct password. The circuit is very simple, cost
effecting and secure.

Home automation system is a computerized, intelligent network of electronic


devices, designed to monitor and control the home appliances and lighting systems in a
building. It allows users to remotely monitor and control consumer electronics through
the external network such as Internet. Home automation is the emerging field that has
attracted the attention in both the commercial and research field.[6] The digital lock has
an interface for the user to enter PIN. Thus, the home resident can relive the burden of
carrying a large set of keys, and no more worry about the key. This paper reflects the
importance of home automation and security. Door locks plays a major role in home
security and thus needs to be reliable. To make it reliable, various theoretical and
practical experiments are done. RFID technology is one of the most secure, simple, cost
efficient and reliable technology.

6
CHAPTER 3

SYSTEM REQUIREMENTS

3.1 Hardware

3.1.1 RFID Tags and Readers

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


technology whereby digital data encoded in RFID tags or smart labels (defined below)
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 (also called an interrogator). 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.

As stated above, 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. 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.

7
Key cards Types

Master Card: can unlock all the locks

Building Card: Can unlock the locks belonging to corresponding building

Floor Card: Can unlock the locks belonging to corresponding floor

Guest Card: For the guest to open the room he/she lodges in within the specific period of
time.

3.1.2 Arduino Uno

The Arduino UNO is a widely used open-source microcontroller board based on


the Microchip ATmega328P microcontroller and developed by Arduino.cc. The board is
equipped with sets of digital and analog input/output (I/O) pins that may be interfaced to
various expansion boards (shields) and other circuits. The board features 14 Digital pins
and 6 Analog pins. It is programmable with the Arduino IDE (Integrated Development
Environment) via a type B USB cable. It can be powered by a USB cable or by an external
9 volt battery, though it accepts voltages between 7 and 20 volts.

General Pin functions

 LED: There is a built-in LED driven by digital pin 13. When the pin is HIGH
value, the LED is on, when the pin is LOW, it's off.

 VIN: The input voltage to the Arduino/Genuino board when it's using an external
power source (as opposed to 5 volts from the USB connection or other regulated
power source). You can supply voltage through this pin, or, if supplying voltage
via the power jack, access it through this pin.

 5V: This pin outputs a regulated 5V from the regulator on the board. The board
can be supplied with power either from the DC power jack (7 - 20V), the USB
connector (5V), or the VIN pin of the board (7-20V). Supplying voltage via the
5V or 3.3V pins bypasses the regulator, and can damage the board.

 3V3: A 3.3 volt supply generated by the on-board regulator. Maximum current
draw is 50 mA.

 GND: Ground pins.

8
 IOREF: This pin on the Arduino/Genuino board provides the voltage reference
with which the microcontroller operates. A properly configured shield can read
the IOREF pin voltage and select the appropriate power source or enable voltage
translators on the outputs to work with the 5V or 3.3V.

 Reset: Typically used to add a reset button to shields which block the one on the
board.

FIG 3.1: ARDUINO UNO BOARD

3.1.3 Servo motor

A servomotor is a rotary actuator or linear actuator that allows for precise control
of angular or linear position, velocity and acceleration. It consists of a suitable motor
coupled to a sensor for position feedback. It also requires a relatively sophisticated
controller, often a dedicated module designed specifically for use with servomotors.

The motor is paired with some type of encoder to provide position and speed
feedback. In the simplest case, only the position is measured. The measured position of
the output is compared to the command position, the external input to the controller. If
the output position differs from that required, an error signal is generated which then
causes the motor to rotate in either direction, as needed to bring the output shaft to the
appropriate position. As the positions approach, the error signal reduces to zero and the
motor stops.

9
The very simplest servomotors use position-only sensing via a potentiometer and
bang-bang control of their motor; the motor always rotates at full speed (or is stopped).
This type of servomotor is not widely used in industrial motion control, but it forms the
basis of the simple and cheap servos used for radio-controlled models.

More sophisticated servomotors use optical rotary encoders to measure the speed
of the output shaft and a variable-speed drive to control the motor speed. Both of these
enhancements, usually in combination with a PID control algorithm, allow the
servomotor to be brought to its commanded position more quickly and more precisely,
with less overshooting.

FIG 3.2: SERVO MOTOR

3.1.4 LCD Screen

A liquid-crystal display (LCD) is a flat-panel display or other electronically


modulated optical device that uses the light-modulating properties of liquid crystals.
Liquid crystals do not emit light directly, instead using a backlight or reflector to produce
images in color or monochrome. LCDs are available to display arbitrary images (as in a
general-purpose computer display) or fixed images with low information content, which
can be displayed or hidden, such as preset words, digits, and seven-segment displays, as
in a digital clock. They use the same basic technology, except that arbitrary images are
made up of a large number of small pixels, while other displays have larger elements.

10
LCDs are used in a wide range of applications including LCD televisions,
computer monitors, instrument panels, aircraft cockpit displays, and indoor and outdoor
signage. Small LCD screens are common in portable consumer devices such as digital
cameras, watches, calculators, and mobile telephones, including smartphones. LCD
screens are also used on consumer electronics products such as DVD players, video game
devices and clocks. LCD screens have replaced heavy, bulky cathode ray tube (CRT)
displays in nearly all applications. LCD screens are available in a wider range of screen
sizes than CRT and plasma displays, with LCD screens available in sizes ranging from
tiny digital watches to very large television receivers.

FIG 3.3: LCD SCREEN

3.2 Software

3.2.1 Arduino IDE

The Arduino integrated development environment (IDE) is a cross-platform


application (for Windows, macOS, Linux) that is written in the programming language
Java. It is used to write and upload programs to Arduino board.

The source code for the IDE is released under the GNU General Public License,
version 2. The Arduino IDE supports the languages C and C++ using special rules of
code structuring. The Arduino IDE supplies a software library from the Wiring project,
which provides many common input and output procedures. User-written code only
requires two basic functions, for starting the sketch and the main program loop, that are
compiled and linked with a program stub main() into an executable cyclic executive

11
program with the GNU toolchain, also included with the IDE distribution. The Arduino
IDE employs the program avrdude to convert the executable code into a text file in
hexadecimal encoding that is loaded into the Arduino board by a loader program in the
board's firmware.

FIG 3.4: ARDUINO IDE

3.2.2 Fritzing

Fritzing is an open source initiative to develop amateur or hobby CAD software


for the design of electronics hardware, to support designers and artists ready to move
from experimenting with a prototype to building a more permanent circuit. It was
developed at the University of Applied Sciences of Potsdam. The software is created in
the spirit of the Processing programming language and the Arduino microcontroller and
allows a designer, artist, researcher, or hobbyist to document their Arduino-based
prototype and create a PCB layout for manufacturing. The associated website helps users
share and discuss drafts and experiences as well as to reduce manufacturing costs.

12
Fritzing can be seen as an electronic design automation (EDA) tool for non-engineers:
the input metaphor is inspired by the environment of designers (the breadboard-based
prototype), while the output is focused on accessible means of production. As of
December 2, 2014 Fritzing has made a code view option, where one can modify code
and upload it directly to an Arduino device.

FIG 3.5: FRITZING SOFTWARE

13
CHAPTER 4

CONTROLLED DIGITAL LOCK USING ARDUINO


4.1 Introduction

The proposed system consists of a digital door lock with RFID door tag. Gone
are those days when we had to use heavy mechanical locks to safeguard the door.
The new concept will open the door only when the right tag is scanned. If an
unknown tag is scanned, the door will deny access. This digital door lock system
uses Arduino Uno. We will use tags that are based on the MIFARE protocol and the
MFRC522 RFID reader. In addition to the RFID module, we will use a proximity sensor for
checking whether the door is closed or opened, a servomotor for the lock mechanism and a
character display. This lock will be of great help to prevent burglary. Moreover, these
locks will have an added advantage over heavier bulky locks as one would need the
tag to open the door otherwise, the access would be denied.

The proposed system has a lot of advantages over the traditional door lock. A
person doesn’t have carry a bunch of keys.

4.2 System Architecture

An RFID system consists of two main components, a transponder or a tag which


is located on the object that we want to be identified, and a transceiver or a reader.
The RFID reader consist of a radio frequency module, a control unit and an antenna
coil which generates high frequency electromagnetic field. On the other hand, the
tag is usually a passive component, which consist of just an antenna and an electronic
microchip, so when it gets near the electromagnetic field of the transceiver, due to
induction, a voltage is generated in its antenna coil and this voltage serves as power
for the microchip. Now as the tag is powered, it can extract the transmitted message
from the reader, and for sending message back to the reader, it uses a technique called
load manipulation. Switching on and off a load at the antenna of the tag will affect
the power consumption of the reader’s antenna which can be measured as voltage
drop. This changes in the voltage will be captured as ones and zeros and that’s the
way the data is transferred from the tag to the reader.

14
The RFID transceiver communicates with a passive tag. Passive tags have no
power source of their own and instead derive power from the incident
electromagnetic field. Commonly, at the heart of each tag is a microchip. When the
tag enters the generated RF field, it is able to draw enough power from the field to
access its internal memory and transmit its stored information. When the transponder
tag draws power in this way, the resultant interaction of the RF fields causes the
voltage at the transceiver antenna to drop in value. This effect is utilised by the tag
to communicate its information to the reader. The tag is able to control the amount
of power drawn from the field and by doing so it can modulate the voltage sensed at
the transceiver according to the bit pattern it wishes to transmit.

There’s also another way of data transfer between the reader and the tag, called
backscattered coupling. In this case, the tag uses part of the received power for
generating another electromagnetic field which will be picked up by the reader’s
antenna. So that’s the basic working principle and now let’s see how we can use
RFID with Arduino and build the RFID door lock. We will use tags that are based
on the MIFARE protocol and the MFRC522 RFID reader. These tags have 1kb of
memory and have a microchip that can do arithmetic operations. Their operating
frequency is 13.56 MHz and the operating distance is up to 10 cm depending on the
geometry of antenna. If we bring one of these tags in front of a light source we can
notice the antenna and the microchip that was previously talked about. As for the
RFID reader module, it uses the SPI protocol for communication with the Arduino
board and here’s how we need to connect them. Please note that we must connect
the VCC of the module to 3.3V and as for the other pins we don’t have to worry as
they are 5V tolerant. The RFID reader is placed on the outside of the door and it is
detached from the controller confidentially so no one can avoid the security by
breaking open the RFID reader and trying to short circuit the reader. The controller
of this project receives serial information from the RFID reader and controls the
Door lock and the LED. So, finally we can conclude that, when the person swipes
with right RFID tag, then the access control system will be will be granted. In the
same way, when the person swipes with an unauthorized RFID card, then the data
will not be loaded and access will be denied.

15
FIG 4.1: SYSTEM ARCHITECTURE

STEPS:

Step 1: The authorized user should carry the required RFID tagged cards. It consist
of flash memory which is required to enter the restricted area.

Step 2: Arduino Uno Microcontroller is used to control the operations of the


transmitter and receiver of the security system.

Step 3: The given card is brought up close to the RFID reader. Here it operates at
13.56 MHz and transfers data at the rate of 10Mb/s.

Step 4: Here the serial number present on the Tag is verified with that present on
the central server. Once the user is verified he/she is provided access to the restricted
area.

4.3 Circuit Diagram And Explanation

The RFID system consists of two components: an RFID tag and a Reader. The
RFID tag consist of integrated circuit and an antenna, integrated circuit is for the
storage of the data, and an antenna is for transmitting the data to the RFID Reader
module. Whenever the RFID tag comes in the range of RFID reader, RF signal power
the tag and then tag starts transmitting data serially. Data is further received by the
RFID reader and the reader sends it to the Arduino board. And, after that as per the
code in micro-controller different task performs.

16
In our circuit, we have already saved the value of RFID tag in the code. So,
whenever that particular tag comes in range, the relay gets activated. Here we have
connected a LED with Relay to demonstrate, but this LED can be replaced by an
Electric Door Lock, so that whenever the Relay gets activated the lock will be
opened.

If we scan any other RFID card, the buzzer will start beeping as it’s the wrong
RFID tag. Hence, for the door lock system we have used this concept that the door
will only get opened by using the right RFID tag. The relay will itself get deactivated
after 5 seconds, the door will be closed after 5 seconds, and you can change this
delay in the code.

FIG 4.2: CIRCUIT DIGRAM 1

17
FIG 4.3: CIRCUIT DIGRAM 2

4.4 Flow diagram for

FIG 4.4: FLOW DIAGRAM

FIG 4.4: FLOWCHART

18
This is the where the given user approaches the given restricted area to be granted
access. The user is expected to carry their respective RFID tags which are to be examined.
These tags contain flash memories which contain the unique serial number for each
individual user.

 Read RFID Tag:


Here the data is transferred from the given respective tag at the rates of 10Mb/s
and transmits at a bandwidth of 13.56MHz. After the complete transfer of data, it is then
exported to the Arduino Uno.

 Authentication: -
 CASE 1:

If the data extrapolated by the RFID reader does not match with that of present in
system. Authentication process is terminated and access is denied.

 CASE 2:

If the data extrapolated by the RFID reader matches with that present in the system.
Authentication process is terminated and access is granted.

 End
This brings the operation to an end where the main objective of the device is
obtained. By either granting or restricting access to restricted area.

4.4 Division of Modules


The entire project can be divided into various sub-modules. Each sub-module has
a big role to play and they help in modelling and building the project. The RFID door
lock project is being divided into three modules. Those are:

RFID tags and RFID readers identifying users

RFID tags are used to identify each and every individual users by the use of serial
numbers and powered by BAP(battery-assisted passive).These numbers are stored on
flash memories that are non-volatile in nature. They transfer these essential detail on
radio frequency at bandwidth of 13.56MHz at the rate of 10Mb/s. A radio-frequency
identification system uses tags, or labels attached to the objects to be identified. Two-

19
way radio transmitter-receivers called interrogators or readers send a signal to the tag and
read its response.

RFID tags can be either passive, active or battery-assisted passive. An active tag has
an on-board battery and periodically transmits its ID signal. A battery-assisted passive
(BAP) has a small battery on board and is activated when in the presence of an RFID
reader. A passive tag is cheaper and smaller because it has no battery; instead, the tag
uses the radio energy transmitted by the reader. However, to operate a passive tag, it must
be illuminated with a power level roughly a thousand times stronger than for signal
transmission. That makes a difference in interference and in exposure to radiation.

Tags may either be read-only, having a factory-assigned serial number that is used
as a key into a database, or may be read/write, where object-specific data can be written
into the tag by the system user. Field programmable tags may be write-once, read-
multiple; "blank" tags may be written with an electronic product code by the user. This
data is received by the RFID readers that consist of a proximity sensor, which is used to
identify the particular user therefore granting them access.

 Arduino Uno connecting all

The Arduino Uno is the nucleus of the device which is an open source
microcontroller board. It is programmable with the Arduino IDE. Here we implant
the necessary code required to operate various devices such as the LCD display,
RFID reader, servo motor etc. This is where the device makes the decision to whether
grant the user access or to restrict it from, by analysing the given input from the
RFID tags. The 14 digital input/output pins can be used as input or output pins by
using pinMode(), digitalRead() and digitalWrite() functions in arduino
programming. Each pin operate at 5V and can provide or receive a maximum of
40mA current, and has an internal pull-up resistor of 20-50 KOhms which are
disconnected by default. Out of these 14 pins, some pins have specific functions as
listed below:

 Serial Pins 0 (Rx) and 1 (Tx): Rx and Tx pins are used to receive and transmit
TTL serial data. They are connected with the corresponding ATmega328P USB to
TTL serial chip.

20
 External Interrupt Pins 2 and 3: These pins can be configured to trigger an
interrupt on a low value, a rising or falling edge, or a change in value.

 PWM Pins 3, 5, 6, 9 and 11: These pins provide an 8-bit PWM output by using
analogWrite() function.

 SPI Pins 10 (SS), 11 (MOSI), 12 (MISO) and 13 (SCK): These pins are used for
SPI communication.

 In-built LED Pin 13: This pin is connected with an built-in LED, when pin 13 is
HIGH – LED is on and when pin 13 is LOW, its off.

 Along with 14 Digital pins, there are 6 analog input pins, each of which provide
10 bits of resolution, i.e. 1024 different values. They measure from 0 to 5 volts but
this limit can be increased by using AREF pin with analog Reference() function.

 Analog pin 4 (SDA) and pin 5 (SCA) also used for TWI communication using
Wire library.

Arduino Uno has a couple of other pins as explained below:

 AREF: Used to provide reference voltage for analog inputs with


analogReference() function.

 Reset Pin: Making this pin LOW, resets the microcontroller.

The Arduino Uno has a number of facilities for communicating with a computer,
another Arduino board, or other microcontrollers. The ATmega328 provides UART
TTL (5V) serial communication, which is available on digital pins 0 (RX) and 1
(TX). An ATmega16U2 on the board channels this serial communication over USB
and appears as a virtual com port to software on the computer. The 16U2 firmware
uses the standard USB COM drivers, and no external driver is needed. However, on
Windows, a .inf file is required. The Arduino Software (IDE) includes a serial
monitor which allows simple textual data to be sent to and from the board. The RX
and TX LEDs on the board will flash when data is being transmitted via the USB-
to-serial chip and USB connection to the computer (but not for serial communication
on pins 0 and 1). A SoftwareSerial library allows serial communication on any of
the Uno's digital pins.

21
Rather than requiring a physical press of the reset button before an upload, the
Arduino Uno board is designed in a way that allows it to be reset by software running
on a connected computer. One of the hardware flow control lines (DTR) of the
ATmega8U2/16U2 is connected to the reset line of the ATmega328 via a 100
nanofarad capacitor. When this line is asserted (taken low), the reset line drops long
enough to reset the chip.

This setup has other implications. When the Uno is connected to either a computer
running Mac OS X or Linux, it resets each time a connection is made to it from
software (via USB). For the following half-second or so, the bootloader is running
on the Uno. While it is programmed to ignore malformed data (i.e. anything besides
an upload of new code), it will intercept the first few bytes of data sent to the board
after a connection is opened.

 Servo motor and LCD display

A servomotor is a rotary actuator or linear actuator that allows for precise control
of angular or linear position, velocity and acceleration. It consists of a suitable motor
coupled to a sensor for position feedback. It also requires a relatively sophisticated
controller, often a dedicated module designed specifically for use with servomotors.
Servomotors are not a specific class of motor although the term servomotor is often
used to refer to a motor suitable for use in a closed-loop control system. Servomotors
are used in applications such as robotics, CNC machinery or automated
manufacturing. A servomotor is a closed-loop servomechanism that uses position
feedback to control its motion and final position. The input to its control is a signal
(either analogue or digital) representing the position commanded for the output shaft.
The motor is paired with some type of encoder to provide position and speed
feedback. In the simplest case, only the position is measured. The measured position
of the output is compared to the command position, the external input to the
controller.

Servomotors are generally used as a high-performance alternative to the stepper


motor. Stepper motors have some inherent ability to control position, as they have

22
built-in output steps. This often allows them to be used as an open-loop position
control, without any feedback encoder, as their drive signal specifies the number of
steps of movement to rotate, but for this the controller needs to 'know' the position
of the stepper motor on power up. Therefore, on first power up, the controller will
have to activate the stepper motor and turn it to a known position, e.g. until it
activates an end limit switch. This can be observed when switching on an inkjet
printer; the controller will move the ink jet carrier to the extreme left and right to
establish the end positions. A servomotor will immediately turn to whatever angle
the controller instructs it to, regardless of the initial position at power up.

LCD (liquid crystal display) is the technology used for displays in notebook and
other smaller computers. Like light-emitting diode (LED) and gas-plasma
technologies, LCDs allow displays to be much thinner than cathode ray tube (CRT)
technology. LCDs consume much less power than LED and gas-display displays
because they work on the principle of blocking light rather than emitting it. An LCD
is made with either a passive matrix or an active matrix display display grid. The
active matrix LCD is also known as a thin film transistor (TFT) display. The passive
matrix LCD has a grid of conductors with pixels located at each intersection in the
grid. A current is sent across two conductors on the grid to control the light for any
pixel. An active matrix has a transistor located at each pixel intersection, requiring
less current to control the luminance of a pixel.

FIG 4.5: INTERFACE DIAGRAM

23
CHAPTER 5

RESULT

RFID door lock is one of the most efficient, simple, agile, economical form of
home security system. It uses the most cost-efficient tools, that perform their respective
operations without fail. It has helped home security to reached its anticipated growth.
The existing system were primitive in nature. It worked on the premises that the
durability, strength and few vulnerabilities of the given material were the best approach
to construct a given lock system. The proposed system is a lot better than the existing
system. It helps prevent burglary and other thefts. The user no longer needs to carry a
bunch of keys to open the lock. Over the past few years, RFID (Radio Frequency
Identification) technology is becoming more and more popular. RFID is a non-contact
technology that’s broadly used in many industries for tasks such as personnel tracking,
access control, supply chain management, books tracking in libraries, tollgate systems
and so on. The following graph gives a statistical idea of the increasing number of RFID
users.

FIG 5.1: RESULT GRAPH

24
The proposed system is more efficient and secure than that of the existing system.
It has led to the development of security system of the current society to its pinnacle.
This has caused a major demand in the security market, making various major jobs and
positions available for capable employees.

25
CHAPTER 6

CONCLUSION

The given project is one of the most efficient, simple, agile, economical form of
home security system. It uses the most cost-efficient tools, that perform their respective
operations without fail. The existing system were primitive in nature. It worked on the
premises that the durability, strength and few vulnerabilities of the given material were
the best approach to construct a given lock system.

Whereas our project has evolved with the times and integrated with todays technology.
The project is more acclaimed in the aspects for it being an home security system.

It can further be modified to enable AI to recognise the movement of the given user.
Which would be impossible to penetrate and with about 256-bit encryption used on the
key so that it cannot be decrypted in the required span of time.

The proposed system is more efficient and secure than that of the existing system. It has
led to the development of security system of the current society to its pinnacle. This has
caused a major demand in the security market, making various major jobs and positions
available for capable employees.

26
CHAPTER 7
APPENDIX
7.1 Code Used

#include <SPI.h>

#include <MFRC522.h>

#include <LiquidCrystal.h>

#include <Servo.h>

#define RST_PIN 9

#define SS_PIN 10

byte readCard[4];

char* myTags[100] = {};

int tagsCount = 0;

String tagID = "";

boolean successRead = false;

boolean correctTag = false;

int proximitySensor;

boolean doorOpened = false;

// Create instances

MFRC522 mfrc522(SS_PIN, RST_PIN);

LiquidCrystal lcd(2, 3, 4, 5, 6, 7); //Parameters: (rs, enable, d4, d5, d6, d7)

Servo myServo; // Servo motor

27
void setup() {

// Initiating

SPI.begin(); // SPI bus

mfrc522.PCD_Init(); // MFRC522

lcd.begin(16, 2); // LCD screen

myServo.attach(8); // Servo motor

myServo.write(10); // Initial lock position of the servo motor

// Prints the initial message

lcd.print("-No Master Tag!-");

lcd.setCursor(0, 1);

lcd.print(" SCAN NOW");

// Waits until a master card is scanned

while (!successRead) {

successRead = getID();

if ( successRead == true) {

myTags[tagsCount] = strdup(tagID.c_str()); // Sets the master tag into position 0 in the


array

lcd.clear();

lcd.setCursor(0, 0);

lcd.print("Master Tag Set!");

tagsCount++;

successRead = false;

printNormalModeMessage();

28
}

void loop() {

int proximitySensor = analogRead(A0);

// If door is closed...

if (proximitySensor > 200) {

if ( ! mfrc522.PICC_IsNewCardPresent()) { //If a new PICC placed to RFID reader


continue

return;

if ( ! mfrc522.PICC_ReadCardSerial()) { //Since a PICC placed get Serial and continue

return;

tagID = "";

// The MIFARE PICCs that we use have 4 byte UID

for ( uint8_t i = 0; i < 4; i++) { //

readCard[i] = mfrc522.uid.uidByte[i];

tagID.concat(String(mfrc522.uid.uidByte[i], HEX)); // Adds the 4 bytes in a single String


variable

tagID.toUpperCase();

mfrc522.PICC_HaltA(); // Stop reading

correctTag = false;

// Checks whether the scanned tag is the master tag

if (tagID == myTags[0]) {

lcd.clear();

29
lcd.print("Program mode:");

lcd.setCursor(0, 1);

lcd.print("Add/Remove Tag");

while (!successRead) {

successRead = getID();

if ( successRead == true) {

for (int i = 0; i < 100; i++) {

if (tagID == myTags[i]) {

myTags[i] = "";

lcd.clear();

lcd.setCursor(0, 0);

lcd.print(" Tag Removed!");

printNormalModeMessage();

return;

myTags[tagsCount] = strdup(tagID.c_str());

lcd.clear();

lcd.setCursor(0, 0);

lcd.print(" Tag Added!");

printNormalModeMessage();

tagsCount++;

return;

30
successRead = false;

// Checks whether the scanned tag is authorized

for (int i = 0; i < 100; i++) {

if (tagID == myTags[i]) {

lcd.clear();

lcd.setCursor(0, 0);

lcd.print(" Access Granted!");

myServo.write(170); // Unlocks the door

printNormalModeMessage();

correctTag = true;

if (correctTag == false) {

lcd.clear();

lcd.setCursor(0, 0);

lcd.print(" Access Denied!");

printNormalModeMessage();

// If door is open...

else {

lcd.clear();

lcd.setCursor(0, 0);

lcd.print(" Door Opened!");

while (!doorOpened) {

proximitySensor = analogRead(A0);

31
if (proximitySensor > 200) {

doorOpened = true;

doorOpened = false;

delay(500);

myServo.write(10); // Locks the door

printNormalModeMessage();

uint8_t getID() {

// Getting ready for Reading PICCs

if ( ! mfrc522.PICC_IsNewCardPresent()) { //If a new PICC placed to RFID reader


continue

return 0;

if ( ! mfrc522.PICC_ReadCardSerial()) { //Since a PICC placed get Serial and continue

return 0;

tagID = "";

for ( uint8_t i = 0; i < 4; i++) { // The MIFARE PICCs that we use have 4 byte UID

readCard[i] = mfrc522.uid.uidByte[i];

tagID.concat(String(mfrc522.uid.uidByte[i], HEX)); // Adds the 4 bytes in a single String


variable

tagID.toUpperCase();

32
mfrc522.PICC_HaltA(); // Stop reading

return 1;

void printNormalModeMessage() {

delay(1500);

lcd.clear();

lcd.print("-Access Control-");

lcd.setCursor(0, 1);

lcd.print(" Scan Your Tag!");

33
CHAPTER 8

REFERENCES
1. Somjit Nath, Paramita Banerjee, Rathindra Nath Biswas, Swarup Kumar Mitra,
Mrinal Kanti Naskar , “Arduino Based Door Unlocking System with Real Time
Control” in 2nd International Conference on Contemporary Computing and
Informatics, 2016, pp. 358-362.

2. Md. Kishwar Shafin, Kazi Lutful Kabir, Nazmul Hasan, Israt Jahan Mouri,
Samina Tasnia Islam, Lazima Ansari, Md. Mahboob Karim and Md. Afzal
Hossain, “ Development of an RFID Based Access Control System in the Context
of Bangladesh” in 2nd International Conference on Innovations in Information
Embedded and Communication Systems, 2015.

3. Yong Tae Park, Pranesh Sthapit, Jae-Young Pyun, “ Smart Digital Door Lock for
the Home Automation” in TENCON, 2009, pp. 1-6.

4. Meera Mathew, Divya R S, “Super Secure Door Lock System For Critical Zones”
in International Conference on Networks & Advances in Computational
Technologies (NetACT), 2017, pp. 242-245.

5. Meera Mathew, Divya R S, “Survey on Various Door Lock Access Control


Mechanisms” in International Conference on circuits Power and Computing
Technologies [ICCPCT], 2017.

6. Madhusudhan M and Shankaraiah, “Implementation of automated door


unlocking and security system,” International Journal of Computer Applications,
2015, pp. 5-8.

34

Você também pode gostar