RFID Smart Attendance System Using Arduino and Google Sheets (Cloud-Based Attendance Monitoring)
Meta description: Learn how to build an RFID smart attendance system using Arduino, an RFID RC522 reader, ESP8266 Wi-Fi and Google Sheets for automatic cloud attendance tracking.
1. Introduction
Manual attendance recording in schools, colleges, offices and other institutions can be time-consuming, inaccurate and difficult to manage. Traditional attendance registers also make it challenging to retrieve historical attendance records and monitor learners or employees remotely.
The RFID Smart Attendance System using Arduino and Google Sheets provides an automated solution.
The project uses Radio Frequency Identification (RFID) technology to identify individuals through unique RFID cards or tags. When a registered card is scanned, the system reads its identification number, processes the information and sends the attendance record to Google Sheets through a Wi-Fi connection.
The Google Sheets platform acts as a cloud-based attendance database where administrators can view attendance records, names, identification numbers, dates and scanning times.
Project objective: To design and develop an automated attendance monitoring system that uses RFID identification, Arduino programming and cloud-based Google Sheets storage to improve attendance recording and data management.
2. How the RFID Smart Attendance System Works
The system operates through communication between the RFID reader, Arduino microcontroller, Wi-Fi module and Google Sheets.
The working process follows these steps:
- Each learner or employee is assigned a unique RFID card.
- The individual places the card near the RC522 RFID reader.
- The RFID reader captures the card’s unique identification number (UID).
- Arduino processes the received UID and checks whether it belongs to a registered user.
- The system identifies the corresponding individual.
- The ESP8266 Wi-Fi module sends the attendance information to a Google Apps Script web application.
- Google Apps Script records the information in a Google Sheets spreadsheet.
- The system displays a confirmation message when attendance is successfully recorded.
3. Materials and Components Required
The following components are required to construct the project.
| Component | Quantity | Function |
|---|---|---|
| Arduino Uno | 1 | Main control unit |
| RFID RC522 reader | 1 | Reads RFID card information |
| RFID cards/tags | As required | Identifies learners or employees |
| ESP8266 ESP-01 | 1 | Provides Wi-Fi connectivity |
| 16×2 LCD with I2C | 1 | Displays attendance messages |
| Buzzer | 1 | Provides audio feedback |
| Red LED | 1 | Indicates invalid card or error |
| Green LED | 1 | Indicates successful scanning |
| 220Ω resistors | 2 | Limits LED current |
| Breadboard | 1 | Circuit assembly |
| Jumper wires | Several | Electrical connections |
| 3.3V regulated power supply | 1 | Powers ESP8266 and RFID reader |
| USB cable | 1 | Uploads Arduino program |
4. Understanding the Main Components
A. Arduino Uno
The Arduino Uno is the main controller. It receives information from the RFID reader, processes card identification numbers and controls the LCD, buzzer and indicator LEDs.
B. RFID RC522 Reader
The RC522 is a radio-frequency identification module that communicates with compatible RFID cards and tags, typically at 13.56 MHz.
C. ESP8266 Wi-Fi Module
The ESP8266 provides wireless internet connectivity, allowing attendance information to be transmitted from the Arduino to Google Sheets.
D. Google Sheets
Google Sheets stores attendance records in the cloud, making it possible for authorized administrators to access and analyse attendance information.
5. Circuit Connections and Wiring
The project uses SPI communication between the Arduino Uno and the RC522 RFID reader. The ESP8266 communicates with the Arduino through serial communication.
A. RFID RC522 to Arduino Uno
| RC522 pin | Arduino Uno pin |
|---|---|
| SDA (SS) | D10 |
| SCK | D13 |
| MOSI | D11 |
| MISO | D12 |
| IRQ | Not connected |
| GND | GND |
| RST | D9 |
| 3.3V | 3.3V |
The RC522 operates at 3.3V. Do not connect its VCC to the Arduino 5V supply.
B. ESP8266 ESP-01 to Arduino Uno
| ESP8266 pin | Connection |
|---|---|
| VCC | Regulated 3.3V |
| GND | GND |
| TX | Arduino D2 (SoftwareSerial RX) |
| RX | Arduino D3 through a 5V-to-3.3V level shifter |
| EN/CH_PD | 3.3V |
| RST | 3.3V through pull-up |
The ESP8266 requires a stable 3.3V power supply capable of handling its current peaks. Do not power it directly from the Arduino Uno’s 3.3V pin.
C. LCD, Buzzer and LEDs
| Component | Connection |
|---|---|
| LCD SDA | A4 |
| LCD SCL | A5 |
| LCD VCC | According to LCD module specification |
| LCD GND | GND |
| Buzzer positive | D8 |
| Buzzer negative | GND |
| Green LED anode | D7 through 220Ω |
| Red LED anode | D6 through 220Ω |
| LED cathodes | GND |
Wiring consideration: The Arduino Uno and ESP8266 must share a common ground. Check the LCD I2C voltage compatibility and use appropriate level shifting where necessary.
6. Creating the Google Sheets Cloud Database
Google Sheets will act as the online attendance database.
Step 1: Create a Google Spreadsheet
- Open Google Sheets.
- Create a new blank spreadsheet.
- Rename it to RFID Smart Attendance System.
- Create the following column headings in the first row:
| Timestamp | RFID UID | Name | Attendance Status |
|---|---|---|---|
| Automatic | Card ID | Learner Name | Present |
Step 2: Open Google Apps Script
- Open the spreadsheet.
- Select Extensions.
- Click Apps Script.
- Delete the existing sample code.
- Insert the following Google Apps Script.
Google Apps Script Code
function doGet(e) {
var sheet = SpreadsheetApp
.getActiveSpreadsheet()
.getSheetByName("Attendance");
if (!sheet) {
return ContentService.createTextOutput(
"Attendance sheet not found"
);
}
var uid = e.parameter.uid;
if (!uid) {
return ContentService.createTextOutput(
"Missing RFID UID"
);
}
// Registered users
var students = {
"A1B2C3D4": "Student One",
"11223344": "Student Two",
"55667788": "Student Three"
};
var name = students[uid.toUpperCase()];
if (!name) {
return ContentService.createTextOutput(
"UNREGISTERED"
);
}
var now = new Date();
var date = Utilities.formatDate(
now,
Session.getScriptTimeZone(),
"yyyy-MM-dd"
);
// Prevent duplicate attendance on the same day
var lastRow = sheet.getLastRow();
if (lastRow >= 2) {
var records = sheet.getRange(
2, 1, lastRow - 1, 4
).getValues();
for (var i = 0; i < records.length; i++) {
var existingUID = String(records[i][1]);
var existingDate = Utilities.formatDate(
new Date(records[i][0]),
Session.getScriptTimeZone(),
"yyyy-MM-dd"
);
if (
existingUID === uid.toUpperCase() &&
existingDate === date
) {
return ContentService.createTextOutput(
"ALREADY RECORDED"
);
}
}
}
sheet.appendRow([
now,
uid.toUpperCase(),
name,
"PRESENT"
]);
return ContentService.createTextOutput(
"SUCCESS:" + name
);
}
Note: Replace the sample RFID numbers and names with the actual registered card IDs and learner names. Create a worksheet named Attendance and use the four headings shown above.
Step 3: Deploy the Google Apps Script
- Click Deploy.
- Select New deployment.
- Choose Web app.
- Set the execution option to run as yourself.
- Configure access according to your organization’s security requirements.
- Deploy and authorize the script.
- Copy the generated Web App URL.
The URL will be used by the Arduino to submit attendance records.
Security consideration: A public web app URL can be abused if left unprotected. For an actual school deployment, add a secret authentication token, validate requests, restrict access and protect the spreadsheet. Do not publish the deployment URL or authentication credentials.
7. Arduino Source Code
The following Arduino program reads RFID cards, identifies their UIDs and sends them to the ESP8266, which communicates with the Google Apps Script web application.
Install these Arduino libraries:
- MFRC522 by GithubCommunity.
- LiquidCrystal_I2C.
- SoftwareSerial (included with the Arduino AVR core).
The ESP8266 should be configured with AT firmware supporting the commands used below.
#include <SPI.h>
#include <MFRC522.h>
#include <SoftwareSerial.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#define SS_PIN 10
#define RST_PIN 9
#define GREEN_LED 7
#define RED_LED 6
#define BUZZER 8
MFRC522 rfid(SS_PIN, RST_PIN);
SoftwareSerial esp(2, 3);
// Arduino D2 = RX, D3 = TX
LiquidCrystal_I2C lcd(0x27, 16, 2);
// Replace with your Wi-Fi details
const char* WIFI_NAME = "YOUR_WIFI_NAME";
const char* WIFI_PASSWORD = "YOUR_WIFI_PASSWORD";
// Replace with deployed Google Apps Script URL
String scriptHost = "script.google.com";
String scriptPath =
"/macros/s/YOUR_DEPLOYMENT_ID/exec";
void setup() {
Serial.begin(9600);
esp.begin(9600);
SPI.begin();
rfid.PCD_Init();
lcd.init();
lcd.backlight();
pinMode(GREEN_LED, OUTPUT);
pinMode(RED_LED, OUTPUT);
pinMode(BUZZER, OUTPUT);
lcd.setCursor(0, 0);
lcd.print("RFID ATTENDANCE");
lcd.setCursor(0, 1);
lcd.print("Connecting WiFi");
connectWiFi();
lcd.clear();
lcd.print("Scan Your Card");
}
void connectWiFi() {
esp.println("AT");
delay(1000);
esp.println("AT+CWMODE=1");
delay(1000);
esp.print("AT+CWJAP=\"");
esp.print(WIFI_NAME);
esp.print("\",\"");
esp.print(WIFI_PASSWORD);
esp.println("\"");
delay(10000);
}
void sendAttendance(String uid) {
lcd.clear();
lcd.print("Sending Data...");
String path = scriptPath + "?uid=" + uid;
String request =
"GET " + path +
" HTTP/1.1\r\n" +
"Host: " + scriptHost + "\r\n" +
"Connection: close\r\n\r\n";
esp.println("AT+CIPSTART=\"SSL\",\"script.google.com\",443");
delay(6000);
esp.println("AT+CIPSEND=" + String(request.length()));
delay(2000);
esp.print(request);
delay(10000);
String response = "";
while (esp.available()) {
response += (char)esp.read();
}
Serial.println(response);
if (response.indexOf("SUCCESS:") >= 0) {
lcd.clear();
lcd.print("Attendance OK");
digitalWrite(GREEN_LED, HIGH);
tone(BUZZER, 1000, 200);
delay(1000);
digitalWrite(GREEN_LED, LOW);
} else if (
response.indexOf("ALREADY RECORDED") >= 0
) {
lcd.clear();
lcd.print("Already Present");
tone(BUZZER, 500, 300);
} else {
lcd.clear();
lcd.print("Not Recorded");
digitalWrite(RED_LED, HIGH);
tone(BUZZER, 300, 800);
delay(1000);
digitalWrite(RED_LED, LOW);
}
esp.println("AT+CIPCLOSE");
delay(1000);
lcd.clear();
lcd.print("Scan Your Card");
}
void loop() {
if (!rfid.PICC_IsNewCardPresent()) {
return;
}
if (!rfid.PICC_ReadCardSerial()) {
return;
}
String uid = "";
for (byte i = 0; i < rfid.uid.size; i++) {
if (rfid.uid.uidByte[i] < 0x10) {
uid += "0";
}
uid += String(
rfid.uid.uidByte[i], HEX
);
}
uid.toUpperCase();
Serial.print("RFID UID: ");
Serial.println(uid);
lcd.clear();
lcd.print("Card Detected");
delay(500);
sendAttendance(uid);
rfid.PICC_HaltA();
rfid.PCD_StopCrypto1();
delay(1000);
}
Important implementation note: This is a demonstration sketch, not a production-ready attendance terminal. The ESP8266 AT firmware must support the SSL connection and compatible command syntax. The response parser should read the complete HTTP response, including its body, rather than relying on fixed delays. A robust deployment should also handle Wi-Fi disconnections, timeouts, retries and failed submissions. Google Apps Script may redirect requests; a production implementation must follow its HTTPS redirect correctly. The ESP8266 must also be powered and level-shifted correctly.
8. Expected Project Operation
The system should respond differently depending on whether a registered or unregistered RFID card is scanned.
| Action | LCD display | LED indication | Buzzer | Google Sheets |
|---|---|---|---|---|
| System powered ON | Scan Your Card | None | OFF | No entry |
| Registered card scanned | Attendance OK | Green ON briefly | Short beep | Attendance saved |
| Unregistered card scanned | Not Recorded | Red ON briefly | Warning beep | No entry |
| Same card scanned again | Already Present | None | Short beep | No duplicate entry |
| Internet unavailable | Not Recorded / connection error | Red | Error indication | No new entry |
9. Viewing Attendance Records on Google Sheets
Once the system successfully sends attendance information, Google Sheets automatically stores the records.
An example of the expected spreadsheet is shown below.
Example attendance records:
| Timestamp | RFID UID | Name | Attendance Status |
|---|---|---|---|
| 08:05 AM | A1B2C3D4 | Student One | PRESENT |
| 08:12 AM | 11223344 | Student Two | PRESENT |
| 08:18 AM | 55667788 | Student Three | PRESENT |
The administrator can use the spreadsheet to:
- Monitor daily attendance.
- Identify learners who have not reported.
- Search attendance records by name or RFID UID.
- Generate daily, weekly and monthly attendance reports.
- Analyse attendance trends.
- Share reports with authorized school administrators.
10. Applications of the RFID Smart Attendance System
The project can be implemented in different institutions and organizations.
- Schools: Automatically records learner attendance.
- Colleges and universities: Monitors student attendance during lectures.
- Offices: Records employee reporting times.
- Factories: Monitors employee entry and exit.
- Libraries: Identifies registered users.
- Training institutions: Tracks participation in training sessions.
- Laboratories: Controls and records access by registered users.
11. Advantages of the Project
- Automation: Eliminates much of the manual attendance recording process.
- Cloud storage: Attendance information is stored online.
- Accuracy: Reduces handwriting and manual transcription errors.
- Time-saving: Individuals can record attendance by scanning their cards.
- Accessibility: Authorized administrators can access attendance records remotely.
- Low-cost design: Uses affordable electronic components.
- Expandable: Can be upgraded with additional technologies.
12. Possible Project Improvements
The basic system can be upgraded to introduce more advanced features.
A. ESP32 Integration
Replace the Arduino Uno and separate ESP8266 with an ESP32, which has built-in Wi-Fi and Bluetooth.
B. GSM Notifications
Integrate a SIM800L GSM module to send SMS notifications to parents or administrators.
C. Advanced Display
Use an OLED or larger LCD to display the learner’s name, registration number and attendance status.
D. Web-Based Dashboard
Develop a dashboard for monitoring attendance, generating reports and viewing statistics.
13. Project Testing and Evaluation
The system should be tested under different operating conditions to determine its reliability.
| Test | Expected result |
|---|---|
| Scan a registered RFID card | Correct individual identified |
| Scan an unregistered card | Access rejected |
| Scan the same card twice | Duplicate attendance prevented |
| Disconnect Wi-Fi | Cloud submission fails and error is reported |
| Restore Wi-Fi | System reconnects and resumes operation after recovery |
| Scan several registered cards | Each attendance record is correctly stored |
Evaluation criteria:
- RFID card identification accuracy.
- Time taken to record attendance.
- Successful cloud data transmission.
- Prevention of duplicate attendance.
- Reliability of the system during network interruptions.
For an actual school attendance system, RFID card UID alone should not be treated as strong authentication because basic RFID identifiers can be copied. Additional security, such as authenticated cards, user verification and protected cloud access, should be considered.
14. Safety and Technical Considerations
- Use the correct 3.3V supply for the RC522 and ESP8266.
- Avoid connecting 5V Arduino signals directly to ESP8266 input pins.
- Ensure the ESP8266 has a stable power supply.
- Protect Wi-Fi passwords and cloud authentication credentials.
- Ensure that attendance data is accessible only to authorized users.
- Provide an offline storage or retry mechanism for internet interruptions.
- Do not rely on the system as the sole method of verifying learner identity.
15. Conclusion
The RFID Smart Attendance System Using Arduino and Google Sheets demonstrates how Radio Frequency Identification, microcontroller programming and cloud computing can be combined to solve a real-world problem.
By scanning an RFID card, learners or employees can record their attendance automatically without signing a manual register.
The integration of Google Sheets makes it possible to store, retrieve and analyse attendance records remotely. The project also provides an excellent learning opportunity in electronics, embedded systems, wireless communication, programming and Internet of Things (IoT) technology.
It is suitable for STEM exhibitions, school innovation competitions, college projects and practical demonstrations of smart attendance management.







