Introduction: Interface RFID Shield With Arduino

Working with RFID is so much fun, you can do alot with these tags like controlling relay, turing lights on off, access control, door lock and many more. Although there are so many RFID reader in the market but in this article i will be using an Arduino RFID Shield from controleverything.com.

Why this shield

This shield is so much easy to use all you need to do is plug you arduino into it and you are good to go.

The RFID reader comes with a 6 inch cable so you can mount this out side a door or on wall.

What you need to make this project.

1. Arduino RFID Shield

2. Arduino Nano

Step 1: RFID Working

This RFID kit comes pre assembled so all you will need to do is plug your arduino in it and you will be good to go.

This RFID works on uart protocol so to read the RFID tag we will need to read the uart data.

In this sample code we will read the RFID tag and will display it on the serial monitor.

int count = 0; // count = 0
char input[11]; // character array of size 12 void setup() { Serial.begin(9600); // begin serial port with baud rate 9600bps } void loop() { if(Serial.available()) { count = 0; while(Serial.available() && count < 12) // Read 12 characters and store them in input array { input[count] = Serial.read(); count++; delay(5); } Serial.print(input); // Print RFID tag number Serial.print("\n"); } }

whenever user will bring a RFID tag near the RFID reader it will display the RFID tag number.

For RFID wiring diagram please check this RFID Sch

Step 2: RFID Tag Matching

Using the earlier code we will read the RFID tags we have and then we will save them in a data base and then when the next time user brings his card near the RFID reader we will read and will compare it with the existing database.

# Arduino-RFID-Shied

#How to interface RFID Reader with arduino

#https://www.controleverything.com/content/RFID-Reader?sku=ANI2CU_EM18_RFID

int count = 0; // count = 0

char input[11]; // character array

void setup()

{

Serial.begin(9600); // begin serial port with baud rate 9600bps

}

void loop()

{

if(Serial.available())

{

count = 0;

while(Serial.available() && count < 12) // Read 12 characters and store them in input array

{ input[count] = Serial.read();

count++;

delay(5);

}

Serial.print(input); // Print RFID tag number

Serial.print("\n");

if ( strcmp(input,"0A006FBE33E9") == 0)

{

Serial.print("Tag One"); Serial.print("\n");

}
if ( strcmp(input,"0E004560173D") == 0)

{

Serial.print("Tag Two");

Serial.print("\n");

} if ( strcmp(input,"0A00706AF0E1") == 0)

{

Serial.print("Tag Three");

Serial.print("\n");

} if ( strcmp(input,"28018389B696") == 0)

{ Serial.print("Tag Four");

Serial.print("\n");

} }

}

this code will read the RFID tag and will compare with the existing tag.

You can also find the over here.

RDIF Arduino Code

Step 3: RFID Projects

there is a lot which can be done with Arduino and this RFID shield.

1. RFID controlled gate

2. RFID controlled Door lock

3. RFID controlled lights

4. RFID attendance system

There is no soldering required in this kit so this is an ideal kit for schools,kids, software developers and all the people who doesn't want to do soldering.

this kit can be purchased from here.

Arduino RFID kit

Comments

About This Instructable

2,150views

31favorites

License:

More by bhaskar.anil429:Mom I am Fine... IoT Texting ChairWebApp Controlled Relay Using Onion Omega 2 & 1Smart WiFi Router Reboot Switch using Onion Omega 2 & 1
Add instructable to: