Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ESP32 RFID Attendance Monitoring System

Alt text

An ESP32-based RFID attendance system that reads RFID cards using an MFRC522 module, shows status messages on an SSD1306 OLED display, and sends attendance data to a web server over Wi-Fi.

Overview

This project is designed to automate attendance logging with a simple tap-and-record workflow. When a user places an RFID card near the reader, the ESP32 captures the card UID, sends it to a server through an HTTP request, and handles the server response for attendance tracking.

The OLED display provides basic on-device guidance such as prompting the user to scan their card, while the ESP32 manages Wi-Fi connectivity in the background.

Features

  • Reads RFID cards and tags using the MFRC522 reader
  • Connects to Wi-Fi using the ESP32
  • Sends attendance data to a server with HTTP GET requests
  • Displays user prompts on a 128x64 OLED screen
  • Prevents repeated scans of the same card within a short interval
  • Automatically attempts to reconnect if Wi-Fi is lost

Hardware Requirements

  • ESP32 development board
  • MFRC522 RFID reader
  • SSD1306 OLED display (128x64, I2C)
  • RFID cards or key tags
  • Jumper wires
  • Breadboard or prototype board
  • USB cable and power source for the ESP32

Pin Configuration

The current sketch uses the following pin mapping:

MFRC522 to ESP32

  • SS_PIN -> 21
  • RST_PIN -> 22
  • SPI communication is initialized with SPI.begin()

OLED to ESP32

  • SDA_PIN -> 5
  • SCK_PIN -> 4
  • I2C address -> 0x3C

Make sure your actual wiring matches the values defined in SmartTrack.ino.

Software Requirements

  • Arduino IDE or another Arduino-compatible ESP32 development environment
  • ESP32 board package installed in Arduino IDE
  • Required libraries:
    • MFRC522
    • WiFi
    • WiFiClient
    • HTTPClient
    • Wire
    • Adafruit_SSD1306

Project Files

Setup

  1. Open SmartTrack.ino in the Arduino IDE.
  2. Install the required libraries if they are not already available.
  3. Update these values in the sketch:
    • ssid
    • password
    • device_token
    • URL
  4. Connect the ESP32, MFRC522, and OLED display using the configured pins.
  5. Select the correct ESP32 board and COM port in the Arduino IDE.
  6. Upload the sketch to the ESP32.

Configuration

Before uploading the code, edit the following variables in SmartTrack.ino:

const char *ssid = "";
const char *password = "";
const char* device_token  = "";
String URL = "http://192.168.56.166/rfidattendance/getdata.php";

What each setting does

  • ssid: Wi-Fi network name
  • password: Wi-Fi password
  • device_token: token used by the server to identify the device
  • URL: endpoint that receives the RFID attendance request

How It Works

  1. The ESP32 connects to the configured Wi-Fi network.
  2. The OLED display shows a prompt asking the user to scan a card.
  3. When a card is detected, the system reads its UID.
  4. The card UID is sent to the server as an HTTP GET request.
  5. The server responds with a status such as login, logout, or attendance availability.
  6. The system avoids processing the same card repeatedly within a short time window.

Example Request Format

The ESP32 builds the request in this format:

http://your-server/rfidattendance/getdata.php?card_uid=<CARD_ID>&device_token=<DEVICE_TOKEN>

Notes

  • The current code uses HTTP, not HTTPS.
  • The sketch expects a reachable backend endpoint to process attendance.
  • If Wi-Fi disconnects, the ESP32 tries to reconnect automatically.
  • The OLED currently shows the scan prompt, while server response handling is logged through Serial output.

Possible Improvements

  • Display login and logout responses directly on the OLED
  • Add buzzer or LED feedback for successful scans
  • Store logs locally when the network is unavailable
  • Use HTTPS or token validation improvements for better security
  • Add a web dashboard for attendance records

License

This project is licensed under the MIT License.

About

An ESP32-based RFID attendance system that automatically identifies users and records attendance by scanning RFID cards.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages