R307 Digital fingerprint reader sensor
Digital fingerprint reader
The biometric fingerprint sensor is ideal to create a system capable of protecting what you require through the analysis of your fingerprint. The device works with the serial protocol, so it can be used with any microcontroller (arduino etc..) or development card.
The device has the capacity to store up to 162 fingerprints in its internal FLASH memory. The device’s LED lights up every time it is taking pictures for fingerprints.
- -Model: r307 Supply voltage: 5V
- -Operation current: 100mA-150mA
- – Fingerprint parity mode: 1: 1 1: n
- -Baud rate: 9600 * NN = 1 to 12 (Default is 6)
- -Acquisition time less than 1 second
- -5 Security levels
- -Window dimension: 14x18mm
- -Working environment: -10 º c to 40 º c (Relative Humidity 40% to 85%)
- -Dimensions: 5.5 x 2.1 x 2.0 cm Weight: 22g
To be able to use the device, it is necessary to save the fingerprints in its database. These footprints are assigned an ID. Subsequently, the reading and comparison sequence can be started to verify the fingerprints of the users and thus be able to discern and execute actions based on the result.
what is inside in R307 fingerprint sensor
LEDs and touch sense pad
TTP233D IC
Remove the cap to see the prism
Image sensor
Fingerprint cross Section
Schematic & circuit
First we proceed to download the library for Arduino from the following link:
https: //github.com/Adafruit/Adafruit-fingerprint-S …
Once downloaded, the library is unzipped and saved in: C: Program Files (x86) Arduino libraries It is necessary to rename the library folder in case the “.cpp” file is found with a different name is in it.
The sensor works at 57600 baud, it can be configured but this is the default speed, when using serial, the arduino uses the software serial library.
- #include <SoftwareSerial.h>
If it is required to change pins, the serial by software can be done in the following instruction:
- MySerial SoftwareSerial (2, 3);
For the example of the fingerprint, if the arduino is required to execute an action after having found a fingerprint, it is necessary to indicate it in this section of code:
- Serial.Print (“found ID #”);
- Serial.Print (Finger.fingerID);
- Serial.Print (“with confidence”);
- Serial.println (Finger.Confidence); Write the code here return finger.fingerID;
We open the Arduino Serial Monitor to start recording the tracks and follow the instructions:
We save the first fingerprint in position 1 and then we give it enter and follow the instructions:
If the fingerprint was registered correctly, it will show the message “Fingerprint DOES match!”, followed by the position where it was saved and the message “Registered!”
To save more than one fingerprint, the sensor allows up to 162 fingerprints, we now retype the number of the next position where we want to save it, which in this example would be position 2, we type 2 and press enterand continue again the same instructions until all the necessary footprints are recorded, always indicating a different position so that one already saved is not overwritten.
Finally we load the final program that will read the fingerprints. If the fingerprint read matches one of those stored, the relay that is connected to Pin 13 of the Arduino will be activated for 3 seconds
Code#include
int getFingerprintIDez();
// pin #2 is IN from sensor (GREEN wire)
// pin #3 is OUT from arduino (WHITE wire)
SoftwareSerial mySerial(2, 3);
Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial);
void setup()
{
Serial.begin(9600);
Serial.println(“fingertest”);
pinMode(13, OUTPUT);
digitalWrite(13, LOW);
// 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);
}
Serial.println(“Waiting for valid finger…”);
}
void loop() // run over and over again
{
getFingerprintIDez();
delay(50); //don’t ned to run this at full speed.
}
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);
}
// 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;
// found a match!
Serial.print(“Found ID #”); Serial.print(finger.fingerID);
Serial.print(” with confidence of “); Serial.println(finger.confidence);
digitalWrite(13, HIGH);
delay(3000);
digitalWrite(13, LOW);
return finger.fingerID;
}
#include
#include
int getFingerprintIDez();
// pin #2 is IN from sensor (GREEN wire)
// pin #3 is OUT from arduino (WHITE wire)
SoftwareSerial mySerial(2, 3);
Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial);
void setup()
{
Serial.begin(9600);
Serial.println(“fingertest”);
pinMode(13, OUTPUT);
digitalWrite(13, LOW);
// 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);
}
Serial.println(“Waiting for valid finger…”);
}
void loop() // run over and over again
{
getFingerprintIDez();
delay(50); //don’t ned to run this at full speed.
}
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);
}
// 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;
// found a match!
Serial.print(“Found ID #”); Serial.print(finger.fingerID);
Serial.print(” with confidence of “); Serial.println(finger.confidence);
digitalWrite(13, HIGH);
delay(3000);
digitalWrite(13, LOW);
return finger.fingerID;
}
Step 9: NextPCB PCB Manufacturers CompanyThanks so much NextPCB for sponsor this project. Nextpcb offer For New Customer, Your First Order Will Be 10 PCBs for just $0 at Free.
NextPCB one of the world's most professional PCB manufacturers based in China. With professional PCB manufacturing capabilities, for each file of our customer will be double-checked by more than 14 years PCB engineers. they handle the whole process of PCBs including the PCB assembly ,PCB manufacturing, testing and final shipment.
GET $100 Coupan For 1st Order :- Sign up on Nextpcb
NextDFM Software
What is NextDFM?
NextDFM is a professional and efficient PCB design checker for PCB manufacturing, it is an accurate Impedance calculator, simpler than SI9000, corrects PCB Design issues automatically with just one click, and users could panelize PCB in simulation view, which could help users accurately locate and correct design hazards in advance, provide optimization solutions, prevent quality defects and reach the goal of reducing cost and improving efficiency.
1. Easy to Use
To upload files, you just need to drag the file into the software.
2. One-click PCB file checker
NextDFM can analyze the common problems of design with just one click. For Gerber files, NextDFM software can not only automatically recognize the layer type, file format, and alignment, but also can accurately locate the problems and offer the solution to optimize the problems with a combination of design-side problems, production-side problems, factory capabilities, and price factors.
4. Instant quote
Real-time quotation based on the analyzed data of our will show the details of the price and the lead time, which enables users could easily predict the cost and delivery time in PCB design.
Comments