SlideShare a Scribd company logo
2
Most read
6
Most read
15
Most read
Attendance System using ESP8266(Wi-Fi)
with MySQL
By Deligence Technologies
www.deligence.com
What we will Cover?
Project Description
Software Required
Hardware Required
Node MCU V3
RFID-RC522
Circuit Diagram
CODE: (Node MCU ESP8266)
CODE: (PHP)
Video Presentation
Project Description
Here We are going to connect
Node MCU ESP8266 and RFID-
RC522 with MYSQL Database. So
for that first we should connect
our Node MCU ESP8266 Board
with RFID Module. By using the
RFID Module we are going to
scan our RFID card and tag which
are allow or not. And by using
our ESP8266 we are going to
send that data to our MYSQL
Database which is connect
through a php page.
You can watch it in action in slide
20.
Software Used
 Arduino IDE
 LAMP Server for Linux or WAMP Server for Windows or MAMP Server for MAC OS
Hardware Used
 Node MCU V3
 RFID Reader with Tag
 Jumper Wire
Node MCU V3
Node MCU is an open source IOT platform. It includes
firmware which runs on the ESP8266 Wi-Fi SoC from
hardware which is based on the ESP-12 module. The term
"Node MCU" by default refers to the firmware rather than
the dev kits.
RFID-RC522
RFID RC522 is a low cost and easy to use module suitable
for equipment and advanced application development that
needs RFID applications. RFID application. RFID stands for
Radio-Frequency Identification. The acronym refers to small
electronic devices that consist of a small chip and an
antenna.
Circuit Diagram
CODE: (Node MCU ESP8266)
#include<SoftwareSerial.h>
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>
#include <SPI.h>
#include <MFRC522.h>
const char* ssid = "TP-LINK_28C6";
const char* password = "02105604";
//WiFiClient client;
char server[] = "192.168.0.115"; //YOUR SERVER
#define SS_PIN 2 //FOR RFID SS PIN BECASUSE WE ARE USING BOTH ETHERNET
SHIELD AND RS-522
#define RST_PIN 15
#define No_Of_Card 3
Cont…. >>>>>
CODE: (Node MCU ESP8266)
WiFiClient client;
//WiFiServer server(80);
SoftwareSerial mySerial(8,9);
MFRC522 rfid(SS_PIN,RST_PIN);
MFRC522::MIFARE_Key key;
byte id[No_Of_Card][4]={
{44,153,22,219}, //RFID NO-1
{112,224,72,84}, //RFID NO-2
{151,94,80,84} //RFID NO-3
};
byte id_temp[3][3];
byte i;
int j=0;
Cont…. >>>>>
CODE: (Node MCU ESP8266)
for(byte i=0;i<6;i++)
{
key.keyByte[i]=0xFF;
}
// Connect to WiFi network
Serial.println();
Serial.println();
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected");
Cont…. >>>>>
CODE: (Node MCU ESP8266)
// Start the server
// server.begin();
Serial.println("Server started");
Serial.print(WiFi.localIP());
delay(1000);
Serial.println("connecting...");
}
void loop()
{ // Check if a client has connected
int m=0;
if(!rfid.PICC_IsNewCardPresent())
return;
if(!rfid.PICC_ReadCardSerial())
return;
for(i=0;i<4;i++)
{
id_temp[0][i]=rfid.uid.uidByte[i];
delay(50);
} Cont…. >>>>>
for(i=0;i<No_Of_Card;i++)
{
if(id[i][0]==id_temp[0][0])
{
if(id[i][1]==id_temp[0][1])
{
if(id[i][2]==id_temp[0][2])
{
if(id[i][3]==id_temp[0][3])
{
Serial.print("your card no :");
for(int s=0;s<4;s++)
{
Serial.print(rfid.uid.uidByte[s]);
Serial.print(" ");
}
Cont…. >>>>>
CODE: (Node MCU ESP8266)
CODE: (Node MCU ESP8266)
Serial.println("nVALID");
Sending_To_DB();
j=0;
rfid.PICC_HaltA(); rfid.PCD_StopCrypto1(); return;
}
}
}
}
else
{j++;
if(j==No_Of_Card)
{
Serial.println("inVALID");
Sending_To_DB();
j=0;
}
}
} Cont…. >>>>>
CODE: (Node MCU ESP8266)
// Halt PICC
rfid.PICC_HaltA();
// Stop encryption on PCD
rfid.PCD_StopCrypto1();
}
void Sending_To_DB() //CONNECTING WITH MYSQL
{
if (client.connect(server, 80)) {
Serial.println("connected");
// Make a HTTP request:
Serial.println("GET /rfid/rfid_read.php?allow="); //YOUR URL
/rfid/rfid_read.php?allow
client.print("GET /rfid/nodemcu_rfid/rfid_read.php?allow="); //YOUR URL
/rfid/rfid_read.php?allow /var/www/html/rfid/rfid_read.php
Cont…. >>>>>
CODE: (Node MCU ESP8266)
if(j!=No_Of_Card)
{
Serial.println('1');
client.print('1');
}
else
{
Serial.println('0');
client.print('0');
}
Serial.println("&id=");
client.print("&id=");
for(int s=0;s<4;s++)
{
Serial.println(rfid.uid.uidByte[s]);
client.print(rfid.uid.uidByte[s]);
}
Cont…. >>>>>
CODE: (Node MCU ESP8266)
client.print(" "); //SPACE BEFORE HTTP/1.1
client.print("HTTP/1.1");
client.print("Host: ");
client.println(server);
client.println("Host: 192.168.0.115");
client.println("Connection: close");
client.println();
} else {
// if you didn't get a connection to the server:
Serial.println("connection failed");
}
client.stop();
}
CODE: (PHP)
<?php
class rfid{
public $link='';
function __construct($allow, $id){
$this->connect();
$this->storeInDB($allow, $id);
}
function connect(){
$this->link = mysqli_connect('localhost','root','Deligence@1') or die('Cannot
connect to the DB');
mysqli_select_db($this->link,'rfidesp') or die('Cannot select the DB');
}
Cont…. >>>>>
CODE: (PHP)
function storeInDB($allow, $id){
$query = "insert into rfid set rfid='".$id."', allow='".$allow."'";
$result = mysqli_query($this->link,$query) or die('Errant query: '.$query);
}
}
if($_GET['allow'] != '' and $_GET['id'] != ''){
$rfid=new rfid($_GET['allow'],$_GET['id']);
}
?>
You can get it's source code at -
https://github.com/DeligenceTechnologies/
Attendance-System-using-ESP8266-Wi-Fi-
with-MySQL
In case, you need any Embedded Systems
Development or IoT work - you can send an
email to us at sales @ deligence.com
Deligence Technologies –
(your growing technology partner)
www.deligence.com/contact-us
Email : info@deligence.com
Phone : +91 9910130340
Attendance System using ESP8266(Wi-Fi) with MySQL

More Related Content

PPTX
RFID BASED ATTENDANCE SYSTEM PPT
PPTX
Smart digital door locking system
PDF
Security in IoT
PDF
Cyber Security Vulnerabilities
PPTX
Smart door project ppt shivnaresh likhar
PDF
IoT Security Challenges and Solutions
PPTX
Rfid Attadance System ( Project PPt )
PDF
NodeMCU || Controlling and observing a robotic car with a smartphone through...
RFID BASED ATTENDANCE SYSTEM PPT
Smart digital door locking system
Security in IoT
Cyber Security Vulnerabilities
Smart door project ppt shivnaresh likhar
IoT Security Challenges and Solutions
Rfid Attadance System ( Project PPt )
NodeMCU || Controlling and observing a robotic car with a smartphone through...

What's hot (20)

PPTX
RFID BASED ATTENDANCE SYSTEM.pptx
PPTX
IOT gateways.pptx
PPTX
Network attacks
PPTX
Fileless Malware [Cyber Security]
PPTX
Fingerprint base security system
PDF
Rfid based attendance system using arduino (1)
PPTX
Fundamentals of Network security
PPT
Industrial control systems cybersecurity.ppt
PPT
Network security
PPTX
Smart shopping trolley using rfid and remote controlling
PDF
IoT and Fingerprint Based Door Looking System
PPTX
Wi-Fi Esp8266 nodemcu
PPTX
IOT presentation
PPTX
Home security system using iot
PDF
Coal Mine Safety Monitoring and Alerting System using IOT Based
PPT
Finger print based door access system
PPTX
Password management
PPSX
4 Operations Security
PPTX
NETWORK DESIGN CHAPTER 1(1).pptx
PDF
Internet of Things - module 1
RFID BASED ATTENDANCE SYSTEM.pptx
IOT gateways.pptx
Network attacks
Fileless Malware [Cyber Security]
Fingerprint base security system
Rfid based attendance system using arduino (1)
Fundamentals of Network security
Industrial control systems cybersecurity.ppt
Network security
Smart shopping trolley using rfid and remote controlling
IoT and Fingerprint Based Door Looking System
Wi-Fi Esp8266 nodemcu
IOT presentation
Home security system using iot
Coal Mine Safety Monitoring and Alerting System using IOT Based
Finger print based door access system
Password management
4 Operations Security
NETWORK DESIGN CHAPTER 1(1).pptx
Internet of Things - module 1
Ad

Viewers also liked (7)

PPTX
IoT(internet of thing) Based working of Smart devices
PDF
IOT: Home Automation using Android Application
PPTX
Home automation using IoT
PPS
Presentation on home automation
PPTX
Voice controlled home appliances
PPT
Voice Control Home Automation
PPTX
Home automation using android mobiles
IoT(internet of thing) Based working of Smart devices
IOT: Home Automation using Android Application
Home automation using IoT
Presentation on home automation
Voice controlled home appliances
Voice Control Home Automation
Home automation using android mobiles
Ad

Similar to Attendance System using ESP8266(Wi-Fi) with MySQL (20)

PPTX
Attendance system using MYSQL with Raspberry pi and RFID-RC522
PPTX
smart attendance monitoring sysstem-1.pptx
PDF
Esp8266 v12
PPTX
Arduino Interface with MySQL for Storing RFID Access Details
PPTX
Esp8266 Workshop
PPT
WIRELESS COMMUNICATIONAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
PDF
NodeMCU 0.9 Manual using Arduino IDE
PPTX
IOT Talking to Webserver - how to
PPTX
New Microsoft PowerPoint Presentation.pptx
PDF
Athens IoT Meetup #3 - Introduction to ESP8266 (Pavlos Isaris)
PPTX
Esp8266 NodeMCU
PPTX
Esp8266 - Intro for dummies
PDF
IOT NodeMCU - NodeMCU Connection to Internet
PDF
WiFi SoC ESP8266
PPTX
Getting Started with the NodeMCU- Access Point and Station (By Akshet Patel)
PDF
Radio frequency identification system
PPTX
RFID attendance system
DOCX
Sdfgh
PPTX
Rfid based smart attendance system using google sheet.pptx
PDF
RFID Electromagnetic project (rfid)
Attendance system using MYSQL with Raspberry pi and RFID-RC522
smart attendance monitoring sysstem-1.pptx
Esp8266 v12
Arduino Interface with MySQL for Storing RFID Access Details
Esp8266 Workshop
WIRELESS COMMUNICATIONAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
NodeMCU 0.9 Manual using Arduino IDE
IOT Talking to Webserver - how to
New Microsoft PowerPoint Presentation.pptx
Athens IoT Meetup #3 - Introduction to ESP8266 (Pavlos Isaris)
Esp8266 NodeMCU
Esp8266 - Intro for dummies
IOT NodeMCU - NodeMCU Connection to Internet
WiFi SoC ESP8266
Getting Started with the NodeMCU- Access Point and Station (By Akshet Patel)
Radio frequency identification system
RFID attendance system
Sdfgh
Rfid based smart attendance system using google sheet.pptx
RFID Electromagnetic project (rfid)

More from Sanjay Kumar (17)

PPT
Mobile app development
PPT
Accelerated Mobile Pages (AMP)
PPTX
Serial Data from Arduino to Raspberry Pi to MySQL using CoAP Protocol
PPTX
Arduino to Control Bulbs using Web App
PPTX
Bulb Control using Web App with Raspberry Pi
PPTX
Obstacle detection Robot using Ultrasonic Sensor and Arduino UNO
PPTX
Arduino Interface LM35 MQTT Using UART
PPTX
Rain Drop Sensor using Arduino!
PPTX
Arduino Programming Software Development
PPTX
Embedded Software Development
PPTX
Ionic - Hybrid Mobile Application Framework
PPTX
Internet of Things - IOT
PPTX
Meteor Mobile App Development
PPTX
Digital Marketing Strategy
PPTX
Web Application Development
PPTX
Joomla Website Development Company
PPTX
Meteor js App Development
Mobile app development
Accelerated Mobile Pages (AMP)
Serial Data from Arduino to Raspberry Pi to MySQL using CoAP Protocol
Arduino to Control Bulbs using Web App
Bulb Control using Web App with Raspberry Pi
Obstacle detection Robot using Ultrasonic Sensor and Arduino UNO
Arduino Interface LM35 MQTT Using UART
Rain Drop Sensor using Arduino!
Arduino Programming Software Development
Embedded Software Development
Ionic - Hybrid Mobile Application Framework
Internet of Things - IOT
Meteor Mobile App Development
Digital Marketing Strategy
Web Application Development
Joomla Website Development Company
Meteor js App Development

Recently uploaded (20)

PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
A Presentation on Artificial Intelligence
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
KodekX | Application Modernization Development
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Approach and Philosophy of On baking technology
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Network Security Unit 5.pdf for BCA BBA.
NewMind AI Weekly Chronicles - August'25 Week I
Unlocking AI with Model Context Protocol (MCP)
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Chapter 3 Spatial Domain Image Processing.pdf
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
A Presentation on Artificial Intelligence
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
20250228 LYD VKU AI Blended-Learning.pptx
KodekX | Application Modernization Development
The AUB Centre for AI in Media Proposal.docx
Approach and Philosophy of On baking technology
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Review of recent advances in non-invasive hemoglobin estimation
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Reach Out and Touch Someone: Haptics and Empathic Computing
Advanced methodologies resolving dimensionality complications for autism neur...

Attendance System using ESP8266(Wi-Fi) with MySQL

  • 1. Attendance System using ESP8266(Wi-Fi) with MySQL By Deligence Technologies www.deligence.com
  • 2. What we will Cover? Project Description Software Required Hardware Required Node MCU V3 RFID-RC522 Circuit Diagram CODE: (Node MCU ESP8266) CODE: (PHP) Video Presentation
  • 3. Project Description Here We are going to connect Node MCU ESP8266 and RFID- RC522 with MYSQL Database. So for that first we should connect our Node MCU ESP8266 Board with RFID Module. By using the RFID Module we are going to scan our RFID card and tag which are allow or not. And by using our ESP8266 we are going to send that data to our MYSQL Database which is connect through a php page. You can watch it in action in slide 20.
  • 4. Software Used  Arduino IDE  LAMP Server for Linux or WAMP Server for Windows or MAMP Server for MAC OS
  • 5. Hardware Used  Node MCU V3  RFID Reader with Tag  Jumper Wire
  • 6. Node MCU V3 Node MCU is an open source IOT platform. It includes firmware which runs on the ESP8266 Wi-Fi SoC from hardware which is based on the ESP-12 module. The term "Node MCU" by default refers to the firmware rather than the dev kits.
  • 7. RFID-RC522 RFID RC522 is a low cost and easy to use module suitable for equipment and advanced application development that needs RFID applications. RFID application. RFID stands for Radio-Frequency Identification. The acronym refers to small electronic devices that consist of a small chip and an antenna.
  • 9. CODE: (Node MCU ESP8266) #include<SoftwareSerial.h> #include <ESP8266WiFi.h> #include <WiFiClient.h> #include <ESP8266WebServer.h> #include <ESP8266mDNS.h> #include <SPI.h> #include <MFRC522.h> const char* ssid = "TP-LINK_28C6"; const char* password = "02105604"; //WiFiClient client; char server[] = "192.168.0.115"; //YOUR SERVER #define SS_PIN 2 //FOR RFID SS PIN BECASUSE WE ARE USING BOTH ETHERNET SHIELD AND RS-522 #define RST_PIN 15 #define No_Of_Card 3 Cont…. >>>>>
  • 10. CODE: (Node MCU ESP8266) WiFiClient client; //WiFiServer server(80); SoftwareSerial mySerial(8,9); MFRC522 rfid(SS_PIN,RST_PIN); MFRC522::MIFARE_Key key; byte id[No_Of_Card][4]={ {44,153,22,219}, //RFID NO-1 {112,224,72,84}, //RFID NO-2 {151,94,80,84} //RFID NO-3 }; byte id_temp[3][3]; byte i; int j=0; Cont…. >>>>>
  • 11. CODE: (Node MCU ESP8266) for(byte i=0;i<6;i++) { key.keyByte[i]=0xFF; } // Connect to WiFi network Serial.println(); Serial.println(); Serial.print("Connecting to "); Serial.println(ssid); WiFi.begin(ssid, password); while (WiFi.status() != WL_CONNECTED) { delay(500); Serial.print("."); } Serial.println(""); Serial.println("WiFi connected"); Cont…. >>>>>
  • 12. CODE: (Node MCU ESP8266) // Start the server // server.begin(); Serial.println("Server started"); Serial.print(WiFi.localIP()); delay(1000); Serial.println("connecting..."); } void loop() { // Check if a client has connected int m=0; if(!rfid.PICC_IsNewCardPresent()) return; if(!rfid.PICC_ReadCardSerial()) return; for(i=0;i<4;i++) { id_temp[0][i]=rfid.uid.uidByte[i]; delay(50); } Cont…. >>>>>
  • 13. for(i=0;i<No_Of_Card;i++) { if(id[i][0]==id_temp[0][0]) { if(id[i][1]==id_temp[0][1]) { if(id[i][2]==id_temp[0][2]) { if(id[i][3]==id_temp[0][3]) { Serial.print("your card no :"); for(int s=0;s<4;s++) { Serial.print(rfid.uid.uidByte[s]); Serial.print(" "); } Cont…. >>>>> CODE: (Node MCU ESP8266)
  • 14. CODE: (Node MCU ESP8266) Serial.println("nVALID"); Sending_To_DB(); j=0; rfid.PICC_HaltA(); rfid.PCD_StopCrypto1(); return; } } } } else {j++; if(j==No_Of_Card) { Serial.println("inVALID"); Sending_To_DB(); j=0; } } } Cont…. >>>>>
  • 15. CODE: (Node MCU ESP8266) // Halt PICC rfid.PICC_HaltA(); // Stop encryption on PCD rfid.PCD_StopCrypto1(); } void Sending_To_DB() //CONNECTING WITH MYSQL { if (client.connect(server, 80)) { Serial.println("connected"); // Make a HTTP request: Serial.println("GET /rfid/rfid_read.php?allow="); //YOUR URL /rfid/rfid_read.php?allow client.print("GET /rfid/nodemcu_rfid/rfid_read.php?allow="); //YOUR URL /rfid/rfid_read.php?allow /var/www/html/rfid/rfid_read.php Cont…. >>>>>
  • 16. CODE: (Node MCU ESP8266) if(j!=No_Of_Card) { Serial.println('1'); client.print('1'); } else { Serial.println('0'); client.print('0'); } Serial.println("&id="); client.print("&id="); for(int s=0;s<4;s++) { Serial.println(rfid.uid.uidByte[s]); client.print(rfid.uid.uidByte[s]); } Cont…. >>>>>
  • 17. CODE: (Node MCU ESP8266) client.print(" "); //SPACE BEFORE HTTP/1.1 client.print("HTTP/1.1"); client.print("Host: "); client.println(server); client.println("Host: 192.168.0.115"); client.println("Connection: close"); client.println(); } else { // if you didn't get a connection to the server: Serial.println("connection failed"); } client.stop(); }
  • 18. CODE: (PHP) <?php class rfid{ public $link=''; function __construct($allow, $id){ $this->connect(); $this->storeInDB($allow, $id); } function connect(){ $this->link = mysqli_connect('localhost','root','Deligence@1') or die('Cannot connect to the DB'); mysqli_select_db($this->link,'rfidesp') or die('Cannot select the DB'); } Cont…. >>>>>
  • 19. CODE: (PHP) function storeInDB($allow, $id){ $query = "insert into rfid set rfid='".$id."', allow='".$allow."'"; $result = mysqli_query($this->link,$query) or die('Errant query: '.$query); } } if($_GET['allow'] != '' and $_GET['id'] != ''){ $rfid=new rfid($_GET['allow'],$_GET['id']); } ?>
  • 20. You can get it's source code at - https://github.com/DeligenceTechnologies/ Attendance-System-using-ESP8266-Wi-Fi- with-MySQL In case, you need any Embedded Systems Development or IoT work - you can send an email to us at sales @ deligence.com Deligence Technologies – (your growing technology partner) www.deligence.com/contact-us Email : info@deligence.com Phone : +91 9910130340