* Grupa: 335CA
This project aims to implement an access control system using an Arduino board and an NFC card reader. The system works as follows: by default, a red LED is on and the display shows the message “Door Locked”. When a valid NFC card is presented to the reader, the system checks the card's authentication. If the card is valid, the red LED turns off, a green LED lights up, a buzzer emits a sound, and the display shows “Door Open”. After a few seconds, the system automatically “locks” the door again by turning the red LED back on, emitting another buzzer sound, and changing the display message back to “Door Locked”.
Additionally, every valid access is recorded on an SD card along with the exact date and time of the event, using a real-time clock (RTC) module to generate the timestamp.
This project presents a basic access control system using an Arduino microcontroller and NFC technology. When a valid NFC card is presented to the reader, the system authenticates the user, triggers a visual and audio response (using LEDs and a buzzer), displays the access status on a screen, and logs the event with a timestamp to an SD card. The setup demonstrates simple hardware integration for secure access applications and data logging, combining user feedback, real-time tracking, and storage capabilities in an embedded environment.
The following table lists the main components used in this project:
Component | Description |
---|---|
Arduino | Microcontroller |
151051RS11000 | Red color led |
151031VS06000 | Green color led |
SSD1306 | Display |
RC522 | NFC Reader |
PS1440P02BT | Buzzer |
DS1307 | RTC |
Electrical schematics:
Note: The OLED display (SSD1306, 0.96”, I2C interface) and the RC522 NFC reader used in this project are represented using generic connector symbols (Conn_01x04 and Conn_01x07) due to the absence of exact component symbols in the library.
OLED Display Pin Mapping (Conn_01x04): • Pin 1 – GND → Ground • Pin 2 – VCC → 5V Supply • Pin 3 – SCL → Arduino A5 • Pin 4 – SDA → Arduino A4
RC522 NFC Reader Pin Mapping (Conn_01x07): • SDA → Arduino D10 (Chip Select / SS) • SCK → Arduino D13 (SPI Clock) • MOSI → Arduino D11 (SPI Data In) • MISO → Arduino D12 (SPI Data Out) • GND → Ground • 3.3V → Arduino 3.3V
Final Product:
Purpose of the code
This program implements an access control system using RFID cards, based on an Arduino microcontroller. The system integrates an RC522 NFC reader, an OLED display, a real-time clock module (DS3231), LEDs, and a buzzer. When a card is detected, the system displays the access information, provides visual and sound feedback, and logs the timestamp of the event.
Main Software Components
Flow Overview
For debug reasons, I also print the UID of the card and the message in the serial monitor.
Libraries used: SPI.h, Wire.h, MFRC522.h, RTClib.h, Adafruit_GFX.h, Adafruit_SSD1306.h. These libraries are used to enable communication between the Arduino and external modules such as the RFID reader, OLED display, and RTC clock. SPI.h is used for SPI communication with the RC522 module, Wire.h for I2C communication with the OLED and RTC, MFRC522.h for handling RFID card detection and reading, RTClib.h for accessing real-time data from the DS3231, and Adafruit_GFX.h along with Adafruit_SSD1306.h for displaying text and graphics on the OLED screen.
At first, I wasn’t very enthusiastic about this project because I had no clear idea how to build it and I was afraid I wouldn’t be able to complete it successfully. However, once I got started and broke the problem down into smaller steps, everything became more clear and manageable. I began to understand how each part works and how they connect together, and the process became more interesting and rewarding. I found myself enjoying the development more than I expected. In the end, not only did I manage to complete the project, but I also learned a lot in the process and I’m genuinely proud of what I achieved.
I mainly searched on youtube to see how to connect different components or how different components work.