#include #include #define SS_PIN 10 #define RST_PIN 9 #define GREEN_LED 2 #define RED_LED 3 MFRC522 rfid(SS_PIN, RST_PIN); void setup() Serial.begin(9600); SPI.begin(); rfid.PCD_Init(); pinMode(GREEN_LED, OUTPUT); pinMode(RED_LED, OUTPUT); Serial.println("Place your RFID card near the reader..."); void loop() if ( ! rfid.PICC_IsNewCardPresent()) return; if ( ! rfid.PICC_ReadCardSerial()) return; Serial.print("Card UID:"); String uidString = ""; for (byte i = 0; i < rfid.uid.size; i++) Serial.print(rfid.uid.uidByte[i] < 0x10 ? " 0" : " "); Serial.print(rfid.uid.uidByte[i], HEX); uidString += String(rfid.uid.uidByte[i], HEX); Serial.println(); // Example Authorized UID (Change this to match your simulation settings) if (uidString.equalsIgnoreCase("21a3b5c7")) Serial.println("Access Granted!"); digitalWrite(GREEN_LED, HIGH); delay(2000); digitalWrite(GREEN_LED, LOW); else Serial.println("Access Denied!"); digitalWrite(RED_LED, HIGH); delay(2000); digitalWrite(RED_LED, LOW); rfid.PICC_HaltA(); rfid.PCD_StopCrypto1(); Use code with caution. Running the Simulation
Move the .IDX and .LIB files into the LIBRARY folder.
Compile your code in the Arduino IDE and load the .hex file into the Arduino in Proteus.
: Sourcing the .LIB and .IDX files from reputable community sites like The Engineering Projects or GitHub. Copy-Paste : Move the downloaded files to: rc522 proteus library updated
Reputable hobbyist forums often provide the most stable "simulation models" that include both the visual component and the logic model. 📥 Installation Steps To add the updated library to your Proteus environment:
RC522 Proteus library allows engineers and hobbyists to simulate the MFRC522 RFID module within the Proteus Design Suite. Because Proteus does not include this module by default, an external library is required to perform virtual testing of access control systems, inventory tracking, or identification projects. Key Features of the Updated Library Visual Simulation
Q: What is the difference between the old and updated RC522 Proteus library? A: The updated library provides improved simulation accuracy, support for multiple RFID protocols, and increased compatibility with the latest versions of Proteus. #include #include #define SS_PIN 10 #define RST_PIN 9
Right-click the RC522 module to ensure the "Library" path is correctly mapped.
void loop() // Look for a new card if ( ! mfrc522.PICC_IsNewCardPresent()) return; // Select the card and read its UID if ( ! mfrc522.PICC_ReadCardSerial()) return;
#define RST_PIN 9 #define SS_PIN 10
Unzip the library folder to find the .LIB and .IDX files. Locate Proteus Folders:
Ensure the package contains MFRC522.LIB and MFRC522.IDX . Steps to Install the Updated RC522 Library in Proteus
: Always restart Proteus after adding new components so the "Pick Device" list updates. Step 2: Circuit Interfacing (The Wiring) Compile your code in the Arduino IDE and load the
To make the simulation interactive, you need the in your Arduino IDE. Download the library from the MFRC522 GitHub Repository . Install it via Sketch > Include Library > Add .ZIP Library .