RFID-module RC522: description, connection, diagram, characteristics

Detailed review of rc522 rfid module for Arduino: characteristics, wiring diagrams. An example of using the rc522 rfid module based on arduino boards with all sketches and libraries.

RFID-module RC522: description, connection, diagram, characteristics
RFID-module RC522: description, connection, diagram, characteristics

Radio frequency identification (RFID) is a technology for contactless identification of objects using a radio frequency communication channel. Objects are identified by a unique identifier, which each electronic tag has. The reader emits electromagnetic waves of a certain frequency. Tags send information in response - ID number, memory data, etc.

MFRC-522 RC-522 RC522 Antenna RFID IC Wireless Module For Arduino IC KEY SPI Writer Reader IC Card Proximity Module

Benefits of RFID technology:

  • contactless
  • possibility of hidden labeling
  • high speed of data reading
  • possibility of installation in hazardous environments
  • impossibility of forgery

There are a wide variety of RFID tags. Tags can be active and passive (without a built-in power source, they are powered by a current induced in the antenna by a signal from a reader). Tags operate at different frequencies: LF (125 - 134 kHz), HF (13.56 MHz), UHF (860 - 960 MHz). Devices that read information from tags and write data into them are called readers (readers). In Arduino projects, the RFID-RC522 module is very often used as a reader (Figure 1). The module is made on the NXP MFRC522 microcircuit, which provides operation with HF tags (at a frequency of 13.56 MHz). The RFID-RC522 module comes with two tags, one in the form of a card, the other in the form of a key fob.

RC522 RFID Module Specifications

  • Supply voltage: 3.3V;
  • Consumption current: 13-26mA;
  • Working frequency: 13.56MHz;
  • Reading range: 0 - 60 mm;
  • Interface: SPI;
  • Transfer rate: maximum 10Mbps;
  • Size: 40mm x 60mm;

Interfaces and pin assignments

The MFRC522 microcircuit supports SPI, UART and I2C interfaces (see Figure 2). The choice of the interface is carried out by setting logic levels on certain pins of the microcircuit. The SPI interface is selected on this module.

The pin assignment of the SPI interface:
SDA - slave selection;
SCK - synchronization signal;
MOSI - transfer from master to slave;
MISO - transfer from slave to master;
RST - pin for reset;
IRQ - interrupt pin;
GND - ground;
Vcc - power supply 3.3 V.

The reset signal RST is a signal from the digital output of the controller. When the LOW signal is received, the reader is rebooted. Also, by setting RST to a low level, the reader reports that it is in sleep mode; to wake up the module from sleep mode, you must send a HIGH signal to this pin.

Connecting the module to the Arduino board

Let's consider connecting the module to the Arduino board. We need the following details:

  • Arduino Uno board
  • prototyping board
  • RFID-RC522 module
  • RFID tags of 13.56 MHz range
  • wires

 

Below is the link to the library (Download button)

#include SPI      //include the SPI bus library
#include MFRC522  //include the RFID reader library
// pins
const int reset    9
const int ss    10
// Instantiating the MFRC522 Object
MFRC522 rider(reset, ss);
void setup() {
// Serial launch
Serial.begin(9600);
// SPI launch
SPI.begin();
// SPI launch
rider.PCD_Init();
}
void loop() {
// Ожидание
if ( ! rider.PICC_IsNewCardPresent())
return;
// reading
if ( ! rider.PICC_ReadCardSerial())
return;
// data output
Serial.print("UID=");
view_data(rider.uid.uidByte,rider.uid.size);
Serial.println();
Serial.print("type=");
byte piccType = rider.PICC_GetType(rider.uid.sak);
Serial.print(rider.PICC_GetTypeName(piccType));
Serial.println();
delay(1000);
}
//conversion to HEX
void view_data (byte *buf, byte size) {
for (byte j = 0; j < size; j++) {
Serial.print(buf [j]);
Serial.print(buf [j], HEX);
}
}

Find out about the update of this script first in our telegram channel: https://t.me/proweblabxyz