| × | 1 | ||||
![]() |
| × | 1 |
Components and supplies
Apps and online services
About this project
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 shieldThis shield is so easy to use, all you need to do is plug your 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.
2. Arduino Nano
Step 1: RFID WorkingThis 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 = 0char 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 the 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 matchingUsing 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 code over here.
Step 3: RFID ProjectsThere 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