RFID – Radio Frequency Identification, has become part of everyday life, for example, with electronic vehicle tolling, door access control, public transport fare systems and so on.
RFID normally has two components: RFID key and RFID reader(sensor). In this project, we will use RFID reader to get the hidden ID from the key.
If Key ID does not match record, then RED LED will turn on, LCD shows "Card not recognized! contact admin". In serial window(upright corner of Arduino IDE), you will see following information: "Card found - code: ** ** ** ** ** " , '** ** ** ** **' is 5-byte Hex ID of your key.
If the ID matches our record(security passed), make servo motor turn 180 degree(imitating door opening) and turn on the green LED and LCD screen show "ID Found!... Welcome X!".
If the key Hex ID codes matches the any of the Hex ID array of user A,B,C (defined in line 25,26 27 in file RFID_Simples_V3_English.ino), system will consider the key is authorized ID card. So you can change the line 25, 26, 27 and make user A/B/C match your real key code( get from serial window) to test scenario of authorized Key situation.
2 . Devices used in this project
Arduino UNO R3 x 1 ；
Servo Motor x 1;
RFID key and receiver;
Buzzer x 1
220 ohm resistor x 2；
Red LED x 1；
Green LED x 1；
I2C LCD x 1；
Breadboard and jumper wires;
3) Circuit Connection：
Arduino/RFID sensor pin connection:
Arduino/LCD(i2c) pin connection:
Arduino/LED and Servo connection:
|Red LED long leg||D3|
|Green LED long leg||D2|
|servo signal(orange line)||D9|
|servo VCC(red line)||5v|
|servo GND(brown line)||GND|
Download Arduino Library code and library from following link http://osoyoo.com/driver/ArduinoRFID.rar
Unzip above file and you will see a folder called ArduinoRFID, enter into this folder, you will see a sub-folder "library", this folder has libraries required by this project. Copy all these 5 folders in library into your Arduino IDE library folder(normally it should be in Arduino\library )
5)find the I2C address
Each device has an I2C address that it uses to accept commands or send messages. For Uno board, this address usually is 0x27. But sometimes the address might be changed 0x37,0x24 ...., So let's go and look for the one on your device.
Download ic2_scanner sketch file and load it into Arduino IDE. By opening up the serial monitor in the upright corner, Arduino will scan the address range looking for a reply. Most Arduino board will show 0x27, however it be other number.
Write down the Address that you have found, you'll need it in the following step.
6)Run the project
Go to ArduinoRFID/RFID_Simples_V3_English folder and open RFID_Simples_V3_English.ino with your Arduino IDE
Set the I2C address to match ic2_scanner output value. Use your I2C address to replacement the following code:
and then load the project
7)In IDE serial window, you will see following info Serial Monitor of your IDE:
Put a RFID key to sensor, you may see:
Writer the card code, you'll need it in the following step.
8)Replace the RFID key code in project code to make your rfid key valid(such as the code: 75 C0 D0 65 00, write as 0x75,0xC0,0xD0,0x65,0x00):
9)Once you put a valid RFID key to sensor, you will see Serial Monitor of your IDE:
Servo will turn 180 degree，buzzer will beep and green LED will turn on