RFID Sensor Card ID using Arduino Nano


Circuit Diagram: 




 

📁 main_program.ino
Arduino C++
#include <SPI.h>
#include <MFRC522.h>

#define RST_PIN         9          
#define SS_PIN          10         

MFRC522 mfrc522(SS_PIN, RST_PIN);

void setup() {
  Serial.begin(9600);
  SPI.begin();
  mfrc522.PCD_Init();
  Serial.println("Ready to scan...");
}

void loop() {
  // Reset the loop if no new card is present
  if ( ! mfrc522.PICC_IsNewCardPresent() || ! mfrc522.PICC_ReadCardSerial()) {
    return;
  }

  // Convert the UID bytes into a readable String
  String content = "";
  for (byte i = 0; i < mfrc522.uid.size; i++) {
     content.concat(String(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " "));
     content.concat(String(mfrc522.uid.uidByte[i], HEX));
  }
  content.toUpperCase();
  
  Serial.println("Detected UID:" + content);

  // --- ASSIGN TASKS HERE ---
  
  if (content.substring(1) == "33 5A 72 1B") { 
    performTaskA();
  } 
  else id (content.substring(1) == "A1 B2 C3 D4") { 
    performTaskB();
  } 
  else {
    Serial.println("Unknown card. Access Denied.");
  }

  delay(1000); // Short delay to prevent multiple reads
}

// Define what happens for each card
void performTaskA() {
  Serial.println("Task A: Opening the vault...");
}

void performTaskB() {
  Serial.println("Task B: Activating System...");
}

RFID Task Trigger System: Integrating MFRC522 with Arduino Nano

Building secure interactive hardware configurations requires fast peripheral verification networks. This project leverages an Arduino Nano core running a Serial Peripheral Interface (SPI) bus to pull unique card identifiers (UIDs) from a 13.56 MHz MFRC522 RFID module, automating downstream software actions or hardware executions based on the detected tag footprint.

Data Verification & Execution Stream

The control pipeline captures high-frequency carrier wave data, decodes the signature frames, and parses them against a local validation array:

[ RFID Tag / Card Close Pass ] ──► Radio Frequency Induction (13.56 MHz) │ ▼ (SPI Communication Bus) [ Arduino Nano Decoder Core ] ────► UID Extraction & Parsing Engine │ ▼ (Conditional Logic Check) [ Application Logic Gate ] ───────► Execute Custom Process (Task 1 / Task 2)

Hardware Signal Bus Routing Guide

Wire the high-frequency RFID reader array to your microcontroller layout using these exact connection mappings:

MFRC522 Pin Out Target Processing Pin (Arduino Nano) Signal Description & Purpose
VCC 3.3V Dedicated Rail Power Supply Input (Do NOT use 5V)
RST Digital Pin D9 Reset Line (Software Configurable)
GND GND Power Rail Common Circuit Ground Reference
IRQ Not Connected (Unused) Interrupt Line Allocation
MISO Digital Pin D12 SPI Master In Slave Out Bus Channel
MOSI Digital Pin D11 SPI Master Out Slave In Bus Channel
SCK Digital Pin D13 SPI System Clock Signal Channel
SDA (SS) Digital Pin D10 SPI Slave Select Data Line
⚠️ CRITICAL OVERVOLTAGE VOLTAGE WARNING: The MFRC522 IC is highly sensitive and operates exclusively on a 3.3V logic/power bus. Running the VCC wire directly into the 5V terminal line of your Arduino Nano will trigger permanent thermal degradation and burn out the module transceiver crystals!

System Integration Operations

  • Identifying Card Footprints: Flash the firmware, open your serial terminal console at 9600 Baud, and scan your tokens sequentially to observe raw hexadecimal string codes.
  • Custom Logic Routing: Extract those string readouts and plug them directly into the conditional block framework inside the main loop to automate your unique routines.

Live Interactive Simulation Panel

Test the decoding firmware engine and trigger automated actions virtually without loading physical components into a prototype board:

Run Virtual Testing Environment

Launch the live virtual hardware workspace to simulate tag swipes, verify register handling, and monitor active debug outputs.

🌐 Launch Wokwi Simulation Terminal

📺 PROJECT VIDEO DEMONSTRATION

Watch the step-by-step setup walkthrough and live hardware integration tests in action:

Comments