Smart door access control using Arduino and RFID card

Arduino UNO 23-04-25
14 0

Tutorial plan

1- Introduction

2- Description of our Smart Door Access

3- Required Components

4- Circuit Connections of system

5- Arduino program of system

 

 

Introduction

A smart door access control system using a card is a modern security solution that allows users to unlock doors using RFID, NFC, or smart cards instead of traditional keys. These systems are commonly used in offices, schools, hotels, and even smart homes.

How It Works (General Concept)

1- User presents a smart card (RFID, NFC, or magnetic stripe) near a card reader installed at the door.

2- The reader scans the card and checks its unique identifier (UID).

3- The system then:

a) Verifies the UID against a database.

b) Grants or denies access based on the card’s permissions.

4- If access is granted, the system sends a signal to an electronic lock or relay to unlock the door.

5- Optionally, the system logs the event (e.g., who entered and when).

Advantages

Keyless entry = no lost keys

Access can be granted or revoked instantly

Logs entries/exits for better security

Supports multi-user access with different permissions

 

Description of our Smart Door Access

This project demonstrates how to securely control access to a door using an RFID card. The system uses an Arduino to control components, an RFID reader to identify users, an I2C LCD to provide feedback, and a servomotor to open or close a simulated lock.

1. System Initialization

When powered on, the Arduino initializes all components:

RFID module (RC522)

I2C LCD screen

Servo motor

The LCD displays:Scan your card...

2. Waiting for RFID Card

The RFID module constantly checks for the presence of a card/tag.

When a card is placed near the reader (~3–5 cm), it detects the UID (Unique Identifier).

3. Reading and Verifying the UID

The UID from the RFID card is read and sent to the Arduino.

The UID is compared with a list of authorized UIDs stored in the Arduino code (or EEPROM if dynamic storage is used).

4. Access Granted (if UID is valid)

If the UID matches an authorized one:

LCD displays: "Door opens"

The servomotor rotates to unlock the door (e.g., 20° position).

The user approaches the RFID card to the RC522 reader again, the servomotor close the door.

5. Access Denied (if UID is not valid)

If the UID doesn't match:

LCD displays: "Card not validated"

The servomotor does not move; the door remains locked.

6. System Resets

After granting or denying access, the system:

Displays Scan your card... again.

Waits for the next RFID scan.

 

Required Components

Arduino UNO

Arduino Uno

Role: Acts as the central controller of the project.

Function:

Communicates with the RFID reader to read the card UID.

Compares the UID to authorized IDs.

Sends messages to the LCD.

Controls the servomotor to lock/unlock the door.

RFID Module (RC522)

Role: Used to read RFID tags/cards wirelessly.

Function:

Operates at 13.56 MHz frequency.

Uses SPI communication with the Arduino.

Reads the UID of RFID cards when placed near (~3–5 cm).

RFID Cards/Tags

Role: Serve as electronic keys.

Function:

Each card contains a unique identifier (UID).

When placed near the RFID reader, the UID is transmitted.

If the UID is recognized, access is granted.

I2C LCD Display

Pinouts of 1602 LCD display with I2C

Role: Displays messages such as “Access Granted” or “Access Denied”.

Function:

Simplifies LCD wiring using I2C protocol (only 2 wires).

Shows system status and feedback to the user.

Servomotor (e.g., SG90)

Role: Simulates a door lock mechanism.

Function:

Rotates to 20° to unlock the door when access is granted.

Returns to 85° to lock the door after a few seconds.

Breadboard

Breadboard

The breadboard is used for prototyping and connecting components without soldering.

It allows the easy insertion of wires and components for a flexible setup.

Jumper Wires

Fils de connexion

Jumper wires are used to make connections between components on the breadboard, Micro:bit, and GPIO extension card.

Wooden house prototype

A miniature wooden house represents a real-world structure.

The door mechanism is attached to a servo motor, which rotates to open or close it.

The wooden prototype provides a stable frame for installing components like the IR sensor and LCD screen.

Circuit Connections of system

Connection of LCD I2C display to Arduino

LCD I2C Display Pin

Arduino Pin

GND

GND

VCC

5V

SDA

A4

SCL

A5

Connection of servo motor to Arduino

Servo motor

Arduino UNO

Brown wire (-)

GND

Red wire (+)

5V

Yellow wire (Signal)

D2

Connection RFID-RC522 to Arduino

RFID-RC522

Arduino UNO

Description

VCC

3.3V

Power supply

GND

GND

Ground

SDA (SS)

Pin 10

Slave Select (SS)

SCK

Pin 13

SPI Clock (SCK)

MOSI

Pin 11

Master Out Slave In (MOSI)

MISO

Pin 12

Master In Slave Out (MISO)

RST

Pin 9

Reset

 

Arduino program of system

Here is a complete Arduino sketch for your Smart Door Access Control System using RFID, I2C LCD, and Servo motor, with clear comments for each section:

This code uses the MFRC522 library for RFID communication and the LiquidCrystal_I2C library for the LCD display.

1- Open Arduino IDE.

2- Go to Sketch → Include Library → Manage Libraries.

3- Search for MFRC522 and install it.

4- Search for LiquidCrystal_I2C and install it

0 comment

Leave a comment

Veuillez noter s'il vous plaît*

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Purpose of this website

Educational robotics refers to the use of robots and robotics technology to promote learning in educational settings. It involves the integration of technology, engineering, and computer science into the classroom, allowing students to engage in hands-on, project-based learning experiences.
In this context, our website represents an excellent resource for parents, teachers and children who wish to discover robotics.

Contact details

Zaouiet Kontech-Jemmel-Monastir-Tunisia

+216 92 886 231

medaliprof@gmail.com

Pictures of the articles

Robotic site created by MedAli-Teacher info