

The MFRC522 is a highly integrated RFID reader/writer IC that operates at a frequency of 13.56 MHz. It is designed for contactless communication with RFID tags and cards, making it an essential component in a wide range of applications. The MFRC522 is widely used in access control systems, payment terminals, inventory management, and other systems requiring secure and efficient data exchange.
Its compact design, low power consumption, and compatibility with microcontrollers like the Arduino UNO make it a popular choice for both hobbyists and professionals.








Below are the key technical details of the MFRC522:
The MFRC522 is typically used with a breakout board that includes the IC and an antenna. Below is the pin configuration for the breakout board:
| Pin Name | Pin Number | Description |
|---|---|---|
| VCC | 1 | Power supply input (3.3V). |
| GND | 2 | Ground connection. |
| RST | 3 | Reset pin. Active LOW. Used to reset the module. |
| IRQ | 4 | Interrupt pin. Can be used to signal events (optional). |
| MISO/SCL/TX | 5 | SPI MISO (Master In Slave Out) / I2C Clock / UART TX (depending on interface). |
| MOSI/SDA/RX | 6 | SPI MOSI (Master Out Slave In) / I2C Data / UART RX (depending on interface). |
| SCK | 7 | SPI Clock. |
| NSS/SDA | 8 | SPI Chip Select (active LOW) / I2C Address Select. |
The MFRC522 is most commonly used with the SPI interface. Below is the wiring guide for connecting the MFRC522 to an Arduino UNO:
| MFRC522 Pin | Arduino UNO Pin |
|---|---|
| VCC | 3.3V |
| GND | GND |
| RST | Pin 9 |
| IRQ | Not connected |
| MISO | Pin 12 |
| MOSI | Pin 11 |
| SCK | Pin 13 |
| NSS | Pin 10 |
The following example demonstrates how to use the MFRC522 with an Arduino UNO to read RFID card data. This code uses the popular MFRC522 library, which can be installed via the Arduino IDE Library Manager.
#include <SPI.h>
#include <MFRC522.h>
// Define MFRC522 pins
#define RST_PIN 9 // Reset pin connected to Arduino pin 9
#define SS_PIN 10 // Slave Select pin connected to Arduino pin 10
MFRC522 rfid(SS_PIN, RST_PIN); // Create an instance of the MFRC522 class
void setup() {
Serial.begin(9600); // Initialize serial communication
SPI.begin(); // Initialize SPI bus
rfid.PCD_Init(); // Initialize the MFRC522 module
Serial.println("Place your RFID card near the reader...");
}
void loop() {
// Check if a new card is present
if (!rfid.PICC_IsNewCardPresent()) {
return; // Exit if no card is detected
}
// Check if the card can be read
if (!rfid.PICC_ReadCardSerial()) {
return; // Exit if the card cannot be read
}
// Print the UID (Unique Identifier) of the card
Serial.print("Card UID: ");
for (byte i = 0; i < rfid.uid.size; i++) {
Serial.print(rfid.uid.uidByte[i], HEX); // Print each byte in hexadecimal
Serial.print(" ");
}
Serial.println();
// Halt the card to stop communication
rfid.PICC_HaltA();
}
MFRC522 library from the Arduino IDE Library Manager before uploading the code.The module is not detected by the Arduino.
SS_PIN and RST_PIN in the code match your wiring.The RFID card is not being read.
The module is overheating.
The UID is not displayed correctly.
Can the MFRC522 read NFC tags?
What is the maximum range of the MFRC522?
Can I use the MFRC522 with a 5V microcontroller?
Is it possible to write data to RFID cards using the MFRC522?
By following this documentation, you can successfully integrate the MFRC522 into your projects and troubleshoot common issues effectively.