Arduino Based RFID Attendance System

by rohanbarnwal in Circuits > Arduino

21 Views, 2 Favorites, 0 Comments

Arduino Based RFID Attendance System

20251016_0859_Arduino RFID Setup_remix_01k7ngyys2ffjt19eeqg3v81rm.png
IMG_7038.jpg

In today's fast-paced educational and organizational environments, attendance tracking remains a critical but often time-consuming task. The Arduino-Based RFID Attendance System offers a simple, efficient, and automated solution to this problem.

This project uses RFID technology to record the attendance of the students in real-time. Each student is assigned a unique RFID tag that, when scanned, updates their attendance status as Present, Late, or Absent based on a 10-minute time window after power-up. The system also features a teacher's master card that instantly displays the attendance summary of all registered students on a 20x4 I2C LCD display.

In a real world scenario, this system can be deployed in:

  1. Schools and Colleges for automatic classroom attendance
  2. Offices and Workshops for employee check-ins
  3. Events and Seminars for participants management

With minor enhancements, such as Wi-Fi integration (ESP8266) or data logging to SD cards or Google Sheets, this project can evolve into a robust, network-connected smart attendance terminal.


Supplies

  1. Arduino Uno R4 Wi-Fi Board: The latest Arduino with built-in Wi-Fi and enhanced processing speed. Provides stability, higher speed, and easy expansion for future IoT integration.
  2. RFID Module (RC522): Detects and read RFID card UIDs via SPI communication. Offers a cost-effective and efficient way to identify unique cards.
  3. RFID Tags/Cards: Each represents an individual student's unique ID. Simple, durable, and reusable identity method.
  4. 20x4 I2C LCD Display: Displays messages, students names, and real time timer updates. The I2C interface reduces wiring complexity and improves reliability.
  5. Jumper Wires: Connects all components securely. Ensures stable signal flow without soldering.

How This System Works

when powered on, the Arduino Uno R4 Wi-Fi initializes the RFID module and the LCD. The system starts a 10-minute countdown timer, marking the active attendance window.

Here's the step by step process of how the system functions:

  1. System Initialization: Upon powering, the LCD displays a welcome message - "Ready for Attendance." The Arduino records the current time as the start of the session.
  2. RFID Tag Scanning: When a student presents their RFID card, the RC522 module reads the unique identifier (UID) and sends it to the Arduino for comparison with a pre-stored list of registers UIDs
  3. Attendance Status Update:
  4. If the card is scanned within 10 minutes, the system marks the students as "Present - On Time."
  5. Students who do not scan are automatically marked Absent once the teacher's card is scanned.
  6. Teacher Summary Card: The teacher's RFID card triggers the attendance summary. Each student's name and attendance status (On Time/ Late / Absent) are displayed sequentially on the LCD screen.
  7. Wi-Fi expansion (Optional): With the Arduino Uno R4 Wi-Fi data can be later be pushed to online databases cloud servers, or even Google Sheets, enabling real-time remote attendance monitoring.

This system ensures accuracy, transparency, and efficiency, eliminating the hassle of manual attendance sheets.

Steps to Build the Project

Circuit Connections

connection lcd.jpg

Connect The MFRC522 RFID Module to Arduino Uno R4 Wi-Fi

  1. SDA To D10
  2. SCK To D13
  3. MOSI To D11
  4. MISO To D12
  5. RST To D9
  6. 3.3v To 3.3v
  7. GND To GND

Connect the 20x4 I2C LCD Display

  1. SDA To A4
  2. SCL To A5
  3. VCC To 5v
  4. GND To GND

Upload the Code

Use Arduino IDE to upload your code. Ensure you have installed the libraries:

  1. MFRC522.h for RFID
  2. LiquidCrystal_I2C.h for LCD
/* Beginner-friendly RFID Attendance (RC522 + 20x4 I2C LCD)
For Arduino Uno R4 Wi-Fi (pinout same as UNO-compatible boards)
Wiring (Arduino UNO/R4):
RC522: SDA(SS)=D10, SCK=D13, MOSI=D11, MISO=D12, RST=D9, 3.3V, GND
I2C LCD: SDA=A4, SCL=A5, VCC=5V, GND=GND

Changes in this version:
- Removed duplicate UID entry.
- Updated student names list to new names.
*/

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

#define SS_PIN 10 // SDA/SS for RC522
#define RST_PIN 9 // RST for RC522

#define LCD_ADDR 0x27
#define LCD_COLS 20
#define LCD_ROWS 4

MFRC522 rfid(SS_PIN, RST_PIN);
LiquidCrystal_I2C lcd(LCD_ADDR, LCD_COLS, LCD_ROWS);

// teacher UID (uppercase, no spaces)
const char TEACHER_UID[] = "2A7E17B1";

// 10 minutes = 10 * 60 * 1000 milliseconds
const unsigned long ATTENDANCE_LENGTH = 10UL * 60UL * 1000UL;

// debounce time to avoid reading same card many times quickly
const unsigned long DEBOUNCE = 1000UL;

// how long to show a student's info (ms)
const unsigned long SHOW_MS = 1500UL;

// small refresh rate for live timer (ms)
const unsigned long REFRESH_MS = 500UL;

// --- Student UID list and matching names ---
// Duplicate UID removed — ensure all UIDs here are unique (uppercase, no spaces)
const char* uids[] = {
"E2D2D500",
"49F1DF00",
"5C55D500",
"827ED600",
"310AF400",
"D7CFE000",
"23370EAA",
"7EB6F300",
"D784D500"
};

const char* names[] = {
"Amanjeet Kaur",
"Siddharth Verma",
"Meera Patel",
"Arjun Khanna",
"Neha Rathi",
"Vikram Singh",
"Simran Kaur",
"Ritik Sharma",
"Kavya Menon"
};

const int NUM = sizeof(uids) / sizeof(uids[0]);

// attendance state: 0=absent, 1=on time, 2=late
uint8_t attendance[NUM];

// timing vars
unsigned long startTime = 0;
bool windowStarted = false;

// helpers for debounce and display refresh
String lastUID = "";
unsigned long lastUIDTime = 0;
unsigned long lastRefresh = 0;

void setup() {
Serial.begin(9600);
while (!Serial) { } // waits for Serial on some boards, harmless on UNO/R4

SPI.begin();
rfid.PCD_Init();

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

// welcome message
lcd.setCursor(0, 0);
lcd.print("Welcome to the");
lcd.setCursor(0, 1);
lcd.print("RFID attendance");
lcd.setCursor(0, 2);
lcd.print("system");
delay(2000);

// start attendance window now
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Ready for attendance");
startTime = millis();
windowStarted = true;

// mark everyone absent initially
for (int i = 0; i < NUM; i++) attendance[i] = 0;

// show initial timer immediately
updateTimerOnLCD();
Serial.println("Attendance started.");
}

void loop() {
unsigned long now = millis();

// update the live countdown at intervals
if (now - lastRefresh >= REFRESH_MS) {
updateTimerOnLCD();
lastRefresh = now;
}

// check for a new card
if (!rfid.PICC_IsNewCardPresent()) return;
if (!rfid.PICC_ReadCardSerial()) return;

// build UID string (HEX uppercase, no spaces)
String uid = "";
for (byte i = 0; i < rfid.uid.size; i++) {
if (rfid.uid.uidByte[i] < 0x10) uid += "0";
uid += String(rfid.uid.uidByte[i], HEX);
}
uid.toUpperCase();

// simple debounce: ignore if same card scanned within DEBOUNCE ms
if (uid == lastUID && (now - lastUIDTime) < DEBOUNCE) {
rfid.PICC_HaltA();
rfid.PCD_StopCrypto1();
return;
}
lastUID = uid;
lastUIDTime = now;

Serial.print("Card scanned: ");
Serial.println(uid);

// teacher card -> show summary of all students
if (uid == String(TEACHER_UID)) {
showSummary();
rfid.PICC_HaltA();
rfid.PCD_StopCrypto1();
updateTimerOnLCD();
return;
}

// find student index
int idx = findIndex(uid.c_str());
if (idx < 0) {
// unknown card
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Unknown card:");
lcd.setCursor(0,1);
lcd.print(uid);
lcd.setCursor(0,3);
lcd.print("Not registered");
Serial.println("Unknown UID - not registered.");
delay(SHOW_MS);
updateTimerOnLCD();
rfid.PICC_HaltA();
rfid.PCD_StopCrypto1();
return;
}

// if already marked, just display status again
if (attendance[idx] != 0) {
showStudent(idx);
delay(SHOW_MS);
updateTimerOnLCD();
rfid.PICC_HaltA();
rfid.PCD_StopCrypto1();
return;
}

// determine if scan is inside the attendance window
bool onTime = windowStarted && ((now - startTime) <= ATTENDANCE_LENGTH);
if (onTime) attendance[idx] = 1; // on time
else attendance[idx] = 2; // late

// show student info
showStudent(idx);
delay(SHOW_MS);
updateTimerOnLCD();

rfid.PICC_HaltA();
rfid.PCD_StopCrypto1();
}

// find index of uid in uids[]; return -1 if not found
int findIndex(const char* uid) {
for (int i = 0; i < NUM; i++) {
if (strcmp(uids[i], uid) == 0) return i;
}
return -1;
}

// show ready screen and live remaining time
void updateTimerOnLCD() {
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Ready for attendance");

if (windowStarted) {
long elapsed = (long)(millis() - startTime);
long remaining = (long)ATTENDANCE_LENGTH - elapsed;
if (remaining > 0) {
unsigned long seconds = remaining / 1000UL;
unsigned int mins = seconds / 60UL;
unsigned int secs = seconds % 60UL;

lcd.setCursor(0,1);
// print "Time left: mm:ss" with leading zero for seconds
lcd.print("Time left: ");
if (mins < 10) lcd.print('0');
lcd.print(mins);
lcd.print(':');
if (secs < 10) lcd.print('0');
lcd.print(secs);
} else {
lcd.setCursor(0,1);
lcd.print("Attendance closed");
}
} else {
lcd.setCursor(0,1);
lcd.print("Window not set");
}

// clear lower lines for neatness
lcd.setCursor(0,2); lcd.print(" ");
lcd.setCursor(0,3); lcd.print(" ");
}

// show one student's info on LCD
void showStudent(int i) {
lcd.clear();
lcd.setCursor(0,0);
lcd.print(names[i]); // name
lcd.setCursor(0,1);
lcd.print("Present");
lcd.setCursor(0,2);
if (attendance[i] == 1) {
lcd.print("ON time");
Serial.print(names[i]); Serial.println(" -> ON time");
} else {
lcd.print("Came late");
Serial.print(names[i]); Serial.println(" -> Came late");
}
}

// show one-by-one summary for teacher (Name + Present/Absent + On time/ Late)
void showSummary() {
for (int i = 0; i < NUM; i++) {
lcd.clear();
lcd.setCursor(0,0);
lcd.print(names[i]);
if (attendance[i] == 0) {
lcd.setCursor(0,1);
lcd.print("Absent");
Serial.print(names[i]); Serial.println(": Absent");
} else if (attendance[i] == 1) {
lcd.setCursor(0,1);
lcd.print("Present");
lcd.setCursor(0,2);
lcd.print("ON time");
Serial.print(names[i]); Serial.println(": Present (ON time)");
} else {
lcd.setCursor(0,1);
lcd.print("Present");
lcd.setCursor(0,2);
lcd.print("Late");
Serial.print(names[i]); Serial.println(": Present (Late)");
}

delay(2500); // pause 2.5 seconds per student
}
}

Register Your RFID Tags

Each student receives an RFID tag. Update their UIDs and names in the code:

Power on and Start Attendance

IMG_7039.jpg

Once powered, the system begins the 10 minutes timer. Scan the cards during this time to be marked "On Time." Late scans are labeled accordingly.

View Summary

11.png
22.png
44.png
download (10) - Copy.png
21.png

Use the teacher's card to view a detailed attendance summary of all students on the LCD screen.

Taking the Project to the Next Level - With JUSTWAY

while your Arduino attendance system works perfectly on a breadboard, it might not look the part when you showcase it at competitions, tech fairs, or investor demos.

Presentation matters - and that's where JUSTWAY comes in.

JUSTWAY helps you transform your DIY project into a professional-grade prototype, making it look and feel like a real market-ready product.

Why JUSTWAY Is the Perfect Partner

  1. Rapid Prototyping
  2. 24-hour production turnaround
  3. Real-time production tracking
  4. Perfect for students and makers on tight deadlines
  5. CNC Machining (Aluminum 6061 / Stainless Steel 304)
  6. Delivers ultra-precise, strong enclosures
  7. Gives your project a premium industrial-grade body
  8. Sheet Metal Fabrication
  9. Laser-cut and CNC-bent metal sheets
  10. Options for powder coating finishes
  11. Ideal for casting your attendance system elegantly
  12. Injection Molding
  13. Transition from prototypes to mass production
  14. High-quality, custom-designed plastic enclosures
  15. Urethane Casting
  16. Perfect for low-volume production runs
  17. Delivers professional-grade parts for display models
  18. 3D Printing (SLA & HP-PA12)
  19. SLA resin: clear, aesthetic display for internal electronics
  20. HP-PA12 nylon: durable and long-lasting casting
  21. Pro Tip: Transparent resin highlights your circuitry; matte black adds a stealthy, modern touch.

How To Order in 4 Easy Steps

  1. Upload Your CAD Files at JUSTWAY.com : Start by uploading your STL or STEP files.
  2. Select Material & Finish: Choose from plastics, resins, or metals depending on your design.
  3. Preview Your Model in 3D: Live dimension checks ensure perfect fitting before production
  4. Place Your Order : Transparent pricing, fast delivery, and zero hidden costs.

Conclusion

The Arduino Uno R4 Wi-Fi Based RFID Attendance System is powerful demonstration of how automation and IoT can simplify daily administrative tasks. By integrating RFID technology, LCD visualization, and time-based logic, this system ensures accurate, tamper proof attendance tracking. With JUSTWAY, you can elevate this project from a prototype to a professional-grade product, combining functionality, design, and durability. Whether for school, exhibitions, or startups - this system is your gateway to real-world innovation.