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:

47

Arduino/RFID sensor pin connection:

RFID sensor Arduino
Reset D5
SDA D10
MOSI D11
MISO D12
SCK D13
GND GROUND
3.3v 3.3v

Arduino/LCD(i2c) pin connection:

I2C LCD Arduino
SDA A4
SCL A5
VCC 5V
GND GND

Arduino/LED and Servo connection:

device Arduino
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
Buzz VCC D8

4)Software installation

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.

ic2scanner

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:

changei2caddress

and then load the project

7)In IDE serial window, you will see following info Serial Monitor of your IDE:

48

Put a RFID key to sensor, you may see:

48

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):

changecode

9)Once you put a valid RFID key to sensor, you will see Serial Monitor of your IDE:

49

Servo will turn 180 degree,buzzer will beep and green LED will turn on

IMG_20160704_171027

12 Comments

  • rainzpogi says:

    Sir good day about this project i want to make it work when the card is still in and card reader when i remove the card the door locks again . how to change the code ?thanks

    • elaine says:

      our sample code actually can meet your requirment.When you tap the key into RFID sensor, the lock(we use servo to immitate lock) will open. After 3 seconds, the lock will automatically close. In our project Arduino file RFID_simples_V3_English.ino line 135 to 137, you can change the parameter in function doorLock.write() to control the lock open or close, you can also change the delay time in line 136.

  • sosakosa says:

    Hello

    can you help me with these

    1- How can I change the login sound? I want regular sound not a music
    2- I want to change the startup screen “RFID Test by etc”
    3- I want to change the user “Welcome A” to “Welcome (any name)”
    4- can I add a 4*4 keybad?

    last thing

    5- I don’t want to close the door automatically I want to scan the opening card to close it can I do that?

    • elaine says:

      1. It can’t change the sound in this code
      2. You can change the line 333 to 380 code “RFID_Simples_V3_English”
      3. You can try to change the codes about User A
      4. You need to change the code and set the graph
      5. In our project, When you tap the key into RFID sensor, the lock(we use servo to immitate lock) will open. After 3 seconds, the lock will automatically close. In our project Arduino file RFID_simples_V3_English.ino line 135 to 137, you can change the parameter in function doorLock.write() to control the lock open or close, you can also change the delay time in line 136

  • elaine says:

    It’s my pleasure.

  • sosakosa says:

    Hi again

    I am trying to add the keypad

    but it’s not working

    can you help me with the code

    I want to open the door(servo) by using the RFID and Password

    I connected the keypad as the diagram show and I include the keypad
    and library but i got this

    Arduino: 1.8.2 (Windows 10), Board: “Arduino/Genuino Uno”

    C:\Users\Alienware\Downloads\Compressed\ArduinoRFID\RFID_Simples_V3_English\RFID_Simples_V3_English.ino:19:20: fatal error: Keypad.h: No such file or directory

    #include

    ^

    compilation terminated.

    Multiple libraries were found for “SPI.h”
    Used: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI
    Not used: C:\Program Files (x86)\Arduino\libraries\SPI
    Multiple libraries were found for “Wire.h”
    Used: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire
    Not used: C:\Program Files (x86)\Arduino\libraries\Wire
    exit status 1
    Error compiling for board Arduino/Genuino Uno.
    Invalid library found in C:\Program Files (x86)\Arduino\libraries\examples: C:\Program Files (x86)\Arduino\libraries\examples
    Invalid library found in C:\Program Files (x86)\Arduino\libraries\examples: C:\Program Files (x86)\Arduino\libraries\examples

    This report would have more information with
    “Show verbose output during compilation”
    option enabled in File -> Preferences.

  • seanjackalope says:

    Hi, I’ve checked four times that the RFID sensor is wired correctly, but it still isn’t reading the card or tag. How do I troubleshoot that? Thanks

Leave a Reply

WordPress spam blocked by CleanTalk.
Bombax Theme designed by itx