You are on page 1of 27

RFID and Wi-Fi based Home Automation

CSE3001 – Software Engineering

PROJECT BASED COMPONENT REPORT

By
Ojashwi Paudel(19BCE2552)
Samyogita Bhandari(19BCE2537)
Aravindaan S(19BCE0144)

School of Computer Science and Engineering

June 2021
DECLARATION

I hereby declare that the report entitle RFID and Wi-Fi based Home Automation
submitted by me, for the CSE3001 Software Engineering (EPJ) to VIT is a record of bonafide
work carried out by me under the supervision of Prof Vengadeswaran S.

I further declare that the work reported in this report has not been submitted and will not be
submitted, either in part or in full, for any other courses in this institute or any other institute or
university.

Place: VIT,Vellore Aravindaan S


Date: June 6, 2021 Signature of the candidate
Title Pg. No.
1) Abstract 4

2) Introduction to the project 5


a) Objective
b) Motivation
c) Project Scope

3) Project Description and Goals 6


a) Work Breakdown Structure
b) Process Model
c) Software Requirement Specification
i) Functional Requirements
ii) Non-Functional requirements
iii) System and Domain requirements

4) Module Descriptions 13

5) User Interface Design 14

6) Test Cases 15

7) Software Metrics 16

8) Conclusion 17

9) Appendix 18
1. ABSTRACT

Radio-Frequency Identification is the most important area of the future, and it is gaining a lot of
attention from the scientific world and businesses. RFID-based door access control and home
automation using NodeMCU is built in this project. We utilized an RFID ID tag and RFID reader
to compare the data on the tag with the data in the database software, allowing the door to move
by validating whether the data is right or erroneous. The door is opened by a servo motor that is
powered by a NodeMCU. The Arduino answer sets a flag, which is used to open and close the
door. The door opens when the flag is set to 1, and it remains closed when the flag is set to 0. The
Arduino board also controls the LED that is based on the feed. RFID, or Radio Frequency
Identification, is a cutting-edge technology that may be applied to improve the route control
framework. It allows for robotization in a variety of processes ranging from mechanical parts to
home automation. RFID technology will aid us in building a door access control framework that
will allow authorized academics to move through constrained zones. An RFID tag is a credit-card-
sized smooth card that is read by an RFID reader. NodeMCU is an open source IoT platform with
a cheap cost. It came with firmware that ran on Espressif Systems' ESP8266 Wi-Fi SoC and
hardware that was based on the ESP-12 module. It operates at 125 kHz and has a unique 32-bit
ID. Each tag usually has a unique ID number that cannot be modified. We can use software to
determine its unique ID. When we see sophisticated door management system(s), we instantly
think of the price tag, as well as the functionality. Such automated systems are not inexpensive in
developing nations like India. As a result, we decided to build a basic and inexpensive prototype
to investigate if such a robust system could be built using our preferred tool, the NodeMCU Uno.
2. INTRODUCTION TO PROJECT

2.1 OBJECTIVE
The goal of this project is to eliminate the manual lock and key security system because it
offers very little safety. This initiative will transform everyone's lives by making the procedure
more user-friendly and enhancing security measures. The product will be an RFID-enabled
door lock.

Features include:

● Door unlock using RFID TAGs.

● Door unlock using android app.

● Door unlock using Google assistant (Voice recognition).

● Monitor/control temperature of room using android app.

2.2 MOTIVATION
In a near future much more devices will be directly connected and accessible over the internet. A
number of technologies to interact with these devices will be implemented to form a heterogeneous
landscape of access technologies. As an example, a high density of RFID readers will be
networked. These can be used to interrogate RFID tags attached to objects and carried by people
moving in the environment. To achieve a ubiquitous computing experience, the RFID reader of
the future must evolve from its current closed-loop applications to an open-loop application
scenario. This requires a novel reader architecture to be designed. For the first time we
demonstrate a RFID-based access control system with home automation.
2.3 PROJECT SCOPE

So, initially, we will need to connect the RFID sensor to the NodeMCU esp8266 Wi-Fi module,
and then we will need to enter the user's RFID tag information. After that we
connect the microcontroller to the computer.
An online database that may be used to store data as well as be accessed via an Android app.
For the home automation module, DHT11 sensor is connect to NodeMCU which measures the
temperature and stores it to database. Just like door access control, monitoring and controlling
is facilitated by android app.

The only disadvantage is that, since its all-digital information, it is a bit easy to bypass since
the level of encryption is not very high. There are room for certain malpractices.
3. PROJECT DESCRIPTION AND GOALS

3.1 WORKBREAK DOWN STRUCTURE


3.2 PROCESS MODEL

Fig: Waterfall Model


The Waterfall Model was chosen as the process model for our project. Waterfalls rely on groups
of people following a set of steps and not moving forward until the previous level is completed.
This style is ideal for modest projects such as ours. Expectations that are easy to categorize right
from the start. If needs are established, well documented, and explicit, waterfall may be an
effective and predictable strategy. Since the technology we employed in our project is
straightforward, transparent, and understandable, and because our project focuses on a specified
set of actions. As a result, the Waterfall Model is the best option. If needs are defined, well
documented, and explicit, waterfall may be a productive and reliable method. Because the
technology we employed in our project is straightforward, transparent, and

understandable, as well as the fact that our project focuses on a specified set of actions. As a result,
the Waterfall Model is ideal. Costs and deadlines are also known at the beginning of the project.
As a result, it's an excellent model for our RFID-based automatic door system project. However,
when an application is in the testing stage, difficulties may develop. It's quite tough to fix anything
that was poorly thought out at the idea stage.
3.3 SOFTWARE REQUIREMENT SPECIFICATIONS

3.1 Functional Requirements

3.1.1 Door unlock using RFID TAGs:

This is a general functionality to ensure the security of the software that it is accessed through
authentic person only. Once the user RFID tag is scanned, the user can enter the room after
validation.

REQ-1:

Input: The user must scan his/her RFID tag.

Output:

> If the user is a valid user, the door is unlocked.

> If the user is not a valid user, the security alarm goes off.

Processing: Validates the user RFID tag and after validation, the door is unlocked.

3.1.2 Door unlock using android app:

This is another functionality to unlock the door if the users’ RFID tag is not with him/her. The user
login credentials are entered into the app. Then, for valid users, after successful authentication, the
door is unlocked.
REQ-1:

Input: The user must login through the app.

Output: After verification, the door is unlocked

Processing: Validates the user app login and after validation, the door is unlocked.

3.1.3 Door unlock using Google assistant (Voice recognition):

If the user does not have their RFID tag or the app is not accessible, the user can enter the system
through voice recognition. The user opens Google assistant and tells it to unlock the door. If the
voice is a registered voice in the system, the door is unlocked.

REQ-1:

Input: The user tells the Google assistant to open the door.

Output: If the voice is a registered voice, the door is unlocked. The user’s voice is searched in the
database and after voice validation, the door is unlocked.

Processing: The user’s voice is searched in the database and after voice validation, the door is
unlocked.
3.2 External Interface Requirements

3.2.1 User
They can access the system whenever they want if they are registered users.

REQ-1:

Input: The user must have either RFID tag, app login or a voice registered in the database.

Output:

> If the user is a valid user, the door is unlocked.

> If the user is not a valid user, the security alarm goes off.

Processing: Validates the user and after validation, the door is unlocked.

3.2.2 Software

While working with the RC522 RFID sensor, the SPI, MFRC522, Servo, LiquidCrystal_I2C
libraries must be installed in the Uno IDE. Also, UID of master cards is required.

REQ-1:

Input: Get the UID of master cards.

Output: Gives the permission to access the resource.

3.3 Non-functional Requirements

3.3.1 Performance Requirements

1. Valid users are immediately able to enter the system.

2. If any unregistered member tries to login, the system will not allow the access and the security
alarm is turned on.
3.3.2 Safety Requirements

If there is extensive damage to a wide portion of the database due to catastrophic failure, such as
a disk crash, the recovery method restores a past copy of the database that was backed up to
archival storage (typically tape) and reconstructs a more current state by reapplying or redoing the
operations of committed transactions from the backed-up log, up to the time of failure.

3.3.3 Security Requirements

The user is only allowed in the system when they scan their RFID tags or by entering the system
through the app. They can also enter through voice recognition if their voice is registered. If anyone
else who is not a valid user tries to enter the system, the security alarm is turned on and access is
denied.

3.3.4 Reliability Requirements

The system will work perfectly fine for the valid users. However, if some invalid users have access
to the stolen RFID tags or login credentials of the authenticated users, unwanted access might
occur.

3.4 Other Requirements


For the system we will be using an online database system. The project can be built and be made
into a more secure system by upgrading the hardware.
SOFTWARE DESIGN DOCUMENT

System design and Detailed design

USE CASE DIAGRAM

ER DIAGRAM
LEVEL 1 DFD

LEVEL 2 DFD
STATE CHART DIAGRAM

4. Module Descriptions
1) Temperature module – Nodemcu esp8266 coded with Arduino IDE + Android app. The
functionalities under temperature module includes monitoring and changing the temperature
of the room. AC and heater is turned on automatically if temperature is above 95 degrees and
less than 75 degrees respectively. The manipulation can be performed using android app too.
2) Database module – Online database used in our project is Google Firebase (Real-time
Database). Only the admin has the authority to access this module. All the activities of the user
are recorded for both temperature and rfid module. This module acts as the interface between
hardware component and software components for our project.
3) Rfid Module – Nodemcu esp8266 coded with Arduino IDE IDE + Android app. Admin
generates the login credentials for the user then only the user can access the rfid module. The
functionalities of this module can be performed by both user and admin which includes
unlocking and locking the door via RFID tag, Google assistant voice recognition or by
manually using android app.
4) Android Module – Android app

Here we have implemented an android app using xml and java which works as the GUI
interface for our entire project
5. User Interface Design
Landing Screen Door Control Screen

Temperature Control Screen


6. Test Cases
 Wrong Rfid

Correct RFID
7. SOFTWARE METRICS

According to the COCOMO model, our project falls under the category
of Organic complexity. Therefore, the values are:
a=2.4
b=1.05
c=2.5
d=0.38
Effort = a(KLOC)b

Effort = 2.4*(807/1000)1.05

Effort = 1.92 Person-Months (Approx.)


Time = c (Effort) d
Time = 2.5 *(1.92) 0.38
Time = 3.2 Months (Approx.)
8. CONCLUSION
In this project we have implemented a digital security system contains door lock system
using passive RFID. The door locking system functions in real time as when the user put
the tag in contact with the reader, the door open and the check-in information is stored in
online database along with basic information of the users. We utilize RFID technology to
provide solution for secure access of a space while keeping record of the user. Also, we
have designed an app that lets the user enter the system by entering the login credentials or
using voice recognition. In addition to this, we have added a feature which enables the user
to control the temperature of their room through DHT11 sensor or if manually according
to the users’ convenience.
9. Appendix

Screenshots
Source Codes
RFID CODE

#include <SPI.h>#include <MFRC522.h>#include <Ethernet.h>#include <BlynkSimpleEsp


8266.h>#include <ESP8266WiFi.h>#include <Firebase.h>#include <FirebaseArduino.h>#
include <FirebaseCloudMessaging.h>#include <FirebaseError.h>#include <FirebaseHtt
pClient.h>#include <FirebaseObject.h>#define SS_PIN 2 #define RST_PIN 0 #define b
uzzer 4 #define led 5 // Set these to run example.
#define FIREBASE_HOST "nodemcu-test-b3159-default-rtdb.firebaseio.com"
#define FIREBASE_AUTH "89O0PzUSc0vghjgrkhzcPTOHc3iN3AZaUjRIVzyh"
#define WIFI_SSID "Act_Aravindaan"
#define WIFI_PASSWORD "aravi@123"
#define BLYNK_PRINT Serial char auth[]="_K_cl_ogJxVBP6uaoai_tbXL8lb_hp3N";

MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance.

void setup() {

pinMode(buzzer, OUTPUT);
pinMode(led, OUTPUT);
WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
Serial.print("Connecting to ");
Serial.print(WIFI_SSID);

while (WiFi.status() !=WL_CONNECTED) {


Serial.print(".");
delay(500);
}

Serial.println();
Serial.print("Connected to ");
Serial.println(WIFI_SSID);
Serial.print("IP Address is : ");
Serial.println(WiFi.localIP());
pinMode(LED_BUILTIN, OUTPUT);
Serial.begin(9600); // Initiate a serial communication
digitalWrite(LED_BUILTIN, LOW);
SPI.begin(); // Initiate SPI bus
mfrc522.PCD_Init(); // Initiate MFRC522
Serial.println("Approximate your card to the reader...");
Serial.println();
Firebase.begin(FIREBASE_HOST, FIREBASE_AUTH);
Firebase.setString("Door Status/Door Status", "");
Blynk.begin(auth, WIFI_SSID, WIFI_PASSWORD);

void loop() {
Blynk.run();

if (Firebase.failed()) {
Serial.print("setting /number failed:");
Serial.println(Firebase.error());
return;
}

// Look for new cards


if ( ! mfrc522.PICC_IsNewCardPresent()) {
return;
}

// Select one of the cards


if ( ! mfrc522.PICC_ReadCardSerial()) {
return;
}

//Show UID on serial monitor


Serial.print("UID tag :");
String content="";
byte letter;

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


Serial.print(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " ");
Serial.print(mfrc522.uid.uidByte[i], HEX);
content.concat(String(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " "));
content.concat(String(mfrc522.uid.uidByte[i], HEX));
}

Serial.println();
Serial.print("Message : ");
content.toUpperCase();
if (content.substring(1)=="A9 F7 89 6D") //change here the UID of the card/ca
rds that you want to give access

{
Serial.println("Authorized access");
Firebase.setString("Door Status/Door Status", "Access Granted");
digitalWrite(buzzer, LOW);
digitalWrite(led, HIGH);
delay(2000);
digitalWrite(led, LOW);
Serial.println();
delay(3000);
}

else {
Serial.println(" Access denied");
Firebase.setString("Door Status/Door Status", "Access Denied");
digitalWrite(led, LOW);
digitalWrite(buzzer, HIGH);
delay(500);
digitalWrite(buzzer, LOW);
delay(500);
digitalWrite(buzzer, HIGH);
delay(500);
digitalWrite(buzzer, LOW);
delay(500);
digitalWrite(buzzer, HIGH);
delay(500);
digitalWrite(buzzer, LOW);
delay(1000);
}
}
DHT 11 CODE
#include <ESP8266WiFi.h> //esp8266 library

#include <FirebaseArduino.h> //firebase library


#include <DHT.h> // dht11 temperature and humidity sensor library
#define FIREBASE_HOST "nodemcu-test-b3159-default-
rtdb.firebaseio.com" // the project name address from firebase id
#define FIREBASE_AUTH "89O0PzUSc0vghjgrkhzcPTOHc3iN3AZaUjRIVzyh" // the secret ke
y generated from firebase

#define WIFI_SSID "Act_Aravindaan" // wifi name


#define WIFI_PASSWORD "aravi@123" //password of wifi

#define DHTPIN 2 //D4


#define DHTTYPE DHT11 #define greenLed 5 //D1
#define redLed 4 //D2

String redStatus,
greenStatus;

DHT dht(DHTPIN, DHTTYPE);

void setup() {
pinMode(greenLed, OUTPUT);
pinMode(redLed, OUTPUT);
Serial.begin(9600);
delay(1000);
WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
Serial.print("Connecting to ");
Serial.print(WIFI_SSID);

while (WiFi.status() !=WL_CONNECTED) {


Serial.print(".");
delay(500);
}

Serial.println();
Serial.print("Connected to ");
Serial.println(WIFI_SSID);
Serial.print("IP Address is : ");
Serial.println(WiFi.localIP()); //print local IP address
Firebase.begin(FIREBASE_HOST, FIREBASE_AUTH); // connect to firebase
dht.begin(); //Start reading dht sensor
Firebase.setString("Fahrenheit/Fahrenheit", "");
Firebase.setString("Celsius/Celsius", "");
Firebase.setString("Humidity/Humidity", "");
Firebase.setString("greenLed", "off");
Firebase.setString("redLed", "off");

void loop() {
float h=dht.readHumidity(); // Reading temperature or humidity
float t=dht.readTemperature(); // Read temperature as Celsius (the default)
float c;

if (isnan(h) || isnan(t)) {
// Check if any reads failed and exit early (to try again).
Serial.println(F("Failed to read from DHT sensor!"));
return;
}

Serial.print("Humidity: ");
Serial.print(h);
String fireHumid=String(h)+String("%"); //convert integer humidity to string
humidity
Serial.print("% Temperature: ");
Serial.print(t);
Serial.println("°C ");
String fireTemp=String(t)+String("°C"); //convert integer temperature to stri
ng temperature
c=(t * 1.8)+32;
String fireC=String(c);

Firebase.setString("Fahrenheit/Fahrenheit", fireC); //setup path and send rea


dings
Firebase.setString("Humidity/Humidity", fireHumid); //setup path and send rea
dings
Firebase.setString("Celsius/Celsius", fireTemp);

redStatus=Firebase.getString("redLed/redLed");
greenStatus=Firebase.getString("greenLed/greenLed");

if(greenStatus=="on") {
digitalWrite(greenLed, HIGH);
}

else if(redStatus=="on") {
digitalWrite(redLed, HIGH);

else if(greenStatus=="off"&& redStatus=="off") {


digitalWrite(greenLed, LOW);
digitalWrite(redLed, LOW);
}

delay(4000);
}

You might also like