RFID Module, MFRC522 with UART, SPI, I²C Interface
Overview
The RobotDyn MFRC522 RFID Module is a 13.56 MHz RFID reader/writer based on the NXP MFRC522 IC. It can read and write to ISO/IEC 14443 Type A tags — most commonly MIFARE Classic 1K (1 KB storage), MIFARE Ultralight (64 bytes), and NTAG21x series.
This module is distinctive because it supports three interfaces (SPI, I²C, UART), making it flexible for projects on different MCU platforms or where pin count is limited.
Pinout
| Pin | SPI Function | I²C Function | UART Function |
|---|---|---|---|
| 3.3V | Power | Power | Power |
| RST | Reset | Reset | Reset |
| GND | Ground | Ground | Ground |
| IRQ | Interrupt | Interrupt | Interrupt |
| MISO | MISO | — | TX |
| MOSI | MOSI | — | — |
| SCK | SCK | SCL | — |
| SDA | SS (CS) | SDA | RX |
Default mode is SPI. To switch:
- I²C mode: Connect EA (pin selectable on chip) to VDD, set address jumpers
- UART mode: Pull EA high; data via MISO (TX) / SDA (RX)
Most libraries (including the popular MFRC522 Arduino library) assume SPI mode — easiest for getting started.
Arduino Code Example (SPI Mode)
#include <SPI.h>
#include <MFRC522.h>
#define SS_PIN 10
#define RST_PIN 9
MFRC522 rfid(SS_PIN, RST_PIN);
void setup() {
Serial.begin(9600);
SPI.begin();
rfid.PCD_Init();
Serial.println("Tap a card...");
}
void loop() {
if (!rfid.PICC_IsNewCardPresent() || !rfid.PICC_ReadCardSerial()) return;
Serial.print("UID: ");
for (byte i = 0; i < rfid.uid.size; i++) {
Serial.print(rfid.uid.uidByte[i] < 0x10 ? " 0" : " ");
Serial.print(rfid.uid.uidByte[i], HEX);
}
Serial.println();
rfid.PICC_HaltA();
}
Install the MFRC522 library from the Arduino Library Manager.
SPI Wiring (Arduino Uno)
| MFRC522 | Uno Pin |
|---|---|
| 3.3V | 3.3V (⚠️ NOT 5V) |
| GND | GND |
| RST | D9 |
| SDA (SS) | D10 |
| MOSI | D11 |
| MISO | D12 |
| SCK | D13 |
| IRQ | (optional) |
For Mega/Nano/ESP8266/ESP32, MOSI/MISO/SCK pins differ — check your board’s SPI pin mapping.
Read Range Notes
Realistic read distance is 30–50 mm, often less through plastic enclosures or metal-backed surfaces. Tips for maximum range:
- Keep the module away from metal (especially the antenna coil area)
- Don’t enclose in a metal case — RFID won’t work through aluminum/steel
- Lower-quality clone cards may have weaker antennas (shorter range)
Common Uses
- Access control systems
- Time-attendance trackers
- Inventory / asset tracking
- Custom NFC tag readers
- Maker projects (RFID-activated lockboxes, music triggers, etc.)
Where to Buy in 2026
MFRC522 modules are among the cheapest RFID readers — typically $1–3 each. Look for boards with all 8 pins broken out (some cheaper ones omit IRQ or interface-selection pins).
Documentation
- Pinout PDF — coming soon
- Interface selection guide (SPI vs. I²C vs. UART) — coming soon