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.
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.
- 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
- 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
The current sketch uses the following pin mapping:
SS_PIN->21RST_PIN->22- SPI communication is initialized with
SPI.begin()
SDA_PIN->5SCK_PIN->4- I2C address ->
0x3C
Make sure your actual wiring matches the values defined in SmartTrack.ino.
- Arduino IDE or another Arduino-compatible ESP32 development environment
- ESP32 board package installed in Arduino IDE
- Required libraries:
MFRC522WiFiWiFiClientHTTPClientWireAdafruit_SSD1306
- SmartTrack.ino - main firmware for the ESP32
- README.md - project documentation
- LICENSE - MIT license
- projectProposal.pdf - project proposal document
- Open SmartTrack.ino in the Arduino IDE.
- Install the required libraries if they are not already available.
- Update these values in the sketch:
ssidpassworddevice_tokenURL
- Connect the ESP32, MFRC522, and OLED display using the configured pins.
- Select the correct ESP32 board and COM port in the Arduino IDE.
- Upload the sketch to the ESP32.
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";ssid: Wi-Fi network namepassword: Wi-Fi passworddevice_token: token used by the server to identify the deviceURL: endpoint that receives the RFID attendance request
- The ESP32 connects to the configured Wi-Fi network.
- The OLED display shows a prompt asking the user to scan a card.
- When a card is detected, the system reads its UID.
- The card UID is sent to the server as an HTTP GET request.
- The server responds with a status such as login, logout, or attendance availability.
- The system avoids processing the same card repeatedly within a short time window.
The ESP32 builds the request in this format:
http://your-server/rfidattendance/getdata.php?card_uid=<CARD_ID>&device_token=<DEVICE_TOKEN>
- 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.
- 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
This project is licensed under the MIT License.
