Arduino Fingerprint Door Lock System

Experience the future of access control with our cutting-edge Arduino Fingerprint Lock. Say goodbye to traditional locks and welcome the power of biometric security. Our fingerprint lock utilizes your unique fingerprint to provide secure access to locks or restricted areas.

Arduino Fingerprint Door Lock System

Enjoy the convenience of keyless entry as the lock captures and converts your fingerprint into a digital code. This code is securely stored in our system, ensuring that only authorized individuals can gain access. With each fingerprint being unique and nearly impossible to replicate, our fingerprint lock offers unparalleled security.

From homes and businesses to high-security facilities, our fingerprint lock delivers reliability, convenience, and enhanced protection. Visit our website at Robotshapers.com to explore our range of innovative security solutions. Upgrade your security to the next level with Robotshapers! Fingerprint lock, also known as biometric lock, is a security device that uses a person's unique fingerprint to gain access to locks or areas. It is designed to increase security by replacing traditional locks based on keys or combinations.

The fingerprint lock has a sensor that captures an image of the user's fingerprint and converts it into a digital number. These numbers are stored in a database in the system or network. When the user needs to log in, he places his finger on the sensor and the lock compares the captured fingerprint with the stored code. If there is a match, the lock mechanism opens to enter. fingerprint lock has many advantages, including convenience as there is no need to carry a key or remember to combine the key. They also provide high security as each fingerprint is unique and difficult to reproduce by unauthorized persons. Also, fingerprint locks can control who accesses the locked area and when. Overall, fingerprint locks provide a reliable and effective means of access, providing better security and convenience in many places, including homes, businesses, and high-security facilities.

Components required:

  1. Arduino Uno
  2. R307 Fingerprint sensor
  3. Single Relay Channel
  4. 12v Solenoid lock
  5. 16x2 LCD Display
  6. 10 K Variable resistor
  7. 12V DC power supply

R307 Fingerprint sensor:
 
The R307 fingerprint sensor is a popular biometric module used for fingerprint recognition and authentication. It offers a compact and easy-to-use solution for integrating fingerprint security into a variety of applications. The sensor uses an optical fingerprint sensor to capture high resolution fingerprint images. It then processes the captured fingerprint data and matches it with the stored pattern. R307 fingerprint sensor supports functions such as fingerprint registration, authentication and identification.


It communicates with other devices using UART/TTL serial communication, making it compatible with many microcontrollers and systems. With its reliable performance and affordable price, the R307 fingerprint sensor is widely used in access control, sentry equipment, electronic equipment and other applications that require secure biometric authentication.

12v solenoid lock:

A 12V solenoid lock is an electronic device used to lock and unlock systems using a magnet. It operates on 12 volts and has a solenoid and piston. When current passes through the coil, it creates a magnetic field that causes the piston to retract or extend, depending on the design. This action affects or lifts the lock mechanism, thereby securing or releasing the lock. Widely used in applications such as door locks, cabinets, security and automatic entry systems, 12V solenoid locks provide a reliable, durable solution that requires easy control and installation.

Circuit diagram:

Code for finger enrollment:

#include 
#include 
SoftwareSerial mySerial(2, 3);

Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial);

uint8_t id;

void setup()  
{
  Serial.begin(9600);
  while (!Serial);  // For Yun/Leo/Micro/Zero/...
  delay(100);
  Serial.println("\n\nFingerprint sensor enrollment");

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

uint8_t readnumber(void) {
  uint8_t num = 0;
  
  while (num == 0) {
    while (! Serial.available());
    num = Serial.parseInt();
  }
  return num;
}

void loop()                     // run over and over again
{
  Serial.println("Ready to enroll a fingerprint!");
  Serial.println("Please type in the ID # (from 1 to 127) you want to save this finger as...");
  id = readnumber();
  if (id == 0) {// ID #0 not allowed, try again!
     return;
  }
  Serial.print("Enrolling ID #");
  Serial.println(id);
  
  while (!  getFingerprintEnroll() );
}

uint8_t getFingerprintEnroll() {

  int p = -1;
  Serial.print("Waiting for valid finger to enroll as #"); Serial.println(id);
  while (p != FINGERPRINT_OK) {
    p = finger.getImage();
    switch (p) {
    case FINGERPRINT_OK:
      Serial.println("Image taken");
      break;
    case FINGERPRINT_NOFINGER:
      Serial.println(".");
      break;
    case FINGERPRINT_PACKETRECIEVEERR:
      Serial.println("Communication error");
      break;
    case FINGERPRINT_IMAGEFAIL:
      Serial.println("Imaging error");
      break;
    default:
      Serial.println("Unknown error");
      break;
    }
  }

  // OK success!

  p = finger.image2Tz(1);
  switch (p) {
    case FINGERPRINT_OK:
      Serial.println("Image converted");
      break;
    case FINGERPRINT_IMAGEMESS:
      Serial.println("Image too messy");
      return p;
    case FINGERPRINT_PACKETRECIEVEERR:
      Serial.println("Communication error");
      return p;
    case FINGERPRINT_FEATUREFAIL:
      Serial.println("Could not find fingerprint features");
      return p;
    case FINGERPRINT_INVALIDIMAGE:
      Serial.println("Could not find fingerprint features");
      return p;
    default:
      Serial.println("Unknown error");
      return p;
  }
  
  Serial.println("Remove finger");
  delay(2000);
  p = 0;
  while (p != FINGERPRINT_NOFINGER) {
    p = finger.getImage();
  }
  Serial.print("ID "); Serial.println(id);
  p = -1;
  Serial.println("Place same finger again");
  while (p != FINGERPRINT_OK) {
    p = finger.getImage();
    switch (p) {
    case FINGERPRINT_OK:
      Serial.println("Image taken");
      break;
    case FINGERPRINT_NOFINGER:
      Serial.print(".");
      break;
    case FINGERPRINT_PACKETRECIEVEERR:
      Serial.println("Communication error");
      break;
    case FINGERPRINT_IMAGEFAIL:
      Serial.println("Imaging error");
      break;
    default:
      Serial.println("Unknown error");
      break;
    }
  }

  // OK success!

  p = finger.image2Tz(2);
  switch (p) {
    case FINGERPRINT_OK:
      Serial.println("Image converted");
      break;
    case FINGERPRINT_IMAGEMESS:
      Serial.println("Image too messy");
      return p;
    case FINGERPRINT_PACKETRECIEVEERR:
      Serial.println("Communication error");
      return p;
    case FINGERPRINT_FEATUREFAIL:
      Serial.println("Could not find fingerprint features");
      return p;
    case FINGERPRINT_INVALIDIMAGE:
      Serial.println("Could not find fingerprint features");
      return p;
    default:
      Serial.println("Unknown error");
      return p;
  }
  
  // OK converted!
  Serial.print("Creating model for #");  Serial.println(id);
  
  p = finger.createModel();
  if (p == FINGERPRINT_OK) {
    Serial.println("Prints matched!");
  } else if (p == FINGERPRINT_PACKETRECIEVEERR) {
    Serial.println("Communication error");
    return p;
  } else if (p == FINGERPRINT_ENROLLMISMATCH) {
    Serial.println("Fingerprints did not match");
    return p;
  } else {
    Serial.println("Unknown error");
    return p;
  }   
  
  Serial.print("ID "); Serial.println(id);
  p = finger.storeModel(id);
  if (p == FINGERPRINT_OK) {
    Serial.println("Stored!");
  } else if (p == FINGERPRINT_PACKETRECIEVEERR) {
    Serial.println("Communication error");
    return p;
  } else if (p == FINGERPRINT_BADLOCATION) {
    Serial.println("Could not store in that location");
    return p;
  } else if (p == FINGERPRINT_FLASHERR) {
    Serial.println("Error writing to flash");
    return p;
  } else {
    Serial.println("Unknown error");
    return p;
  }   
}

After enrollment of finger there is another code for lock controll system.

Code for lock system:

#define Lock 9
#include 
#include 
#include 
LiquidCrystal lcd(2, 3, 4, 5, 6, 7);
SoftwareSerial mySerial(2,3);
Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial);
void setup()  
{
  lcd.begin(16,2);
  Serial.begin(9600);
  while (!Serial);  // For Yun/Leo/Micro/Zero/...
  delay(100);
  Serial.println("fingertest");
  pinMode(Lock, OUTPUT);



  // set the data rate for the sensor serial port
  finger.begin(57600);
  
  if (finger.verifyPassword()) {
    Serial.println("Fingerprint sensor Available");
  } else {
    Serial.println("fingerprint sensor not Available");
    while (1) { delay(1); }
  }

  finger.getTemplateCount();
  Serial.print("Sensor contains "); Serial.print(finger.templateCount); Serial.println(" templates");
  Serial.println("Waiting for valid finger...");
  lcd.setCursor(0,0);
  lcd.print("Robotshapers");
  delay(1500);
  lcd.setCursor(0,1);
  lcd.print("Fingerprint lock");
  delay(1500);
  lcd.clear();
  lcd.setCursor(0,0);
  lcd.print("Put Finger");
  
}

void loop()                     // run over and over again

{
  getFingerprintIDez();
  delay(50);            //don't ned to run this at full speed.
  digitalWrite(12, LOW);
}

uint8_t getFingerprintID() {
  uint8_t p = finger.getImage();
  switch (p) {
    case FINGERPRINT_OK:
      Serial.println("Image taken");
      break;
    case FINGERPRINT_NOFINGER:
      Serial.println("No finger detected");
      return p;
    case FINGERPRINT_PACKETRECIEVEERR:
      Serial.println("Communication error");
      return p;
    case FINGERPRINT_IMAGEFAIL:
      Serial.println("Imaging error");
      return p;
    default:
      Serial.println("Unknown error");
      return p;
  }

  // OK success!

  p = finger.image2Tz();
  switch (p) {
    case FINGERPRINT_OK:
      Serial.println("Image converted");
      break;
    case FINGERPRINT_IMAGEMESS:
      Serial.println("Image too messy");
      return p;
    case FINGERPRINT_PACKETRECIEVEERR:
      Serial.println("Communication error");
      return p;
    case FINGERPRINT_FEATUREFAIL:
      Serial.println("Could not find fingerprint features");
      return p;
    case FINGERPRINT_INVALIDIMAGE:
      Serial.println("Could not find fingerprint features");
      return p;
    default:
      Serial.println("Unknown error");
      return p;
  }
  
  // OK converted!
  p = finger.fingerFastSearch();
  if (p == FINGERPRINT_OK) {
    Serial.println("Found a print match!");
  } else if (p == FINGERPRINT_PACKETRECIEVEERR) {
    Serial.println("Communication error");
    return p;
  } else if (p == FINGERPRINT_NOTFOUND) {
    Serial.println("Did not find a match");
    return p;
  } else {
    Serial.println("Unknown error");
    return p;
  }   
  
  // found a match!
  Serial.print("Found ID #"); Serial.print(finger.fingerID); 
  Serial.print(" with confidence of "); Serial.println(finger.confidence); 

  return finger.fingerID;
}

// returns -1 if failed, otherwise returns ID #
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; 
  digitalWrite(Lock, HIGH);
  delay(3000);
  lcd.setCursor(0,1);
  lcd.print("WLECOME");
  digitalWrite(Lock, LOW);
  lcd.setCursor(0,1);
  lcd.print("        ");

  Serial.print("Found ID #"); Serial.print(finger.fingerID); 
  Serial.print(" with confidence of "); Serial.println(finger.confidence);
  return finger.fingerID; 
}

Applications:

Fingerprint locks have many uses in many fields due to their reliability, convenience and advanced security features :

  1. In residences, fingerprint locks are often used at the front door to prevent homeowners from entering without the need for a key. They provide convenience for family members and can also be designed to provide temporary access for guests or service providers.
  2. In a business environment, fingerprint locks are used to ensure the security of employees and authorized personnel in office buildings. They can be integrated with the time and attendance process, making it easy to keep accurate information and prevent unauthorized access.
  3. Fingerprint locks are also used in high security facilities such as research centers, data centers and government buildings. Biometric technology provides strong protection against unauthorized access because fingerprints are unique to each individual and difficult to forge.
  4. Fingerprint locks are also used in the hotel industry, gyms and other places to ensure the safety of guests. They offer a seamless, seamless experience without the need for traditional keys or card access.
  5. Overall, fingerprint locks are versatile and flexible, making them a reliable security solution for a wide variety of applications, from residential and commercial spaces to public spaces to the security and hospitality industry.

Best projects in Bhilai, Chhattisgarh, India. Contact: 7067150002