hIOTron
Created December 31, 2019 © GPL3+

Arduino RFID based Door Lock

The RFID Door Lock is the lock that can be installed simply at your home and allows to easily lock and unlock doors

Arduino RFID based Door Lock

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
EM 18 RFID reader module
×1
Relay (generic)
×1
LED (generic)
LED (generic)
×1
Buzzer
Buzzer
×1
Connecting wires
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Arduino RFID door lock

Code

Run a program

Arduino
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);
      }
      }
    }
  }
}

Credits

hIOTron

hIOTron

78 projects • 2 followers
hIOTron is an internet of things based company that offers an IoT Platform, products, IoT Solutions, and IoT Training.

Comments