RFID RC522 Pinout and Interfacing with Arduino for Door Lock System



Hi, in this article, we are going to see the pinout diagram of RFID RC522. We will also learn how to interface the RFID RC522 with an Arduino Uno Module, We will see the wiring diagram for the door lock system using RFID and Arduino.

The RFID RC522 module is a widely used RFID (Radio Frequency Identification) reader that operates at 13.56 MHz. It is best suitable for use with Arduino projects to read RFID tags and cards. If we look at its main key features, It operates with 2.5V to 3.3V (but some modules can work with 5V when connected to Arduino). It uses SPI, I2C, or UART Communication Interfaces (SPI is the most commonly used). It provides the Reading Distance of Up to 5 cm depending on the size of the antenna and the tag. It supports MIFARE 1k, MIFARE 4k, MIFARE Ultralight, etc cards.


RFID RC522 Pinout Diagram


Here, you can see the Pinout Diagram of RC522 RFID Reader.

Pinout Diagram of RC522 RFID Reader


As you can see it has a total of 8 pins. Each of them is explained below,

Pin no.8-SDA (SS): It is the Chip Select pin for SPI communication. It determines whether the RFID module is actively communicating with the microcontroller.

Pin no.7-SCK: It is the Serial Clock pin used to synchronize data transmission over SPI.

Pin no.6-MOSI: This Master Out Slave In pin for data sent from the microcontroller to the RC522 module.

Pin no.5-MISO: This Master In Slave Out pin for data received by the microcontroller from the RC522 module.

Pin no.4-IRQ: This is the Interrupt Request pin. It is generally unused in basic projects.

Pin no.3-GND: Ground pin for completing the circuit.

Pin no.2-RST (Reset): It is used to reset the module. It is an active low pin, which means it resets when pulled to the ground.

Pin no.1-3.3V: This is the Power supply pin. The RC522 operates at 3.3V, so connecting it to 5V can damage the module.


RFID RC522 Interfacing with Arduino for Door Lock System


Here, you can see the wiring diagram for the Door Lock system by Interfacing the RFID RC522 with Arduino Uno.

Automatic Door Lock system Wiring Diagram with RFID and Arduino



Connection Explanation
  1. The VCC (3.3V) pin Supplies power to the RC522 module so we can connect it to the 3.3V pin on the Arduino.
  2. The RST (Reset) pin is used to reset the module so we can connect it to digital pin 9 or 5 on the Arduino. (here we have connected to pin 5)
  3. We can Connect the GND (Ground) pin to the Arduino’s GND pin.
  4. The MISO (Master In Slave Out) pin is used by the module to send data to the Arduino. We can connect it to digital pin 12.
  5. The MOSI (Master Out Slave In) pin is used to receive data from the Arduino. We can connect it to digital pin 11.
  6. The SCK (Serial Clock) pin is the clock signal for the SPI communication. We can connect it to pin 13 on the Arduino.
  7. The SDA (Slave Select) pin is used to select the RC522 module. We can connect it to digital pin 10.

Here, a simple code is given below to test if the RFID RC522 module is working. Make sure you have the MFRC522 library installed in your Arduino IDE.

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

#define SS_PIN 10
#define RST_PIN 9
MFRC522 rfid(SS_PIN, RST_PIN);

void setup() {
  Serial.begin(9600);
  SPI.begin();         // Initialize SPI bus
  rfid.PCD_Init();     // Initialize MFRC522 module
  Serial.println("Place your card near the reader...");
}

void loop() {
  if (!rfid.PICC_IsNewCardPresent() || !rfid.PICC_ReadCardSerial())
    return;

  Serial.print("Card UID: ");
  for (byte i = 0; i < rfid.uid.size; i++) {
    Serial.print(rfid.uid.uidByte[i], HEX);
    Serial.print(" ");
  }
  Serial.println();
  delay(1000);
  rfid.PICC_HaltA(); // Halt PICC
}



Read Also: 

Thank you for visiting the Website. Keep visiting for more Updates.

RFID RC522 Pinout and Interfacing with Arduino for Door Lock System RFID RC522 Pinout and Interfacing with Arduino for Door Lock System Reviewed by Author on November 15, 2024 Rating: 5
Powered by Blogger.