FINGERPRINT BASED DOOR LOCK SYSTEM USING ARDUINO

INTRODUCTION

Bio metric systems have overtime served as robust security mechanisms in various domains. Fingerprints are the oldest and most widely used form of bio metric identification. The use of fingerprint for identification has been employed in law enforcement for about a century. A much broader application of fingerprint is for personal authentication, for instance to access a computer, a network, an ATM machine, a car or a home. In this article we will be discussing about fingerprint based door lock system.

Electronic lock using fingerprint recognition system is a process of verifying the fingerprint image to open the electronic lock. This project highlights the development of fingerprint verification. Verification is completed by comparing the data of authorized fingerprint image with incoming fingerprint image. Then the information of incoming fingerprint image will undergo the comparison process to compare with authorized fingerprint image. 

Fingerprint door lock incorporates the proven technology. Fingerprint reader scanning is the most mature and tested type of bio metric technology. Recent studies on bio metrics have shown that compared to the hand method, fingerprint is more accurate and cost-effective. The duplication of bio metric fingerprint technology is virtually impossible, only one in one billionth of a chance. Bio metric security guarantees a positive method of user identification with something that cannot be lost, replicated or stolen. fingerprint based door lock system can achieve all these features

We have done another project using R503 Capacitive Fingerprint sensor. We are going to make a fingerprint based door lock system using this capacitive fingerprint sensor.

BILL OF MATERIALS

SNCOMPONENTS NAMEDESCRIPTIONQUANTITY
1Arduino MegaMicrocontroller1https://amzn.to/3mT3Qfi
2Finger print SensorR3051https://amzn.to/3mRJ1Rj
3Servo MotorSG51R1https://amzn.to/3HHgJCV
4Battery9V1https://amzn.to/3tDmZpm
5led5mmsomehttps://amzn.to/39uhxOw
6LCD display16*21https://amzn.to/3QAckpk
7Buzzersmall1https://amzn.to/3Hsz9ae
8Connecting wiresjumper wiresomehttps://amzn.to/3xs9FFd
9DHT11Temperature /Humidity sensor1https://amzn.to/3HzVxyA
10POT100K1https://amzn.to/39rrlcj

HARDWARE DESCRIPTION OF FINGERPRINT BASED DOOR LOCK SYSTEM

ARDUINO

Arduino is an open-source electronic platform based on easy-to-use hardware and software. Arduino boards are able to read inputs – light on sensor, a finger on a button, or a Twitter message – and turn it into an output – activating a motor, turning on an LED, publishing some thing online. You can tell your board what to do by sending a set of instructions to the microcontroller on the board. To do so you use the Arduino programming language (based on writing), and the arduino software (IDE), based on processing.

Over the years Arduino has been the brain of thousands of projects, from everyday objects to complex scientific instruments. A worldwide community of makers students, hobbyists, artists, programmers, and professionals – has gathered around this open source platform, their contributions have added up to an incredible amount of accessible knowledge that can be of great help to novices and experts alike.

Arduino was born at the ivrea interaction design institute as an easy tool for fast prototyping, aimed at students without a background in electronics and programming. As soon as it reached a wider community, the Arduino board started changing to adapt to new needs and challenges, differentiating its offer from simple 8-bit boards to products for IOT applications, wearable, 3D printing, and embedded environments. All Arduino boards are completely open-source, empowering users to build them independently and eventually adapt them to their particular needs. The software, too, is open –source, and it is growing through the contributions of users worldwide.

ARDUINO MEGA (2560)

FIG:- ARDUINO MEGA (2560) MODULE

OVERVIEW

The Arduino Mega 2560 is a microcontroller board based on the ATmega2560. It has 54 digital input/output pins (of which 14 can be used as PWM outputs), 16 analog inputs, 4 UARTs (hardware serial ports), a 16 MHz crystal oscillator, a USB connection, a power jack, an ICSP HEADER, AND A RESWT BUTTON. It contains everything needed to support the microcontroller; simply connect it to a computer with USB cable or power it with most shields designed for the Arduino Duemilanove or Diecimili.

 CHARACTERISTIC

Microcontroller                                                           ATmega2560

Operating Voltage                                                        5V

Input Voltage (recommended)                                 7-12V

Input Voltage (limits)                                                  6-20V

Digital I/O Pins                                                              54 (of which 14 provides PWM output)

Analog Input Pins                                                          16

DC Current per I/P Pin                                                 40mA

DC Current for 3.3V Pin                                                50mA

Flash Memory                                                                256 KB of which 8 KB used by boot loader

SRAM                                                                               8 KB

EEPROM                                                                          4 KB

Clock Speed                                                                    16 MHz

POWER

The Arduino Mega can be powered via the USB connection or with an external power supply. The power source is selected automatically.

External (non-USB) power can come either from an AC-to-DC adapter (wall-wart) or battery. The adapter can be connected by plugging a 2.1mm centre-positive plug into the board’s power jack. Leads from a battery can be inserted in the Gnd and Vin pin headers of the POWER connector.

The board can operate on an external supply of 6 to 20 volts. If supplied with less than 7V, however, the 5V pin may supply less than five volts and the board may be unstable. If using more than 12V, the voltage regulator may overheat and damage the board. The recommended range is 7 to 12 volts.

The Mega2560 differs from all preceding boards in that it does not use the FTDI USB-to serial driver chip. Instead, it features the Atmega8U2 programmed as a USB-to-serial converter.

The power pins description

+VIN:- The input voltage to the Arduino board when it’s using an external power source (as opposed to  volt from the USB connector or other regulated power source). You can supply voltage through this pin, or, if supplying voltage via the power jack, access through this pin.

+5V:- The regulated power supply used to power the microcontroller and other components on the board. This can come either from VIN an on-board regulator, or be supplied but USB or another 5V supply.

+3V3:- A 3.3 volt supply generated by the on-board regulator. Maximum current draw is 50mA.

GND:- Ground pins.

MEMORY

The ATmega2560 has 256 KB of flash memory for storing code (of which 8 KB is used for the boot loader), 8KB of SRAM AND 4KB of EEPROM (which can be read and written with the EEPROM  library).

INPUT AND OUTPUT 

Each of the 54 digital pins on the Mega can be used as an input or output, using pin Mode(), digital Write(), and digital Read() functions. They operate at 5 volts. Each pin can provide or receive a maximum of 40 mA and has an internal pull-up resistor (disconnected by default) of 20-50 k Ohms. In adding, some pins have specialized functions:

Serial:-0 (RX) and 1 (TX); Serial 1:19 (RX) and 18 (TX); Serial 2:17 (RX) and 16 (TX); Serial 3:15 (RX) and 14 (TX). Used to receive (RX) and transmit (TX) TTL serial data. Pins 0 and 1 are also connected to the corresponding pins of the ATmega8U2 USB-to-TTL Serial chip.

External Interrupts: 2 (interrupt 0), 3 (interrupt 1), 18 (interrupt 5), 19 (interrupt 4), 20 (interrupt 3), and 21 (interrupt 2). These pins can be configured to trigger an interrupt on a low value, a rising or falling edge, or a change in value. See attach interrupt() function for details.

PWM: 0 to 13. Provide 8-bit PWM output with the analog write () function.SPI: 50 (MISO), 51 (MOSI), 52 (SCK), 53 (SS). These pins support SPI communication using the SPI library. The SPI pins also broken out on the ICSP header, which is physically compatible with the Uno, Duemilanove and Diecimila.

LED: 13. There is a built-in LED connected to digtal pin 13. When the pin is HIGH value, the LED is on, when the pin is LOW, it’s off.

I2C: 20 (SDA) and 21 (SCL). Support I2C (TWI) communication using the Wire library

(documentation on the Wiring website). Note that these pins are not in the same location as the I2C pins on the Duemilanove or Decimal.

The mega 2560 has 16 analog inputs, each of which provide 10 bits of resolution (i.e.1024 different values). By default they measure from ground to 5 volts, through is it possible to change the upper end of their range using the AREF pin and analog Reference () function.

There are a couple of other pins on the board:

AREF. Reference voltage for the analog inputs. Used with analog Reference ().

Reset. Bring this line LOW to reset the microcontroller. Typically used to add a reset buttom to shields which block the one on the board.

Communication The Arduino Mega2560 has a number of facilities for communicating with a computer, another Arduino, or other microcontrollers. The ATmega2560 provides four hardware UARTs for TTL (5V) serial communication. An ATmega8U2 on the board channels one of these over USB and provides a virtual com port to software on the computer (windows machines will need in a file, but OSX and Linux machines will recoginized the board as a COM port automatically. The Arduino software includes a serial monitor which allows simple textual data to be sent to and from the board. The RX and TX LEDs on the board will flash when data is being transmitted via the ATmega8U2 chip and USB connection to the computer (but not for serial communication on pins 0 and 1).

SERVO MOTOR

A servomotor is a rotary actuator or linear actuator that allows for precise control of angular or linear position, velocity and acceleration. It consists of a suitable motor coupled to a sensor for position feedback. It also requires a relatively sophisticated controller, often a dedicated module designed specifically for use with servomotors.

Servomotors are not a specific class of motor although the term servomotoris often used to refer to a motor suitable for use in a closedloop control system.

Fig:-servo motor

FINGERPRINT SENSOR

A fingerprint is an impression left by the friction ridges of a human finger. The recovery of partial fingerprints from a crime scene is an important method of forensic science. Moisture and grease on a finger result in fingerprints on surfaces such as glass or metal. Deliberate impressions of entire fingerprints can be obtained by ink or other substances transferred from the peaks of friction ridges on the skin to a smooth surface such as paper. Fingerprint records normally contain impressions from the pad on the last joint of fingers and thumbs, although fingerprint cards also typically record portions of lower joint areas of the fingers.

Human fingerprints are detailed, nearly unique, difficult to alter, and durable over the life of an individual, making them suitable as long-term markers of human identity. They may be employed by police or other authorities to identify individuals who wish to conceal their identity, or to identify people who are incapacitated or deceased and thus unable to identify themselves, as in the aftermath of a natural disaster.

FIG:-Fingerprint sensor

BATTERY

The nine-volt battery, or 9-volt battery, is a common size of battery that was introduced for the early transistor radios. It has a rectangular prism shape with rounded edges and a polarized snap connector at the top. This type is commonly used in walkietalkies, clocks and smoke detectors.

The nine-volt battery format is commonly available in primary carbon-zinc and alkaline chemistry, in primary lithium iron disulfide, and in rechargeable form in nickel-cadmium, nickel-metal hydride and lithium-ion. Mercury-oxide batteries of this format, once common, have not been manufactured in many years due to their mercury content. Designations for this format include NEDA 1604 and IEC 6F22 (for zinc-carbon) or MN1604 6LR61 (for alkaline). The size, regardless of chemistry, is commonly designated PP3—a designation originally reserved solely for carbon-zinc, or in some countries, E or E-block.

FIG:-Battery

LED

A light-emitting diode (LED) is a semiconductor light source that emits light when current flows through it. Electrons in the semiconductor recombine with electron holes, releasing energy in the form of photons. This effect is called electroluminescence. The colour of the light (corresponding to the energy of the photons) is determined by the energy required for electrons to cross the band gap of the semiconductor.White light is obtained by using multiple semiconductors or a layer of light-emitting phosphor on the semiconductor device.

FIG:-LED

LCD DISPLAY

A liquid-crystal display (LCD) is a flatpanel display or other electronically modulated optical device that uses the light-modulating properties of liquid crystals. Liquid crystals do not emit light directly, instead using a backlight or reflector to produce images in colour or monochrome. LCDs are available to display arbitrary images (as in a general-purpose computer display) or fixed images with low information content, which can be displayed or hidden, such as present words, digits, and sevensegment displays, as in a digital clock. They use the same basic technology, except that arbitrary images are made up of a large number of small pixels, while other displays have larger elements. LCDs can either be normally on (positive) or off (negative), depending on the polarizer arrangement. For example, a character positive LCD with a backlight will have black lettering on a background that is the colour of the backlight, and a character negative LCD will have a black background with the letters being of the same colour as the backlight. Optical filters are added to white on blue LCDs to give them their characteristic appearance.

Fig:-LCD Display

BUZZER

A buzzer or beeper is a signaling device, usually electronic, typically used in automobiles, household appliances such as a microwave oven, or game shows.It most commonly consists of a number of switches or sensors connected to a control unit that determines if and which button was pushed or a preset time has lapsed, and usually illuminates a light on the appropriate button or control panel, and sounds a warning in the form of a continuous or intermittent buzzing or beeping sound. Initially this device was based on an electromechanical system which was identical to an electric bell without the metal gong (which makes the ringing noise). Often these units were anchored to a wall or ceiling and used the ceiling or wall as a sounding board. Another implementation with some ACconnected devices was to implement a circuit to make the AC current into a noise loud enough to drive a loudspeaker and hook this circuit up to a cheap 8-ohm speaker. Nowadays, it is more popular to use a ceramic-based piezoelectric sounder like a Son alert which makes a high-pitched tone. Usually these were hooked up to “driver” circuits which varied the pitch of the sound or pulsed the sound on and off.

FIG:-Buzzer

JUMPER WIRE

A jump wire is an electrical wire, or group of them in a cable, with a connector or pin at each end, which is normally used to interconnect the components of a breadboard or other prototype or test circuit, internally or with other equipment or components, without soldering.

FIG:-Jumper Wire

DHT SENSOR

This tutorial covers the low cost DHT temperature & humidity sensors. These sensors are very basic and slow, but are great for hobbyists who want to do some basic data logging. The DHT sensors are made of two parts, a capacitive humidity sensor and a thermistor. There is also a very basic chip inside that does some analog to digital conversion and spits out a digital signal with the temperature and humidity. The digital signal is fairly easy to read using any microcontroller.

FIG:-DHT Sensor

POT METER

A potentiometer is a threeterminal resistor with a sliding or rotating contact that forms an adjustable voltage divider. If only two terminals are used, one end and the wiper, it acts as a variable resistor or rheostat. The measuring instrument called a potentiometer is essentially a voltage divider used for measuring electric potential(voltage); the component is an implementation of the same principle, hence its name. Potentiometers are commonly used to control electrical devices such as volume controls on audio equipment. Potentiometers operated by a mechanism can be used as position transducers, for example, in a joystick.

FIG:POT Meter

PUSH BUTTON

A push-button (also spelled push button) or simply button is a simple switch mechanism for controlling some aspect of a machine or a process. Buttons are typically made out of hard material, usually plastic or metal. The surface is usually flat or shaped to accommodate the human finger or hand, so as to be easily depressed or pushed. Buttons are most often biased switches, although many un-biased buttons (due to their physical nature) still require a spring to return to their unpushed state.

Mini Push Button Switch
FIG:-Push Botton

BATTERY HOLDER

A battery holder is one or more compartments or chambers for holding a battery. For dry cells, the holder must also make electrical contact with the battery terminals. For wet cells, cables are often connected to the battery terminals, as is found in automobiles or emergency lighting equipment.

A battery holder is either a plastic case with the shape of the housing moulded as a compartment or compartments that accepts a battery or batteries, or a separate plastic holder that is mounted with screws, eyelets, glue, double-sided tape, or other means. Battery holders may have a lid to retain and protect the batteries or may be sealed to prevent damage to circuitry and components from battery leakage. Coiled spring wire or flat tabs that press against the battery terminals are the two most common methods of making the electrical connection inside a holder. External connections on battery holders are usually made by contacts with pins, surface mount feet, solder lugs, or wire leads.

Socket 9V (Battery Cap) | BreadFruit Electronics | Buy latest Arduino,  Sensors, Raspberry Pi, ICs, Resistors and other electronic components in  Nepal
FIG:-Battery Holder

SOFTWEAR DESCRIPTION OF FINGERPRINT BASED DOOR LOCK SYSTEM

ARDUINO IDE (R3)

The open-source Arduino software (IDE) makes is easy to write code and upload it to the board. It runs on windows, MAX OS X, and Linux. The environment is written in java and based on processing and other open-source software. The Arduino integrate Development Environment or Arduino software (IDE) contains a text editor for writing code, a message area, a text console, a toolbar with buttons for common function and a series of menus. It connects to the Arduino and Genuine hardware to upload the program and communication with them. 

USING ARDUINO

CHAPTER 4

BLOCK DIAGRAM

BLOCK DIAGRAM

FIG:- ARDUINO BASED BIOMETRIC FINGERPRINT DOOR LOCK

CIRCUIT DIAGRAM & OPERATION

CIRCUIT DIAGRAM

FIG:-CIRCUIT DIAGRAM OF ARDUINO BASED BIOMETRIC FINGERPRINT DOOR LOCK

OPERATION 

The circuit of this fingerprint based door lock system is very simple which contains Arduino Mega2560 which controls whole the process of the project, push button, buzzer, and LCD. Arduino Mega2560 controls the complete processes.

The push button is directly connected to pin A9 (ENROL), A10 (OK/DEL), A11 (UP), A12 (DOWN) and A8 (CLOSED) of Arduino Mega2560 with respect to ground and Red LED is connected at Digital pin D4 of Arduino Mega2560 with respect to ground through a 10 ohms resistor and Green LED is connected to D3 of Arduino Mega2560 with the same method. Finger Print Module’s Rx and Tx directly connected at Software Serial or Digital pin D11 and D10 of Arduino Mega2560. 5v supply is used for powering finger print module taken from Arduino Mega pin and Servo motor is also connected to PWM pin D5 of Arduino mega2560. A 16×2 LCD is configured in 4-bit mode and its RS, EN, D4, D5, D6, and D7 are directly connected at Digital pin D13, D12, D6, D7, D9, and D8 of Arduino Mega2560. Buzzer is connected at the Digital pin D14 of Arduino Mega2560 and with respect to the ground. DHT is connected at the Digital pin D2 of Arduino Mega2560 and with respect to the ground and Vcc. Potentiometer of middle pin is connected LCD (Vo). 

Firstly, “Enroll” button is pressed to enroll the finger print of the authenticate user. Finger print is stored by pressing “OK/Del” button. Gate is closed by pressing the “Close” button of the module.

When any user tries to open the gate, module checks the authenticity of the user by comparing his/her fingerprint with the database, if the users fingerprint matches with the one that is stored in the database then arduino sends the signal to run the motor which then opens the gate with the “ WELCOME” “DOOR OPENED” message on the LCD.

SOURCE CODE

#include "dht.h"
#define dht_apin 2 // Analog Pin sensor is connected to
dht DHT;
#include<LiquidCrystal.h>
LiquidCrystal lcd(13,12,6,7,9,8);
#include <SoftwareSerial.h>
SoftwareSerial fingerPrint(10, 11);
#include<Servo.h>
Servo myServo;

#include <Adafruit_Fingerprint.h>
uint8_t id;
Adafruit_Fingerprint finger = Adafruit_Fingerprint(&fingerPrint);
#define rabin A8
#define enroll A0
#define del A1
#define up A2
#define down A3
#define openLight 3
#define closeLight 4
#define servoPin 5

void setup() 
{
    delay(1000);
    myServo.attach(servoPin);
    myServo.write(180);
    pinMode(enroll, INPUT_PULLUP);
    pinMode(up, INPUT_PULLUP); 
    pinMode(down, INPUT_PULLUP); 
    pinMode(del, INPUT_PULLUP); 
    pinMode(rabin, INPUT_PULLUP); 
    pinMode(openLight, OUTPUT);
    pinMode(closeLight, OUTPUT);
    lcd.begin(16,2);
    DHT.read11(dht_apin);
    
    lcd.setCursor(0,0);
    lcd.print("    MANMOHAN ");
   lcd.setCursor(0,1);
   lcd.print("POLYTECHNIC COLLAGE");
    lcd.scrollDisplayLeft();
    delay(1000);
    lcd.scrollDisplayLeft();
    delay(1000);
    lcd.scrollDisplayLeft();
    delay(1000);
    lcd.scrollDisplayLeft();
    delay(5000);
    lcd.clear();
    finger.begin(57600);
    Serial.begin(9600);
    lcd.clear();
    lcd.print(" Finding Module ");
    lcd.setCursor(0,1);
    delay(2000);
    if (finger.verifyPassword()) 
    {
      Serial.println("Found fingerprint sensor!");
      lcd.clear();
      lcd.print(" Module Found  ");
      delay(2000);
    } 
    else 
    {
    Serial.println("Did not find fingerprint sensor :(");
    lcd.clear();
    lcd.print("Module Not Found");
    lcd.setCursor(0,1);
    lcd.print("Check Connections");
    while (1);
    }
}

void loop() 
{
  lcd.setCursor(0,0);
    lcd.print("HUMI    =");
   lcd.print(DHT.humidity);
   lcd.print("%  ");
   lcd.setCursor(0,1);
   lcd.print("TEMP    =");
    lcd.print(   DHT.temperature); 
   lcd.println("'C  ");
   delay(5000);
   lcd.clear();
 lcd.setCursor(0,0);
 lcd.print("  Press Match       ");
 lcd.setCursor(0,1);
 lcd.print("To Start System");
 digitalWrite(closeLight, HIGH);
 if(digitalRead(up)==0 || digitalRead(down)==0)
 {
  for(int i=0;i<5;i++) { lcd.clear(); lcd.print("Place Finger"); delay(2000); int result=getFingerprintIDez(); if(result>=0)
    {
        digitalWrite(openLight, HIGH);
        digitalWrite(closeLight, LOW);
        lcd.clear();
        lcd.print("    Allowed    ");
        lcd.setCursor(0,1);
        lcd.print("  Gate Opened   ");
        myServo.write(0);
        delay(5000);
        myServo.write(180);
        digitalWrite(closeLight, HIGH);
        digitalWrite(openLight, LOW);
        lcd.setCursor(0,1);
        lcd.print("  Gate Closed   ");
        return;
     }
   }
 }
 checkKeys();
 delay(2000);
 if( currentposition==0 && digitalRead(rabin) == 0)
{
displayscreen();

}
int l ;
char code=keypad.getKey();
if(code!=NO_KEY)
{
lcd.clear();
lcd.setCursor(0,0);
lcd.print("PASSWORD:");
lcd.setCursor(7,1);
lcd.print(" ");
lcd.setCursor(7,1);
for(l=0;l<=currentposition;++l)
{

lcd.print("*");
keypress();
}

if (code==password[currentposition])
{
++currentposition;
if(currentposition==4)
{

unlockdoor();
currentposition=0;

}

}

else
{
++invalidcount;
incorrect();
currentposition=0;

}
if(invalidcount==5)
{

++invalidcount;
torture1();

}
if(invalidcount==8)
{
torture2();
}
}

void checkKeys()
{
   if(digitalRead(enroll) == 0)
   {
    lcd.clear();
    lcd.print("Please Wait");
    delay(2000);
    while(digitalRead(enroll) == 0);
    Enroll();
   }

   else if(digitalRead(del) == 0)
   {
    lcd.clear();
    lcd.print("Please Wait");
    delay(2000);
    delet();
   }  
}

void Enroll()
{
   int count=0;
   lcd.clear();
   lcd.print("Enroll Finger    ");
   lcd.setCursor(0,1);
   lcd.print("Location:");
   while(1)
   {
     lcd.setCursor(9,1);
     lcd.print(count);
     if(digitalRead(up) == 0)
     {
       count++;
       if(count>25)
       count=0;
       delay(500);
     }

     else if(digitalRead(down) == 0)
     {
       count--;
       if(count<0) count=25; delay(500); } else if(digitalRead(del) == 0) { id=count; getFingerprintEnroll(); return; } else if(digitalRead(enroll) == 0) { return; } } } void delet() { int count=0; lcd.clear(); lcd.print("Delete Finger "); lcd.setCursor(0,1); lcd.print("Location:"); while(1) { lcd.setCursor(9,1); lcd.print(count); if(digitalRead(up) == 0) { count++; if(count>25)
       count=0;
       delay(500);
     }

     else if(digitalRead(down) == 0)
     {
       count--;
       if(count<0)
       count=25;
       delay(500);
     }
     else if(digitalRead(del) == 0)
     {
          id=count;
          deleteFingerprint(id);
          return;
     }

       else if(digitalRead(enroll) == 0)
     {        
          return;
     }
 }
}

uint8_t getFingerprintEnroll() 
{
  int p = -1;
  lcd.clear();
  lcd.print("Finger ID:");
  lcd.print(id);
  lcd.setCursor(0,1);
  lcd.print("Place Finger");
  delay(2000);
  while (p != FINGERPRINT_OK)
  {
    p = finger.getImage();
    switch (p)
    {
    case FINGERPRINT_OK:
      Serial.println("Image taken");
      lcd.clear();
      lcd.print("Image taken");
      break;
    case FINGERPRINT_NOFINGER:
      Serial.println("No Finger");
      lcd.clear();
      lcd.print("No Finger");
      break;
    case FINGERPRINT_PACKETRECIEVEERR:
      Serial.println("Communication error");
      lcd.clear();
      lcd.print("Comm Error");
      break;
    case FINGERPRINT_IMAGEFAIL:
      Serial.println("Imaging error");
      lcd.clear();
      lcd.print("Imaging Error");
      break;
    default:
      Serial.println("Unknown error");
       lcd.clear();
      lcd.print("Unknown Error");
      break;
    }
  }

  // OK success!

  p = finger.image2Tz(1);
  switch (p) {
    case FINGERPRINT_OK:
      Serial.println("Image converted");
      lcd.clear();
      lcd.print("Image converted");
      break;
    case FINGERPRINT_IMAGEMESS:
      Serial.println("Image too messy");
       lcd.clear();
       lcd.print("Image too messy");
      return p;
    case FINGERPRINT_PACKETRECIEVEERR:
      Serial.println("Communication error");
      lcd.clear();
      lcd.print("Comm Error");
      return p;
    case FINGERPRINT_FEATUREFAIL:
      Serial.println("Could not find fingerprint features");
      lcd.clear();
      lcd.print("Feature Not Found");
      return p;
    case FINGERPRINT_INVALIDIMAGE:
      Serial.println("Could not find fingerprint features");
      lcd.clear();
      lcd.print("Feature Not Found");
      return p;
    default:
      Serial.println("Unknown error");
      lcd.clear();
      lcd.print("Unknown Error");
      return p;
  }
  
  Serial.println("Remove finger");
  lcd.clear();
  lcd.print(" 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");
   lcd.clear();
      lcd.print("  Place Finger  ");
      lcd.setCursor(0,1);
      lcd.print("     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!");
    lcd.clear();
    lcd.print("Stored!");
    delay(2000);
  } 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;
  }   
}

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)
  {
   lcd.clear();
   lcd.print("Finger Not Found");
   lcd.setCursor(0,1);
   lcd.print("Try Later");
   delay(2000);  
  return -1;
  }
  // found a match!
  Serial.print("Found ID #"); 
  Serial.print(finger.fingerID); 
  return finger.fingerID; 
}

uint8_t deleteFingerprint(uint8_t id) 
{
  uint8_t p = -1;  
  lcd.clear();
  lcd.print("Please wait");
  p = finger.deleteModel(id);
  if (p == FINGERPRINT_OK) 
  {
    Serial.println("Deleted!");
    lcd.clear();
    lcd.print("Figer Deleted");
    lcd.setCursor(0,1);
    lcd.print("Successfully");
    delay(2000);
  } 
  
  else 
  {
    Serial.print("Something Wrong"); 
    lcd.clear();
    lcd.print("Something Wrong");
    lcd.setCursor(0,1);
    lcd.print("Try Again Later");
    delay(2000);
    return p;
  }   
}
void unlockdoor()
{
delay(900);

lcd.setCursor(0,0);
lcd.println(" ");
lcd.setCursor(1,0);
lcd.print("Access Granted");
lcd.setCursor(4,1);
lcd.println("WELCOME!!");
lcd.setCursor(15,1);
lcd.println(" ");
lcd.setCursor(16,1);
lcd.println(" ");
lcd.setCursor(14,1);
lcd.println(" ");
lcd.setCursor(13,1);
lcd.println(" ");
unlockbuzz();

for(pos = 180; pos>=0; pos-=5) // goes from 180 degrees to 0 degrees
{
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(5); // waits 15ms for the servo to reach the position
}
delay(2000);



delay(1000);
counterbeep();

delay(1000);

for(pos = 0; pos <= 180; pos +=5) // goes from 0 degrees to 180 degrees
{ // in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15);


int currentposition=0;

lcd.clear();
displayscreen();

}
}

//**********************************WRONG CODE FUNCTION*************************************************//

void incorrect()
{
delay(500);
lcd.clear();
lcd.setCursor(1,0);
lcd.print("CODE");
lcd.setCursor(6,0);
lcd.print("INCORRECT");
lcd.setCursor(15,1);
lcd.println(" ");
lcd.setCursor(4,1);
lcd.println("GET AWAY!!!");

lcd.setCursor(13,1);
lcd.println(" ");
Serial.println("CODE INCORRECT YOU ARE UNAUTHORIZED");
digitalWrite(redled, HIGH);
digitalWrite(buzz, HIGH);
delay(3000);
lcd.clear();
digitalWrite(redled, LOW);
digitalWrite(buzz,LOW);
displayscreen();
}
//****************************** CLEAR THE SCREEN!!!**********************//
void clearscreen()
{
lcd.setCursor(0,0);
lcd.println(" ");
lcd.setCursor(0,1);
lcd.println(" ");
lcd.setCursor(0,2);
lcd.println(" ");
lcd.setCursor(0,3);
lcd.println(" ");
}
//******************************KEYPRESS***********************************//
void keypress()
{



digitalWrite(buzz, HIGH);
delay(50);
digitalWrite(buzz, LOW);
}
//********************************DISPALAY FUNCTION!!!***********************************************************//
void displayscreen()
{

lcd.setCursor(0,0);
lcd.println("*ENTER THE CODE*");
lcd.setCursor(1 ,1);

lcd.println("TO _/_ (OPEN)!!");
}
//*************************** ARM SERVO****************************************************************************//
void armservo()
{

for (pos=180;pos<=180;pos+=50)
{
myservo.write(pos);
delay(5);
}
delay(5000);

for(pos=180;pos>=0;pos-=50)
{
myservo.write(pos);
}

}
//********************************UNLOCK BUZZ***********************************//
void unlockbuzz()
{

digitalWrite(buzz, HIGH);
delay(80);
digitalWrite(buzz, LOW);
delay(80);
digitalWrite(buzz, HIGH);
delay(80);
digitalWrite(buzz, LOW);
delay(200);
digitalWrite(buzz, HIGH);
delay(80);
digitalWrite(buzz, LOW);
delay(80);
digitalWrite(buzz, HIGH);
delay(80);
digitalWrite(buzz, LOW);
delay(80);
}

//*******************************COUNTER BEEP*************************************//
void counterbeep()
{
delay(1200);


lcd.clear();
digitalWrite(buzz, HIGH);

lcd.setCursor(2,15);
lcd.println(" ");
lcd.setCursor(2,14);
lcd.println(" ");
lcd.setCursor(2,0);
delay(200);
lcd.println("GET IN WITHIN:::");

lcd.setCursor(4,1);
lcd.print("5");
delay(200);
lcd.clear();
lcd.setCursor(2,0);
lcd.println("GET IN WITHIN:");
digitalWrite(buzz,LOW);
delay(1000);
//2
digitalWrite(buzz, HIGH);
lcd.setCursor(2,0);
lcd.println("GET IN WITHIN:");
lcd.setCursor(4,1); //2
lcd.print("4");
delay(100);
lcd.clear();
lcd.setCursor(2,0);
lcd.println("GET IN WITHIN:");
digitalWrite(buzz,LOW);
delay(1000);
//3
digitalWrite(buzz, HIGH);
lcd.setCursor(2,0);
lcd.println("GET IN WITHIN:");
lcd.setCursor(4,1); //3
lcd.print("3");
delay(100);
lcd.clear();
lcd.setCursor(2,0);
lcd.println("GET IN WITHIN:");
digitalWrite(buzz,LOW);
delay(1000);
//4
digitalWrite(buzz, HIGH);
lcd.setCursor(2,0);
lcd.println("GET IN WITHIN:");
lcd.setCursor(4,1); //4
lcd.print("2");
delay(100);
lcd.clear();
lcd.setCursor(2,0);
lcd.println("GET IN WITHIN:");
digitalWrite(buzz,LOW);
delay(1000);
//
digitalWrite(buzz, HIGH);
lcd.setCursor(4,1);
lcd.print("1");
delay(100);
lcd.clear();
lcd.setCursor(2,0);
lcd.println("GET IN WITHIN::");
digitalWrite(buzz,LOW);
delay(1000);
//5
digitalWrite(buzz, HIGH);
delay(40);
digitalWrite(buzz,LOW);
delay(40);
digitalWrite(buzz, HIGH);
delay(40);
digitalWrite(buzz,LOW);
delay(40);
digitalWrite(buzz, HIGH);
delay(40);
digitalWrite(buzz,LOW);
delay(40);
digitalWrite(buzz, HIGH);
delay(40);
digitalWrite(buzz,LOW);
lcd.clear();
lcd.setCursor(2,0);
lcd.print("RE-LOCKING");
delay(500);
lcd.setCursor(12,0);
lcd.print(".");
delay(500);
lcd.setCursor(13,0);
lcd.print(".");
delay(500);
lcd.setCursor(14,0);
lcd.print(".");
delay(400);
lcd.clear();
lcd.setCursor(4,0);
lcd.print("LOCKED!");
delay(440);
}
//*****************************TORTURE1****************************************//
void torture1()
{
delay(1000);
lcd.clear();
lcd.setCursor(2,0);
lcd.print("WAIT FOR ");
lcd.setCursor(5,1);
lcd.print("15 SECONDS");
digitalWrite(buzz, HIGH);
delay(15000);
digitalWrite(buzz, LOW);
lcd.clear();
lcd.setCursor(2,0);
lcd.print("LOL..");
lcd.setCursor(1,1);
lcd.print(" HOW WAS THAT??");
delay(3500);
lcd.clear();

}
//******************************TORTURE2*****************************************//
void torture2()
{
delay(1000);
lcd.setCursor(1,0);
lcd.print(" ");
lcd.setCursor(2,0);
lcd.print("EAR DRUMS ARE");
lcd.setCursor(0,1);
lcd.print(" PRECIOUS!! ");
delay(1500);
lcd.clear();
lcd.setCursor(1,0);
lcd.print(" WAIT FOR");
lcd.setCursor(4,1);
lcd.print(" 1 MINUTE");
digitalWrite(buzz, HIGH);
delay(55000);
counterbeep();
lcd.clear();
digitalWrite(buzz, LOW);
lcd.setCursor(2,0);
lcd.print("WANT ME TO");
lcd.setCursor(1,1);
lcd.print("REDICULE MORE??");
delay(2500);
lcd.clear();
lcd.setCursor(2,0);
lcd.print("Ha Ha Ha Ha");
delay(1700);
lcd.clear();
}

ADVANTAGES & LIMITATIONS 

ADVANTAGES

  • This project provides security.
  • Power consumption is less.
  • Used commonly available component.
  • Circuit diagram is simple and easy.
  • Easy to use and setup.
  • Storage of up to 200 fingerprints.
  • Generally it is used in ATM, fingerprint car and home door lock etc for security.

LIMITATIONS  

The limitations of fingerprint based door lock system are:

  • Different biometric technologies need the use of different devices that have a range of cost.
  • Entry and delete fingerprints need to operate multiple steps, the program is too much trouble, convenience is not enough.
  • Performance can be fluctuate to dry, wet, dirty fingers.
  • Population coverage may be a problem with old age people or people with skin disease.

APPLICATIONS

  • Used in Banks and Offices to secure the vaults door or simply for residential houses door lock system.
  • Fingerprint security system can be used in ATM, fingerprint operated Vehicles.
  • Can be used for voter ID registration.

FUTURE IMPROVEMENTS

Advancements in bio metric identification management technology are moving so fast, In future we will make advancement and multi functions like sms alert if authorized person try to lock the door .Image recognizing process system and password system based. Also eyes retina for password which helps authorized persons for authentication for entrance so bio metric technology makes individual convenient in real life. so, fingerprint based door lock system need more improvements.

PROBLEM FORMULATION

  • The fingerprint will not work when it is dirty or wait finger.
  • “Module not detected” problem may occur which can be easily solved by resetting using reset button.

CONCLUCSION

Fingerprint door locks are great investment for home or business. It provides great security by providing restrictions to unwanted access. This device increases level of security by adding unique biological features of authorized person. For anyone who wants more security to their homes, fingerprint based door lock system are best choice.

YOUTUBE LINK

THIS PROJECT IS DONE BY:

Saroj Singh

Randhir Thakur
Ranjan Kumar Yadav
Suresh Kumar Mandal
Sunil Kumar Patel
Shivcharan Kumar Mahato

UNDER THE SUPERVISION OF

ER. RABIN POUDEL

Recommended For You

About the Author: admin

2 Comments

  1. Hi there, MegaCool blog mate, I really loved this page. I’ll be sure to talk about this to my cousin who would, odds are, love to check out this post too. Found this sites post through the Bing search engine by the way, incase you were curious. Many thanks for the wonderful read!

  2. Hello sir, mujhe FINGERPRINT BASED DOOR LOCK SYSTEM USING ARDUINO project chaiye..
    Kya woh mujhe mil sakta hai?

Leave a Reply

Your email address will not be published.