How-to · Beginner · 3 min read
RC522 RFID Reader
Wiring, Reading Tags and Access Control
By Geekobot Learning Team · Updated 24 Oct 2026
On this page
The RC522 is a 13.56 MHz RFID reader that reads MIFARE cards and key fobs from a few centimetres away over SPI. It runs on 3.3 V, never 5 V, and uses the MFRC522 Arduino library: a few lines of code print each tag's unique ID, which you compare against a list to open a lock or log attendance. For 125 kHz tags you need an EM4100 reader instead.
Key specs at a glance
- Frequency
- 13.56 MHz (ISO 14443A: MIFARE Classic, Ultralight, NTAG)
- Supply
- 3.3 V, about 25 mA active
- Interface
- SPI (also I2C and UART on the chip, rarely broken out)
- Range
- 1 to 3 cm with the PCB antenna
- Logic
- 3.3 V; SPI inputs tolerate 5 V on most boards but 3.3 V is safer
- Library
- MFRC522 (by GithubCommunity) for Arduino, ESP32, Pico
RC522 SPI wiring
| RC522 pin | Arduino Uno / Nano | ESP32 | Raspberry Pi Pico |
|---|---|---|---|
| 3.3V | 3.3V | 3V3 | 3V3 |
| GND | GND | GND | GND |
| RST | D9 | GPIO 22 | GP20 |
| SDA (SS) | D10 | GPIO 5 | GP17 |
| SCK | D13 | GPIO 18 | GP18 |
| MOSI | D11 | GPIO 23 | GP19 |
| MISO | D12 | GPIO 19 | GP16 |
| IRQ | Not connected | Not connected | Not connected |
- 3.3V
- Arduino Uno / Nano:
- 3.3V
- ESP32:
- 3V3
- Raspberry Pi Pico:
- 3V3
- GND
- Arduino Uno / Nano:
- GND
- ESP32:
- GND
- Raspberry Pi Pico:
- GND
- RST
- Arduino Uno / Nano:
- D9
- ESP32:
- GPIO 22
- Raspberry Pi Pico:
- GP20
- SDA (SS)
- Arduino Uno / Nano:
- D10
- ESP32:
- GPIO 5
- Raspberry Pi Pico:
- GP17
- SCK
- Arduino Uno / Nano:
- D13
- ESP32:
- GPIO 18
- Raspberry Pi Pico:
- GP18
- MOSI
- Arduino Uno / Nano:
- D11
- ESP32:
- GPIO 23
- Raspberry Pi Pico:
- GP19
- MISO
- Arduino Uno / Nano:
- D12
- ESP32:
- GPIO 19
- Raspberry Pi Pico:
- GP16
- IRQ
- Arduino Uno / Nano:
- Not connected
- ESP32:
- Not connected
- Raspberry Pi Pico:
- Not connected
Read a tag's UID
Install MFRC522 from the Library Manager. The example below prints each card's UID in hex.
#include <SPI.h>
#include <MFRC522.h>
MFRC522 rfid(10, 9); // SS, RST
void setup() {
Serial.begin(9600);
SPI.begin();
rfid.PCD_Init();
Serial.println("Scan a tag");
}
void loop() {
if (!rfid.PICC_IsNewCardPresent() || !rfid.PICC_ReadCardSerial()) return;
Serial.print("UID: ");
for (byte i = 0; i < rfid.uid.size; i++) {
if (rfid.uid.uidByte[i] < 0x10) Serial.print("0");
Serial.print(rfid.uid.uidByte[i], HEX);
}
Serial.println();
rfid.PICC_HaltA();
}Turning it into a door lock or attendance logger
Store the UIDs of allowed tags in an array (or EEPROM so you can add tags at runtime). On a match, pulse a relay module or a 12 V solenoid lock through a MOSFET for a second, and beep a buzzer. For attendance, send the UID and a timestamp from an ESP32 to a Google Sheet or MQTT broker. Note that a UID can be cloned onto writable cards, so a UID check is convenience, not security; MIFARE DESFire or NTAG with authentication is needed for real access control.
RC522 vs PN532 vs EM4100 (125 kHz)
| Reader | Frequency | Interface | Choose it for |
|---|---|---|---|
| RC522 (MFRC522) | 13.56 MHz | SPI | Cheapest MIFARE reader for Arduino projects |
| PN532 | 13.56 MHz | I2C, SPI, UART | NFC with phones, card emulation, longer range |
| EM4100 / RDM6300 | 125 kHz | UART (serial) | Reading older 125 kHz fobs and cards |
| USB RFID reader | 125 kHz or 13.56 MHz | USB keyboard | Logging to a PC or Raspberry Pi without coding |
- RC522 (MFRC522)
- Frequency:
- 13.56 MHz
- Interface:
- SPI
- Choose it for:
- Cheapest MIFARE reader for Arduino projects
- PN532
- Frequency:
- 13.56 MHz
- Interface:
- I2C, SPI, UART
- Choose it for:
- NFC with phones, card emulation, longer range
- EM4100 / RDM6300
- Frequency:
- 125 kHz
- Interface:
- UART (serial)
- Choose it for:
- Reading older 125 kHz fobs and cards
- USB RFID reader
- Frequency:
- 125 kHz or 13.56 MHz
- Interface:
- USB keyboard
- Choose it for:
- Logging to a PC or Raspberry Pi without coding
Common mistakes to avoid
- Powering the RC522 from 5 V, which damages it.
- Buying 125 kHz tags for a 13.56 MHz reader, or the reverse.
- Placing the antenna on or near metal, which kills the range.
- Using long jumper wires for SPI; keep them short.
- Treating a UID match as secure access control.
Frequently asked questions
What voltage does the RC522 use?
3.3 V on the VCC pin. The logic pins are 3.3 V, and the module has no 5 V regulator.
What is the range of the RC522?
About 1 to 3 cm with the module's PCB antenna. Larger antennas and the PN532 reach a little further.
Can the RC522 read 125 kHz cards?
No. It reads 13.56 MHz MIFARE and NTAG tags only. For 125 kHz EM4100 fobs use an EM4100 or RDM6300 reader.
Can I use the RC522 with an ESP32 or Raspberry Pi?
Yes. On ESP32 use the VSPI pins (18, 19, 23, SS 5). On a Raspberry Pi use SPI0 and the Python mfrc522 library.
Can I write data to the cards?
Yes. MIFARE Classic cards have 1 KB of memory in sectors you can read and write with the library after authenticating with the default key FFFFFFFFFFFF.
Parts for this guide
Terms in this guide
Projects that use it
Put this into practice: 7 step-by-step builds in our project library use parts from this guide.
Keep learning
Sources
- MFRC522 datasheet (NXP Semiconductors)
- MIFARE Classic 1K datasheet (NXP Semiconductors)
- MFRC522 Arduino library documentation
Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.




