Loading...

Thursday, March 04, 2021

Biometric Door Lock Security System Using Arduino & Fingerprint sensor R307

INTRODUCTION

Hey Friends welcome to “diyprojectslab” In this tutorial, I’ll show you how to make “Biometric Door Lock Security System Using Arduino Uno & Fingerprint Sensor R307.” The Biometric security system is designed using Arduino uno & fingerprint sensor R307 where once the correct finger ID is placed, the door will get open and concerned person is allow access to enter.
Biometric security system use Arduino Uno as a microcontroller where a finger ID will act as a door unlocking system or a key. One of the distinct features of these intelligent lock system is their simplicity which allows you to enroll new finger ID as to delete ID’s as per operator requirement. This system consists of electronic control assembly, which controls the servomotor while correct fingerprint id is placed. The example of this output can be a motor or solenoid lock or any other mechanical or electrical load. Here, we made a Biometric locks system using Arduino Uno, which provides control to the door locking system which is servomotor. It is a simple system with take input from finger print sensor and the output give command to servo motor to lock/unlock. This system demonstrates a Biometric security system to doors, control panel or bank lockers using Arduino. Where a once correct finger ID is entered, the door lock is get opened, and the concerned person/operator is allowed to access to enter. If another person arrives whose finger id is not stored in system the system will ask to place finger again. If the finger ID is wrong, then door would remain locked, and restrict that person to access. Here is a unique feature which increase your security by removing unwanted person finger id. The system provides you to delete the finger id using setting buttons. There are 4 setting buttons which gives you full control to customize the system. 
1. Enroll & Back :-This button used for enrolling new fingerprint as well as reversing the back process or going back. 
2. Delete & Ok :- This Button is used for deleting the stored fingerprint in system like a unwanted person finger id which helps you in feature as well as this button used to grant access as the OK selection. 
3. Up & Match :-This Button is used for moving forward while selecting the memory location for storing or deleting fingerprint id. 
4. Down & Match :- This button used for moving backwards whiles selecting memory location for storing or deleting fingerprint id.
 
Follow Me On :-

| YOUTUBE | INSTAGRAM | FACEBOOK | INSTRUCTABLES | DAILYMOTION | HACKSTER |

MATERIAL REQUIRED

  1. Arduino Uno x 1
  2. Fingerprint Sensor x 1
  3. Servomotor sg-90 x 1
  4. LCD Display (16×2) x 1
  5. Green led x 1
  6. Red led x 2
  7. Resistor (1K) x 3
  8. Potentiometer (10K) x 1
  9. Male-Female berge strips x 1nos
  10. Capacitor (220uf) x 1
  11. 12V DC jack socket x 1
  12. 1-Sides PCB Board x 1
  13. Push Buttons x 4
  14. PCB etching kit x 1
  15. Soldering kit x 1
  16. Adapter x 1

CIRCUIT DIAGRAM

Follow the above Circuit diagram to make connections.
Download following 3 files which contains circuit diagram & PCB Layout.

ARDUINO CODE

/*
* Hello Friends Welcome To Techno-E-Solution
* Here Is Code For Bio-Metric Security System
*/

#includeLiquidCrystal lcd(13,12,11,10,9,8);
#include
SoftwareSerial fingerPrint(2, 3);
#include
Servo myServo;
#include
uint8_t id;
Adafruit_Fingerprint finger = Adafruit_Fingerprint(&fingerPrint);
#define enroll 14
#define del 15
#define up 16
#define down 17
#define openLight 6
#define closeLight 7
#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(openLight, OUTPUT);
pinMode(closeLight, OUTPUT);
lcd.begin(16,2);
lcd.print(" BIOMETRIC ");
lcd.setCursor(0,1);
lcd.print("SECURITY SYSTEM");
delay(2000);
lcd.clear();
lcd.print("TechnoEsolution");
delay(2000);
finger.begin(57600);
Serial.begin(9600);
lcd.clear();
lcd.print("Finding Module");
lcd.setCursor(0,1);
delay(1000);
if (finger.verifyPassword())
{
Serial.println("Found fingerprint sensor!");
lcd.clear();
lcd.print("Found Module ");
delay(1000);
}
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("Press UP/Down ");
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("Gete 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(1000);
}
void checkKeys()
{
if(digitalRead(enroll) == 0)
{
lcd.clear();
lcd.print("Please Wait");
delay(1000);
while(digitalRead(enroll) == 0);
Enroll();
}
else if(digitalRead(del) == 0)
{
lcd.clear();
lcd.print("Please Wait");
delay(1000);
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;
}
————————————————————————————–
Simply Copy the above code & upload to the arduino uno.
Add following libraries in your Arduino IDE :-
1. Adafruit_Fingerprint.h
2. Servo.h
3. SoftwareSerial.h
4. LiquidCrystal.h

SETTINGS

Enroll New FInger ID :- 

1.Press Enroll button.
2.Use Up Button To Change Location from 1 to 127 to store finger ID.
3.Place Finger on sensor.
4.Again place same finger on sensor. We need to place finger twice beacause R307 sensor works on 1:1 ratio.
5.LCD Shows Finger ID Stored !

Delete Finger ID :- 

1.Press Delete Button.
2.Use Up or Down button to locate finger ID Location.
3.Then press OK Button.
4.LCD print Finger ID delete successfully.

Open Door Lock :- 

1.Press Match button.
2.Place Finger On Sensor.
3.Servomotor rotate  & wait for  3-4 seconds & it’ll get automatically lock.

DEMONSTRATION

I hope you like this video.
Follow Me On :-
| YOUTUBE | INSTAGRAM | FACEBOOK | INSTRUCTABLES | DAILYMOTION | HACKSTER |

Leave a Reply

Your email address will not be published. Required fields are marked *