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

Arduino RFID Reader with RC522 Module

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

Circuit Documentation

Summary

This circuit utilizes an Arduino UNO microcontroller and an RC522 RFID module. The Arduino UNO serves as the main controller, interfacing with the RC522 module to read RFID tags. The circuit is designed to power the RFID module and facilitate communication between the two components using the SPI protocol.


Component List

Arduino UNO

RC522 RFID Module


Wiring Details

Arduino UNO


Documented Code

Arduino Code

#include <SPI.h>
#include <MFRC522.h>

constexpr uint8_t SS_PIN  = 10;  // RC522 SDA pin wired to D10
constexpr uint8_t RST_PIN = 9;   // RC522 RST pin wired to D9

MFRC522 mfrc522(SS_PIN, RST_PIN);

void setup() {
  Serial.begin(115200);
  while (!Serial) { /* wait for serial */ }

  SPI.begin();
  mfrc522.PCD_Init();  // Initialize RC522

  // Read and print VersionReg (our sim returns 0x92)
  byte v = mfrc522.PCD_ReadRegister(MFRC522::VersionReg);
  Serial.print(F("MFRC522 VersionReg: 0x")); Serial.println(v, HEX);
  Serial.println(F("Present a card (toggle 'Present Card' in the component)."));
}

void loop() {
  delay(500);

  // Look for new cards
  if (!mfrc522.PICC_IsNewCardPresent()) return;
  if (!mfrc522.PICC_ReadCardSerial())   return;

  // Print UID
  Serial.print(F("UID: "));
  for (byte i = 0; i < mfrc522.uid.size; i++) {
    if (mfrc522.uid.uidByte[i] < 0x10) Serial.print('0');
    Serial.print(mfrc522.uid.uidByte[i], HEX);
    Serial.print(i + 1 < mfrc522.uid.size ? ' ' : '\n');
  }

  // Halt PICC and stop encryption
  mfrc522.PICC_HaltA();
  mfrc522.PCD_StopCrypto1();
}

Documentation Code

(Note: The documentation code section is empty as per the provided input.)


This concludes the documentation for the circuit.