Chahat Iot 8
Chahat Iot 8
COMPUTERSCIENCE&ENGINEERING
Experiment 8
2. Objective: To design a smart door lock system using RFID and Arduino Uno to enhance security by
restricting unauthorized access.
3. Input/Equipment Used:
a) Arduino Uno
b) RFID
c) LCD I2C module
d) Servomotor
e) Door lock
f) Jumper Wires
4. Procedure:
a) Connect the RFID module, LCD display with I2C module, and servo motor to the Arduino Uno
using male-to-female jumper wires.
b) Install the Arduino IDE on your computer if not already installed.
c) Install the required libraries, such as MFRC522 for RFID and LiquidCrystal_I2C for the LCD, in
the Arduino IDE.
d) Write the Arduino code in the IDE to control the door lock system. This should include reading
the RFID card, displaying messages on the LCD, and controlling the servo motor to lock/unlock
the door.
e) Connect the Arduino to your computer using a USB cable.
f) Select the correct board and port in the Arduino IDE, then upload the code to the Arduino.
g) Open the Serial Monitor in the Arduino IDE (if needed) to view RFID data or system status
messages.
DEPARTMENT OF
COMPUTERSCIENCE&ENGINEERING
5. Connections:
a) Connect the VCC pin of the RFID module to the 3.3V pin on the Arduino.
b) Connect the GND pin of the RFID module to one of the GND pins on the Arduino.
c) Connect the SDA pin of the RFID module to digital pin 10 on the Arduino (or as specified in
your code).
d) Connect the SCK pin of the RFID module to digital pin 13 on the Arduino.
e) Connect the MOSI pin of the RFID module to digital pin 11 on the Arduino.
f) Connect the MISO pin of the RFID module to digital pin 12 on the Arduino.
g) Connect the RST pin of the RFID module to digital pin 9 on the Arduino.
Fig-1: Conduct
DEPARTMENT OF
COMPUTERSCIENCE&ENGINEERING
6. CODE:
#include <SPI.h>
#include <MFRC522.h>
#define SS_PIN 10
#define RST_PIN 9
byte readCard[4];
void setup() {
Serial.begin(9600);
SPI.begin();
mfrc522.PCD_Init();
delay(4);
mfrc522.PCD_DumpVersionToSerial();
void loop() {
while (getID()) {
if (tagID == MasterTag) {
Serial.println("Access Granted!");
} else {
Serial.println("Access Denied!");
DEPARTMENT OF
COMPUTERSCIENCE&ENGINEERING
}
delay(2000);
boolean getID() {
if (!mfrc522.PICC_IsNewCardPresent()) {
return false;
if (!mfrc522.PICC_ReadCardSerial()) {
return false;
tagID = "";
tagID.concat(String(mfrc522.uid.uidByte[i], HEX));
tagID.toUpperCase();
return true;
}
DEPARTMENT OF
COMPUTERSCIENCE&ENGINEERING
7. Result:
8. Conclusion:
The setup successfully demonstrates a smart door lock system using RFID technology to control
access. By employing an Arduino Uno and an RFID module, the system effectively verifies user
credentials and grants or denies access accordingly. This implementation enhances security by
preventing unauthorized entry, making it suitable for various applications, such as homes, offices, and
secure facilities. Future enhancements could include integrating IoT capabilities for remote monitoring
and control, allowing users to manage access in real time and receive alerts for unauthorized attempts.
9. Learning Outcomes
a) Gain knowledge of how RFID technology works, including the principles of contactless
communication and data transmission.
b) Develop programming skills in Arduino, focusing on using libraries to interface with external
components like RFID readers.
c) Learn how to design and integrate circuits involving multiple components, such as the RFID
module and actuators, using Arduino.
d) Recognize the practical applications of RFID technology in everyday life, such as security systems,
inventory management, and access control.