0% found this document useful (0 votes)
66 views

RFID Based Attendance System

This document summarizes a student project report on developing an RFID-based attendance system using ESP32 NodeMCU. The system aims to automate the process of recording student attendance to reduce manual work. Deepesh Rajpoot developed the system under the supervision of Dr. Atul Kumar Dwivedi for their BTech mini project. The abstract provides an overview of how RFID technology will be used along with IoT to read student RFID tags and record attendance electronically, eliminating duplicate data entry. The report is organized into chapters covering an introduction to RFID and IoT, literature review, methodology, system overview, results and conclusion.

Uploaded by

Deepesh Rajpoot
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
66 views

RFID Based Attendance System

This document summarizes a student project report on developing an RFID-based attendance system using ESP32 NodeMCU. The system aims to automate the process of recording student attendance to reduce manual work. Deepesh Rajpoot developed the system under the supervision of Dr. Atul Kumar Dwivedi for their BTech mini project. The abstract provides an overview of how RFID technology will be used along with IoT to read student RFID tags and record attendance electronically, eliminating duplicate data entry. The report is organized into chapters covering an introduction to RFID and IoT, literature review, methodology, system overview, results and conclusion.

Uploaded by

Deepesh Rajpoot
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 40

RFID based Attendance System using ESP32 NodeMCU

This report is submitted to


Bundelkhand Institute of Engineering and Technology
For a Mini Project
Bachelor of Technology
in
Electronics and Communication Engineering

By
Deepesh Rajpoot (2100430310023)

Under the supervision of


Dr. Atul Kumar Dwivedi

Department of Electronics and Communication Engineering


Bundelkhand Institute of Engineering & Technology
Jhansi
(An Autonomous Institute)
CERTIFICATE
This is to certify that the work contained in the thesis entitled “RFID based
Attendance System using ESP32 NodeMCU” submitted by Deepesh Rajpoot
(2100430310023) for a mini project of Bachelor of Technology in Electronics and
Communication Engineering to the Bundelkhand Institute of Engineering and
Technology, Jhansi is a record of bonafide work carried out by him under my direct
supervision and guidance.

Date:
Place:
Dr. Atul Kumar Dwivedi
Assistant Professor
ECE Department
BIET Jhansi

ii
ACKNOWLEDGEMENT

We would like to express our gratitude towards Dr. Atul Kumar Dwivedi for his guidance
and constant supervision as well as for providing us necessary information regarding the
project and this report. We feel thankful and express our kind gratitude towards our Director,
Head of Department and all faculty members. We would also like to express our special
gratitude and thanks to our parents for giving us constant support that improved our
performance significantly.

Deepesh Rajpoot (2100430310023)

iii
ABSTRACT

In many schools and colleges, teachers record the students' attendance in an attendance
register manually. Later this data is entered into a computer and the aggregate percentage
of students' attendance is calculated. This method results in duplication of work and
increases manpower requirements. Recently, students’ attendance has been considered as
one of the crucial elements or issues that reflects the academic achievements and the
performance contributed to any university compared to the traditional methods that
impose time-consuming and inefficiency.

Internet of Things (IoT) is one of the key mediums to solve the said issue. Diverse
automatic identification technologies have been more in vogue such as Radio Frequency
Identification (RFID). RFID is a wireless technology which uses to a purpose of
identifying and tracking an object via radio waves to transfer data from an electronic tag,
called RFID tag or label to send data to RFID reader. This IOT based project is for
reducing manpower and implementing automation and furthermore being beneficial for
the school, colleges, or any workplace.

iv
TABLE OF CONTENTS

Chapter No. Title Page No.


Title i
Certificate ii
iii
Declaration iv
Acknowledgements v
Abstract vi
List of Figures
List of Tables vii

Chapter 1 Introduction................................................................................................1

1.1 RFID Technology 2


1.2 RFID Tag 2
1.3 RFID Reader 2
1.4 IOT (Internet of Things) 2
1.5 NodeMCU

Chapter 2 Literature Review......................................................................................3

2.1 Attendance and Information System using RFID and Web-Based 3


Application for Academic Sector
2.2 A RFID based (IoT) automatic attendance system: A survey analysis 3
2.3 A New Model of The Student Attendance Monitoring System
Using RFID Technology 4
2.4 Fully Automated Classroom Attendance System 4
2.5 Problem Statement 5
2.6 Objectives 5

Chapter 3 Methodology…...........................................................................................6

3.1 Block Diagram 6


3.2 Flow Chart 7
3.3 Pin Diagram 8

Chapter 4 System Overview........................................................................................15

4.1 Components and Supplies 15


4.2 NodeMCU ESP32 15
4.3 RFID Reader MFRC522 Module 16
4.4 RFID Cards 16
4.5 LCD Display 17
4.6 Breadboard 17
4.7 Jumper Wires 18
4.8 Connecting Diagram of the system 18
4.9 Software Implementation 19
4.9.1 Arduino IDE 19
4.9.2 Working 19

Chapter 5 Outcome & Result…....................................................................................20

Chapter 6 Conclusion & Overview...............................................................................21


References 22

Appendix 23
List of Figures

S.No. Figure No. Title Page No.


1. 3.1 Block Diagram of the whole system 6
2. 3.2 Flow chart of the system 7
3. 3.3 Pin Out of Node MCU ESP 32 8
5. 3.4 Pinout of RFID-RC522 11

6. 3.5 Pinout of 16x2 LCD Display Module 12


9. 4.1 NodeMCU ESP32 Module 15
10. 4.2 RFID MFRC522 16
13. 4.3 RFID Card & Tag 16
14. 4.4 LCD Display 17
15. 4.5 Breadboard 17
16. 46 Jumper Wire 18
17. 4.7 Circuit diagram 18
18. 5.1 Hardware installation of prototype 31
19. 5.2 Results on Google Sheets 31

v
List of Tables

S.No. Table No. Title Page No.


1. 3.1 RFID-RC522 Pin Configuration 12
2. 3.2 16x2 LCD Pin Configuration 13
3. 3.3 Pin Connection of RFID & Node MCU 14

vi
Chapter 1
INTRODUCTION

Information Technology (IT) has played a significant role in developing several aspects
in academic sectors and domains such as student monitoring and management systems.

Attendance or daily register of understudies has turned into a vital assessment perspective
in the current instructive framework in both universities and schools. The conventional
attendance monitoring framework has a few impediments with the trend and the
technology gap. For instance, passing the everyday attendance sheet to a huge number of
students in a class is extremely risky and it hampers the consideration of the students in
the class. It is waste of time as well as a student can deliberately enlist counterfeit
attendance record in the day-by-day attendance sheet. On the off chance, if the teacher
loses these documents, all the significant attendance records are lost without doubt.

Therefore, it is a critical subject to tracking and manages student’s attendance in school,


college, and university environment. Since it can be helped to urge students to attend on
time, amend the efficiency of the learning, increase learning grade, and finally boosting
and improving the education level. So, there is a need to manage the student attendance
records automatically by using information technology management system in a faculty
to assist the maintaining attendance. Biometrics techniques are used to verify
identification through their characteristics like face recognition, signatures, fingerprint,
voice recognition, irises, barcode, Bluetooth, Near-Field Communication (NFC), RFID
and so on.

RFID innovation has a tremendous task to carry out in the completion of the vision of
associating objects around us to the internet. These items extend from huge structures,
modern plants, planes, vehicles, machineries, any sort of merchandise, and explicit pieces
of a bigger framework to people, animals and plants and even explicit body portions of
them. The idea driving this is called Internet of Things (IoT).

1
1.1 RFID Technology: RFID is standard for Radio Frequency Identification which is the
very latest concept of Internet of Things (IoT) and it is very similar technology of
barcode system but with some higher advanced concept. It works by using
transferring and receiving signal using Antenna and Integrated Circuit. It has two
parts namely, RFID Tag and RFID Reader.

1.2 RFID Tag: A RFID Tag is an electronic tag that exchanges information with a RFID
reader through radio waves. Almost every RFID Tags have two parts namely,
Antenna and Integrated Circuit (IC). Antenna used for receives radio frequency
waves and IC used for processing and store data.

1.3 RFID Reader: RFID reader is a device which used to gather information from RFID
tag which used to track individual. RFID uses radio waves to transfer the data from
tag to reader

1.4 IOT (Internet of Things): The Internet of things (IoT) describes physical objects (or
groups of such objects) with sensors, processing ability, software and other
technologies that connect and exchange data with other devices and systems over
the Internet or other communications networks. Internet of things has been considered
a misnomer because devices do not need to be connected to the public internet, they
only need to be connected to a network and be individually addressable.

1.5 NodeMCU: NodeMCU ESP32 is a versatile, compact electronics platform that


combines a microcontroller with built-in Wi-Fi and Bluetooth capabilities. It's like a
tiny computer that can be programmed to perform various tasks. With its power to
connect to the internet and communicate wirelessly, it's commonly used for creating
smart devices, automation projects, and IoT applications. This small board can be
programmed to gather data from sensors, control lights, motors, and more. Its
integrated Wi-Fi and Bluetooth features allow it to communicate with other devices
and cloud services. Overall, NodeMCU ESP32 is a valuable tool for makers,
hobbyists, and developers looking to bring their ideas to life by building smart and
connected project.
2
Chapter 2
LITERATURE REVIEW

In this project, I did a literature review and took some paper for the reference as follows:

2.1 Attendance and Information System using RFID and Web-Based Application
for Academic Sector.

By: Hasanein D. Rjeib. Nabeel Salih Ali, Ali Al Farawn, Basheer Al-Sadawi., Haider
Alsharqi.
Journal & Published: Article in International Journal of Advanced Computer Science and
Applications & January 2018

Findings: A student attendance and information system are designed and implemented to
manage student’s data and provide capabilities for tracking student attendance, grading
student marks, giving information about timetable, lecture time, room number, and other
student-related information. Also, the proposed system provides easiness for the staff
where there is no need for extra paper works and additional lockers for saving data.

Research Gap: Much complicated being web-based application. Only students’ data is
involved, can be used for other staffs and faculties.

2.2 A RFID based (IoT) automatic attendance system: A survey analysis.

By: RKAR. Kariapper1, MS. Suhail Razeeth.


Journal & Published: Southeastern University of Sri Lanka, Oluvil & April 2019.

Findings: Radio Frequency Identification (RFID) is a very advanced technology for


automatic attendance system, and it provide very higher accuracy and speed than a
traditional paper-based system. And it says that RFID is a best replacement of traditional
method without any doubt.

Research Gap: Eventually from this study I got to know that each system we have its own
advantages and disadvantages. Some characteristics are good for some system, and some

3
are not. To overcome this, a hybrid model is necessary, and which merely provide higher
efficient system without any disadvantage.

2.3 A New Model of The Student Attendance Monitoring System Using RFID
Technology

By: Mutammimul Ula, Angga Pratama, Yuli Asbar, Wahyu Fuadi, Riyadhul Fajri, Richki
Hardi.
Journal & Published: Journal of Physics: Conference Series CSINTESA 2019
Findings: With the student attendance system using RFID technology, the management
of the inputted data, and the archive of reports that often occur file loss no longer
occurs because it has been stored in a database. With the student attendance system
using RFID technology.

Research Gap: Beneficial for other staffs also, high maintenance and cost implementation.

2.4 Fully Automated Classroom Attendance System.

By: Eid Al Hajri, Farrukh Hafeez, Ameer Azhar N V.

Journal & Published: International Journal of Interactive Mobile Technologies, &


August 2019

Findings: The implemented system offers number of befits over traditional system
includes freedom of delivering lecture with full focus without notifying student timing.
As it is fully automated, the chance of error in the attendance entry is NIL. Fully
Automated Classroom Attendance System metric identification make system invincible.

Research Gap: Biometric identification can be installed; RFID reader range can be
increased by replacing high range RFID reader.

4
2.5 PROBLEM STATEMENT

Problem Definition
Passing the everyday attendance sheet to a huge number of students in a class is risky as
students can miss their attendance call and it can hamper students’ attendance percentage.
It is waste of time as well as a student can give a false attendance and cheat on the record
in the day-by-day attendance sheet. If the teacher loses these documents, all the
significant attendance records are lost without doubt.

2.6 OBJECTIVE
 To provide very higher accuracy and speed than a traditional paper-based system.
 To provide security and easy tracking of data.
 Implement fully automatic process.

5
Chapter 3
METHODOLOGY

The research methodology used is as follows:


3.1 BLOCK DIAGRAM
A block diagram is used to represent a control system in diagram form. In other words,
the practical representation of a control system is its block diagram. Each element of the
control system is represented with a block and the block is the symbolic representation of
the transfer function of that element.

Figure 3.1: Block Diagram of the whole system

The following fig shows the block diagram for our project Smart attendance system using
RFID. Which mainly consists of Node-Mcu (ESP-32), RFID Cards RFID readers, A
breadboard,16 x 2 LCD display. Here Node-Mcu acts as a Central processing unit (CPU)
for controlling all the input/output components. For this project, we have used a 5v power
supply to power up the node MCU and other components. RFID reader module is
interfaced with NodeMcu to read the data from RFID cards/tags.16 x 2 LCD display is
used to display the real- time attendance of the students /employee and the permanent
attendance is stored on a google sheet using IoT. In this system, a student or employee
has to place /put his card on an RFID reader. When the RFID reader reads the data it
directly transfers the data to Node-Mcu and the real-time attendance will be displayed on
a 16 x 2 LCD display and the permanent attendance is stored on a google sheet.

6
3.2 FLOW CHART

A flowchart is a picture of the separate steps of a process in sequential order. It is a


generic tool that can be adapted for a wide variety of purposes, and can be used to
describe various processes, such as a manufacturing process, an administrative or
service process, or a project plan.

Figure 3.2: Flowchart of the system

Each student is issued an RFID card as their id card and their attendance is marked
when they touch their card to RFID reader.

7
3.3 PIN DIAGRAM

A pin out is a reference to the pins or contacts that connect an electrical device or
connector. It describes the functions of transmitted signals and the circuit input/output
(I/O) requirements. Each individual pin in a chip, connector or singular wire is defined in
text, a table or a diagram.

Pin Out

A pin out is a reference to the pins or contacts that connect an electrical device or
connector. It describes the functions of transmitted signals and the circuit input/output
(I/O) requirements. Each individual pin in a chip, connector or singular wire is defined in
text, a table or a diagram

PIN Out of different modules:

Figure 3.3: Pin Out of Node MCU ESP 32

8
NodeMCU ESP32:

NodeMCU ESP32 Pinout Details

Power Pins:
1. VIN (Voltage Input): Accepts an external power supply (5V-12V) to power the
board. Ensure the voltage is within the acceptable range. Use caution not to
exceed the voltage limits.
2. 5V: Provides a regulated 5V output that can power external components. Useful
for sensors and modules requiring 5V.
3. 3.3V: Outputs a regulated 3.3V voltage supply, suitable for powering most
components on the board.
4. GND (Ground): These pins are connected to the ground reference and complete
the electrical circuit.

Digital Pins (GPIO):


NodeMCU ESP32 offers multiple GPIO pins (GPIO0 to GPIO39) for digital input/output
and interfacing with external devices and components.

Analog Pins (ADC):


ADC Pins: Labeled ADC1_0 to ADC1_7, these pins allow analog-to-digital conversion
and reading of analog sensor values.

UART (Serial Communication):


TX0 / RX0: GPIO1 (TX0) and GPIO3 (RX0) are used for serial communication
(UART), critical for programming and debugging.

I2C Pins:
SDA (Serial Data Line): GPIO21 (SDA) serves as the I2C data line for communication
with I2C devices.
SCL (Serial Clock Line): GPIO22 (SCL) is the I2C clock line.

9
SPI Pins:
NodeMCU ESP32 supports Serial Peripheral Interface (SPI) communication through
pins:
1. SCK (Clock): GPIO5
2. MISO (Master in Slave Out): GPIO18
3. MOSI (Master Out Slave In): GPIO23
4. CS (Chip Select): GPIO19

PWM Pins:
Certain pins can be configured as Pulse Width Modulation (PWM) outputs, allowing for
analog-like control of output signals:
GPIO4, GPIO5, GPIO12, GPIO13, GPIO14, GPIO15, GPIO16, GPIO17

Other Pins:
1. Boot Button: Used to enter bootloader mode during programming. Press this
button while resetting the board.
2. Reset Button: Pressing this button resets the board, restarting program execution.

Caution:
GPIO pins are not 5V tolerant; use level shifters or voltage dividers when interfacing
with 5V devices.
Observe current limits; avoid overloading pins and the board.
Use proper grounding and decoupling techniques to minimize noise and ensure stable
operation.

10
RFID-RC522:

The RC522 is a 13.56MHz RFID module that is based on the MFRC522 controller
from NXP semiconductors. The module can support I2C, SPI and UART and normally
is shipped with a RFID card and key fob. It is commonly used in attendance systems
and other person/object identification applications.

Figure 3.4: Pin Out of RFID-RC522

11
RC522 Pin Configuration:

Pin Pin Name Description


Number

1 Vcc Used to Power the module, typically 3.3V is used

2 RST Reset pin – used to reset or power down the module

3 Ground Connected to Ground of system

4 IRQ Interrupt pin – used to wake up the module when a


device comes into range

5 MISO/SCL/TX MISO pin when used for SPI communication, acts as


SCL for I2c and TX for UART.

6 MOSI Master out slave in pin for SPI communication

7 SCK Serial Clock pin – used to provide clock source

8 SS/SDA/Rx Acts as Serial input (SS) for SPI communication, SDA


for IIC and Rx during UART
Table 3.1: RFID-RC522 Pin Configuration

16x2 LCD Module:

16x2 LCD modules are commonly used in most embedded projects, the reason being its
cheap price, availability, programmer friendly and available educational resources.

Figure 3.5: Pin Out of 16x2 LCD Display Module

12
16x2 LCD Pinout Configuration:
PinNo: Pin Name: Description
1 Vss (Ground) Ground pin connected to system ground

2 Vdd (+5 Volt) Powers the LCD with +5V (4.7V – 5.3V)

3 VE (Contrast V) Decides the contrast level of display. Grounded to get


maximum contrast.

4 Register Connected to Microcontroller to shift between


Select command/data register
5 Read/Write Used to read or write data. Normally grounded to write
data to LCD
6 Enable Connected to Microcontroller Pin and toggled between
1 and 0 for data acknowledgement
7 Data Pin 0 Data pins 0 to 7 forms an 8-bit data line. They can be
connected to Microcontroller to send 8-bit data.
These LCD’s can also operate on 4-bit mode in such case
Data pin 4,5,6 and 7 will be left free.

8 Data Pin 1

9 Data Pin 2

10 Data Pin 3

11 Data Pin 4

12 Data Pin 5

13 Data Pin 6

14 Data Pin 7

15 LED Positive Backlight LED pin positive terminal

16 LED Negative Backlight LED pin negative terminal

Table 3.2: 16x2 LCD Pin Configuration

13
Pin Connection of the system:

RFID NODE MCU

SDA D4

SCK D5

MOSI D7

MISO D6

IRQ

GND GND

RST D3

3.3V 33.3v

Table 3.3: Pin Connection of RFID & Node MCU

14
Chapter 4
SYSTEM OVERVIEW

4.1 COMPONENTS AND SUPPLIES

 NodeMCU ESP32
 RFID MFRC522 Module
 RFID Card/Tag
 LCD display
 Breadboard
 Jumper wires

4.2 NodeMCU ESP32

In this project, we have used NodeMCU which is an opensource platform. NodeMCU is


based on ESP32 which can be used to connect objects and transfer data using Wi-Fi. In
this project, the NodeMCU is used to send the attendance on the spreadsheet via the Wi-
Fi module. Whatever the google spreadsheet code has generated the deployment link, we
have to copy that link and paste it into the code and with the help, NodeMCU will send
the data on the spreadsheet.

Figure 4.1: NodeMCU esp32 Module


15
16
4.3 RFID Reader MFRC522 Module

Full form of RFID is Radio Frequency Identification. RFID tags and RFID reader use
wireless communication between them. In this kind of communication RFID Reader does
not need any line of sight with the tags. The reader can find the RFID tag even if there is
an obstacle between them. RFID Reader is shown in figure

Figure 4.2: RFID MFRC522 Module

4.4 RFID Card & Tag


There are two main kinds of RFID cards, Passive and Active. Passive RFID tags are used
in this system.

We can use normal RFID cards which are of the size of credit card. These cards are like
credit or debit

cards which are white in color that can be used as ID card also.

Figure 4.3: RFID Tag & Card


17
4.1 LCD Display

Liquid crystal display is also used to display the Name, Time in and Time out of the
authorized students and to display error message for unauthorized access

Figure 4.4: LCD Display

4.2 Breadboard

A breadboard is a rectangular plastic board with a bunch of tiny holes in it. Most
electronic components in electronic circuits can be interconnected by inserting their leads
or terminals into the holes and then making connections through wires where appropriate.
The breadboard has strips of metal underneath the board and connects the holes on the
top of the board.

Figure 4.5: Breadboard

18
19
4.3 Jumper Wire

Jumper wires are used to connect two points in a circuit. All Electronics stocks jumper
wire in a variety of lengths and assortments. Frequently used with breadboards and other
prototyping tools to make it easy to change a circuit as needed. Male jumpers are
designed to plug securely into the holes in a breadboard. Female jumpers are useful for
connecting male header posts and pin terminals on components. Jumpers are available in
female- female, male-male and male-female configurations.

Figure 4.6: Jumper Wires

Connecting Diagram of the system:

Figure 4.7: Circuit diagram

20
4.4 SOFTWARE IMPLEMETATION

4.4.1 Arduino IDE


Software implementation on the NodeMCU ESP32 begins with setting up the Arduino
Integrated Development Environment (IDE), which serves as the programming
platform. After installing the IDE, the ESP32 board definitions are added via the Boards
Manager. Once the development environment is ready, selecting the appropriate
NodeMCU ESP32 variant and COM port is crucial for accurate code uploading. Writing
the code itself involves creating or modifying a sketch, embedding libraries, and coding
the desired functionalities.

4.4.2 Working of the system


This system consists of 3 codes.
1. First one is the spreadsheet code which is written on the back end of the
spreadsheet
2. Second one is the code in which we will register the card by loading his/her
information. That means that the card will be permanently assigned to the
student/employee.
3. The third code is the code through which we will scan our id card and then the
attendance will be marked on the spreadsheet via NodeMCU.
In the second code, we will write the information which we want to save in the new
fresh card. When the information is written in the code, we simply have to upload the
code. When the uploading is done, we have to take our new fresh card close to the
RFIDRC522 module once the information is loaded in the card the serial monitor will
show that” The Block is successfully Read” and” Data is stored in Block No 2”. With
this we have registered one card, same process is repeated to create the remaining cards,
just change the information in the code, upload the code take a new fresh card, and scan.
After that in the third code, we have pasted a link to the google spreadsheet which is
deployed/generated when we run the google spreadsheet code. So, after registering the
card we have to just simply upload the third code when the code is successfully
uploaded, we have to take our” Registered Card” close to the RFID-RC522 module
once the card has scanned the buzzer will immediately beep for a few seconds and the
serial monitor will give us the link and the HTTPS code. If the HTTPS code is 302 that
means our data is successfully read on the spreadsheet.

21
Chapter 5
OUTCOME/RESULT

The attendance of the students is stored in the google sheet. Attendance is stored in
tabular format with Date, Time and Name.

Figure 5.1: Hardware installation of prototype

Figure 5.2: Results on Google Sheets

22
Chapter 6
CONCLUSION AND OVERVIEW

In this project attempt has been made to mark the attendance of the students using RFID
technology. It has been up to mark, the use of RFID is a success, it is storing up data
much faster than traditional method and with much higher accuracy. Just swiping the
RFID tags attendance is being stored and time saving for the student and the teacher.
We aimed to get effective and efficient time-saving automated computerized attendance
in real-time with a ready excel sheet to maintain attendance records we conclude that this
user-friendly proposed system can be proved to be easy to use and implement, cost
efficient, time-saving, less tedious, and portable. To overcome all the drawbacks,
unreliable and inaccurate manual work, this proposed system gets improved with very
minimal effort and yet generates the results with maximal accuracy and qualitative.
Ultimately, the system improves academic performance which encourages time saves and
accuracy in attendance

It is obvious that the use of biometrics could improve some aspects of using this kind of
system. High security level can be increased, much wider range of RFID can be set to
capture the data over from distance. data can be sent to the parents about the presence and
absence of the student, cards can be misused by the student’s, proxy attendance can be
given, where fingerprint can be an essential as well as implementing NFC Near field
communication and improve and be much more secure to use.

23
REFERENCES:

[1] Ula, Mutammimul, et al. "A New Model of The Student Attendance Monitoring
System Using RFID Technology." Journal of Physics: Conference Series. Vol.
1807. No. 1. IOP Publishing, 2021.
[2] Nivetha, R., et al. "Student Attendance System Using RFID." International
Journal of Research in Engineering, Science and Management 3.10 (2020): 16-19.
[3] Al Hajri, Eid, Farrukh Hafeez, and Ameer Azhar NV. "Fully Automated
Classroom Attendance System." Int. J. Interact. Mob. Technol. 13.8 (2019): 95-
106.
[4] Kariapper, R. K. A. R., and Suhail Razeeth. "RFID Based (IoT) Automatic
Attendance System: A Survey Analysis." Available at SSRN 3372734 (2019).
[5] Rjeib, Hasanein D., et al. "Attendance and information system using RFID and
web-based application for academic sector." International Journal of Advanced
Computer Science and Applications 9.1 (2018).

24
APPENDIX
//Google Sheet Code
function doGet(e) {
Logger.log( JSON.stringify(e) );
var result = 'Ok';
if (e.parameter == 'undefined') {
result = 'No Parameters';
}
else {
var sheet_id = ''; // Spreadsheet ID
var sheet = SpreadsheetApp.openById(sheet_id).getActiveSheet();
var newRow = sheet.getLastRow() + 1;
var rowData = [];
var Curr_Date = new Date();
rowData[0] = Curr_Date; // Date in column A
var Curr_Time = Utilities.formatDate(Curr_Date, "Asia/Kolkata", 'HH:mm:ss');
rowData[1] = Curr_Time; // Time in column B
for (var param in e.parameter) {
Logger.log('In for loop, param=' + param);
var value = stripQuotes(e.parameter[param]);
Logger.log(param + ':' + e.parameter[param]);
switch (param) {
case 'name':
rowData[2] = value; // Employee Name in column C
result = 'Employee Name Written on column C';
break;
default:
result = "unsupported parameter";
}
}
Logger.log(JSON.stringify(rowData));
var newRange = sheet.getRange(newRow, 1, 1, rowData.length);
newRange.setValues([rowData]);
}
return ContentService.createTextOutput(result);
}
function stripQuotes( value ) {
return value.replace(/^["']|['"]$/g, "");
}

//Send data to google sheet

#include <SPI.h>
#include <MFRC522.h>
#include <Arduino.h>
#include <ESP8266WiFi.h>
25
#include <ESP8266WiFiMulti.h>
#include <ESP8266HTTPClient.h>
#include <WiFiClient.h>
#include <WiFiClientSecureBearSSL.h>

// Fingerprint for demo URL, expires on June 2, 2021, needs to be updated well before this
date
const uint8_t fingerprint[20] = {0x4a, 0x2e, 0xb2, 0xa8, 0x29, 0x12, 0x9a, 0xca, 0xac, 0xe1,
0xe0, 0xf4, 0xa0, 0x6c, 0x74, 0x4b, 0x4b, 0x7d, 0x5b, 0xab};
// 4a 2e b2 a8 29 12 9a ca ac e1 e0 f4 a0 6c 74 4b 4b 7d 5b ab

#define RST_PIN D3 // Configurable, see typical pin layout above


#define SS_PIN D4 // Configurable, see typical pin layout above
#define BUZZER D2 // Configurable, see typical pin layout above

MFRC522 mfrc522(SS_PIN, RST_PIN); // Instance of the class


MFRC522::MIFARE_Key key;
ESP8266WiFiMulti WiFiMulti;
MFRC522::StatusCode status;

/* Be aware of Sector Trailer Blocks */


int blockNum = 2;

/* Create another array to read data from Block */


/* Legthn of buffer should be 2 Bytes more than the size of Block (16 Bytes) */
byte bufferLen = 18;
byte readBlockData[18];
String data2;
Const String data1 =
"https://script.google.com/macros/s/AKfycbwi5Lioy_QXdIw0Snh3x_9bsLDtOu2-
nxgSBgGmj9k8DPO1j_g0-cM3N9PIgehlKRZN/exec?name=";
void setup()
{
/* Initialize serial communications with the PC */
Serial.begin(9600);
// Serial.setDebugOutput(true);
Serial.println();
Serial.println();
Serial.println();
for (uint8_t t = 4; t > 0; t--)
{
Serial.printf("[SETUP] WAIT %d...\n", t);
Serial.flush();
delay(1000);
}
WiFi.mode(WIFI_STA);
/* Put your WIFI Name and Password here */
26
WiFiMulti.addAP("iot", "project1234");
/* Set BUZZER as OUTPUT */
pinMode(BUZZER, OUTPUT);
/* Initialize SPI bus */
SPI.begin();
}
void loop()
{
/* Initialize MFRC522 Module */
mfrc522.PCD_Init();
/* Look for new cards */
/* Reset the loop if no new card is present on RC522 Reader */
if ( ! mfrc522.PICC_IsNewCardPresent())
{
return;
}
/* Select one of the cards */
if ( ! mfrc522.PICC_ReadCardSerial())
{
return;
}
/* Read data from the same block */
Serial.println();
Serial.println(F("Reading last data from RFID..."));
ReadDataFromBlock(blockNum, readBlockData);
/* If you want to print the full memory dump, uncomment the next line */
//mfrc522.PICC_DumpToSerial(&(mfrc522.uid));
/* Print the data read from block */
Serial.println();
Serial.print(F("Last data in RFID:"));
Serial.print(blockNum);
Serial.print(F(" --> "));
for (int j=0 ; j<16 ; j++)
{
Serial.write(readBlockData[j]);
}
Serial.println();
digitalWrite(BUZZER, HIGH);
delay(200);
digitalWrite(BUZZER, LOW);
delay(200);
digitalWrite(BUZZER, HIGH);
delay(200);
digitalWrite(BUZZER, LOW);
// wait for WiFi connection
if ((WiFiMulti.run() == WL_CONNECTED))
{
27
std::unique_ptr<BearSSL::WiFiClientSecure>client(new BearSSL::WiFiClientSecure);
client->setFingerprint(fingerprint);
// Or, if you happy to ignore the SSL certificate, then use the following line instead:
// client->setInsecure();
data2 = data1 + String((char*)readBlockData);
data2.trim();
Serial.println(data2);
HTTPClient https;
Serial.print(F("[HTTPS] begin...\n"));
if (https.begin(*client, (String)data2))
{
// HTTP
Serial.print(F("[HTTPS] GET...\n"));
// start connection and send HTTP header
int httpCode = https.GET();

// httpCode will be negative on error


if (httpCode > 0)
{
// HTTP header has been send and Server response header has been handled
Serial.printf("[HTTPS] GET... code: %d\n", httpCode);
// file found at server
}
else
{
Serial.printf("[HTTPS] GET... failed, error: %s\n",
https.errorToString(httpCode).c_str());
}
https.end();
delay(1000);
}
else
{
Serial.printf("[HTTPS} Unable to connect\n");
}
}
}
void ReadDataFromBlock(int blockNum, byte readBlockData[])
{
/* Prepare the ksy for authentication */
/* All keys are set to FFFFFFFFFFFFh at chip delivery from the factory */
for (byte i = 0; i < 6; i++)
{
key.keyByte[i] = 0xFF;
}
/* Authenticating the desired data block for Read access using Key A */
status = mfrc522.PCD_Authenticate(MFRC522::PICC_CMD_MF_AUTH_KEY_A,
28
blockNum, &key, &(mfrc522.uid));
if (status != MFRC522::STATUS_OK)
{
Serial.print("Authentication failed for Read: ");
Serial.println(mfrc522.GetStatusCodeName(status));
return;
}
else
{
Serial.println("Authentication success");
}
/* Reading data from the Block */
status = mfrc522.MIFARE_Read(blockNum, readBlockData, &bufferLen);
if (status != MFRC522::STATUS_OK)
{
Serial.print("Reading failed: ");
Serial.println(mfrc522.GetStatusCodeName(status));
return;
}
else
{
Serial.println("Block was read successfully");
}
}

//write RFID by NodeMCU

#include <SPI.h>
#include <MFRC522.h>
constexpr uint8_t RST_PIN = D3; // Configurable, see typical pin layout above
constexpr uint8_t SS_PIN = D4; // Configurable, see typical pin layout above
MFRC522 mfrc522(SS_PIN, RST_PIN); // Instance of the class
MFRC522::MIFARE_Key key;
/* Set the block to which we want to write data */
/* Be aware of Sector Trailer Blocks */
int blockNum = 2;
/* Create an array of 16 Bytes and fill it with data */
/* This is the actual data which is going to be written into the card */
byte blockData [16] = {"Himanshu_Sharma"};
/* Create another array to read data from Block */
/* Legthn of buffer should be 2 Bytes more than the size of Block (16 Bytes) */
byte bufferLen = 18;
byte readBlockData[18];
FRC522::StatusCode status;
void setup()
{
/* Initialize serial communications with the PC */
29
Serial.begin(9600);
/* Initialize SPI bus */
SPI.begin();
/* Initialize MFRC522 Module */
mfrc522.PCD_Init();
Serial.println("Scan a MIFARE 1K Tag to write data...");
}
void loop()
{
/* Prepare the ksy for authentication */
/* All keys are set to FFFFFFFFFFFFh at chip delivery from the factory */
for (byte i = 0; i < 6; i++)
{
key.keyByte[i] = 0xFF;
}
/* Look for new cards */
/* Reset the loop if no new card is present on RC522 Reader */
if ( ! mfrc522.PICC_IsNewCardPresent())
{
return;
}
/* Select one of the cards */
if ( ! mfrc522.PICC_ReadCardSerial())
{
return;
}
Serial.print("\n");
Serial.println("**Card Detected**");
/* Print UID of the Card */
Serial.print(F("Card UID:"));
for (byte i = 0; i < mfrc522.uid.size; i++)
{
Serial.print(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " ");
Serial.print(mfrc522.uid.uidByte[i], HEX);
}
Serial.print("\n");
/* Print type of card (for example, MIFARE 1K) */
Serial.print(F("PICC type: "));
MFRC522::PICC_Type piccType = mfrc522.PICC_GetType(mfrc522.uid.sak);
Serial.println(mfrc522.PICC_GetTypeName(piccType));
/* Call 'WriteDataToBlock' function, which will write data to the block */
Serial.print("\n");
Serial.println("Writing to Data Block...");
WriteDataToBlock(blockNum, blockData);
/* Read data from the same block */
Serial.print("\n");
Serial.println("Reading from Data Block...");
30
ReadDataFromBlock(blockNum, readBlockData);
/* If you want to print the full memory dump, uncomment the next line */
//mfrc522.PICC_DumpToSerial(&(mfrc522.uid));
/* Print the data read from block */
Serial.print("\n");
Serial.print("Data in Block:");
Serial.print(blockNum);
Serial.print(" --> ");
for (int j=0 ; j<16 ; j++)
{
Serial.write(readBlockData[j]);
}
Serial.print("\n");
}

void WriteDataToBlock(int blockNum, byte blockData[])


{
/* Authenticating the desired data block for write access using Key A */
status = mfrc522.PCD_Authenticate(MFRC522::PICC_CMD_MF_AUTH_KEY_A,
blockNum, &key, &(mfrc522.uid));
if (status != MFRC522::STATUS_OK)
{
Serial.print("Authentication failed for Write: ");
Serial.println(mfrc522.GetStatusCodeName(status));
return;
}
else
{
Serial.println("Authentication success");
}
/* Write data to the block */
status = mfrc522.MIFARE_Write(blockNum, blockData, 16);
if (status != MFRC522::STATUS_OK)
{
Serial.print("Writing to Block failed: ");
Serial.println(mfrc522.GetStatusCodeName(status));
return;
}
else
{
Serial.println("Data was written into Block successfully");
}
}
void ReadDataFromBlock(int blockNum, byte readBlockData[])
{
31
/* Authenticating the desired data block for Read access using Key A */
status = mfrc522.PCD_Authenticate(MFRC522::PICC_CMD_MF_AUTH_KEY_A,
blockNum, &key, &(mfrc522.uid));
if (status != MFRC522::STATUS_OK)
{
Serial.print("Authentication failed for Read: ");
Serial.println(mfrc522.GetStatusCodeName(status));
return;
}
else
{
Serial.println("Authentication success");
}

/* Reading data from the Block */


status = mfrc522.MIFARE_Read(blockNum, readBlockData, &bufferLen);
if (status != MFRC522::STATUS_OK)
{
Serial.print("Reading failed: ");
Serial.println(mfrc522.GetStatusCodeName(status));
return;
}
else
{
Serial.println("Block was read successfully");
}
}

32

You might also like