0% found this document useful (0 votes)
26 views5 pages

Smart RFID Door Lock System Lab Report

Uploaded by

faizan
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views5 pages

Smart RFID Door Lock System Lab Report

Uploaded by

faizan
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

DEPARTMENT OF

COMPUTER SCIENCE & ENGINEERING

Experiment 8

Student Name: Abhigyan Singh UID: 22BCS14340


Branch: BE CSE Section/Group: 22BCS_IOT_ FL_602 ‘A’
Semester: 5th Date of Performance: 19-09-24
Subject Name: IOT architecture & protocols lab Subject Code: 22CSP-329

1. Aim:
To create a smart door lock system using RFID

2. Objectives:
• Learn about IoT based simulations.
• Testing and model in IoT based simulation platform.

3. Software/Components Used:

▪ Arduino Uno
▪ RFID
▪ LCD
▪ I2C module
▪ Servomotor
▪ Door lock
▪ Jumper Wires

Arduino:
It is an open-source electronics platform. It consists ATmega328 8-bit Micro controller. It can be able to
read inputs from different sensors & we can send instructions to the micro controller in the Arduino. It
provides Arduino IDE to write code & connect the hardware devices like Arduino boards & sensors.

4. Procedure:

▪ Connect RFID reader (SDA to pin 10, RST to pin 9, SPI pins).
▪ Connect LCD with I2C module (SDA to A4, SCL to A5).
▪ Connect servomotor (signal wire to pin 8).
▪ Power components (5V and GND to Arduino).
▪ Upload the code to Arduino.
▪ Test the system with RFID cards Connect the MQ135 sensor to the Arduino Uno using male-to-
female jumper wires.
DEPARTMENT OF
COMPUTER SCIENCE & ENGINEERING
5. CODE:
#include <SPI.h>
#include <Servo.h>
#include <LiquidCrystal.h>
#include <RFID.h>
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);
Servo myservo; // Servo object for controlling the door
#define val0 117 // Token value for user 1 #define val1 134 // Token value for user 2 int pos = 0;
#define SDA_DIO 10
#define RESET_DIO 9
RFID RC522(SDA_DIO, RESET_DIO);
void setup()
{ [Link](8);
[Link](9600);
[Link]();
[Link](); // Initialize RFID reader
[Link](16, 2);
}
void loop() {
byte i = 0; intID; if ([Link]()) {
[Link]
ardSerial();
[Link]([Link][i], DEC);
[Link]("Card detected:");
ID = [Link][0];
}
User 1
if (val0 == ID) {
[Link]();
[Link]("Access
Granted");
[Link](0, 1);

[Link]("Welcome Haris");
delay(1800); [Link]();
[Link]("Door
Opening"); delay(1500); for (pos = 0;
pos <= 180; pos++) { [Link](pos);
// Rotate servo toopen door delay(15);
} delay(5000); [Link](); [Link]("Door
Closing"); delay(1500); for (pos = 180;
pos >= 0; pos--) { [Link](pos); //
Rotate servo to close door delay(15);
DEPARTMENT OF
COMPUTER SCIENCE & ENGINEERING
} } else if (val1
== ID) {
[Link]();
[Link]("Access
Granted");
[Link](0, 1);
[Link]("Welcome
Bilal"); delay(1800);
[Link]();
[Link]("Door
Opening");
delay(1500); for (pos =0;
pos <= 180; pos++)
{ [Link](pos);
delay(15);
} delay(5000);
[Link]();
[Link]("Door
Closing");
delay(1500);
for (pos = 180; pos >= 0; pos--) {
[Link](pos);
delay(15);
}}else{
[Link]();
[Link]("DoorSecurity "); [Link](0,1);
[Link]("System");
}
}

// ABHIGYAN SINGH 22BCS14340

6. Connections:

Servo Motor Arduino

VCC pin 5V
GND pin GND

Control Signal Pin 8

Connections of Servomotor with Arduino


DEPARTMENT OF
COMPUTER SCIENCE & ENGINEERING

RC522 RFID Reader Module Arduino


VCC 3.3V
RST Pin 9
GND GND
IRQ Not connected
MISO Pin 12
MOSI Pin 11
SCK Pin 13
SDA Pin 10

Connections of RC522 Module with Arduino

16×2 LCD Arduino


D4 – D7 Pin 5,4,3,2
Enable Pin 6
RS Pin 7
RW GND
VEE 10k POT (Middle Leg)
VSS GND
VCC +5V
LED+ +5V
LED- GND

Arduino connections with 16×2 LCD

7. Result:
DEPARTMENT OF
COMPUTER SCIENCE & ENGINEERING

8. Conclusion:
By following the setup procedure, the Arduino Uno is ready for programming and communication with
the motor for various projects and experiments. A smart door lock system using RFID offers a secure,
efficient, and modern solution for access control. By integrating an RFID reader with a microcontroller like
Arduino, users can unlock doors by simply tapping authorized RFID cards or tags. The system uses a relay
module to activate an electronic lock, ensuring that access is only granted to approved individuals. This
technology eliminates the need for traditional keys, reducing the risk of unauthorized entry or lost keys..

Common questions

Powered by AI

Challenges when connecting multiple components such as RFID readers, LCDs, and servomotors to an Arduino Uno include power limitations, pin conflicts, and signal interference. To mitigate these, proper power distribution must be ensured; the Arduino should be powered sufficiently to support all connected devices. Pin conflicts can be resolved by carefully selecting non-conflicting pins and using I2C or SPI interfaces to minimize the number of pins used. Additionally, ensuring good quality connections and shielding cables can help alleviate signal interference issues. These measures collectively ensure stable and efficient operation of the integrated system .

The primary components of the smart door lock system are the Arduino Uno, RFID reader, LCD display, I2C module, and servomotor. The Arduino Uno acts as the central controller, processing inputs and sending commands. The RFID reader detects RFID cards to verify access. The LCD display shows visual messages like access confirmation. The I2C module facilitates communication between the LCD and Arduino with fewer connections. The servomotor is responsible for physically locking and unlocking the door by rotating to predetermined angles based on access granted or denied .

The IoT-based smart door lock system can be improved to address potential security vulnerabilities by implementing stronger encryption algorithms for data transmitted between the RFID reader and the Arduino to prevent interception or unauthorized access. Adding fingerprint scanning or facial recognition as secondary authentication methods can enhance security. Regularly updating firmware and using secure networking protocols can protect against cyber threats. Additionally, integrating a tamper alert system to notify users of unauthorized attempts can further secure the system .

A servomotor is beneficial in an IoT-based smart door lock system due to its precise control of angular position, which is essential for the accurate opening and closing of the lock mechanism. It can be controlled by a microcontroller like Arduino to rotate to specific angles, enabling reliable locking and unlocking processes. The use of a servomotor ensures that the door is properly secured and can be consistently operated with minimal error, contributing to the system's overall reliability .

The LCD module enhances the usability of the smart door lock system by providing real-time feedback to users. It displays messages such as "Access Granted" or "Access Denied," which are crucial for informing users about the status of their access attempt. It can also show welcome messages or errors, aiding in troubleshooting and user interaction. This visual interface simplifies the user experience, making the system intuitive and ensuring that users understand the outcome of their RFID card swipes instantly .

The practical implications of using an RFID-based smart lock system for security in residential or commercial buildings include increased access control efficiency and reduced dependency on physical keys, which can be lost or copied. Such systems offer controlled access by allowing only those with authorized RFID cards to enter. This enhances security by logging access attempts and integrating with other security systems for monitoring and management. Additionally, they can be updated remotely to revoke or grant access, offering flexibility in managing entry, which is particularly useful in dynamic environments like offices or large apartment complexes .

The setup procedure of the smart door lock system ensures successful implementation by detailing precise connections and programming steps required for integrating the RFID reader, LCD, and servomotor with the Arduino. By connecting components correctly and uploading the specific code designed for access control, the system is prepared to function as intended. Testing with RFID cards during setup allows verification of the system's responsiveness and reliability, ensuring that the door operation matches the access control logic programmed into the Arduino .

Integrating an RFID reader with an Arduino microcontroller allows for secure and efficient access control in a smart door lock system. The RFID reader detects and reads RFID cards, which have been pre-authorized, and sends the information to the Arduino. The Arduino, programmed with specific code, processes this information, checks against authorized IDs, and operates the servomotor to unlock or lock the door. This system eliminates the need for traditional keys, reducing the risk of unauthorized entry or loss of keys .

The Arduino IDE plays a crucial role in the development and implementation of the smart door lock system by providing a user-friendly platform for coding and uploading programs to the Arduino Uno. It allows developers to write, compile, and upload code easily, enabling seamless communication between the Arduino and the connected components like the RFID reader, LCD, and servomotor. The IDE supports the use of libraries (e.g., SPI, Servo, and LiquidCrystal) which simplify complex operations like handling RFID signals or controlling a servomotor. This functionality is essential for creating and debugging the code, ensuring the system operates as intended .

In the smart door lock system, RFID card values are pre-assigned unique identifiers that are compared against stored authorized IDs within the Arduino code. When a card is detected by the RFID reader, its ID is checked against these pre-set values, and if a match is found, access is granted by operating the servomotor to unlock the door. Coding strategies to ensure secure access management include using conditional statements to validate IDs, storing encrypted or hashed ID values in the Arduino to prevent tampering, and implementing regular updates to the authorized ID list to maintain security integrity .

You might also like