Interfacing Fingerprint Sensor with Arduino for Biometric Security System

//Interfacing Fingerprint Sensor with Arduino for Biometric Security System

Interfacing Fingerprint Sensor with Arduino for Biometric Security System

Introduction

In this project, we will connect the fingerprint sensor with Arduino for the biometric security system. As a fingerprint module we use the fingerprint scanner module R305. Security is a major concern in our daily lives, and digital barriers have become an important part of these security systems. The fingerprint sensor is one of the safest door locking systems because it allows you to identify and distinguish each person individually and accurately. In addition, the module is very small and can be stored anywhere. With portability and lower power consumption, you can take it anywhere.

R305 Fingerprint Scanner Sensor Module

This is a fingerprint sensor module with TTL-UART interface for direct connection to the microcontroller UART or PC via the MAX232 / USB-Serial adapter. The user can store the fingerprint data in the module and configure it in 1: 1 or 1: N mode to identify the person.

Interface fingerprint sensor with Arduino

The fingerprint module can be connected directly to any microcontroller as well as to the Arduino board. This optical biometric fingerprint reader with outstanding features can be integrated into a variety of finished products, such. B. an access control system, a presence system, a safe and a car door lock system.

Features

  1. Integrated set of image collection and algorithm chip, ALL-in-One
  2. The fingerprint reader can perform a secondary development and be integrated into various end products.
  3. Low power consumption, low cost, small size, excellent performance
  4. Professional optical technology, precise module manufacturing techniques
  5. Good image processing capabilities can successfully capture an image with a resolution of 500 dpi.

Specifications

  1. Type of fingerprint sensor: Optical
  2. Life of the sensor: 100 million times
  3. Static displays: 15KV backlight: light green
  4. Interface: USB1.1 / UART (TTL logic level)
  5. RS232 communication rate: 4800BPS ~ 115200BPS modifiable
  6. Dimension: 55 * 32 * 21.5 mm
  7. Image capture area 15-18 (mm)
  8. Verification speed: 0.3 s
  9. Scanning speed: 0.5 s
  10. Character file size: 256 bytes
  11. Size of the model: 512 bytes
  12. Storage capacity: 250
  13. Security level: 5 (1,2,3,4,5 (the highest))
  14. Incorrect acceptance rate (FAR): 0.0001%
  15. Wrong rejection rate: 0.1%
  16. Resolution 500 DPI
  17. Voltage: 3.6-6.0 VDC
  18. Operating current: typically 90mA, peak 150mA
  19. Correspondence method: 1: N
  20. Operating temperature: -20 to 45 ° C

Interface fingerprint sensor with Arduino for the biometric security system

Required components

  1. Arduino UNO Board
  2. Fingerprint Module R305
  3. Push Button -4
  4. LED -2
  5. 330E Resistance -2
  6. 5V Power Supply
  7. Connecting Wires
  8. Servomotor -1
  9. LCD 16×2 -1
  10. Breadboard -1

Circuit Diagram

Working Explanation

The working of the Fingerprint Sensor based Biometric Security System is easy. In this project we have used a Servo motor SG90 which acts as a rotatary access to door unlocking. We have used 2 LEDs, one as green LED and other the red LED which acts as access granted and access denied indicator. We have interfaced 16*2 LCD which displays everything whenever the finger is placed or removed, or gate is opened or gate is closed or finger is matched or not.

We have used 4 push buttons which are used to control the entire system. The functions of each buttons are:
1. Enroll/Back Button – Used for enrolling new finger print as well as reversing the back process or going back
2. DEL/OK Button – This Button is used for deleting the earlier stored finger print system as well as granting access as OK selection.
3. UP/Match – Used for moving forward while selecting the memory location for storing or deleting fingerprint.
4. DOWN/Match Button – Used for moving backward while selecting memory location for storing or deleting fingerprint.

Enrolling New Fingerprint

To enroll New Fingerprint Click on Enroll Button. Then select the memory location where you want to store your fingerprint using UP/DOWN button. Then click on OK. Put your finger and remove your finger as the LCD instructs. Put your finger again. So finally your fingerprint get stored.

Deleting Stored Fingerprint

To delete the fingerprint which is already click on DEL Button. Then select the memory location where your fingerprint was stored earlier using UP/DOWN button. Then click on OK. So finally your fingerprint is deleted.

Checking the working with the help of different fingers

Simply click on MATCH button. Put your fingers over the scanner. If your fingerprint is matched the door will be opened and if not match you will see LCD indicating Please! Try Again.


Video Demonstration

If you are facing problem with the above explanation the you can simply follow this video guide that will help you to understand easily. Here we have explained all about Interfacing Fingerprint Sensor with Arduino for Biometric Security System.


Arduino Source Code

Simply copy this code and upload it to your arduino UNO Board using Arduino IDE. There are some library files you need to add to arduino library before making it work. Else the code won’t compile. Similarly the code doesn’t compile with earlier old version of Arduino IDE as older Arduino IDE has some array issue. So use latest version of Arduino IDE for compiling the code. So you will be simply Interfacing Fingerprint Sensor with Arduino for Biometric Security System

#include<LiquidCrystal.h>
LiquidCrystal lcd(13,12,11,10,9,8);
#include <SoftwareSerial.h>
SoftwareSerial fingerPrint(2, 3);
#include<Servo.h>

Servo myServo;

#include <Adafruit_Fingerprint.h>
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();
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(" 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);
}

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");
return;
}
}

// 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;
}
}
By |2018-11-29T22:56:27+00:00November 22nd, 2018|Arduino|0 Comments

You May Like




Author

Posted by
This author has not yet filled in any details.
So far the author has created 4 blog entries.
November 22nd, 2018

Recent Posts

Categories

For You

%d bloggers like this: