RFID Door Lock Using Arduino

by Utsource in Circuits > Arduino

1416 Views, 0 Favorites, 0 Comments

RFID Door Lock Using Arduino

Screenshot_20191023-085705__02.jpg

Hi guys in this instructables we will learn how to create a door lock with arduino using RFID card & RFID reader.

Since RFID card is used in most of the offices and other secure buildings for door access so i thought we should also build our secure door lock using RFID reader & RFID Card to access the door lock.

Things You Need

Km5Zu-2RIncAUweU7uG7IhyWPySZ0SqIgAI0-vk9w7767_IkthCPCcsirj2GGmXF4IdQDg8UVpHVLVM6CXnzFsG1hnAdSkK7BIhIOtEldXoZiDsvzsPo-6o0rD6Mda7UyOE=w456-h323-nc.png
images(104).jpg
images(103).jpg
electronics-kit-resistor-led-button-breadboard-wire-1697-1024x1024.jpg

For this instructables we will need following things :

Arduino UNO


EM-18 Reader Module with Tags

Relay 5v

LED

Buzzer

Connecting wire

Resistors

Breadboard

Connections

Arduino-RFID-Door-Lock-circuit-diagram.png

Please follow the shown schmatics and connect everything together.

Code

images(101).jpg

Please copy the following code & upload the code to your arduino Board :

char tag[] ="180088F889E1";


char input[12];

int count = 0;

boolean flag = 0;

void setup()

{

pinMode(2,OUTPUT);

pinMode(3, OUTPUT);

pinMode(4, OUTPUT);

Serial.begin(9600);

}

void loop()

{

digitalWrite(3,1);

if(Serial.available())

{

count = 0;

while(Serial.available() && count < 12)

{

input[count] = Serial.read();

count++;

delay(5);

}

if(count == 12)

{

count =0;

flag = 1;

while(count<12 && flag !=0)

{

if(tag[count]==input[count])

flag = 1;

else

flag= 0;

}

if(flag == 1)

{

digitalWrite(2,HIGH);

digitalWrite(3,LOW);

delay(5000);

digitalWrite(2,LOW);

}

if(flag == 0)

{

for(int k =0; k<= 10; k++)

{

digitalWrite(4,HIGH);

}

}

}

}

}

Project in Action

Screenshot_20191023-085705__02.jpg
Screenshot_20191023-085705__01.jpg
Screenshot_20191023-085509__01.jpg
Screenshot_20191023-085512__01.jpg
Screenshot_20191023-085523__01.jpg
Screenshot_20191023-085525__01.jpg

So after connecting everything together and uploading the code to your arduino. Its finally ready for action so connect the power and when you put your RFID card to your card reader it will give access to the door and if it is another card it will not give access. So have fun making your own door lock with Arduino.