This project implements a simple RFID card-based door lock system using Arduino, an OLED display, and a servo motor. It reads the Unique ID (UID) of each RFID tag placed close to the reader and displays it on the OLED display. If the UID of the tag matches a predefined value stored in Arduino's memory, an "Unlocked" message is displayed on the OLED display, granting access. If the UID does not match the predefined value, the "Unlocked" message won't appear.
The following components are needed to build this project:
- Arduino Uno
- RFID Reader (RC522)
- OLED Display
- Small breadboard
- Wires
Ensure you have all the necessary components listed above.
Each RFID tag has a unique number (UID) that identifies it. This project uses the UID to identify specific cards.
The OLED display used in this project has a resolution of 128x64 pixels and low power consumption. It communicates via the I2C interface, requiring only a few connections.
Connect the RFID reader and OLED display to the Arduino as per the following connections:
- RST -> Digital Pin 9
- IRQ -> Unconnected
- MISO -> Digital Pin 12
- MOSI -> Digital Pin 11
- SCK -> Digital Pin 13
- SDA -> Digital Pin 10
- Vcc -> 3.3V
- GND -> GND
- SCL -> Analog Pin 5
- SDA -> Analog Pin 4
Caution
The RFID reader must be connected to the 3.3V output of the Arduino Uno to avoid damage.
- Connect all the components as described above.
- Install the required libraries:
- MFRC522 (for RFID reader)
- Adafruit SSD1306 (for OLED display)
- Adafruit GFX (required by SSD1306)
- Upload the provided Arduino sketch (
RFID_Project.ino
) to your Arduino board. - Power up the project and place an RFID card close to the reader.
- If the UID matches the predefined value, the OLED display will show an "Unlocked" message, granting access.
- In order to install it, go to Sketch -> Include Libraries -> Manage libraries. Search for MFRC522 and install it. We also need the Adafruit SSD1306 library and the Adafruit GFX library for the display.
- The Adafruit SSD1306 library needs a small modification. Go to the Arduino -> Libraries folder, open the Adafruit SSD1306 folder and edit the Adafruit_SSD1306.h library. Comment line 70 and uncomment line 69. Our display has a resolution of 128x64, that’s what we are defining here.
- declare the card id here: int code[] = {69,141,8,136}; //This is the stored UID
The Arduino sketch (code.ino
) provided in this repository contains the code for the RFID card door lock system. It initializes the RFID reader and OLED display, reads RFID tags, compares the UID with a predefined value, and displays the access status on the OLED display.
This project is licensed under the MIT License.