Monday 30 November 2020

RFID Based DoorLock System project

 Circuit:- 





Code:- 


int count = 0;
char input[12];
int Lock = 13;

void setup() {
  Serial.begin(9600);
  pinMode(Lock , OUTPUT);
}

void loop() {
  if(Serial.available())
  {
    count = 0;
    while(Serial.available() && count < 12)
    {
      input[count] = Serial.read();
      count++;
      delay(5);
    }
    if(input[0] == '3' && input[1] == '0' && input[2] == '0' && input[3] == '0' &&
       input[4] == '4' && input[5] == 'F' && input[6] == 'F' && input[7] == '0' &&
       input[8] == '2' && input[9] == '0' && input[10] == 'A' && input[11] == 'F' )
    {
      digitalWrite(Lock , HIGH);
      delay(2000);
      digitalWrite(Lock , LOW);
    }
  }
}



First of all you will have to find the 12 digit unique id number of your card which you are using. You can generate that id with the help of this video:-
https://www.youtube.com/watch?v=8B14w5t9-MI

Don't forget to subscribe our channel and press the bell icon for more interesting videos :)

No comments:

Post a Comment