Overview
The rfid_rc522 node interfaces with the MFRC522 RFID reader module via SPI
to read and write 13.56MHz MIFARE Classic and Ultralight cards and tags. Commonly used for access control,
inventory tracking, attendance systems, and interactive IoT projects requiring contactless identification.
Properties
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
| spiBus | number | No | 0 | SPI bus number |
| spiDevice | number | No | 0 | SPI chip select (CE0=0, CE1=1) |
| spiSpeed | number | No | 1000000 | SPI clock speed in Hz (max 10MHz) |
| resetPin | number | No | 25 | GPIO pin for hardware reset (-1 to disable) |
| antennaGain | select | No | "48dB" | Antenna gain: "18dB", "23dB", "33dB", "38dB", "43dB", "48dB" |
Inputs
{
"payload": {
"command": "scan"
}
} {
"payload": {
"command": "read",
"block": 4,
"key": "FFFFFFFFFFFF"
}
} Outputs
{
"uid": "A1:B2:C3:D4",
"type": "MIFARE 1KB",
"size": 1024,
"data": null,
"timestamp": "2025-01-15T10:30:00.000Z"
} {
"uid": "A1:B2:C3:D4",
"type": "MIFARE 1KB",
"size": 1024,
"data": [72, 101, 108, 108, 111, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0],
"timestamp": "2025-01-15T10:30:01.000Z"
} Wiring Diagram
RC522 to Raspberry Pi
RC522 Module Raspberry Pi +------------+ +--------------+ | SDA (CS) |--------| CE0 (Pin 24)| | SCK |--------| SCLK (Pin 23)| | MOSI |--------| MOSI (Pin 19)| | MISO |--------| MISO (Pin 21)| | IRQ |--------| (not connected)| | GND |--------| GND (Pin 6) | | RST |--------| GPIO25(Pin 22)| | 3.3V |--------| 3.3V (Pin 1) | +------------+ +--------------+
Wiring Notes
3.3V power only (module is NOT 5V tolerant)
SDA is the SPI chip select (CS/SS) line
RST hardware reset, set to -1 to tie to 3.3V
IRQ optional, not required for polling mode
Note: Enable SPI on your Pi: sudo raspi-config then Interface Options, then SPI, then Enable.
Example Use Cases
Door Access Control System
Scan RFID cards and check against an authorized list to unlock a door.
[
{
"id": "rfid-scan",
"type": "rfid_rc522",
"spiBus": 0,
"spiDevice": 0,
"resetPin": 25,
"antennaGain": "48dB"
},
{
"id": "check-auth",
"type": "function",
"name": "Check Authorized Cards"
},
{
"id": "door-relay",
"type": "gpio-out",
"pin": 18,
"initialState": 0
}
] Attendance Logging System
Log RFID card scans with timestamps to a SQLite database and display on dashboard.
[
{
"id": "rfid-reader",
"type": "rfid_rc522",
"antennaGain": "48dB"
},
{
"id": "log-attendance",
"type": "sqlite",
"sql": "INSERT INTO attendance (uid, scan_time) VALUES (?, datetime('now'))"
},
{
"id": "display-table",
"type": "table",
"name": "Recent Scans"
}
] Inventory Tracking
Read RFID tags on items and update inventory in a MongoDB database.
[
{
"id": "rfid-item",
"type": "rfid_rc522",
"antennaGain": "43dB"
},
{
"id": "lookup-item",
"type": "mongodb",
"operation": "findOne",
"collection": "inventory"
},
{
"id": "update-status",
"type": "mongodb",
"operation": "updateOne",
"collection": "inventory"
}
] Common Use Cases
Access Control
RFID card-based door and gate entry systems
Attendance Systems
Employee and student check-in/check-out logging
Inventory Tracking
Tag and track assets with RFID labels
Interactive Projects
NFC-triggered actions, games, and educational kits