RFID and Fingerprint Based Door Lock Authentication

RFID and Fingerprint Based Door Lock Authentication

Created by Gregorio E. Tomas III. This door lock have 2 methods of authentication. RFID and Fingerprint.

  • 1,536 views
  • 3 comments
  • 2 respects

Components and supplies

Ph a000066 iso (1) ztbmubhmho
Arduino UNO
×1
MFRC522
×1
Relay (generic)
×1
Adafruit industries ada1536 image
Buzzer
×1
Cover 450x300
DFRobot I2C 16x2 Arduino LCD Display Module
×1
Electronic Door Lock
×1

Necessary tools and machines

About this project

Code

FingerprintC/C++
Fingerprint only
  #include <Adafruit_Fingerprint.h>

  #define RELAY A2 //relay pin (#A2)
  #define LED_G A1  // led green pin (#A1)

  // Pin cofigurTION FOR THE FINGERPRINT SENSOR
  // pin #2 is IN from sensor (GREEN wire)
  // pin #3 is OUT from arduino  (WHITE wire)
  // pin 5v is for RST ( RED wire)
  // pin GRD is for GND ( BLACK wire) 
  SoftwareSerial mySerial(2, 3);// Tx, Rx
  
  Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial);
  
  void setup()  
  {
    
     digitalWrite(RELAY, HIGH);
     digitalWrite(LED_G, LOW); 
    pinMode(A2, OUTPUT);
    pinMode(A1, OUTPUT);
    Serial.begin(9600);
    while (!Serial);
    delay(50);
    // set the data rate for the sensor serial port
    finger.begin(57600);
    
    if (finger.verifyPassword()) {
      Serial.println("Found fingerprint sensor");
    } else {
      Serial.println("Did not find fingerprint sensor");
      while (1) { delay(1); }
    }
  
    finger.getTemplateCount();
    Serial.print("Sensor contains "); Serial.print(finger.templateCount); Serial.println(" template(s)");
    Serial.println("Waiting for valid finger...");
  }
  
  void loop()             // run over and over again
  {
    getFingerprintIDez();
    delay(50);            //( TIPS YOU DONT NEED TO RUN AT FULL SPEED) SYSTEM MAY MALFUNCTION 
  }
  
  int getFingerprintIDez() {
    uint8_t p = finger.getImage();
    if (p != FINGERPRINT_OK)  return -1;
  
    p = finger.image2Tz();
    if (p != FINGERPRINT_OK)  return -1;
  
    p = finger.fingerFastSearch();
    if (p != FINGERPRINT_OK)  return -1;
    
    // found a match!
    Serial.print("Found ID #"); Serial.print(finger.fingerID); 
    Serial.print(" with confidence of "); Serial.println(finger.confidence);
    digitalWrite(RELAY, LOW);
    delay(1000);                        // IF YOU WANT TO CHANCE THE DELAY ( TIPS YOU DONT NEED TO RUN AT FULL SPEED) 
    digitalWrite(RELAY, HIGH);
    Serial.println("Unlocked");
    return finger.fingerID; 
  }
  void readprint()             // run over and over again
  {
    getFingerprintIDez();
    delay(50);            //( TIPS YOU DONT NEED TO RUN AT FULL SPEED) SYSTEM MAY MALFUNCTION 
  }
  
  int getFingerprintID()
  {
    uint8_t p = finger.getImage();
    if (p != FINGERPRINT_OK)  return -1;
  
    p = finger.image2Tz();
    if (p != FINGERPRINT_OK)  return -1;
  
    p = finger.fingerFastSearch();
    if (p != FINGERPRINT_OK)  return -1;
    
    // found a match!
    Serial.print("Found ID #"); Serial.print(finger.fingerID); 
    Serial.print(" with confidence of "); Serial.println(finger.confidence);
    digitalWrite(RELAY, LOW);
    digitalWrite(LED_G, HIGH);
    delay(500);                        // IF YOU WANT TO CHANCE THE DELAY ( TIPS YOU DONT NEED TO RUN AT FULL SPEED) 
    digitalWrite(RELAY, HIGH);
    digitalWrite(LED_G, LOW);
    Serial.println("Unlocked");
    return finger.fingerID; 
  }

Schematics

Circuit Design
Fritzing
Owdow mfekwx9xaq

Comments

Similar projects you might like

RFID and Keypad Based Door Lock Using Arduino

by Aqib

  • 43,060 views
  • 24 comments
  • 93 respects

RFID Based Automatic Door System

Project showcase by Robodia Technology

  • 80,542 views
  • 33 comments
  • 169 respects

RFID+Relay+RFID Door Lock Code = RFID PC Switch!

Project tutorial by HeathenHacks

  • 31,658 views
  • 13 comments
  • 53 respects

Arduino and Android Based Password Protected Door Lock

Project tutorial by Md. Khairul Alam

  • 27,388 views
  • 9 comments
  • 65 respects

Pseudo Two-Factor Authentication Using HC-05, RFID + Relay!

Project tutorial by HeathenHacks

  • 3,968 views
  • 1 comment
  • 8 respects
Add projectSign up / Login