Access Control System
This project proposes a secure access control system based on two-factor authentication using RFID cards: the door is only allowed to open if two valid and distinct badges are presented successively on two separate reade...
This project proposes a secure access control system based on two-factor authentication using RFID cards: the door is only allowed to open if two valid and distinct badges are presented successively on two separate readers. The system is driven by an ESP8266 microcontroller, which operates a servo motor to unlock the door and transmits its state (open or closed) in real time to the YoupiLab IoT platform.
Context
In sensitive environments (party halls, laboratories, safes or regulated areas), a single verification point is often a security flaw: a stolen, duplicated or borrowed card is enough to allow unintended access.
The principle of two-factor authentication, widely used in banking and industrial systems, reduces this risk by requiring two distinct identifiers before any authorization. Combined with an ESP8266 microcontroller and an IoT platform, this principle becomes accessible to simple, low-cost embedded projects.
Problems solved
Conventional RFID systems rely on the validation of a single card, which has two major limitations:
Single-card access: a lost, copied or borrowed card allows an unauthorized person to access the protected area alone.
No cross-checking: no cross-verification is possible; the system cannot ensure that access is validated by two truly distinct identifiers.
This project addresses these limitations by requiring double validation with two different cards on two separate readers, within a limited time between the two presentations, preventing a single person or a single card from being enough to unlock access.
Proposed solution
The system relies on five main elements:
ESP8266 microcontroller (NodeMCU): is the brain of the system. It manages the two-factor authentication logic, drives the actuators and communicates with the IoT platform.
Two RFID readers (MFRC522): each independently reads one badge, one per reader, to allow cross-verification.
Servo motor: operates the physical opening and closing of the door.
LED and buzzer: indicate the system state in real time (waiting, validation or error).
WiFi connection and YoupiLab API: transmit the door state (open/closed) in real time to the YoupiLab platform.
General operation
The system waits for a first valid card to be presented on one of the two readers. Once this card is recognized, a three-second delay starts for presenting a second card, which must be different, on the other reader:
Successful double validation: if the second card is valid and distinct from the first, the servo motor unlocks the door and the "open" status is sent to YoupiLab.
Authentication failure: if the card is invalid, if the time limit is exceeded, or if the same card is presented twice, the buzzer and the red LED are activated, then the system resets.
Once the door is open, a push button triggers manual closing; the "closed" state is then sent back to the IoT platform, and the system becomes available again for a new access.
Features
Two-factor authentication by RFID card, on two separate readers.
Automatic locking and unlocking of the door via servo motor.
Audible and visual alert in case of anomaly (invalid card, time limit exceeded, card reused).
Real-time notification of the door state to the YoupiLab IoT platform.
Automatic reset of the system after each attempt, successful or not.
Composition details
Software
Language: C++ (Arduino IDE).
Libraries: MFRC522, Servo, ESP8266WiFi / ESP8266HTTPClient / WiFiClientSecure for connectivity.
Processing: state machine managing the synchronization of the two readers and the time window between the two cards.
IoT communication: HTTP GET requests to the YoupiLab API to update the door status in real time.
Hardware
| Components | Role | Reference | Pins |
| ESP8266 (NodeMCU) | Brain of the system: manages two-factor authentication, drives the actuators and communicates with the IoT platform. | https://youpilab.com/components/product/module-wifi-node-mcu-esp-8266-12 | |
| RFID reader 1 (MFRC522) | Reads the first access card. | https://youpilab.com/components/product/module-lecteur-rfid | SS : D8 / RST : D1 |
| RFID reader 2 (MFRC522) | Reads the second access card, which must be different from the first. | https://youpilab.com/components/product/module-lecteur-rfid | SS : D2 / RST : D1 |
| Servo motor | Operates the opening and closing of the door | https://youpilab.com/components/product/micro-servomoteur-sg90-3600-9g | D3 |
| Buzzer | Audibly signals a validation or an access error. | https://youpilab.com/components/product/buzzer-pwm | D0 |
| Red LED | Red = access denied. | https://youpilab.com/components/product/led-rouge-transparente | Rx |
| Green LED | Green = access granted. | https://youpilab.com/components/product/led-verte-transparente | D4 |
| Push button | Triggers manual closing of the door after opening | https://youpilab.com/components/product/bouton-poussoir-121273 | A0 |
Applications
Secure access control for server rooms, laboratories and safes.
Industrial security requiring double identity validation.
Connected home security systems.
Remote supervision of access status via an IoT platform.
Educational projects in embedded security and IoT.
Project carried out by: HODONOU Ange-Hervé
No comments yet. Be the first!