0% found this document useful (0 votes)
25 views4 pages

Iot 8

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)
25 views4 pages

Iot 8

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
You are on page 1/ 4

Experiment - 8

Student Name: Sahil Singh UID: 23BCS80031


Branch: CSE Section/Group: 610/B
Semester: 5th Date of Performance: 14/10/2024
Subject Name: Internet of Thing (IOT) Subject Code: 22CSP-329

Aim: To Create a Smart door lock system using RFID.

Objective: To develop a secure and efficient smart door lock system using RFID
technology, enabling authorized access through contactless RFID cards or tags,
enhancing security and convenience for residential or commercial applications.

Input/Apparatus Used:

1. 1 × Arduino Uno R3
2. 4 × Jumper Wires
3. 1 x RFID Sensor

Procedure:

• Set up the Microcontroller.


• Libraries for the RFID module.
• Program the Microcontroller.
• Assemble the Hardware.
• Test the System.

Department of Computer Science & Engineering 1


Connections: This is the Circuit connection for the Smart door lock system by using Arduino.

• RFID Reader to Microcontroller.


• Microcontroller to Relay Module.
• Relay Module to Electronic Door Lock.

Fig 1.1 – Connections required to make a Smart door lock system.

CODE:

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

#define SS_PIN 10
#define RST_PIN 9
#define RELAY_PIN 8

MFRC522 mfrc522(SS_PIN, RST_PIN);

void setup() {
Serial.begin(9600);
SPI.begin();
mfrc522.PCD_Init();
pinMode(RELAY_PIN, OUTPUT);

Department of Computer Science & Engineering 2


digitalWrite(RELAY_PIN, LOW); // Initially lock is engaged
Serial.println("Place your card on the reader...");
}

void loop() {
if (!mfrc522.PICC_IsNewCardPresent() || !mfrc522.PICC_ReadCardSerial()) {
return;
}

String uid = "";


for (byte i = 0; i < mfrc522.uid.size; i++) {
uid += String(mfrc522.uid.uidByte[i], HEX);
}

Serial.print("UID: ");
Serial.println(uid);

if (uid == "YOUR_CARD_UID") { // Replace YOUR_CARD_UID with your tag's UID


Serial.println("Access Granted!");
digitalWrite(RELAY_PIN, HIGH); // Unlock
delay(5000); // Keep the door unlocked for 5 seconds
digitalWrite(RELAY_PIN, LOW); // Lock again
} else {
Serial.println("Access Denied");
}

mfrc522.PICC_HaltA();
}

Department of Computer Science & Engineering 3


Result:

Fig 1.2 – Using RFID Sensor for sensing the Locking System.

Conclusion:

In conclusion, creating a smart door lock system using RFID technology provides a secure, convenient,
and efficient solution for controlling access. By utilizing RFID tags and readers, the system can identify
authorized users and unlock the door automatically, eliminating the need for traditional keys.
Additionally, the system can be enhanced with features such as real-time access logs, remote
management, and integration with other smart home devices, further enhancing security and user
experience. This project demonstrates the potential of RFID technology in modern security applications
and serves as a practical approach to smart home automation.

Department of Computer Science & Engineering 4

You might also like