Professional Documents
Culture Documents
IoT Based RFID Attendance System Using ESP32 - The IOT Projects
IoT Based RFID Attendance System Using ESP32 - The IOT Projects
HOME ARDUINO PROJECTS ELECTRONICS CIRCUITS IOT PROJECTS MICRO CONTROLLERS Search for
Home / IoT Projects / IoT Based RFID Attendance System using ESP32
Follow Us
431 89
Fans Followers
1,600 455
Subscribers Followers
Popular Recent
In this project, I will tell you how to build a Portable IoT based RFID Attendance System using ESP32,
0.96” OLED Display & MF-RC522 Module. RFID Attendance Systems are commonly used to mark the
IoT Fall Detector Using
presence of students or staff in schools and offices. MPU6050 & ESP8266
April 2, 2021
more reliable. But before getting started, let’s learn How RFID Attendance System works? Program Digispark
Attiny85 with Arduino IDE
The ESP32 Wi-Fi Module will collect the RFID CARD/keychain UID from the multiple users and sends it over
the internet to a website. The Enrollment of RFID CARD is done on the server using any MF-RC522 RFID
Module that is available on the market. The verification of the Card/keychain will be done on the webserver,
while Card UID is transmitted over the WiFi.
Recent Posts
The website used in this project is developed using PHP, CSS, and Javascript, it has a database to record
Card UID. By logging in to the web server, we can collect personal records of each attendee as well as all Arduino Intruder Intruder Security
Security Alert Alarm using
attendance records, including incoming and outgoing times. These data can also be downloaded and
System Vibration Sensor
exported to an excel sheet. 3 weeks ago 3 weeks ago
Admin Panel
Program Digispark Interface BME680
User Entry Log Attiny85 with Environmental
User Management System Arduino IDE Sensor with Arduino
3 weeks ago April 8, 2021
Multiple Device Management System
Now, talking about the features of the RFID based Attendance system using ESP32. The home page
displays the admin login page. Until you login to the system, you will not be able to browse other available Arduino Projects 38
options. So the system is safe. In general, the design of the RFID presence system project is quite simple. So IoT Projects 36
the user does not find any difficulties in registering his/her Attendance. The user must swipe his/her card or
ESP8266 29
keychain to enroll in attendance, including entry time. The main tasks assigned to the administrator are as
Articles 10
follows:
Micro controllers 5
You can watch the following video tutorial for detailed information, or you can ESP32 3
read the article written here.
Raspberry Pi Projects 1
Electronics Circuits 1
Manage Users
View users
Remove Users
From the admin panel, administrators can add new users, update and remove users using the user
management system. Additionally, the administrator can view all attendance records.
Manage Device
Delete device
Change the device mode (Enrollment mode: to register new users to the system, Attendance Mode:
To record attendance of registered users)
In fact, from device section administrators can add a new device, update, and remove too. To add a new
device you need to enter the device name and its depart. Additionally, you can update the device token
from the device UID section.
From the User Log menu, you can navigate to all user log data. You can also see their arrival and departure
times. It also filters your logs to filter user, date, arrival time, timeout, and various sections. So you can export
that data to Excel.
Components Required
Following are the Hardware and Software components required for making IoT Based RFID Attendance
System Using ESP32.
Hardware Components
COMPONENTS
S.N DESCRIPTION QUANTITY
NAME
Software Components
Arduino IDE
XAMPP server
RFID-RC522 Library
1. Embedded C: All the hardware interface coding has been done in embedded C Language.
2. PHP: All the Logics and web interface is written in PHP Language.
5. Javascript and CSS: To Style web Interface with animation and validate the form.
Now its time to interface all the components together to build the project.
GPIO 4 SDA/SS
GPIO 18 SCK
GPIO 17 MOSI
GPIO 16 MISO
GND GND
GPIO 5 RST
Vcc/3.3v 3.3V
GPIO 22 SCL
GPIO 21 SDA
GND GND
Circuit Diagram: IoT based RFID Attendance System using ESP32 and OLED Display
Anyway, we are using the XAMPP server. It can be used on both Windows and Linux. Generally, Ubuntu
users can use LAMP which is better than XAMPP. But, I am using Windows so I am going to use the XAMPP
server. So you can download XAMPP server from this link
Download the PHP web app and the Arduino IDE Program code.
Create a database name “rfidattendance” and then click on the import tab.
Click on the browse file and then choose the “rfidattendance.sql” file located inside the rfidattendance
folder.
Click on Go.
After creating a database, open a browser and go to the URL “http://localhost/rfidattenddance/”. Now, the
admin login panel will be displayed.
The default admin credentials is: email= admin@gmail.com, and password= 123.
Go to “Tools -> Board -> Boards Manager” search and install ESP32.
Now select Your ESP32 Board by clicking Tools -> Board. Scroll down until you find it.
RFID Library
Adafruit GFX
Adafruit SSD1306
Program/Sketch Code
The source code for the Portable IoT Based RFID Attendance System using ESP32 is here. In this source
code, you need to do some modifications like your WiFi Network credentials, Device token from the
website, and PC IP Address.
Include ESP32, RFID, Adafruit GFX, and Adafruit SSD1306 Library header files.
#include <WiFi.h>
#include <HTTPClient.h>
#include <time.h>
//RFID-----------------------------
#include <SPI.h>
#include <MFRC522.h>
//OLED-----------------------------
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
Defining Pin of all the components that are interfaced to ESP32 board.
#define SS_PIN 4 // SCK-GPIO 18, MOSI-GPIO 17, MISO-GPIO 16, Vcc-3.3v, GND -GND,
#define RST_PIN 5
// Declaration for SSD1306 display connected using software I2C pins are(22 SCL, 21 SDA)
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
#define OLED_RESET 0 // Reset pin # (or -1 if sharing Arduino reset pin)
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
Set these to your desired credentials. Your WiFi SSID Name, Password, and Device Token.
SPI.begin();
mfrc522.PCD_Init();
if(!WiFi.isConnected())
connectToWiFi();
if ( ! mfrc522.PICC_IsNewCardPresent()) {
if ( ! mfrc522.PICC_IsNewCardPresent()) {
return;
Select one of the cards. If read card serial(0) returns 1, the UID struct contains the ID of the read card.
if ( ! mfrc522.PICC_ReadCardSerial()) {
return;
if (httpCode == 200) {
if (payload.substring(0, 5) == "login") {
String user_name = payload.substring(5);
// Serial.println(user_name);
}
else if (payload.substring(0, 6) == "logout") {
String user_name = payload.substring(6);
// Serial.println(user_name);
}
else if (payload == "succesful") {
}
else if (payload == "available") {
}
delay(100);
http.end(); //Close connection
}
}
}
void connectToWiFi(){
WiFi.mode(WIFI_OFF); //Prevents reconnection issue (taking too long to connect)
delay(1000);
WiFi.mode(WIFI_STA);
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, password);
delay(1000);
}
RFID Based Attendance System Using NodeMCU with PHP Web App
IoT Based RFID Smart Door Lock System Using NodeMCU ESp8266
/* -----------------------------------------------------------------------------
- Project: RFID attendance system using ESP32
- Author: https://www.youtube.com/ElectronicsTechHaIs
- Date: 6/03/2020
-----------------------------------------------------------------------------
This code was created by Electronics Tech channel for
the RFID attendance project with ESP32.
---------------------------------------------------------------------------*/
//*******************************libraries********************************
//ESP32----------------------------
#include <WiFi.h>
#include <HTTPClient.h>
#include <time.h>
//RFID-----------------------------
#include <SPI.h>
#include <MFRC522.h>
//OLED-----------------------------
#include <Wire.h>
#include <Adafruit_GFX.h> //https://github.com/adafruit/Adafruit-GFX-Library
#include <Adafruit_SSD1306.h> //https://github.com/adafruit/Adafruit_SSD1306
//************************************************************************
#define SS_PIN 4 // SCK-GPIO 18, MOSI-GPIO 17, MISO-GPIO 16, Vcc-3.3v, GND -GND,
#define RST_PIN 5
// Declaration for SSD1306 display connected using software I2C pins are(22 SCL, 21 SDA)
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
#define OLED_RESET 0 // Reset pin # (or -1 if sharing Arduino reset pin)
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
//************************************************************************
MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance.
//************************************************************************
/* Set these to your desired credentials. */
const char *ssid = "SSID";
const char *password = "Password";
const char* device_token = "Device Token";
//************************************************************************
int timezone = x * 3600; //Replace "x" your timezone.
int time_dst = 0;
String getData, Link;
String OldCardID = "";
unsigned long previousMillis1 = 0;
unsigned long previousMillis2 = 0;
String URL = "http://YourComputerIP/rfidattendance/getdata.php"; //computer IP or the server
domain
//*************************Biometric Icons*********************************
#define Wifi_start_width 54
#define Wifi_start_height 49
const uint8_t PROGMEM Wifi_start_bits[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x1f,0xf0,0x00,0x00,0x00
,0x00,0x03,0xff,0xff,0x80,0x00,0x00
,0x00,0x1f,0xf0,0x1f,0xf0,0x00,0x00
,0x00,0x7e,0x00,0x00,0xfc,0x00,0x00
,0x01,0xf0,0x00,0x00,0x1f,0x00,0x00
,0x03,0xc0,0x00,0x00,0x07,0xc0,0x00
,0x0f,0x00,0x00,0x00,0x01,0xe0,0x00
,0x1c,0x00,0x00,0x00,0x00,0x70,0x00
,0x38,0x00,0x07,0xc0,0x00,0x38,0x00
,0x70,0x00,0xff,0xfe,0x00,0x1e,0x00
,0xe0,0x03,0xfc,0x7f,0xc0,0x0e,0x00
,0x00,0x1f,0x80,0x03,0xf0,0x00,0x00
,0x00,0x3c,0x00,0x00,0x78,0x00,0x00
,0x00,0xf0,0x00,0x00,0x1c,0x00,0x00
,0x01,0xe0,0x00,0x00,0x0c,0x00,0x00
,0x03,0x80,0x00,0x00,0x00,0x00,0x00
,0x03,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x3f,0xf8,0x07,0x1e,0x00
,0x00,0x00,0xff,0xfe,0x1f,0xbf,0x80
,0x00,0x03,0xe0,0x04,0x7f,0xff,0xc0
,0x00,0x07,0x80,0x00,0xff,0xff,0xe0
,0x00,0x0e,0x00,0x00,0xff,0xff,0xe0
,0x00,0x0c,0x00,0x00,0x7f,0xff,0xc0
,0x00,0x00,0x00,0x00,0xfe,0x07,0xe0
,0x00,0x00,0x00,0x03,0xf8,0x03,0xf8
,0x00,0x00,0x07,0xe7,0xf9,0xf1,0xfc
,0x00,0x00,0x1f,0xe7,0xf1,0xf9,0xfc
,0x00,0x00,0x1f,0xe7,0xf3,0xf9,0xfc
,0x00,0x00,0x3f,0xe7,0xf3,0xf9,0xfc
,0x00,0x00,0x3f,0xe7,0xf1,0xf1,0xfc
,0x00,0x00,0x3f,0xe3,0xf8,0xe3,0xfc
,0x00,0x00,0x3f,0xf3,0xfc,0x07,0xf8
,0x00,0x00,0x1f,0xf0,0x7f,0x0f,0xc0
,0x00,0x00,0x0f,0xe0,0x7f,0xff,0xe0
,0x00,0x00,0x07,0xc0,0xff,0xff,0xe0
,0x00,0x00,0x00,0x00,0x7f,0xff,0xe0
,0x00,0x00,0x00,0x00,0x3f,0xff,0x80
,0x00,0x00,0x00,0x00,0x1f,0xbf,0x00
,0x00,0x00,0x00,0x00,0x03,0x18,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00
};
#define Wifi_connected_width 63
#define Wifi_connected_height 49
const uint8_t PROGMEM Wifi_connected_bits[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x03,0xff,0xff,0x80,0x00,0x00
,0x00,0x00,0x3f,0xff,0xff,0xf8,0x00,0x00
,0x00,0x01,0xff,0xff,0xff,0xff,0x00,0x00
,0x00,0x0f,0xff,0xff,0xff,0xff,0xe0,0x00
,0x00,0x3f,0xff,0xc0,0x07,0xff,0xf8,0x00
,0x00,0xff,0xf8,0x00,0x00,0x3f,0xfe,0x00
,0x03,0xff,0x80,0x00,0x00,0x03,0xff,0x80
,0x07,0xfe,0x00,0x00,0x00,0x00,0xff,0xc0
,0x1f,0xf8,0x00,0x00,0x00,0x00,0x3f,0xf0
,0x3f,0xe0,0x01,0xff,0xff,0x00,0x0f,0xf8
,0x7f,0x80,0x0f,0xff,0xff,0xe0,0x03,0xfc
,0xff,0x00,0x7f,0xff,0xff,0xfc,0x01,0xfe
,0xfc,0x01,0xff,0xff,0xff,0xff,0x00,0x7e
,0x78,0x07,0xff,0xc0,0x07,0xff,0xc0,0x3c
,0x00,0x0f,0xfc,0x00,0x00,0x7f,0xe0,0x00
,0x00,0x1f,0xf0,0x00,0x00,0x1f,0xf0,0x00
,0x00,0x3f,0xc0,0x00,0x00,0x07,0xf8,0x00
,0x00,0x7f,0x00,0x01,0x00,0x01,0xfc,0x00
,0x00,0x7e,0x00,0x7f,0xfc,0x00,0xfc,0x00
,0x00,0x3c,0x03,0xff,0xff,0x80,0x78,0x00
,0x00,0x00,0x07,0xff,0xff,0xc0,0x00,0x00
,0x00,0x00,0x1f,0xff,0xff,0xf0,0x00,0x00
,0x00,0x00,0x3f,0xf0,0x1f,0xf8,0x00,0x00
,0x00,0x00,0x3f,0x80,0x03,0xf8,0x00,0x00
,0x00,0x00,0x3f,0x00,0x01,0xf8,0x00,0x00
,0x00,0x00,0x1c,0x00,0x00,0x70,0x00,0x00
,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x0f,0xe0,0x00,0x00,0x00
,0x00,0x00,0x00,0x1f,0xf0,0x00,0x00,0x00
,0x00,0x00,0x00,0x3f,0xf8,0x00,0x00,0x00
,0x00,0x00,0x00,0x3f,0xf8,0x00,0x00,0x00
,0x00,0x00,0x00,0x3f,0xf8,0x00,0x00,0x00
,0x00,0x00,0x00,0x3f,0xf8,0x00,0x00,0x00
,0x00,0x00,0x00,0x1f,0xf0,0x00,0x00,0x00
,0x00,0x00,0x00,0x0f,0xe0,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
};
//************************************************************************
void setup() {
delay(1000);
Serial.begin(115200);
SPI.begin(); // Init SPI bus
mfrc522.PCD_Init(); // Init MFRC522 card
//-----------initiate OLED display-------------
if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { // Address 0x3D for 128x64
Serial.println(F("SSD1306 allocation failed"));
for(;;); // Don't proceed, loop forever
}
// you can delet these three lines if you don't want to get the Adfruit logo appear
display.display();
delay(2000); // Pause for 2 seconds
display.clearDisplay();
//---------------------------------------------
connectToWiFi();
//---------------------------------------------
configTime(timezone, time_dst, "pool.ntp.org","time.nist.gov");
}
//************************************************************************
void loop() {
//check if there's a connection to Wi-Fi or not
if(!WiFi.isConnected()){
connectToWiFi(); //Retry to connect to Wi-Fi
}
//---------------------------------------------
if (millis() - previousMillis1 >= 1000) {
previousMillis1 = millis();
display.clearDisplay();
if (httpCode == 200) {
if (payload.substring(0, 5) == "login") {
String user_name = payload.substring(5);
// Serial.println(user_name);
display.clearDisplay();
display.setTextSize(2); // Normal 2:2 pixel scale
display.setTextColor(WHITE); // Draw white text
display.setCursor(15,0); // Start at top-left corner
display.print(F("Welcome"));
display.setCursor(0,20);
display.print(user_name);
display.display();
}
else if (payload.substring(0, 6) == "logout") {
String user_name = payload.substring(6);
// Serial.println(user_name);
display.clearDisplay();
display.setTextSize(2); // Normal 2:2 pixel scale
display.setTextColor(WHITE); // Draw white text
display.setCursor(10,0); // Start at top-left corner
display.print(F("Good Bye"));
display.setCursor(0,20);
display.print(user_name);
display.display();
}
else if (payload == "succesful") {
display.clearDisplay();
display.setTextSize(2); // Normal 2:2 pixel scale
display.setTextColor(WHITE); // Draw white text
display.setCursor(5,0); // Start at top-left corner
display.print(F("New Card"));
display.display();
}
else if (payload == "available") {
display.clearDisplay();
display.setTextSize(2); // Normal 2:2 pixel scale
display.setTextColor(WHITE); // Draw white text
display.setCursor(5,0); // Start at top-left corner
display.print(F("Free Card"));
display.display();
}
delay(100);
http.end(); //Close connection
}
}
}
//********************connect to the WiFi******************
void connectToWiFi(){
WiFi.mode(WIFI_OFF); //Prevents reconnection issue (taking too long to connect)
delay(1000);
WiFi.mode(WIFI_STA);
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, password);
display.clearDisplay();
display.setTextSize(1); // Normal 1:1 pixel scale
display.setTextColor(WHITE); // Draw white text
display.setCursor(0, 0); // Start at top-left corner
display.print(F("Connecting to \n"));
display.setCursor(0, 50);
display.setTextSize(2);
display.print(ssid);
display.drawBitmap( 73, 10, Wifi_start_bits, Wifi_start_width, Wifi_start_height, WHITE);
display.display();
display.clearDisplay();
display.setTextSize(2); // Normal 1:1 pixel scale
display.setTextColor(WHITE); // Draw white text
display.setCursor(8, 0); // Start at top-left corner
display.print(F("Connected \n"));
display.drawBitmap( 33, 15, Wifi_connected_bits, Wifi_connected_width,
Wifi_connected_height, WHITE);
display.display();
delay(1000);
}
//=======================================================================
Thank You so much Electronics Tech Channel for this awesome Project.
Conclusion
Finally, we have completed the IoT Based RFID Attendance System Using ESP32 with a Website and
Database. I hope you found this project useful! Drop a comment below if you have any doubts or queries. l
will try my best to answer your questions.
Also Read:
Home Automation with ESP8266 Web Server & Relay Module Control Appliances from Local Network
#IoT based Attendance system #IoT based RFID Attendance with ESP32
Alsan Parajuli
I am a WordPress enthusiast, a hardworking and highly positive person. I always believes in practicality
rather than theoretical knowledge. With my curiosity and fast learning skills, I managed to learn
everything on my own. I love coding, editing, writing and rummaging around Internet. I am passionate
about IoT Projects, Digital marketing, website designing, and reviewing. Moreover, I had been
contributing to WordPress Biratnagar as an active member since 2018.
Read Next
ESP8266
4 days ago April 2, 2021 March 25, 2021 February 24, 2021
IoT Based Bidire… IoT Fall Detector… Portable Wi-Fi R… BMP280 Based I…
Related Articles
ESP8266 & BME280 IoT DHT11 Temperature and LoRa Based Wireless Weather
Weather Station Humidity Monitor with Station using Arduino & ESP32
February 7, 2021 NodeMCU on ThingSpeak December 20, 2020
January 19, 2021
15 Comments
Pingback: Capacitive Soil Moisture Sensor with OLED Display & Arduino-IoT Projects
Pingback: Fire Security System using Arduino & Flame Sensor | The IOT Projects
Pingback: IoT based Fire Detector & Automatic Extinguisher using NodeMCU
Chinpuy
September 21, 2020 at 8:33 pm
Hello how do i change time in and out acording to my country time zone ?
Reply
articnl
October 20, 2020 at 1:47 am
Reply
Pingback: LoRa Based Wireless Weather Station using Arduino & ESP32
Madhavi
December 21, 2020 at 8:59 pm
Great work! But can we use MQTT protocol instead of http in this project. If yes then can you please explain
in brief as how to use it.
Reply
sudhakar
January 19, 2021 at 8:58 am
Reply
Alsan Parajuli
January 19, 2021 at 5:44 pm
Reply
bella
March 1, 2021 at 3:39 pm
Hi Alsan the password is not 123. I change it in db with MD5 field but doesn.t work. Whot can I do? thanks
Reply
jack
April 27, 2021 at 12:09 pm
Reply
George
May 8, 2021 at 6:19 am
Hi Alsan,
After successfully getting a WEMOS d1 mini running with NodeMCU_RFIDv2.0.INO with your help.
I now want to run my ESP32-WROOM with ESP32_RFID.INO.
I use same IP adres as with NodeMCU_RFIDv2.0.INO so connection doesn’t seems the problem.
Reply
Leave a Reply
RFID Based
Attendance System
Using NodeMCU
with PHP Web App
April 23, 2020
Intruder Security
Alarm using
Vibration Sensor
3 weeks ago
© Copyright 2021, All Rights Reserved | The IoT Projects Privacy Policy Disclaimer DMCA Advertise With us