Description:-
RFID is a wireless technology, the complete form of RFID is Radio Frequency Identification. Rfid uses Electromagnetic fields to transfer data for the short term to identify a particular object.
Rfid consists of 2 main parts RFID RC255 reader and RFID tag.
Rfid reader generates the electromagnetic wave and recognizes the information of an object from that generated electromagnetic wave. That means identifying the information hidden in the RFID tag and sending the signal through the microcontroller or processor. For example, if you want to open the door, then you need the right password, if the RFID card has the right password, then the RFID reader will easily open the door by matching the right password of the RFID card.
RFID RC255 Reader:- It consists RC255 chip which controls the whole process of the Rfid RC255 reader. It has a 13.56MHZ oscillator which is used for communication between the RFID reader and RFID tag and it has an antenna, whose job is to generate an electromagnetic field and to identify the data hidden in the RFID card from that electromagnetic wave. There is two communication in the RFID reader. It can transmit radio and receive. The RFID reader sends a signal to the tag and then reads the tag's data and response.
RFID Tag:- There are two types of RFID tags, one is of key type and the other is of electromagnetic type. it is a chip inside both types of cards and data is stored inside the chip. Rfid card is a passive element. This means that no power supply is required to run the RFID card. When the tag is close to the RFID reader, then the coil in the tag gets power through the radio wave generated from the RFID reader and then the data inside the chip is received by the RFID reader through the radio wave. And each tag has its own UID.
Specification:-
RC522 RFID Module Pinout:-
RC255 RFID Library Download:-
Pin Wiring:-
Circuit Connection:-
Reading Information from the Rfid tag:-
Go to the file>Example>Dumpinfo>Upload the code to the Arduino Uno Board.
CODE:-
#include <MFRC522.h>
#define RST_PIN 9
#define SS_PIN 10
MFRC522 mfrc522(SS_PIN, RST_PIN);
void setup() {
Serial.begin(9600);
while (!Serial);
mfrc522.PCD_Init();
delay(4);
mfrc522.PCD_DumpVersionToSerial();
Serial.println(F("Scan PICC to see UID, SAK, type, and data blocks..."));
}
void loop() {
if ( ! mfrc522.PICC_IsNewCardPresent()) {
return;
}
// Select one of the cards
return;
}
mfrc522.PICC_DumpToSerial(&(mfrc522.uid));
}
Open the serial monitor. You will see something as follows below.
RFID tags or key chains close to the RFID reader then after a few times displayed some data on the serial monitor.
This is all information you can read from the RFID cards and including the UID number. You can see all information on each RFID tag in the serial monitor. And also UID number of card in blue color marked. All this data is stored in a chip of RFID tags but the most important is the UID number. Each RFID card is to own a UID number. So note down the UID number.
After writing down the UID number from the RFID card. For example, the UID number of the key chain is 73 4C F3 8B . Then open the other code and write down the UID and upload the code.
#include <MFRC522.h>
#define SS_PIN 10
#define RST_PIN 9
MFRC522 mfrc522(SS_PIN, RST_PIN);
void setup()
{
Serial.begin(9600);
SPI.begin();
mfrc522.PCD_Init();
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= "";
byte letter;
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();
if (content.substring(1) == "73 4C F3 8B")
{
Serial.println("Authorized access");
Serial.println();
delay(3000);
}
else {
Serial.println(" Access denied");
delay(3000);
}
}
0 Comments