Arduino UNO Q - RFID
RFID (Radio Frequency Identification) lets you read a unique ID from a tag or card wirelessly — no contact required. On Arduino UNO Q, the MFRC522 (RC522) module connects over SPI to the MCU. With Bridge and Telegram, you can receive instant notifications on your phone when a tag is scanned.
In this tutorial, you will learn:
- What an RFID RC522 module is and how it works
- How to wire the RC522 to the Arduino UNO Q MCU via SPI
- How to read RFID/NFC tag UIDs using the MFRC522 library
- How to use Bridge to expose scan events to the Linux side (Python)
- How to receive Telegram alerts when an RFID tag is scanned on Arduino UNO Q
- How to use OpenClaw on Arduino UNO Q with the RFID reader

Hardware Preparation
Or you can buy the following kits:
| 1 | × | DIYables Sensor Kit (18 sensors/displays) |
Additionally, some of these links are for products from our own brand, DIYables .
Overview of the RFID-RC522 Module
Pinout
The RC522 has 8 pins. In this tutorial, we use SPI communication:
- GND: Connect to GND
- VCC: Connect to 3.3V (⚠️ NOT 5V — may damage the module)
- RST: Reset pin — connect to MCU digital pin
- IRQ: Interrupt pin — not connected in this tutorial
- MISO/SCL/TX: MISO line (SPI)
- MOSI: MOSI line (SPI)
- SCK: Clock line (SPI)
- SS/SDA/RX: Slave Select (SPI)

※ NOTE THAT:
- Pin arrangement may vary by manufacturer — always follow the labels on the module itself.
- Do NOT connect VCC to 5V — this may permanently damage the RC522 module.
- The MFRC522 library uses SPI mode only.
How RFID/NFC Works
RFID has two parts: a reader and a tag:
- The reader generates an electromagnetic field via its antenna
- The tag is passive (no battery) — it draws power from the field and transmits its stored UID back to the reader

The MCU receives the UID bytes from the reader and can act on them — e.g., grant access if the UID matches an authorized list.
Wiring Diagram

This image is created using Fritzing. Click to enlarge image
| RC522 Pin | Arduino UNO Q MCU |
|---|---|
| GND | GND |
| VCC | 3.3V |
| RST | D5 |
| IRQ | (not connected) |
| MISO | D12 (MISO) |
| MOSI | D11 (MOSI) |
| SCK | D13 (SCK) |
| SS | D10 (SS) |
How To Program For RFID
- Initialize SPI and MFRC522:
- Detect and read a tag in loop():
Arduino UNO Q Code
The Arduino UNO Q has two processors working together:
- The STM32 MCU communicates with the RC522 over SPI and reads tag UIDs in loop()
- The Qualcomm MPU runs Debian Linux and handles Wi-Fi, Python, and cloud connectivity
- In this section, only the MCU is programmed — the Linux side stays idle. A later section shows how both processors work together via Bridge.
Detailed Instructions
First time with Arduino UNO Q? Follow the Getting Started with Arduino UNO Q tutorial before proceeding.
- Connect: Wire the RC522 to the Arduino UNO Q MCU as shown in the wiring diagram.
- Open Arduino App Lab: Launch Arduino App Lab and wait until it detects your Arduino UNO Q.
- Create a new App: Click the Create New App button.

- Give the App a name, for example: RC522RFID
- Click Create to confirm.

- Paste the sketch: Copy the MCU code above and paste it into sketch/sketch.ino. Keep other files as default.
- Install the library: Click the Add sketch library button (the open book icon with a + sign) in the left sidebar.

- Search for MFRC522 created by GithubCommunity and click the Install button.
- Upload: Click the Run button in Arduino App Lab.

- Tap an RFID/NFC tag on the reader and observe the UID printed in the Serial Monitor.
App Lab Console Output
Bridge: Linux + MCU
This section shows how to program both processors of the Arduino UNO Q so the Linux side can receive tag scan events and read UIDs via Bridge:
- The RC522 RFID reader is connected to the MCU via SPI — the MCU scans for tags in loop() and sets an event flag when a tag is detected
- The MPU cannot read the RC522 directly — it calls Bridge functions to poll for tag events and read the last UID
- The MPU has Wi-Fi — running full Debian Linux, it can send Telegram notifications when a tag is scanned
- Arduino_RouterBridge enables RPC communication between the two processors
- ⚠️ /dev/ttyHS1 (Linux) and Serial1 (MCU) are RESERVED by the router — never open them in user code
In short: MCU detects tag in loop() → sets event flag → MPU polls Bridge → MPU sends Telegram alert.
MCU Code (Bridge)
Python Code (Bridge)
Detailed Instructions
- Connect: Wire the RC522 to the Arduino UNO Q as shown in the wiring diagram.
- Open Arduino App Lab: Launch Arduino App Lab and wait for the board to be detected.
- Create a new App: Click Create New App, name it RC522RFIDBridge, then click Create.
- Paste the MCU sketch: Copy the MCU Bridge code above and paste it into sketch/sketch.ino.
- Paste the Python code: Copy the Python Bridge code above and paste it into the Python file in the App.
- Upload: Click the Run button in Arduino App Lab.

- Tap an RFID/NFC tag — observe the UID in the MCU console and the Python console.
App Lab Console Output
Telegram
Receive instant Telegram notifications when an RFID/NFC tag is scanned on the Arduino UNO Q.
MCU sketch: Keep the same MCU sketch from the previous Bridge section.
Python Code (Telegram)
Detailed Instructions
- Replace YOUR_TELEGRAM_BOT_TOKEN with your actual bot token from BotFather.
- Replace YOUR_CHAT_ID with your Telegram chat ID.
- Paste this Python code into your App's Python file (keep the same MCU sketch).
- Click the Run button. Tap a tag — receive the Telegram notification instantly.
App Lab Console Output
ArduinoBot
OpenClaw
...OPENCLAW
OpenClaw support for Arduino UNO Q RFID is coming soon.
...OPENCLAW
Project Ideas
You can build many useful projects with the RFID reader and Arduino UNO Q:
- Access Control System: Maintain an authorized UID list on the Linux side — when a tag is scanned, compare the UID to the list and use Bridge to unlock an electromagnetic lock if authorized, or send a Telegram alert for unauthorized scans
- Attendance Tracker: Every time a student or employee scans their RFID card, the MPU logs the UID and timestamp to a CSV file on Linux — send a daily attendance report to Telegram automatically at end of day
- Telegram Tag Register: Use /register via Telegram to add the last scanned UID to an authorized list — and /list to see all registered UIDs stored in a Python JSON file
- Smart Locker: Combine RFID with a solenoid lock — each registered tag unlocks a personal locker for 10 seconds, with every access logged and sent to Telegram
- Library Book Tracking: Attach RFID tags to books — scan on borrow and return, log each event with timestamp and UID to a file on Linux, and query via Telegram to check who has which book
Challenge Yourself
Ready to go further with RFID on Arduino UNO Q? Try these challenges:
- Easy: Modify the Python code to print "Authorized" if the scanned UID matches a hardcoded string in Python, or "Unauthorized" if it does not — no MCU changes needed.
- Medium: Build a tag register via Telegram: send /register to add the last scanned UID from Bridge.call("get_uid") to a Python JSON file, and /list to see all registered UIDs — make the access control decision in Python.
- Advanced: Implement a time-limited access system: each registered UID has an allowed time window (e.g., 08:00–18:00) stored in a JSON file — scans outside the allowed window send a Telegram alert and do not unlock the door, while scans inside unlock the door for 10 seconds.