Skip to content

RFID IoT Membership Scanner & Automation Integration

ESP32 DevKit RC522 RFID Supabase (PostgreSQL) n8n Cloud Telegram API LittleFS

System Demonstration & Walkthrough

Below are video recordings showcasing the hardware scanner in action, user registration, database state syncing, and the unified admin interface:

Hardware RFID In & Out Demo

Real-time check-in/check-out scanner feedback with automatic LED visual indicator cues.

User Registration & Card Setup

Scanning new RFID tag UIDs and linking them dynamically with user profiles inside the system backend.

UI Automation & Web Integration

Admin dashboard telemetry controls, real-time sync, and automated cloud notification triggers.

Overview

The RFID IoT Membership Scanner & Automation Integration is a production-ready hardware-to-cloud ecosystem designed to replace manual, error-prone spreadsheet check-in systems. Built on an **ESP32 microcontroller** wired to an **RC522 RFID reader**, the scanner validates membership cards directly against a **Supabase PostgreSQL database** using secure RLS (Row Level Security) schemas.

It integrates an offline-first cache database using **LittleFS** file systems to guarantee scan capture during internet drops, hosting local WebSocket monitors for onsite staff and visual cloud pipelines in **n8n** for Telegram notifications and auto-expiration auditing.

The Problem It Solves

Gyms, coworking spaces, and member clubs lose billable hours and leak subscription revenue because of manual check-in processes, lost paper journals, and unmonitored membership expirations.

This system completely automates the entry/exit validations. A single tap of an RFID tag queries database states in sub-100ms, flashes colored LEDs for immediate user feedback, stores logs, alerts staff via Telegram if an invalid or expired card is scanned, and calculates auto-expirations daily without manual intervention.

Core Subsystems

1. ESP32 Microprocessor Firmware

  • MFRC522 Library: Captures high-frequency 13.56MHz RFID card UID numbers.
  • Offline Queue Database: Integrates LittleFS storage to queue scans locally during WiFi outages, automatically syncing backlogs to Supabase upon reconnection.
  • Local WebSocket Server: Serves a lightweight web interface locally, allowing staff on the same network to view scans live without relying on outside web servers.
  • Captive Portal Setup: Integrates WiFiManager to allow easy configuration of WiFi SSID/passwords via phone browser without hardcoding credentials in firmware.

2. Supabase Backend Database

  • Relational DB Layout: Normalizes `members`, `plans`, `memberships`, and `scan_logs` tables.
  • Validate Scan Stored Procedure: Executes transactional checks (card presence, active plan date, and scan status toggle) in a single atomic SQL transaction.
  • Row Level Security (RLS): Enforces strict data access rules protecting database connections.

3. n8n Cloud Automation & Telegram Alerts

  • Instant Notifications: Translates database webhooks into formatted Telegram message warnings for expired access attempts.
  • Auto-Expiration Daemon: Runs scheduled Cron jobs to toggle member status to expired, keeping data clean.
  • Outbound Reporting: Compiles daily check-in reports sent straight to admins' chats.

Hardware Wiring Schematics

Below is the SPI pin connections utilized between the ESP32 DevKit board and the RC522 RFID IC:

RC522 Pin ESP32 GPIO Description
SDA (SS) GPIO 21 Chip Select
SCK GPIO 18 SPI Clock
MOSI GPIO 23 Master Out Slave In
MISO GPIO 19 Master In Slave Out
RST GPIO 22 Hardware Reset Pin
3.3V 3.3V Power Source (3.3V Only)
GND GND Ground Reference Connection

Want to build high-performance PWAs or full-stack platforms?

Let's coordinate to build custom software, offline-first mobile webapps, or high-throughput databases.

Get in Touch →