

The RFID RC522 is a low-cost RFID reader/writer module that operates at a frequency of 13.56 MHz. It is widely used for reading RFID tags and cards, enabling wireless communication in a variety of applications. This module is based on the MFRC522 IC and supports ISO/IEC 14443 Type A cards. Its compact size, low power consumption, and ease of integration make it a popular choice for projects involving access control, inventory management, attendance systems, and identification systems.








Below are the key technical details and pin configuration of the RFID RC522 module:
The RFID RC522 module has 8 pins, as described in the table below:
| Pin | Name | Description |
|---|---|---|
| 1 | VCC | Power supply input (3.3V). Can be connected to 5V with a level shifter. |
| 2 | RST | Reset pin. Active LOW. Used to reset the module. |
| 3 | GND | Ground connection. |
| 4 | IRQ | Interrupt pin. Can be used to signal events (optional). |
| 5 | MISO/SCL/TX | SPI MISO (Master In Slave Out), I2C clock (SCL), or UART TX (default: SPI MISO). |
| 6 | MOSI/SDA/RX | SPI MOSI (Master Out Slave In), I2C data (SDA), or UART RX (default: SPI MOSI). |
| 7 | SCK | SPI clock input. |
| 8 | NSS/SDA | SPI chip select (NSS) or I2C address select (SDA). |
#include <SPI.h>
#include <MFRC522.h>
// Define pins for the RC522 module
#define RST_PIN 9 // Reset pin connected to D9
#define SS_PIN 10 // Slave Select pin connected to D10
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 RC522 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 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();
}
Module Not Responding:
Card Not Detected:
UID Not Displayed:
Can the RC522 module write data to RFID tags? Yes, the RC522 can write data to compatible RFID tags. Refer to the MFRC522 library examples for writing data.
Can I use the RC522 with a 5V microcontroller? Yes, but you must use level shifters for the SPI pins to avoid damaging the module.
What is the maximum range of the RC522 module? The maximum range is approximately 5 cm, depending on the tag and environmental conditions.