Professional Documents
Culture Documents
By
Ojashwi Paudel(19BCE2552)
Samyogita Bhandari(19BCE2537)
Aravindaan S(19BCE0144)
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.
4) Module Descriptions 13
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:
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
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
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:
Output:
> 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.
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:
Processing: Validates the user app login and after validation, the door is unlocked.
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 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:
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.
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.
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.
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
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
Screenshots
Source Codes
RFID CODE
void setup() {
pinMode(buzzer, OUTPUT);
pinMode(led, OUTPUT);
WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
Serial.print("Connecting to ");
Serial.print(WIFI_SSID);
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;
}
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
String redStatus,
greenStatus;
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);
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);
redStatus=Firebase.getString("redLed/redLed");
greenStatus=Firebase.getString("greenLed/greenLed");
if(greenStatus=="on") {
digitalWrite(greenLed, HIGH);
}
else if(redStatus=="on") {
digitalWrite(redLed, HIGH);
delay(4000);
}