Blog

RC522 RFID Reader/Writer Module – Complete Guide

RFID Reader/Writer Module

RC522 RFID Reader/Writer Module

13.56MHz Contactless Card Reading via SPI

The RC522 is built around NXP's MFRC522 chip, an integrated reader/writer for contactless communication at the 13.56MHz ISM band - the same frequency used by MIFARE cards. It works through inductive coupling: the module's onboard antenna coil generates an oscillating magnetic field, and when a passive RFID tag (which has no battery of its own) is brought within a few centimeters, that field induces a current in the tag's own coil - enough to power its tiny onboard chip and let it modulate the field back with its stored data, a technique called load modulation. The RC522 chip demodulates that faint returned signal, handles the ISO/IEC 14443 Type A protocol timing, and exposes read/write access to the tag's memory over SPI, so your microcontroller only deals with clean structured commands and data rather than raw RF timing.

13.56 MHz
Frequency
~3cm (typical)
Read Range
SPI
Interface

Key features

Read & Write

Not just reading UIDs, but reading and writing to MIFARE card memory sectors.

SPI Interface

A fast, simple 4-wire digital connection to any microcontroller.

ISO/IEC 14443A Compliant

Compatible with standard MIFARE Classic and Ultralight cards and tags.

Includes Card + Keyfob

Most kits bundle both a card and a keyfob tag to get started immediately.

Low Power Operation

Draws modest current, practical for battery-powered access-control projects.

Anti-Collision Support

Can detect and address multiple tags in the field without conflict.

Technical specifications

Supply Voltage 3.3V (NOT 5V tolerant)
Operating Frequency 13.56 MHz
Interface SPI (bare chip also supports I2C/UART)
Read Range ~3cm typical (up to ~5cm)
Card Types MIFARE Classic 1K/4K, Ultralight, DESFire
Protocol ISO/IEC 14443 Type A
Data Rate Up to 10 Mbit/s (SPI)
Operating Current ~13–26 mA
Package Breakout module with PCB antenna

Pinout

PinFunction
3.3V Power supply - do not connect to 5V
RST Reset input
GND Ground
SDA/SS SPI chip select
SCK / MOSI / MISO SPI clock and data lines
IRQ Interrupt output (optional, tag-detected signaling)

Applications

Access control and door lock systems Attendance tracking systems Cashless vending and payment prototypes Inventory and asset tagging Library book checkout systems DIY NFC-triggered automation

What's in the box

1x RC522 RFID reader module
1x MIFARE RFID card
1x RFID keyfob

Downloads

Datasheet (PDF) Arduino MFRC522 Library Example
🔌
Pin Connections
1 Table
Pin Connections Table 1
BoardSensor PinConnection
RC522SDA/RSTboard SS pin / board RST pin
📟
RFID Reader/Writer RC522 SPI S50 with RFID Card and Tag
7 Examples • C/C++ | Boards: Arduino Uno, Arduino Nano, Arduino Mega, ESP32, ESP8266, STM32, Raspberry Pi Pico
RFID Reader/Writer RC522 SPI S50 with RFID Card and Tag - Arduino Uno
RFID Reader/Writer RC522 SPI S50 with RFID Card and Tag - Arduino Nano
RFID Reader/Writer RC522 SPI S50 with RFID Card and Tag - Arduino Mega
RFID Reader/Writer RC522 SPI S50 with RFID Card and Tag - ESP32
RFID Reader/Writer RC522 SPI S50 with RFID Card and Tag - ESP8266
RFID Reader/Writer RC522 SPI S50 with RFID Card and Tag - STM32
RFID Reader/Writer RC522 SPI S50 with RFID Card and Tag - Raspberry Pi Pico
📄 File: rfid_reader/writer_rc522_spi_s50_with_rfid_card_and_tag_-_arduino_uno.inoArduino Uno
605 characters
1//ekostra.com
2//electronics store in egypt
3//+201008896258
4
5// SDA(SS)=10, RST=9 on Arduino Uno (MOSI/MISO/SCK use hardware SPI pins)
6#include <SPI.h>
7#include <MFRC522.h>
8
9#define SS_PIN 10
10#define RST_PIN 9
11MFRC522 mfrc522(SS_PIN, RST_PIN);
12
13void setup() {
14 Serial.begin(115200);
15 SPI.begin();
16 mfrc522.PCD_Init();
17}
18
19void loop() {
20 if (!mfrc522.PICC_IsNewCardPresent() || !mfrc522.PICC_ReadCardSerial()) return;
21 Serial.print("Card UID:");
22 for (byte i = 0; i < mfrc522.uid.size; i++) { Serial.print(" "); Serial.print(mfrc522.uid.uidByte[i], HEX); }
23 Serial.println();
24 mfrc522.PICC_HaltA();
25}
📄 File: rfid_reader/writer_rc522_spi_s50_with_rfid_card_and_tag_-_arduino_nano.inoArduino Nano
606 characters
1//ekostra.com
2//electronics store in egypt
3//+201008896258
4
5// SDA(SS)=10, RST=9 on Arduino Nano (MOSI/MISO/SCK use hardware SPI pins)
6#include <SPI.h>
7#include <MFRC522.h>
8
9#define SS_PIN 10
10#define RST_PIN 9
11MFRC522 mfrc522(SS_PIN, RST_PIN);
12
13void setup() {
14 Serial.begin(115200);
15 SPI.begin();
16 mfrc522.PCD_Init();
17}
18
19void loop() {
20 if (!mfrc522.PICC_IsNewCardPresent() || !mfrc522.PICC_ReadCardSerial()) return;
21 Serial.print("Card UID:");
22 for (byte i = 0; i < mfrc522.uid.size; i++) { Serial.print(" "); Serial.print(mfrc522.uid.uidByte[i], HEX); }
23 Serial.println();
24 mfrc522.PICC_HaltA();
25}
📄 File: rfid_reader/writer_rc522_spi_s50_with_rfid_card_and_tag_-_arduino_mega.inoArduino Mega
606 characters
1//ekostra.com
2//electronics store in egypt
3//+201008896258
4
5// SDA(SS)=53, RST=9 on Arduino Mega (MOSI/MISO/SCK use hardware SPI pins)
6#include <SPI.h>
7#include <MFRC522.h>
8
9#define SS_PIN 53
10#define RST_PIN 9
11MFRC522 mfrc522(SS_PIN, RST_PIN);
12
13void setup() {
14 Serial.begin(115200);
15 SPI.begin();
16 mfrc522.PCD_Init();
17}
18
19void loop() {
20 if (!mfrc522.PICC_IsNewCardPresent() || !mfrc522.PICC_ReadCardSerial()) return;
21 Serial.print("Card UID:");
22 for (byte i = 0; i < mfrc522.uid.size; i++) { Serial.print(" "); Serial.print(mfrc522.uid.uidByte[i], HEX); }
23 Serial.println();
24 mfrc522.PICC_HaltA();
25}
📄 File: rfid_reader/writer_rc522_spi_s50_with_rfid_card_and_tag_-_esp32.inoESP32
599 characters
1//ekostra.com
2//electronics store in egypt
3//+201008896258
4
5// SDA(SS)=5, RST=22 on ESP32 (MOSI/MISO/SCK use hardware SPI pins)
6#include <SPI.h>
7#include <MFRC522.h>
8
9#define SS_PIN 5
10#define RST_PIN 22
11MFRC522 mfrc522(SS_PIN, RST_PIN);
12
13void setup() {
14 Serial.begin(115200);
15 SPI.begin();
16 mfrc522.PCD_Init();
17}
18
19void loop() {
20 if (!mfrc522.PICC_IsNewCardPresent() || !mfrc522.PICC_ReadCardSerial()) return;
21 Serial.print("Card UID:");
22 for (byte i = 0; i < mfrc522.uid.size; i++) { Serial.print(" "); Serial.print(mfrc522.uid.uidByte[i], HEX); }
23 Serial.println();
24 mfrc522.PICC_HaltA();
25}
📄 File: rfid_reader/writer_rc522_spi_s50_with_rfid_card_and_tag_-_esp8266.inoESP8266
603 characters
1//ekostra.com
2//electronics store in egypt
3//+201008896258
4
5// SDA(SS)=D8, RST=D3 on ESP8266 (MOSI/MISO/SCK use hardware SPI pins)
6#include <SPI.h>
7#include <MFRC522.h>
8
9#define SS_PIN D8
10#define RST_PIN D3
11MFRC522 mfrc522(SS_PIN, RST_PIN);
12
13void setup() {
14 Serial.begin(115200);
15 SPI.begin();
16 mfrc522.PCD_Init();
17}
18
19void loop() {
20 if (!mfrc522.PICC_IsNewCardPresent() || !mfrc522.PICC_ReadCardSerial()) return;
21 Serial.print("Card UID:");
22 for (byte i = 0; i < mfrc522.uid.size; i++) { Serial.print(" "); Serial.print(mfrc522.uid.uidByte[i], HEX); }
23 Serial.println();
24 mfrc522.PICC_HaltA();
25}
📄 File: rfid_reader/writer_rc522_spi_s50_with_rfid_card_and_tag_-_stm32.inoSTM32
605 characters
1//ekostra.com
2//electronics store in egypt
3//+201008896258
4
5// SDA(SS)=PA4, RST=PB0 on STM32 (MOSI/MISO/SCK use hardware SPI pins)
6#include <SPI.h>
7#include <MFRC522.h>
8
9#define SS_PIN PA4
10#define RST_PIN PB0
11MFRC522 mfrc522(SS_PIN, RST_PIN);
12
13void setup() {
14 Serial.begin(115200);
15 SPI.begin();
16 mfrc522.PCD_Init();
17}
18
19void loop() {
20 if (!mfrc522.PICC_IsNewCardPresent() || !mfrc522.PICC_ReadCardSerial()) return;
21 Serial.print("Card UID:");
22 for (byte i = 0; i < mfrc522.uid.size; i++) { Serial.print(" "); Serial.print(mfrc522.uid.uidByte[i], HEX); }
23 Serial.println();
24 mfrc522.PICC_HaltA();
25}
📄 File: rfid_reader/writer_rc522_spi_s50_with_rfid_card_and_tag_-_raspberry_pi_pico.inoRaspberry Pi Pico
613 characters
1//ekostra.com
2//electronics store in egypt
3//+201008896258
4
5// SDA(SS)=17, RST=20 on Raspberry Pi Pico (MOSI/MISO/SCK use hardware SPI pins)
6#include <SPI.h>
7#include <MFRC522.h>
8
9#define SS_PIN 17
10#define RST_PIN 20
11MFRC522 mfrc522(SS_PIN, RST_PIN);
12
13void setup() {
14 Serial.begin(115200);
15 SPI.begin();
16 mfrc522.PCD_Init();
17}
18
19void loop() {
20 if (!mfrc522.PICC_IsNewCardPresent() || !mfrc522.PICC_ReadCardSerial()) return;
21 Serial.print("Card UID:");
22 for (byte i = 0; i < mfrc522.uid.size; i++) { Serial.print(" "); Serial.print(mfrc522.uid.uidByte[i], HEX); }
23 Serial.println();
24 mfrc522.PICC_HaltA();
25}
SPI 13.56MHz RFID reader/writer.
The RC522 is a 3.3V-only device - its VCC pin is explicitly not rated for 5V, and while some SPI lines may tolerate it briefly, running it on 5V is a common way to shorten or outright kill the module, so always confirm you're feeding it 3.3V, not the Arduino's 5V rail. Keep the antenna coil away from metal surfaces and enclosures, since nearby metal noticeably shrinks the already-short read range. And remember there's a real difference between simply reading a tag's UID (what most beginner tutorials show) and reading/writing the card's actual data sectors, which are protected by a per-sector authentication key - MIFARE Classic cards ship with a well-known default Key A of FF FF FF FF FF FF, which you'll need for basic read/write access until you set your own.