DIY RFID-Based Attendance System With Arduino

by ElectroScope Archive in Circuits > Arduino

25 Views, 0 Favorites, 0 Comments

DIY RFID-Based Attendance System With Arduino

rfid-attendance-cover.jpg

In this tutorial, you will learn how to create an inexpensive RFID Attendance System with Arduino UNO. Users can check in and check out with a touch of an RFID card. The system will log the entries with time-stamped data from a real-time clock (RTC). The user will see immediate feedback using an LCD display. Recorded data will be securely stored using EEPROM. Whether you're building this for a classroom, a lab setting, or a personal workspace, it is a great intermediate project that will teach RFID, RTC, and EEPROM integration.

Supplies

  1. Arduino UNO ×1
  2. RFID Reader (MFRC522 Module) ×1
  3. Real-Time Clock (Tiny RTC DS1307) ×1
  4. 16x2 I2C LCD Display ×1
  5. Push Buttons ×2
  6. Breadboard ×1
  7. Jumper Wires (as required)
  8. 2S Lithium-Ion Battery ×1 (optional for portable use)

Circuit Diagram & Wiring

Circuit-Diagram-RFID-Based-Attendance-System-Using-ArduinoUNO.jpg

First, let's look at how to connect everything together. Use the breadboard to keep things clean.


RFID MFRC522 to Arduino board:

VCC → 3.3V

GND → GND

RST → D7

SDA → D10

MOSI → D11

MISO → D12

SCK → D13


16x2 I2C LCD & DS1307 RTC to Arduino board:

VCC → 5V

GND → GND

SDA → A4

SCL → A5


Push Buttons:

One side of each push button → GND

The other side → D8 (Menu Button), D9 (Select Button)

Upload the Code

You will find the complete code attached in this section.


Use the Arduino IDE to upload the code. You will need the following libraries:

  1. MFRC522
  2. Wire
  3. RTClib
  4. EEPROM
  5. LiquidCrystal_I2C


The code initializes:

  1. RFID reader
  2. Real Time Clock
  3. LCD display
  4. EEPROM to save attendance logs


Overall Code Functions:

  1. Detect and identify RFID cards.
  2. Record entry/exit time.
  3. Update the LCD to show the count of attendance.
  4. Navigation of the menu can be achieved using buttons.
  5. Data will be stored even post-power loss.


void loop() {
if (mfrc522.PICC_IsNewCardPresent() && mfrc522.PICC_ReadCardSerial()) {
String uid = getUID();
if (isNewEntry(uid)) {
checkIn(uid);
} else {
checkOut(uid);
}
}
}


The above loop checks for a card, reads its UID, and logs check-in or check-out automatically.

Demo in Action

Below is an example of what happens when the device is running:

When the device boots, you will see the LCD display, "RFID Attendance", and show the current attendance count.


When an RFID card is scanned:

If checking in, the LCD shows "CHECKED IN" and increments the attendance count.

If checking out, the LCD shows "CHECKED OUT" and decrements the attendance count.

If the card is unauthorized, the LCD shows "ACCESS DENIED."

The LCD will then return to the idle state that displays the time and attendance status.

Customize the System

You can scale the system by adding more RFID cards with names/IDs.Logging to an SD card with more details.Adding Wi-Fi to sync logs online.Using OLED displays for smaller form factors.

And that's a wrap! You have now built your RFID Attendance System using Arduino UNO. It allows you to log entries, keep track of time, and present everything on a neat little LCD with just a tap of a card. Your data stays stored in EEPROM even after power loss, but keep in mind that EEPROM has a limited number of write cycles. If you are interested in a more comprehensive learning experience, visit this complete RFID-based Attendance System Using Arduino Uno project.