Smart Access Control - Grove Shield for Seeed Studio XIAO - rong - CodeCraft Hub
Scene: Maker. Edge AI application on CodeCraft Hub for Maker use cases.
Devices / BOM: Grove Shield for Seeed Studio XIAO, Seeed Studio XIAO ESP32S3, Skip to the beginning of the images gallery Grove - 125KHz RFID Reader, Grove - Servo, Grove - Speaker, Grove - 16X2 LCD RGB Backlight - Full Color Display, codecraft
Maker application on CodeCraft Hub. This is a mini‑RFID smart access‑control system built on Seeed Studio XIAO ESP32‑S3. It combines a 125 kHz RFID card reader, RGB‑LCD screen, Grove speaker buzzer and servo motor to implement a complete contactless access‑control system.1
Documentation
This is an RFID‑based smart access‑control application developed for the XIAO ESP32‑S3. Built with Grove modular hardware, it adopts a non‑blocking state‑machine program to realize complete card‑swiping access interaction.
When an RFID card is brought close to the card reader, the device automatically reads and parses the card ID, and performs permission verification by comparing it with the local whitelist. If an authorized card is swiped, the servo rotates to unlock the door, the LCD screen displays PASS with green backlight, and the buzzer emits one short prompt tone. If an unauthorized card is swiped, the door remains locked, the LCD shows FAIL with red backlight, and the buzzer gives two consecutive alarm tones.
After a card swipe is triggered, the system features a built‑in 2.5‑second lock cooldown mechanism to prevent repeated triggering caused by keeping the card within the reading range. After the preset time elapses, the servo automatically resets and locks the door, and the screen returns to the READY standby interface to wait for the next card‑swiping operation.
Deploy steps
- Prepare the hardware
Prepare the following hardware:
XIAO ESP32‑S3
Grove Shield for XIAO
Grove 125 kHz RFID card‑reader module
Grove LCD RGB Backlight 16×2
Grove Speaker
Grove 180° Servo
UEM4100 RFID card
USB Type‑C data cable
Connect in the following manner:
Module XIAO ESP32-S3 RFID TX ---> GPIO44 / D7 LCD SDA ---> GPIO5 / D4 LCD SCL ---> GPIO6 / D5 Speaker ---> GPIO4 / D3 Servo ---> GPIO2 / D1
Note: If the TX pin of the RFID card reader outputs a 5V logic level, a 5V → 3.3V level shift conversion is required before connecting it to the XIAO ESP32‑S3.
- Install and connect the equipment
Three firmware compilation methods are provided:
Compile firmware from source code:
Code snippet included — open the application page to copy it.
2、Generate firmware based on the CodeCraft platform: codecraft Prompt:
Code snippet included — open the application page to copy it.
3、Flash the officially provided firmware
Flash firmware to your device (in-app tool on CodeCraft Hub).
- Flash the access control program
Flash the project firmware to the XIAO ESP32-S3.
Power cycle the device after flashing completes. The system will first enter the safe state:
Code snippet included — open the application page to copy it.
LCD Display:
Code snippet included — open the application page to copy it.
At this point, the device enters standby mode and card swiping can begin.
- Configure RFID authorized cards
Configure RFID authorized cards
Hold the RFID card to be authorized close to the card reader.
Check the RFID data via the serial debug page.
The system will output similar content as follows:
Code snippet included — open the application page to copy it.
Add the required authorized card IDs to the whitelist.
Default example authorized card:
Code snippet included — open the application page to copy it.
The program automatically converts all card IDs to uppercase and performs case-insensitive matching.
- Test the access control function
Hold the RFID card close to the card reader for testing.
Authorized Card
The system shall display: PASS
Meanwhile:
LCD backlight turns green
Buzzer beeps once
Servo rotates to 90° to simulate unlocking the door
Unauthorized Card
The system shall display:
FAIL
Meanwhile:
LCD backlight turns red
Buzzer beeps twice
Servo stays at 0°, and the door remains locked
After the test, wait for the system to reset automatically.
- What else can you build with this project
This RFID access-control node is only a basic version.
You can further upgrade it into a real smart access control system.
👥 Multi-user Permission
Assign different permissions to different cards:
Administrator, Regular User, Temporary User
Different users can have different unlock time windows and access rights.
🚪 Door Contact Sensor
After adding a door contact sensor, the system can detect:
Door closed, Door opened, Door left open for too long, Forced opening
This allows the system not only to control the door but also to know its actual physical state.
🌐 Wi-Fi Access Control
Leverage the Wi-Fi capability of ESP32-S3 to upload RFID data to a server.
Example:
RFID → XIAO ESP32-S3 → Wi-Fi → MQTT / HTTP → Server
This enables remote permission management.
📊 Access Logging
Record every card swipe event:
Card ID, Timestamp, PASS / FAIL, User
Generate complete access logs.
☁️ Cloud Control
You can go one step further to let administrators add or remove authorized cards remotely via a web page, building a fully connected smart access control system.
- Who is this project for?
Difficulty: ★★★☆☆
Suitable for: ESP32 beginners, Arduino developers, RFID project enthusiasts, smart home Makers, embedded learners, developers who want to learn state machines, and makers building complete applications with Grove modules.
If you are new to ESP32, you can start by implementing RFID card reading and LCD display, then add the buzzer, servo and state machine step by step.