Lab 4 Vault
Lab 4 Vault
Laboratory Activity 3
Arduino-Controlled RFID-Based Smart Door Lock with LED and Buzzer Feedback
Submitted by:
Miro G. Angeles
Deen Reiner B. Crusem
Julius Caezar R. Eugenio
BS CPE 4-1
Submitted to:
Prof. Aileen V. Rocillo
November 2024
Laboratory Activity 3
Arduino-Controlled RFID-Based Smart Door Lock with LED and Buzzer Feedback
OBJECTIVES
At the end of the experiment, the students should be able to:
1. Implement an RFID-based security system for access control.
2. Understand the process of configuring RFID tags for secure access.
3. Control the behavior of a servo motor, LED indicators, and a buzzer based on RFID
tag authorization status.
Introduction
Together, the elements of this RFID-based security system provide a smooth and effective
access control system. The RFID reader serves as the main sensor in this configuration,
continuously searching for RFID tags placed close to the door and sending the Arduino
microcontroller the unique tag data. The Arduino serves as the processing center and is
configured to compare the received tag data with a list of pre-authorized tags that is kept in
its memory. The Arduino signals a servo motor to turn, unlocking the door and permitting
admission if a match is detected, signaling an approved tag. Additionally, a green LED
illuminates to verify access, giving the user unambiguous visual confirmation. To notify those
in the vicinity of a restricted access attempt, the system instantly turns on a siren and a red
LED if an unauthorized tag is found. By quickly alerting unwanted access attempts, this dual-
response technology improves overall security while simultaneously expediting entrance for
authorized users. Real-time feedback and automation are combined in this system to offer a
reliable, approachable method of safe access control.
CIRCUIT DIAGRAM
Figure 1. Wiring Diagram of the Security Door Lock System
An RFID module (R1), a servo motor (M1), a buzzer (B1), and two LEDs (LED1 for green
and LED2 for red) are all controlled by an Arduino Uno (U2) in this circuit schematic design.
The servo motor is attached to pin 5 (SERVO_PIN) to control the locking mechanism, and
the RFID module connects to the Arduino via the SDA (10) and RST (9) pins. The LEDs are
attached to pins 4 (LED_PIN) and 3 (RED_LED_PIN) to offer visual feedback for access
being allowed or denied, and the buzzer is connected to pin 6 (BUZZER_PIN) to sound an
alert. The Arduino serves as the main controller, processing the RFID tag data and
controlling the door mechanism in accordance with it. All of the components are powered by
a 5V supply.
Procedure
Code
#include <Servo.h> // Initialize Servo, Buzzer, and LEDs
#define SERVO_PIN 5
#define LED_PIN 4 // Green LED for // Set the initial state to locked (specific
void unlockDoor() {
Serial.println("Unlocking door...");
blinkLED(LED_PIN); // Blink the green LED twice
playUnlockLockSound(); // Play the sound for
unlocking
doorServo.write(120); // Move servo to unlock
position
doorUnlocked = true; // Set door state to
unlocked
Serial.println("Door is now unlocked.");
}
void loop() {
// Check if a new RFID card is present
if (!rfid.PICC_IsNewCardPresent() || !
rfid.PICC_ReadCardSerial()) {
return;
}
// Read and format the UID
String tagUID = "";
for (byte i = 0; i < rfid.uid.size; i++) {
if (rfid.uid.uidByte[i] < 0x10) tagUID += "0";
// Add leading zero for consistency
tagUID += String(rfid.uid.uidByte[i], HEX);
Results
The outcomes of the Arduino-Controlled RFID-Based Smart Door Lock with LED and
Buzzer Feedback successfully aligned with the desired objectives of the project. The RFID
module accurately detected RFID tags and differentiated between authorized and
unauthorized tags. Upon scanning an authorized tag, the servo motor rotated to unlock the
door, the green LED blinked twice, and the buzzer emitted a short confirmation sound,
signifying successful access. Conversely, when an unauthorized tag was scanned, the red
LED flashed twice, and the buzzer emitted a continuous denial sound, indicating restricted
access.
The system demonstrated smooth operation in managing access control, with real-
time feedback from both the LEDs and the buzzer. While minor issues, such as occasional
misreads of RFID tags, were observed, these were attributed to environmental factors or the
positioning of the RFID module. Nevertheless, the system's response mechanism efficiently
communicated access status, ensuring both functionality and reliability in line with the
project's intended design.
Discussions
The results from testing the Arduino-Controlled RFID-Based Smart Door Lock
demonstrated that the system effectively differentiated between authorized and unauthorized
RFID tags, providing a reliable access control mechanism. The LED and buzzer feedback
system worked seamlessly, offering clear indicators of access status. Authorized tags
triggered the servo motor to unlock the door, accompanied by a blinking green LED and a
short confirmation beep, while unauthorized tags resulted in a locked door, a blinking red
LED, and a continuous denial sound. These responses ensured functional and intuitive
communication with users during operation.
However, during the testing phase, a few challenges and areas for improvement were
identified. One challenge encountered was occasional misreads of RFID tags, where the
system would momentarily fail to detect the tag or produce an inaccurate response. These
issues were likely due to the environmental conditions, such as interference or improper
positioning of the RFID reader relative to the tags. Ensuring optimal placement of the RFID
module and reducing potential interference sources could improve reliability.
Proposed Improvements:
Costa, F., Genovesi, S., Borgese, M., Michel, A., Dicandia, F. A., & Manara, G. (2021). A review
of RFID sensors, the new frontier of internet of things. Sensors, 21(9), 3138.
Shanthini, M., Vidya, G., & Arun, R. (2020, August). IoT enhanced smart door locking system.
In 2020 Third International Conference on Smart Systems and Inventive Technology
(ICSSIT) (pp. 92-96). IEEE.
Aswini, D., Rohindh, R., Ragavendhara, K. M., & Mridula, C. S. (2021, October). Smart Door
Locking System. In 2021 International Conference on Advancements in Electrical,
Electronics, Communication, Computing and Automation (ICAECA) (pp. 1-5). IEEE.
Hasan, Y., Wijanarko, Y., Muslimin, S., & Maulidda, R. (2020, April). The automatic door lock to
enhance security in RFID system. In Journal of Physics: Conference Series (Vol. 1500,
No. 1, p. 012132). IOP Publishing.
Appendices
Parameters Details/Value
Model MFRC522
Type RFID Reader/Writer
Operating Frequency 13.56 MHz
Interface SPI (Serial Peripheral Interface), I2C (optional with
additional hardware)
Operating Voltage 3.3V to 5V
Current Consumption 13-26 mA (typical)
Communication Speed Up to 10 Mbps (SPI)
Card Type Supported MIFARE, ISO/IEC 14443 Type A and Type B, NTAG,
ISO/IEC 18092, and other 13.56 MHz RFID cards
Data Transmission Rate 848 Kbps (max)
Antenna Type External (with integrated coil for
transmission/reception)
Communication Protocol SPI or I2C (with additional connection setup)
Dimensions 40mm x 60mm (approx.)
Mounting Type PCB Mountable (through-hole or surface mount)
Operating Temperature -20°C to 85°C
Operating Humidity 5% to 95% RH (non-condensing)
Detection Range Up to 5 cm (depends on the card and antenna size)
Features Anti-collision, Multi-card support, Low power
consumption, High-speed communication
Power Supply Typically powered via 3.3V or 5V rail (depending on
the logic level requirement)
Pin Configuration 8 Pins: SDA, SCK, MOSI, MISO, IRQ, GND, RST,
3.3V/5V
Table 3. MFRC522-RFID Reader Datasheet