Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino Nano RFID Reader with RC522 Module

View and Edit Project In Cirkit DesignerImage of Arduino Nano RFID Reader with RC522 Module

Circuit Documentation

Summary

This circuit integrates an RFID-RC522 module with an Arduino Nano to enable RFID reading capabilities. The RFID-RC522 is connected to the Arduino Nano through SPI (Serial Peripheral Interface) for communication, and a couple of resistors are used to create a voltage divider that likely serves to step down the voltage from the Arduino's 5V output to a lower voltage suitable for the RFID-RC522 module, which operates at 3.3V.

Component List

RFID-RC522

Arduino Nano

Resistor (2k Ohms)

Resistor (1k Ohms)

Wiring Details

RFID-RC522

Arduino Nano

Resistor (2k Ohms)

Resistor (1k Ohms)

Documented Code

#include <MFRC522.h>
#include <MFRC522Extended.h>
#include <deprecated.h>
#include <require_cpp11.h>
#include <SPI.h>
#include <MFRC522.h>

#define RST_PIN         9          // Configurable, see typical pin layout above
#define SS_PIN          10         // Configurable, see typical pin layout above

MFRC522 mfrc522(SS_PIN, RST_PIN);  // Create MFRC522 instance

void setup() {
    Serial.begin(115200);                       // Initialize serial communications with the PC
    while (!Serial);                            // Do nothing if no serial port is opened (added for Arduinos based on ATMEGA32U4)
    SPI.begin();                                // Init SPI bus
    mfrc522.PCD_Init();                         // Init MFRC522
    delay(4);                                   // Optional delay. Some board do need more time after init to be ready, see Readme
    mfrc522.PCD_DumpVersionToSerial();          // Show details of PCD - MFRC522 Card Reader details
    Serial.println(F("Scan PICC to see UID, SAK, type, and data blocks..."));
}

void loop() {
    // Reset the loop if no new card present on the sensor/reader. This saves the entire process when idle.
    if ( ! mfrc522.PICC_IsNewCardPresent()) {
        return;
    }
    // Select one of the cards
    if ( ! mfrc522.PICC_ReadCardSerial()) {
        return;
    }
    // Dump debug info about the card; PICC_HaltA() is automatically called
    mfrc522.PICC_DumpToSerial(&(mfrc522.uid));
}

This code is designed to be uploaded to the Arduino Nano. It initializes the RFID-RC522 module and sets up serial communication. In the loop, it checks for the presence of a new RFID card and reads its data if present, then dumps the card information to the serial output.