The only electronic website that replies to every comment, and addresses all circuit related issues.

Make this RFID Circuit using Arduino

In this article we are going to take a tour on RFID circuit technology. We will be exploring how RFID tags and readers work, how to interface RFID module (RC522) with Arduino and extract some useful information from the RFID tags.


By: Girish Radhakrishnan 

I am sure every one of you has used RFID to get security access at least once at office, school, college, library etc.

The tag/card which you carry around has electronic chip embedded in it, the chip stores your identity electronically. Unlike barcodes, where card should be line of sight of the reader, RFIDs can be placed just near to reader to read the information.  

Most of our smart cards use passive RFID technology, which means no power is required to read the information from the card. The reader powers the RFID chip and extracts information at the same time.

These kinds of tags can read information from millimetres to few feet, depending on the tag and application.

 An active RFID tags are powered externally, these kinds of tags transmit the information up to 100 feet. The battery power consumption is optimized to last few years.

In this project we are going to look at passive RFID technology. We are using RC522 reader module along with arduino for extracting and displaying information. RC522 module is commonly available at e-commerce websites and local electronics kits shop.

Illustration of RC522 reader/writer module:





Card and keychain type tags:




As we can see that, a part of the PCB is surrounded by conducting path in square shape on the reader; this will generate electromagnetic field for the tag at 13.56MHz frequency.

The generated EMF is picked by the tag and converts to sufficient voltage for the tag to operate, the tag will sends out the necessary information in pulse form back to the reader. The on-board microcontroller decodes the information.

The circuit:


Make this RFID Circuit using Arduino



The schematic is very easy and self-explanatory, few jumper wires is enough to accomplish this project. We are going to power the arduino and RFID via USB port of the computer. The operating voltage of RC522 is 3.3V, do not connect 5V supply to the module and will damage the on-board components.

Author’s Arduino RFID circuit prototype :




That’s all the hardware connections, now let’s jump into coding.

Before uploading the program, download the library file from the following link and move to library folder of arduino IDE.

https://github.com/miguelbalboa/rfid.git




Program:

//-------------------------Program developed by R.Girish------------------//
#include <SPI.h>
#include <MFRC522.h>
#define SS_PIN 10
#define RST_PIN 9
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())
    return;
  if ( ! rfid.PICC_ReadCardSerial())
    return;
  MFRC522::PICC_Type piccType = rfid.PICC_GetType(rfid.uid.sak);
  if(piccType != MFRC522::PICC_TYPE_MIFARE_MINI &&  
    piccType != MFRC522::PICC_TYPE_MIFARE_1K &&
    piccType != MFRC522::PICC_TYPE_MIFARE_4K) 
{
    Serial.println(F("Your tag is not of type MIFARE Classic, your card/tag can't be read :("));
    return;
}
String StrID = "" ;
   for (byte i = 0; i <4; i ++) 
   {
    StrID +=
    (rfid.uid.uidByte[i]<0x10? "0" : "")+
    String(rfid.uid.uidByte[i],HEX)+
    (i!=3?":" : "" );
  }
  StrID.toUpperCase();
  Serial.print("Your card's UID:");
  Serial.println(StrID);
  rfid.PICC_HaltA ();
  rfid.PCD_StopCrypto1 ();
}

//-------------------------Program developed by R.Girish------------------//

Ok! What does the above program designed to function?

The above program will display the UID of the tag in serial monitor of IDE, when you scan on the reader. UID is unique identification number of the tag, it can’t be changed and it is set by the manufacturer.

OUTPUT:

Your card's UID:  FA:4E:B2   // this is an example.

Note 1: The each two values are separated by colon, which is done by the program; real values may not be separated by colon but, rather by space.

Note 2: Only NXP manufactured RFID tags are readable/writeable with the proposed setup, these are commonly and commercially used.

The UID is used to recognize the tag; the tag that comes along with the kit can store up to 1KB of information. There are other cards which can store up to 4KB of information or even more.

The process of storing and extracting the information from the tag is subject of another article.
If you have question, regarding this project, feel free ask in the comment section.




Please Share this Post:
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble



  • 2 comments:

    1. good evening swaggattam
      there was a digital display circuit I want to design, but there is one particular component. I can't found it here in ma country " 2N3053" transistor. Pls can u suggest me another transistor use to replace it. i'll be great and happy if I get responds. thanks

      ReplyDelete

    Please Note: If you find any DEAD link starting with http//:homemadecircuitsandschematics.blogspot.com, please replace it with http://www.homemade-circuits.com/ for making it visible and alive again.