-
1Understanding How the RFID Logger Works
Before connecting any wires or uploading code, it's important to understand how the entire system operates. Once you understand the data flow, the rest of the project becomes much easier to follow.
Unlike traditional RFID examples where the card information is only displayed on the Serial Monitor, this project sends every scanned RFID card directly to Google Sheets over Wi-Fi. This means every scan is automatically stored in the cloud and can be viewed from anywhere.
The entire communication process is shown below.
RFID Card │ ▼ MFRC522 RFID Reader │ (SPI Communication) │ ▼ ESP32-S3-BOX-3 │ Wi-Fi Connection │ ▼ Google Apps Script │ ▼ Google Sheets
Whenever an RFID card is brought close to the reader, the MFRC522 detects the card and extracts its Unique Identifier (UID). This UID is a hexadecimal number that uniquely identifies the RFID card.
For example, a scanned UID may look like this:
827ED600
Once the ESP32 receives this UID, it immediately performs two actions:
- Displays a confirmation message on the ESP32-S3-BOX-3 display.
- Sends the UID to Google Apps Script using an HTTP request.
Google Apps Script receives this request and automatically appends a new row to a Google Sheet along with the current date and time.
Since Google Sheets stores all the records online, you don't need to worry about creating or maintaining a database.
-
2Understanding the Hardware
Let's briefly understand the purpose of each component used in this project.
ESP32-S3-BOX-3
The ESP32-S3-BOX-3 acts as the brain of the project.
It performs several important tasks simultaneously:
- Reads RFID data from the MFRC522 module.
- Connects to the Wi-Fi network.
- Sends HTTP requests to Google Apps Script.
- Displays the project status on the built-in screen.
Because the ESP32-S3 includes built-in Wi-Fi, we don't need any additional communication modules.
MFRC522RFID Reader
The MFRC522 is one of the most popular low-cost RFID readers available for Arduino and ESP32 projects.
It operates at 13.56 MHz and communicates with the ESP32 using the SPI protocol.
Whenever an RFID card enters its reading range, the module extracts the UID and sends it to the ESP32.
The typical reading distance is around 2–5 cm, depending on the RFID card and antenna orientation.
RFIDCard
Each RFID card contains a small integrated circuit and antenna.
Every card has its own unique UID, which acts like a digital fingerprint.
For example:
Card 1827ED600-------------------Card 22A7E17B1-------------------Card 3D784D500
Throughout this tutorial, only the UID will be stored in Google Sheets.
Later, you can modify the software to associate each UID with a person's name, employee ID, student record, or any other information.
-
3Understanding SPI Communication
The MFRC522 communicates with the ESP32 using the SPI (Serial Peripheral Interface) protocol.
SPI is one of the fastest communication methods available for embedded systems and is commonly used with displays, SD cards, RFID modules, and other high-speed peripherals.
The communication uses four primary signals:
SCK: Clock signal generated by the ESP32
MOSI: Data sent from ESP32 to RFID module
MISO: Data sent from RFID module to ESP32
SDA(SS): Chip Select signal
The ESP32-S3-Box3 uses the following pin mapping:
MFRC522 Pin -> ESP32-S3-BOX-3 Pin
SDA - GPIO 10
SCK - GPIO 12
MOSI - GPIO 11
MISO - GPIO 13
3.3v - 3.3v
GND - GND
-
4Creating the Google Sheet
Now that our hardware is ready, it's time to create the cloud database that will store every RFID scan.
The best part about this project is that we don't need to install MySQL, Firebase, or any other database server. Instead, we'll use Google Sheets, which is completely free and extremely easy to configure.
Every time an RFID card is scanned, a new row will automatically be added to the spreadsheet.
Create a New Spreadsheet
Open your web browser and visit:
Sign in with your Google account if you haven't already.
Click the Blank Spreadsheet button to create a new spreadsheet.
Rename the First Sheet
At the bottom of the spreadsheet, you'll notice the default sheet named:
Sheet1
Double-click rename it to whatever you want in my case I will name it as attendance
Although this project logs RFID UIDs rather than attendance, using this name keeps the Apps Script consistent. Feel free to rename it if you also update the Apps Script accordingly.
Create the Column Headers
In the first row, add the following headers: A: UID and B: Date & Time
Your spreadsheet should now look similar to this:
UID - Date & Time
Every RFID scan will automatically create a new row below these headers.
-
5Getting the Spreadsheet ID
Our Google Apps Script needs to know which spreadsheet it should write data into.
To find the Spreadsheet ID, look at the URL of your spreadsheet.
It will look something like this:
The highlighted section between /d/ and /edit is your Spreadsheet ID. Copy this value because we'll need it in the next step.
-
6Creating Google App Script
Google Apps Script acts as the bridge between the ESP32 and Google Sheets.
Instead of sending data directly to Google Sheets, the ESP32 sends an HTTP request to Apps Script.
Apps Script receives the request and writes the data into the spreadsheet.
This makes the communication secure and extremely easy to manage.
Open App Script
Inside your Google Sheet, click: Extensions -> Apps Script
A new browser tab will open with the Apps Script editor.
Remove the Default Code
Google automatically creates a small sample script.
Delete everything inside the editor.
You'll replace it with your own code.
Paste the Following Code
function doGet(e) {
var sheet = SpreadsheetApp
.openById("YOUR_SPREADSHEET_ID")
.getSheetByName("Attendance");
sheet.appendRow(
[ e.parameter.uid,
new Date() ]);
return ContentService.createTextOutput("SUCCESS");
}
Replace:
YOUR_SPREADSHEET_ID
with the Spreadsheet ID you copied in the previous step.
Once you've replaced the ID, click Save.
Give the project any name you like, such as:
RFID Logger
-
7Deploying the Script
Writing the Apps Script isn't enough—we also need to publish it so the ESP32 can access it over the internet.
Click:
Deploy → New Deployment
A dialog box will appear.
From the deployment type dropdown, select:
Web App
Now configure the following options:
Description
RFID Logger
Execute As
Me
Who Has Access
Anyone
Click Deploy.
The first time you deploy the script, Google will ask you to authorize the application.
Click:
- Review Permissions
- Select your Google Account
- Advanced
- Go to Project (unsafe)
- Allow
These permissions are required because the script needs access to your spreadsheet.
After authorization, Google will generate a Web App URL.
It will look similar to this: https://script.google.com/macros/s/AKfycbxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/exec
Copy this URL carefully.
We'll use it inside the Arduino code.
-
8Testing the Apps Script
Before writing any Arduino code, it's always a good idea to verify that the Apps Script is working correctly.
Open a new browser tab.
Paste the Web App URL and add the following parameter:
?uid=12345678
The complete URL should look similar to:
https://script.google.com/macros/s/xxxxxxxxxxxxxxxxxxxxxxxx/exec?uid=12345678
Press Enter.
If everything is configured correctly, your browser should display:
SUCCESS
Now return to your Google Sheet.
You should see a new row similar to this:
UID Date & Time
12345678 Current Timestamp
Congratulations!
Your cloud database is now fully functional and ready to receive data from the ESP32.
-
9Setting Up the Arduino IDE
Now that our Google Sheets and Google Apps Script are ready, it's time to configure the Arduino IDE and program the ESP32-S3-BOX-3.
If you've never programmed an ESP32 before, don't worry. We'll go through every step carefully.
Installing the ESP32 Board Package
The Arduino IDE does not include ESP32 support by default, so the first step is to install the ESP32 board package.
Open the Arduino IDE.
Navigate to:
File → Preferences
Locate the field named:
Additional Boards Manager URLs
If the field is empty, paste the following URL:
https://espressif.github.io/arduino-esp32/package_esp32_index.json
If another URL already exists, simply add this URL separated by a comma.
Click OK.
Now open:
Tools → Board → Boards Manager
Search for:
ESP32
Install the package published by Espressif Systems.
Wait until the installation completes.
Selecting the Correct Board
After installing the board package:
Go to:
Tools → Board
Select:
ESP32S3 Dev Module
or
ESP32-S3-BOX-3
depending on your installed board package.
Next, connect your ESP32-S3-BOX-3 to your computer using a USB Type-C cable.
Select the correct COM Port from:
Tools → Port
Installing the Required Libraries
This project requires a few Arduino libraries.
Open:
Sketch → Include Library → Manage Libraries
Search and install the following libraries.
MFRC522v2
Used for reading RFID cards.
Author:
OSSLibraries
LovyanGFX
Used to control the built-in display on the ESP32-S3-BOX-3.
LGFX_AUTODETECT
Automatically detects the display configuration.
The following libraries are included with the ESP32 board package, so you don't need to install them separately.
- WiFi
- HTTPClient
- SPI
- Wire
Opening the Arduino Sketch
Download the complete Arduino sketch provided with this project.
Open the sketch in Arduino IDE.
Before uploading the code, we'll need to modify three parameters.
Configure Your Wi-Fi Credentials
Locate the following section inside the sketch.
const char* ssid = "YOUR_WIFI_NAME";const char* password = "YOUR_WIFI_PASSWORD";
Replace these values with your own Wi-Fi network credentials.
For example:
const char* ssid = "HomeWiFi";const char* password = "MyPassword123";
Make sure the ESP32 and your computer are connected to the same network during testing.
Configure the Google Apps Script URL
Next, locate the following line.
String GOOGLE_SCRIPT_URL ="https://script.google.com/macros/s/xxxxxxxxxxxxxxxxxxxx/exec";
Replace it with the Web App URL you copied after deploying Google Apps Script.
Do not modify anything else in the URL.
Verify the RFID Pin Connections
This project uses SPI communication.
Verify that the following pin definitions match your wiring.
#define SS_PIN 10#define SCK_PIN 12#define MOSI_PIN 11#define MISO_PIN 13
If you've connected the RFID module to different GPIO pins, update these values accordingly.
Uploading the Code
Click the Verify button.
The Arduino IDE will compile the sketch.
If everything is configured correctly, no errors should appear.
Next, click the Upload button.
The upload process may take around 30–60 seconds depending on your computer.
Once the upload finishes successfully, you'll see:
Hard resetting via RTS pin...
This indicates that the firmware has been uploaded successfully.
Opening the Serial Monitor
Open:
Tools → Serial Monitor
Set the baud rate to:
115200
After a few seconds, you should see output similar to this.
Connecting WiFi...WiFi ConnectedIP Address:192.168.1.120RFID ReadyWaiting for Card...
If you don't see these messages, double-check:
- Correct COM Port
- Correct Board Selection
- Correct Baud Rate
- USB Cable Supports Data
Many inexpensive USB cables only provide power and cannot transfer data.
-
10Testing the RFID Logger
Now comes the exciting part—testing the complete system.
Take any compatible RFID card or key tag.
Bring it close to the MFRC522 reader.
Within a second, several things happen automatically.
On the ESP32 Display
The screen changes to display a confirmation message such as:
RFID SCANNED
This lets you know that the RFID card has been successfully detected.
On the Serial Monitor
The Serial Monitor prints the UID of the scanned RFID card.
For example:
UID:827ED600
This confirms that the MFRC522 has successfully communicated with the ESP32.
Inside Google Sheets
Refresh your Google Sheet.
A new row should appear automatically.
UID Date & Time
827ED600 2026-06-27 11:43:12
Each time you scan another RFID card, a new row is appended automatically.
No existing records are overwritten.
This allows you to maintain a complete history of every RFID card scanned by the device.
Troubleshooting
If the project doesn't work on the first attempt, don't worry. Below are some of the most common issues and their solutions.
Wi-Fi Doesn't Connect
Check:
- Wi-Fi SSID
- Wi-Fi Password
- 2.4 GHz network (ESP32 does not support 5 GHz-only networks)
RFID Card Not Detected
Verify:
- SDA pin
- MOSI
- MISO
- SCK
- 3.3V supply
- GND connection
Never power the MFRC522 using 5V.
Google Sheet Doesn't Update
Check:
- Google Apps Script deployed correctly
- Execute As → Me
- Access → Anyone
- Correct Web App URL
- Spreadsheet ID copied correctly
HTTP Response Not 200
If the Serial Monitor shows:
HTTP Response: 403
The deployment permissions are incorrect.
Redeploy the Apps Script and verify the access settings.
If the response is:
HTTP Response: 200
Everything is working correctly.
Step 13: Future Improvements
One of the biggest advantages of this project is that it serves as a solid foundation for many other RFID-based IoT applications. While this tutorial focuses on logging RFID UIDs to Google Sheets, the same hardware and software can easily be expanded with additional features.
Here are a few ideas you can explore:
RFID Attendance System
Associate each RFID UID with a student's or employee's information and automatically mark attendance in Google Sheets.
Smart Door Access Control
Replace Google Sheets with a UID verification database. If the scanned UID matches an authorized user, the ESP32 can unlock an electronic door lock using a relay.
Library Management System
Each book can have its own RFID tag. The ESP32 can log book check-ins and check-outs directly into Google Sheets.
Inventory Management
Attach RFID tags to products and maintain a cloud-based inventory log by simply scanning each item.
Visitor Management System
Visitors can scan RFID visitor cards at the entrance, automatically creating a cloud-based visitor log.
Asset Tracking
Track laboratory equipment, office assets, or warehouse inventory by recording every RFID scan with timestamps.
Smart Locker
Each RFID UID can be assigned to a specific locker, allowing only authorized users to access it.
Notification System
You can further expand the project by sending:
- Email Notifications
- Telegram Messages
- Discord Notifications
- Slack Notifications
- WhatsApp Alerts (using APIs)
whenever a particular RFID card is scanned.
These enhancements require only software modifications, making this project an excellent platform for learning IoT development.
Conclusion
Congratulations!
You have successfully built a Cloud-Based RFID Logger using the ESP32-S3-BOX-3, MFRC522 RFID Reader, Google Apps Script, and Google Sheets.
Although the project itself is relatively simple, it demonstrates several important IoT concepts, including:
- Reading RFID cards using SPI communication.
- Connecting an ESP32 to a Wi-Fi network.
- Sending HTTP requests from an embedded device.
- Using Google Apps Script as a lightweight cloud API.
- Storing data in Google Sheets without requiring a traditional database.
These techniques form the foundation of countless IoT applications. Once you're comfortable with this workflow, you can easily extend the project by adding user authentication, cloud dashboards, access control, attendance management, inventory systems, notification services, or mobile applications.
One of the goals of this project was to show that cloud-connected embedded systems don't always require complex infrastructure. By leveraging freely available Google services, even beginners can build practical IoT applications with minimal setup while gaining hands-on experience with cloud communication.
I hope this tutorial helped you understand not only how to build the project but also why each step is important. Feel free to customize the code, experiment with new features, and adapt the project to your own applications.
If you build this RFID Logger or create your own version based on this tutorial, I'd love to see your results. Happy building, and keep making amazing projects!
Thank You for Reading!
If you found this project helpful, consider giving it a Like ❤️, leaving a Comment 💬, and sharing it with fellow makers. Your support encourages me to continue creating more open-source electronics and IoT projects for the community.
Happy Making! 🚀
Rohan Barnwal
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.