Translate

Arduino RFID Attendance System

 📖 1. Introduction

RFID attendance systems are widely used in schools, colleges, and offices. However, most basic systems require reprogramming the Arduino every time a new card is added.

In this project, we design a smart RFID attendance system with an Admin Card, which allows:

  • Adding new RFID cards without editing code
  • Switching between normal mode and registration mode
  • Displaying status on LCD
  • Providing buzzer confirmation

This makes the system professional, flexible, and user-friendly.


🔧 2. Components

  • Arduino UNO
  • RC522 RFID Module
  • RFID Cards / Tags
  • 16x2 LCD Display with I2C Module
  • Buzzer
  • Connecting wires
  • Breadboard

🔌 3. Circuit and Connections

Pinout Diagram of Arduino Uno R3

PInout Diagram RC522 RFID Module
PINOUT RFID

Pinout Diagram of LCD with I2C
PINOUT LCD WITH I2C

Pinout Diagram Buzzer

📍 RFID RC522:

  • SDA → Pin 10
  • SCK → Pin 13
  • MOSI → Pin 11
  • MISO → Pin 12
  • RST → Pin 9
  • GND → GND
  • 3.3V → 3.3V ⚠️

📍 LCD (I2C):

  • VCC → 5V
  • GND → GND
  • SDA → A4
  • SCL → A5

📍 Buzzer:

  • Positive → Pin 8
  • Negative → GND

⚙️ 4. Step by Step Circuit Working

  1. System starts in Normal Mode
  2. RFID card is scanned
  3. Arduino reads unique UID

🔐 If Admin Card scanned:

  • System enters Add Mode
  • LCD shows “Scan New Card”

➕ In Add Mode:

  • Next scanned card is stored
  • LCD shows “Card Added”
  • System returns to normal mode

✅ In Normal Mode:

  • If card is stored → Access Granted
  • If not → Unknown Card

💻 5. Code

#include <SPI.h>
#include <MFRC522.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>

#define SS_PIN 10
#define RST_PIN 9
#define buzzer 8

MFRC522 mfrc522(SS_PIN, RST_PIN);
LiquidCrystal_I2C lcd(0x27, 16, 2);

// 🔴 Replace with your Admin Card UID
String adminUID = "a1b2c3d4";

// Store users
String users[10];
int userCount = 0;

bool addMode = false;

void setup() {
SPI.begin();
mfrc522.PCD_Init();

pinMode(buzzer, OUTPUT);

lcd.init();
lcd.backlight();

Serial.begin(9600);
lcd.print("Scan Card...");
}

void loop() {

if (!mfrc522.PICC_IsNewCardPresent()) return;
if (!mfrc522.PICC_ReadCardSerial()) return;

String uid = "";

for (byte i = 0; i < mfrc522.uid.size; i++) {
uid += String(mfrc522.uid.uidByte[i], HEX);
}

lcd.clear();

// 🔐 ADMIN MODE
if (uid == adminUID) {
addMode = true;
lcd.print("Admin Mode");
lcd.setCursor(0,1);
lcd.print("Scan New Card");
delay(2000);
return;
}

// ➕ ADD NEW CARD
if (addMode) {
users[userCount] = uid;
userCount++;

lcd.print("Card Added");
digitalWrite(buzzer, HIGH);
delay(1000);
digitalWrite(buzzer, LOW);

addMode = false;
lcd.clear();
lcd.print("Scan Card...");
delay(1500);
return;
}

// ✅ NORMAL MODE
bool found = false;

for (int i = 0; i < userCount; i++) {
if (uid == users[i]) {
found = true;
break;
}
}

if (found) {
lcd.print("Access Granted");
digitalWrite(buzzer, HIGH);
} else {
lcd.print("Unknown Card");
}

delay(2000);
digitalWrite(buzzer, LOW);
}

🔍 6. Step by Step Code Working

  • RFID module reads UID using SPI
  • UID stored as string
  • If UID = Admin UID → enters Add Mode
  • In Add Mode:
    • Next card is saved in array
    • Confirmation displayed
  • In Normal Mode:
    • UID compared with stored users
    • Access granted or denied

💡 7. Tips

✔ Always use 3.3V for RC522 ⚠️
✔ First find Admin UID using Serial Monitor
✔ Increase array size for more users
✔ Keep RFID card close to reader
✔ Use good power supply


🚀 8. Uses

  • Student attendance system
  • Office entry system
  • Door access control
  • Smart ID systems

⚠️ 9. Common Issues and Solutions

❌ RFID not working

✔ Check 3.3V supply

❌ Card not detected

✔ Bring card closer

❌ LCD not working

✔ Check I2C address

❌ Users lost after restart

✔ Use EEPROM (upgrade)


🧠 10. Conclusion

This project provides a smart and flexible RFID system with admin control. It eliminates the need for reprogramming and makes the system highly practical for real-world use.  

With this only a limited number of RFID can be stored say 20 numbers, we can use other storage methods to improve this

തുടക്കക്കാർക്കായി ഇലക്ട്രോണിക്സ് ലളിതമായി പഠിക്കാം.

Empowering students in Kerala with hands-on technical skills.