RFID Smart Attendance System Using Arduino and Google Sheets (Cloud-Based Attendance Monitoring)

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.

ESP8266 RFID Attendance System with Google Sheets
technomate – #1 DIY Electronics Projects & Kits for Students India
Gallery | Attendance System Based on Arduino & Google Sheets | Hackaday.io

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.
ESP8266 RFID Attendance System with Google Sheets

3. Materials and Components Required

The following components are required to construct the project.

ComponentQuantityFunction
Arduino Uno1Main control unit
RFID RC522 reader1Reads RFID card information
RFID cards/tagsAs requiredIdentifies learners or employees
ESP8266 ESP-011Provides Wi-Fi connectivity
16×2 LCD with I2C1Displays attendance messages
Buzzer1Provides audio feedback
Red LED1Indicates invalid card or error
Green LED1Indicates successful scanning
220Ω resistors2Limits LED current
Breadboard1Circuit assembly
Jumper wiresSeveralElectrical connections
3.3V regulated power supply1Powers ESP8266 and RFID reader
USB cable1Uploads Arduino program
RFID Tag/card Verification System : Arduino UNO + RFID RC522 + LCD 16x2 I2C + LEDs : 4 Steps - Instructables

4. Understanding the Main Components

A. Arduino Uno

Arduino UNO Rev3 – Reliable ATmega328P Board with Digital & Analog I/O — Arduino Online Shop

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

MFRC522 NFC RFID Reader Module 13.56MHz Kit (2473)

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

Modulo wifi ESP8266 ESP-01 - Maker Creativo Store

The ESP8266 provides wireless internet connectivity, allowing attendance information to be transmitted from the Arduino to Google Sheets.

D. Google Sheets

Attendance Sheet Examples: Free Template for Easy Record Keeping | Orah Blog

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 pinArduino Uno pin
SDA (SS)D10
SCKD13
MOSID11
MISOD12
IRQNot connected
GNDGND
RSTD9
3.3V3.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 pinConnection
VCCRegulated 3.3V
GNDGND
TXArduino D2 (SoftwareSerial RX)
RXArduino D3 through a 5V-to-3.3V level shifter
EN/CH_PD3.3V
RST3.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

ComponentConnection
LCD SDAA4
LCD SCLA5
LCD VCCAccording to LCD module specification
LCD GNDGND
Buzzer positiveD8
Buzzer negativeGND
Green LED anodeD7 through 220Ω
Red LED anodeD6 through 220Ω
LED cathodesGND
RFID Based Attendance System Using Arduino - Hackster.io

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:
TimestampRFID UIDNameAttendance Status
AutomaticCard IDLearner NamePresent

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.

ActionLCD displayLED indicationBuzzerGoogle Sheets
System powered ONScan Your CardNoneOFFNo entry
Registered card scannedAttendance OKGreen ON brieflyShort beepAttendance saved
Unregistered card scannedNot RecordedRed ON brieflyWarning beepNo entry
Same card scanned againAlready PresentNoneShort beepNo duplicate entry
Internet unavailableNot Recorded / connection errorRedError indicationNo new entry
A DIY RFID Attendance System Using Arduino - Hackster.io

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.

Gallery | Attendance System Based on Arduino & Google Sheets | Hackaday.io

Example attendance records:

TimestampRFID UIDNameAttendance Status
08:05 AMA1B2C3D4Student OnePRESENT
08:12 AM11223344Student TwoPRESENT
08:18 AM55667788Student ThreePRESENT

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.

- YouTube

A. ESP32 Integration

Replace the Arduino Uno and separate ESP8266 with an ESP32, which has built-in Wi-Fi and Bluetooth.

RFID based Attendance System using Arduino & SIM800L Module | Iot projects, Arduino, Rfid

B. GSM Notifications

Integrate a SIM800L GSM module to send SMS notifications to parents or administrators.

DIY RFID-Based Attendance System With Arduino : 4 Steps - Instructables

C. Advanced Display

Use an OLED or larger LCD to display the learner’s name, registration number and attendance status.

Smart Attendance Tracking Applications Of IoT In Education Sector IoT SS V PPT Sample

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.

TestExpected result
Scan a registered RFID cardCorrect individual identified
Scan an unregistered cardAccess rejected
Scan the same card twiceDuplicate attendance prevented
Disconnect Wi-FiCloud submission fails and error is reported
Restore Wi-FiSystem reconnects and resumes operation after recovery
Scan several registered cardsEach 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.

mbeva

Dominic Mbeva is a science teacher, experienced researcher, innovator, and creative technologist with expertise in STEM education, digital media, and scientific research. As a Kenya Science and Engineering Fair (KSEF) advisor and projects manager, he mentors young scientists, guiding them in developing award-winning innovations. He is also an IC Technorat, leading advancements in science and technology. Beyond education, Dominic is a skilled photographer and video editor, using visual storytelling to make science more engaging. His philosophy, “If you take care of minutes, hours will take care of themselves,” reflects his belief in consistent effort, strategic thinking, and innovation to drive success in both research and creativity.

Related Posts

How to Make a Smart River Water Level and Pollution Monitoring Boat / Buoy Using ESP32 and GPS

Meta Description: Learn how to build a smart river water level and pollution monitoring boat using ESP32, GPS and water quality sensors. Includes components, circuit connections, Arduino code and IoT…

Read more

How to build an automatic street light controller using Arduino and an LDR sensor.

Meta Description: Learn how to build an automatic street light controller using Arduino and an LDR sensor. Explore circuit connections, components, Arduino code and how the system works. 1. Introduction…

Read more

Leave a Reply

Your email address will not be published. Required fields are marked *