Rc522 Proteus Library Info

Complete Guide to the RC522 Proteus Library: Simulation and Interfacing

Simulating high-frequency RFID systems in Proteus requires adding specialized component libraries that do not come standard with the software. The RC522 (MFRC522) is a popular 13.56MHz contactless communication module used for reading and writing RFID tags. Using an RC522 Proteus library allows you to test RFID-based security systems, attendance trackers, and door locks virtually before building physical hardware. 1. How to Download and Install the RC522 Proteus Library

Since the MFRC522 is not a default component in Proteus 7 or 8, you must manually add the library files.

Acquire the Files: Download the library package from trusted hobbyist platforms like The Engineering Projects or GitHub. A standard package includes .LIB (library) and .IDX (index) files.

Locate Installation Folder: Navigate to your Proteus installation directory, typically:

C:\Program Files (x86)\Labcenter Electronics\Proteus 8 Professional\LIBRARY.

Copy and Paste: Move the downloaded .LIB and .IDX files into the LIBRARY folder. If there is a .HEX or .MD5 file, place it in the MODELS folder.

Restart Proteus: For the new components to appear, you must fully restart the software.

Search for Component: Open ISIS, click the "Pick Device" (P) button, and type "MFRC522" or "RC522" to find the module. 2. Interfacing RC522 with Arduino in Proteus rc522 proteus library

To successfully simulate the module, you must connect it to a microcontroller (typically an Arduino Uno) using the SPI protocol.

To simulate the RC522 RFID module in Proteus, you must manually add third-party library files, as it is not included in the standard Proteus installation. 1. Downloading & Installing the Proteus Library

Since Proteus doesn't natively support the MFRC522, you need to download a verified library package from reputable hobbyist sites like The Engineering Projects Extract the Files

: You will typically find two or three files in the download: , and sometimes a model file. Paste into Proteus Folders Navigate to your Proteus installation folder (usually

C:\Program Files (x86)\Labcenter Electronics\Proteus 8 Professional files into the subfolder. If there is an file, paste it into the subfolder. Restart Proteus

: Fully close and reopen the software to refresh the component database. 2. Wiring for Arduino Simulation The RC522 uses SPI communication

. In Proteus, you will search for "MFRC522" or "RC522" in the "Pick Device" (P) menu and connect it to an Arduino Uno board as follows: Instructables Arduino Uno Pin Description Slave Select (Configurable) Serial Clock Master Out Slave In Master In Slave Out Reset (Configurable) Important: The RC522 uses 3.3V logic. 3. Setting up the Arduino IDE Library For the code to compile, you also need the MFRC522 library inside your Arduino IDE. Arduino Docs How to Add RFID Module in Proteus - Cykeo

Sample Arduino Sketch for Simulation

#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("Scan a virtual card...");

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

// Select one card if (!mfrc522.PICC_ReadCardSerial()) return;

// Show UID on serial monitor Serial.print("Card UID: "); for (byte i = 0; i < mfrc522.uid.size; i++) Serial.print(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " "); Serial.print(mfrc522.uid.uidByte[i], HEX); Serial.println();

// Halt PICC mfrc522.PICC_HaltA(); delay(1000);

Compile this code in Arduino IDE to generate a .HEX file. Then, load that HEX file into the microcontroller in Proteus (right-click µC -> Edit Properties -> Program File). Complete Guide to the RC522 Proteus Library: Simulation


Part 6: Simulating the Virtual RFID Card

Once the library is installed and the code is loaded, you need to "add" a virtual card.

  1. Run the simulation (Play button in bottom-left).
  2. Pause the simulation (Optional, but easier).
  3. Right-click the RC522 component on the schematic.
  4. Look for an option like "Virtual Cards" or "Edit Properties".
    • In most RC522TEP libraries, you will see a text field for "Card UID".
    • Enter a 4-byte HEX UID, e.g., AA BB CC DD.
  5. Some advanced libraries allow you to assign sector data (16 bytes per sector).
  6. Resume simulation and open the virtual terminal.

When the microcontroller scans, it will detect the virtual card with the UID you entered.

Pro Tip: To simulate "removing" the card, pause the simulation, change the UID field to 00 00 00 00 or uncheck a "Card Present" box, then resume.


5. Testing the Simulation (Arduino Code)

To test the library in the simulation, you need a script. Install the MFRC522 library in your Arduino IDE first (Sketch -> Include Library -> Manage Libraries -> Search for MFRC522 -> Install).

Here is a minimal code example to read the card UID:

#include <SPI.h>
#include <MFRC522.h>
#define SS_PIN 10
#define RST_PIN 9
MFRC522 mfrc522(SS_PIN, RST_PIN);   // Create MFRC522 instance.
void setup() 
  Serial.begin(9600);   // Initiate a serial communication
  SPI.begin();          // Initiate  SPI bus
  mfrc522.PCD_Init();   // Initiate MFRC522
  Serial.println("Approximate your card to the reader...");
  Serial.println();
void loop() 
  // Look for new cards
  if (!mfrc522.PICC_IsNewCardPresent()) 
    return;
// Select one of the cards
  if (!mfrc522.PICC_ReadCardSerial()) 
    return;
// Show UID on serial monitor
  Serial.print("UID tag :");
  String content = "";
  for (byte i = 0; i < mfrc522.uid.size; i++) 
     Serial.print(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " ");
     Serial.print(mfrc522.uid.uidByte[i], HEX);
     content.concat(String(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " "));
     content.concat(String(mfrc522.uid.uidByte[i], HEX));
Serial.println();
  Serial.print("Message : ");
  content.toUpperCase();
// Example: Specific card check
  if (content.substring(1) == "BD 31 15 2B")  
    Serial.println("Authorized access");
    Serial.println();
    delay(3000);
   else 
    Serial.println(" Access denied");
    delay(3000);

Overview

Step 4: Refresh the Library Catalogue

After copying:

Critical Pin Mapping (RC522 to Microcontroller)

| RC522 Pin | Typical Function | Arduino Uno (Proteus) | PIC16F877A | | :--- | :--- | :--- | :--- | | SDA/SS | Slave Select (Active Low) | Digital 10 | RC0 | | SCK | Serial Clock | Digital 13 | RC3 | | MOSI | Master Out, Slave In | Digital 11 | RC5 | | MISO | Master In, Slave Out | Digital 12 | RC4 | | IRQ | Interrupt (Optional) | Digital 2 | RB0 | | GND | Ground | GND | GND | | RST | Reset | Digital 9 | RC1 | | 3.3V | Power | NOT 5V | NOT 5V |

Crucial Note: The RC522 logic is 3.3V tolerant. If your Proteus simulation uses a 5V microcontroller (like ATmega328P or PIC16F877A), you must still use a voltage regulator (3.3V) for the RC522's VCC pin. In Proteus, use the "POWER" terminal set to 3.3V, or use the LM317 or AMS1117-3.3 virtual regulator. void loop() // Look for new cards if (

What the Library Does NOT Simulate