The fingerprint is one of the safest way to detect and identify the authorized person, We know that fingerprint is unique even identical twins do not have identical fingerprints. By using this we can make pretty sure about security needs. To add fingerprint verification in microcontroller projects, we can use this all in one optical fingerprint sensor-scanner (R305), It makes fingerprint detection and verification super simple. By using this sensor we can make bio-metric authentication and access control-based electronic projects easily.
In this project, I have come with a idea that can be used to secure your logins through fingerprint authentication. It is an interesting Arduino project which is using a fingerprint module. Without any delay, let's get started.
Gather the Parts:- Fingerprint Sensor (R305)
- Arduino Uno
- Arduino Pro Micro
1. Fingerprint Sensor (R305)
TTL UART is a fingerprint sensor module with TTL UART interface. The user can store the fingerprint data in the module and can configure it in 1:1 or 1:N mode for identifying the person. The fingerprint module can directly interface with 3v3 or 5v microcontroller.
Pin out:
2. Arduino Uno:
Here I have used Arduino Uno for enrolling the fingerprint through SFGDemo software.
3. Arduino Pro Micro:
The Micro is a microcontroller board based on the ATmega32U4. This allows the Micro to appear to a connected computer as a mouse and keyboard,
So I have taken advantage of this feature of pro micro to get input from fingerprint and match the fingerprint With already loaded fingerprints to perform different keyboard operation.
- To read fingerprint through windows system we need special GUI software called “SFGdemo”.
- Arduino IDE
The following library is required for this project:
Download SFGdemo Software and Adafruit Fingerprint Sensor Library
--> Install Adafruit Fingerprint Sensor Library
The Fingerprint Identification Process:The fingerprint identification process has two steps that are:
- Enrolling Fingerprint
- Matching Fingerprint
These two steps make the microcontroller/system to authenticate right fingerprint.
Operation Principle
Fingerprint processing includes two parts: fingerprint enrollment and fingerprint matching (the matching can be 1:1 or 1:N). When enrolling, user needs to enter the finger two times. The system will process the two time finger images, generate a template of the finger based on processing results and store the template. When matching, user enters the finger through optical sensor and system will generate a template of the finger and compare it with templates of the finger library. For 1:1 matching, system will compare the live finger with specific template designated in the Module; for 1:N matching, or searching, system will search the whole finger library for the matching finger. In both circumstances, system will return the matching result, success or failure.
Enrolling Fingerprints:Connect the blue wire from the sensor to Arduino RX pin and yellow wire to Arduino TX pin. Put red & black in (+5V & GND) respectively.
After the wiring, upload the following sketch to Arduino Uno board.
// Red connects to +5V
// Black connects to Ground
// Blue goes to Digital 0(RX)
// Yellow goes to Digital 1(TX)
void setup()
{
}
void loop()
{
}
To read fingerprint through windows system we need special GUI software called “SFGdemo".
After loading the above code open the “SFGdemo” software.
- Select "Open Device(O)" and select corresponding Arduino Uno's Port Number:
- Click on enroll, then set your user address:
- Then the software asks you to put your fingers two times to enroll. If it is success, it shows as success to enroll!
- Add more fingers as per your requirement.
Connect blue wire(RX) to pin number 10 and connect yellow (TX)wire to pin number 16.
- After the wiring, upload the following sketch to Arduino Pro Micro
You can get codes from my github too.
#include <Adafruit_Fingerprint.h>
#include <SoftwareSerial.h>
#include <Keyboard.h>
int getFingerprintIDez();
//Connecting the Fingerprint Senosor to the Micro :
//please refer internet to find pinout of fingerprint sensor model ,if you find different color wire than specified below
//Pin #10/RX (Blue wire from sensor)
//Pin #16/TX (Yellow wire from sensor )
SoftwareSerial mySerial(16, 10); // (TX,RX)
Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial);
void setup()
{
finger.begin(57600);
if (finger.verifyPassword()) {
Serial.println("Found fingerprint sensor! Your computer is locked now!");
} else {
Serial.println("Did not find fingerprint sensor :(");
}
Serial.println("Waiting for valid finger...");
}
void loop()
{
getFingerprintIDez();
delay(0);
}
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;
}
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;
}
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;
}
Serial.print("Found ID #"); Serial.print(finger.fingerID);
Serial.print(" with confidence of "); Serial.println(finger.confidence);
}
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;
//Enter your passwords here
//
if(finger.fingerID==0)
Keyboard.print("p@sSw0Rd");
Keyboard.press(0xB0); // refer https://www.arduino.cc/en/Reference/KeyboardModifiers
Keyboard.releaseAll();
//Here you can add more code
//for example see below code
//if(finger.fingerID==1)
//Keyboard.print("Em@1LpASSw0RD");
//Keyboard.press(0xB0);
//Keyboard.releaseAll();
return finger.fingerID;
}
Watch the Video!I have made an enclosure using foam board and insulation tape. You can build one as you wish.
The video shows how you can bypass your PC lock and email through your fingerprints instead of typing it.
Happy making!
Comments