An Arduino Uno RFID access-control prototype that unlocks an electronic latch when a registered card is scanned. The firmware reads card UIDs through an MFRC522 RFID module, displays access status on a 16x2 I2C LCD, triggers a relay to control the lock, and uses buzzer tones for quick feedback.
- Preview
- Tech Stack
- Repository Overview
- Features
- Hardware and Software
- Installation Guide
- Hardware Design Notes
- License
| Category | Technology | Use in This Project |
|---|---|---|
| Firmware Language | C++ / Arduino | Implements card scanning, UID validation, relay control, LCD messaging, buzzer feedback, and serial logging. |
| Microcontroller | Arduino Uno R3 | Main controller for the RFID reader, display, buzzer, and relay module. |
| Build Tool | PlatformIO | Manages the Arduino build environment, board configuration, library dependencies, firmware upload, and serial monitor workflow. |
| RFID | MFRC522 / RFID-RC522 | Reads RFID card UIDs over SPI for access-control decisions. |
| Display | LiquidCrystal_I2C | Drives the 16x2 I2C LCD at address 0x27 for lock and access status messages. |
| Communication | SPI | Connects the Arduino Uno to the MFRC522 RFID reader. |
| Communication | I2C | Connects the Arduino Uno to the LCD through the A4 and A5 pins. |
| Actuation | 5 V Relay Module | Switches the electronic latch circuit when access is granted. |
| Power | 12 V Battery | Powers the electronic latch separately from the Arduino control circuit. |
| Feedback | Buzzer | Plays different tones for granted and denied access attempts. |
| Access Data | Hard-coded RFID UID | Stores the authorized card UID directly in firmware as authorizedUID. |
| Development Tools | Visual Studio Code, PlatformIO IDE, Arduino IDE | Provides the local development, build, upload, and prototype programming workflow. |
| Circuit Design Tools | Tinkercad, Cirkit, Circuit Diagram | Used during the case-study design process for virtual prototyping, wiring references, and diagram preparation. |
.
|-- README.md
|-- LICENSE
`-- arduino-based-rfid-door-lock/
|-- platformio.ini
|-- src/
| `-- main.cpp
|-- preview/
| |-- Circuit Diagram 1.png
| `-- Circuit Diagram 2.png
|-- include/
|-- lib/
`-- test/
The PlatformIO project lives inside the nested arduino-based-rfid-door-lock/ directory. The firmware entry point is src/main.cpp, while platformio.ini defines the Arduino Uno target and external library dependencies.
- RFID card detection and UID comparison using the MFRC522 module.
- Single-card authorization through a firmware-defined UID.
- LCD status messages for startup, scanning, locked, unlocked, granted, and denied states.
- Relay-controlled electronic latch output.
- Buzzer feedback with separate tones for granted and denied access.
- Automatic relock after a 10-second unlock interval.
- Serial monitor output at
9600baud for debugging card and lock state events.
| Category | Item | Project Role |
|---|---|---|
| Controller | Arduino Uno R3 | ATmega328P-based board that runs the access-control firmware and coordinates every connected module. |
| RFID Reader | MFRC522 / RFID-RC522 | 13.56 MHz contactless RFID reader used to read card or tag UIDs. The project uses SPI wiring for this module. |
| Display | 16x2 LCD with I2C Adapter | Shows user-facing status messages while using only the Arduino Uno's I2C pins. |
| Lock Control | 5 V Relay Module | Allows the Arduino's low-voltage output to switch the higher-current latch circuit. |
| Door Hardware | Electronic Door Latch | Physical locking mechanism controlled through the relay. |
| Latch Power | 12 V Rechargeable Battery | Dedicated latch supply used to avoid overloading the Arduino's 5 V output. |
| Feedback | Passive Buzzer | Audio indicator for successful and failed card scans. |
| Prototyping | Jumper Wires, Breadboard, Perfboard, Soldering Tools | Used to build the initial circuit, then stabilize the final prototype after loose connections caused unreliable behavior. |
| Development Software | Arduino IDE and PlatformIO | Arduino IDE was used during the original prototype workflow; this repository is organized as a PlatformIO project for repeatable builds. |
| Design Software | Tinkercad, Cirkit, Circuit Diagram | Used as design, simulation, and circuit-reference tools during development. |
- Arduino Uno R3 or compatible ATmega328P board.
- MFRC522 / RFID-RC522 reader module and compatible RFID card or tag.
- 16x2 I2C LCD, configured at address
0x27. - 5 V relay module.
- Electronic latch with a suitable external power supply.
- Buzzer, jumper wires, USB cable, and breadboard or soldered prototype.
- Visual Studio Code with the PlatformIO IDE extension, or the PlatformIO CLI.
-
Clone the repository:
git clone https://github.com/shoichiideologies/arduino-based-rfid-door-lock.git cd arduino-based-rfid-door-lock/arduino-based-rfid-door-lock -
Install PlatformIO if you are using the CLI:
python -m pip install platformio
-
Open the nested PlatformIO project in VS Code, or stay in the nested directory when using the CLI.
-
Check the configured board and dependencies in
platformio.ini:[env:uno] platform = atmelavr board = uno framework = arduino
-
Update the authorized RFID card UID in
src/main.cpp:byte authorizedUID[] = {0xE2, 0x7E, 0x1B, 0x2F};To get a new card UID, run the MFRC522 library's
DumpInfoexample or temporarily print the scanned UID bytes over serial during development. -
Wire the circuit using the diagrams in the
preview/directory and the pin map below. -
Build the firmware:
pio run
-
Upload the firmware to the Arduino Uno:
pio run --target upload
-
Open the serial monitor:
pio device monitor --baud 9600
| Component | Arduino Uno Pin | Notes |
|---|---|---|
| MFRC522 SDA / SS | D10 |
SPI slave select pin configured as SS_PIN. |
| MFRC522 RST | D9 |
Reset pin configured as RST_PIN. |
| MFRC522 MOSI | D11 |
SPI data from Arduino to RFID reader. |
| MFRC522 MISO | D12 |
SPI data from RFID reader to Arduino. |
| MFRC522 SCK | D13 |
SPI clock. |
| MFRC522 VCC | 3.3V |
Use 3.3 V power for the RFID module. Check module-level logic compatibility before connecting to a 5 V Arduino. |
| 16x2 I2C LCD SDA | A4 |
I2C data line on Arduino Uno. |
| 16x2 I2C LCD SCL | A5 |
I2C clock line on Arduino Uno. |
| Relay IN | D8 |
Relay signal pin configured as RELAY_PIN. |
| Buzzer | D7 |
Buzzer output pin configured as BUZZER_PIN. |
This project is licensed under the MIT License.

