top of page

Interfacing of RFID Module with Arduino Uno.


What is RFID?


Radio-Frequency Identification (RFID) is the use of radio waves to read and capture information stored on a tag attached to an object. A tag can be read from up to several feet away and does not need to be within direct line-of-sight of the reader to be tracked.

Material Required:


Material Quantity


Arduino Uno 1

Rfid module 1

Jumper cables 8


Pinout Diagram:



Circuit Diagram:


Connect the RFID module with Arduino as follows:


GND pin of RFID module to GND of Arduino

VCC pin of RFID module to 5V of Arduino

SDA pin of RFID module to digital pin 10 of Arduino

SCK pin of RFID module to digital pin 13 of Arduino.

MOSI pin of RFID module to digital pin 11 of Arduino.

MISO pin of RFID module to digital pin 12 of Arduino.

RST pin of RFID module to digital pin 9 of Arduino.

IRQ pin of RFID module is not connected


Download RFID Library


We need to download the library for RFID. Go to sketch >> include library >> window open >> go to search bar and type <<MFRC522>> you see a link >> click on that link and install.




Tested Programming Code:


#include <SPI.h>

#include <MFRC522.h>

#define RST_PIN 9

#define SS_PIN 10

MFRC522 rfid(SS_PIN, RST_PIN);

MFRC522::MIFARE_Key key;

void setup()

{

Serial.begin(9600);

SPI.begin();

rfid.PCD_Init();

}


void loop()

{

if( ! rfid.PICC_IsNewCardPresent()||! rfid.PICC_ReadCardSerial())

{

return;

}


MFRC522::PICC_TypepiccType = rfid.PICC_GetType(rfid.uid.sak);

String sd = "";

for (byte i = 0; i < 4; i++)

{

sd +=

(rfid.uid.uidByte[i] < 0x10 ? "0" : "") +

String(rfid.uid.uidByte[i], HEX) +

(i!=3 ? ":" : "");

}


sd.toUpperCase();

Serial.print("Tap card key: ");

Serial.println(sd);


rfid.PICC_HaltA ();

rfid.PCD_StopCrypto1 ();


}


Precautions:


  1. Double check the connections before powering on the circuit.

  2. Don’t use loose jumper cables.

  3. Check whether proper board is selected from Arduino IDE.

  4. Ensure proper placement of RFID module Sensor for correct working.



Conclusion:


Once your sketch is running, you have open serial monitor and then put your RFID tag on RFID module.



GET IN TOUCH

We'd love to hear from you

bottom of page