The MFRC522 RFID Module is a low-cost RFID reader/writer module commonly used with Arduino, ESP8266, and ESP32 projects for access control, attendance systems, smart parking, inventory management, and automation.
Features
- Frequency: 13.56 MHz
- Communication: SPI
- Works with:
- Arduino UNO
- ESP8266 NodeMCU
- ESP32
- Reads RFID cards/tags such as:
- MIFARE 1K
- RFID keychains
- NFC cards (limited support)
MFRC522 Pinout
| MFRC522 Pin | Arduino UNO | ESP32 | NodeMCU ESP8266 |
|---|---|---|---|
| SDA (SS) | D10 | GPIO5 | D2 |
| SCK | D13 | GPIO18 | D5 |
| MOSI | D11 | GPIO23 | D7 |
| MISO | D12 | GPIO19 | D6 |
| RST | D9 | GPIO4 | D1 |
| GND | GND | GND | GND |
| 3.3V | 3.3V | 3.3V | 3.3V |
⚠️ Important:
- Use 3.3V only
- Do NOT connect to 5V directly
Arduino Example Code
#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("Scan RFID Card");
}
void loop() {
// Check if card present
if (!rfid.PICC_IsNewCardPresent())
return;
// Read card
if (!rfid.PICC_ReadCardSerial())
return;
Serial.print("Card UID: ");
for (byte i = 0; i < rfid.uid.size; i++) {
Serial.print(rfid.uid.uidByte[i], HEX);
Serial.print(" ");
}
Serial.println();
rfid.PICC_HaltA();
}
Common Projects
- Smart door lock
- Attendance system
- Smart parking
- Cashless payment
- Student ID verification
- IoT access control
Common Problems
1. “Communication failure”
- Check SPI wiring
- Ensure module uses 3.3V
2. Card not detected
- Bring tag closer
- Verify supported card type
3. ESP32 reset issue
- Use stable 3.3V supply



















