Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use MFRC522 RFID : Examples, Pinouts, and Specs

Image of MFRC522 RFID
Cirkit Designer LogoDesign with MFRC522 RFID in Cirkit Designer

Introduction

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 a versatile component for a wide range of applications. The MFRC522 is widely used in systems requiring secure identification, data exchange, or access control. Its compact design and low power consumption make it ideal for embedded systems and portable devices.

Explore Projects Built with MFRC522 RFID

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Arduino UNO RFID Access Control System with I2C LCD Feedback and Keypad Input
Image of eduVents_NFC: A project utilizing MFRC522 RFID  in a practical application
This circuit is designed to read RFID tags using the RFID-RC522 module, display information on an I2C LCD screen, and accept user input via a 4x4 membrane matrix keypad. It is controlled by an Arduino UNO, which is powered by a 3xAA battery pack, and communicates with the RFID module and LCD screen using SPI and I2C protocols, respectively.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO and RFID-RC522 Based RFID Reader System
Image of attendance: A project utilizing MFRC522 RFID  in a practical application
This circuit integrates an Arduino UNO with an RFID-RC522 module to enable RFID-based identification. The Arduino provides power and SPI communication to the RFID module, allowing it to read RFID tags and potentially perform actions based on the tag data.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO RFID Reader with MFRC522 Module
Image of ARSITEKTUR SISTEM : A project utilizing MFRC522 RFID  in a practical application
This circuit consists of an Arduino UNO microcontroller connected to an RFID-RC522 module. The Arduino UNO reads RFID tags using the RFID-RC522 and outputs the tag information via the serial monitor.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO and RFID-RC522 Based RFID Reader System
Image of compartment: A project utilizing MFRC522 RFID  in a practical application
This circuit consists of an Arduino UNO microcontroller connected to an RFID-RC522 module. The Arduino provides power and handles communication with the RFID module, enabling it to read RFID tags for identification or access control purposes.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with MFRC522 RFID

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of eduVents_NFC: A project utilizing MFRC522 RFID  in a practical application
Arduino UNO RFID Access Control System with I2C LCD Feedback and Keypad Input
This circuit is designed to read RFID tags using the RFID-RC522 module, display information on an I2C LCD screen, and accept user input via a 4x4 membrane matrix keypad. It is controlled by an Arduino UNO, which is powered by a 3xAA battery pack, and communicates with the RFID module and LCD screen using SPI and I2C protocols, respectively.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of attendance: A project utilizing MFRC522 RFID  in a practical application
Arduino UNO and RFID-RC522 Based RFID Reader System
This circuit integrates an Arduino UNO with an RFID-RC522 module to enable RFID-based identification. The Arduino provides power and SPI communication to the RFID module, allowing it to read RFID tags and potentially perform actions based on the tag data.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of ARSITEKTUR SISTEM : A project utilizing MFRC522 RFID  in a practical application
Arduino UNO RFID Reader with MFRC522 Module
This circuit consists of an Arduino UNO microcontroller connected to an RFID-RC522 module. The Arduino UNO reads RFID tags using the RFID-RC522 and outputs the tag information via the serial monitor.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of compartment: A project utilizing MFRC522 RFID  in a practical application
Arduino UNO and RFID-RC522 Based RFID Reader System
This circuit consists of an Arduino UNO microcontroller connected to an RFID-RC522 module. The Arduino provides power and handles communication with the RFID module, enabling it to read RFID tags for identification or access control purposes.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications

  • Access control systems (e.g., door locks, attendance systems)
  • Payment systems (e.g., contactless credit card readers)
  • Inventory and asset management
  • Smart vending machines
  • Embedded systems requiring RFID communication

Technical Specifications

Key Technical Details

Parameter Value
Operating Frequency 13.56 MHz
Operating Voltage 2.5V to 3.3V (logic level)
Supply Voltage (VCC) 3.3V
Current Consumption 13-26 mA (typical)
Communication Interface SPI, I2C, UART
Maximum Data Rate 424 kbit/s
Supported Protocols ISO/IEC 14443 A/MIFARE
Operating Temperature -20°C to +85°C
Dimensions 40mm x 60mm (module size)

Pin Configuration and Descriptions

The MFRC522 module typically comes with an 8-pin header for interfacing. Below is the pinout:

Pin Name Pin Number Description
VCC 1 Power supply input (3.3V)
RST 2 Reset pin (active LOW)
GND 3 Ground connection
IRQ 4 Interrupt pin (optional, not always used)
MISO 5 SPI Master-In-Slave-Out (data output)
MOSI 6 SPI Master-Out-Slave-In (data input)
SCK 7 SPI Clock
SDA/SS 8 SPI Slave Select (chip select)

Usage Instructions

How to Use the MFRC522 in a Circuit

  1. Power Supply: Connect the VCC pin to a 3.3V power source and the GND pin to ground.
  2. SPI Communication: Connect the SPI pins (MISO, MOSI, SCK, and SDA/SS) to the corresponding pins on your microcontroller. Ensure the microcontroller operates at 3.3V logic levels or use a level shifter if necessary.
  3. Reset Pin: Connect the RST pin to a GPIO pin on the microcontroller for resetting the module.
  4. Interrupt Pin: The IRQ pin is optional and can be used for advanced interrupt-driven applications.

Important Considerations

  • Voltage Levels: The MFRC522 operates at 3.3V. If your microcontroller uses 5V logic, use a level shifter to avoid damaging the module.
  • Antenna Placement: Ensure the onboard antenna is not obstructed by metal objects, as this can interfere with RFID communication.
  • Tag Distance: The effective reading distance is typically 2-5 cm, depending on the tag and environmental conditions.

Example Code for Arduino UNO

Below is an example of how to use the MFRC522 with an Arduino UNO to read RFID tags. This code uses the popular MFRC522 library.

#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 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();
}

Notes on the Code

  • Install the MFRC522 library from the Arduino Library Manager before running the code.
  • Ensure the SS_PIN and RST_PIN definitions match your wiring.

Troubleshooting and FAQs

Common Issues

  1. Module Not Responding:

    • Ensure the module is powered with 3.3V and all connections are secure.
    • Verify that the SPI pins are correctly connected to the microcontroller.
  2. Card Not Detected:

    • Check the distance between the card and the antenna. It should be within 2-5 cm.
    • Ensure there are no metal objects near the antenna that could cause interference.
  3. Incorrect UID Read:

    • Verify that the SPI communication speed is set correctly in the microcontroller.
    • Ensure the RFID tag/card is compatible with the MFRC522 (e.g., MIFARE cards).

Tips for Troubleshooting

  • Use a multimeter to check the voltage levels on the module's pins.
  • Test the module with a known working RFID tag to rule out compatibility issues.
  • If using a 5V microcontroller, double-check the level shifter connections.

FAQs

Q: Can the MFRC522 read NFC tags?
A: The MFRC522 supports ISO/IEC 14443 A/MIFARE protocols, which are compatible with many NFC tags. However, it does not support all NFC standards.

Q: What is the maximum range of the MFRC522?
A: The typical range is 2-5 cm, depending on the tag and environmental conditions.

Q: Can I use the MFRC522 with a 5V microcontroller?
A: Yes, but you must use a level shifter to convert the 5V logic levels to 3.3V to avoid damaging the module.