ARDUINO FINGERPRINT SCANNER WITH 16X2 LCD
Intro: ARDUINO FINGERPRINT SCANNER WITH 16X2 LCD
this instructable is based and inspired by Arduino LCD tutorial and fingerprint scanner from Adafruit (http://www.adafruit.com/product/751). I have added 16x2 LCD into the fingerprint to be able to see the status of the process of fingerprint scanning.
this is my first instructable, you are very welcome to comment and share.
materials:
Arduino Uno
16x2 LCD
fingerprint sensor
10k potentionmeter
220ohms resistor = 3pcs
red LED
green LED
jumper wires
breadboard
future improvements to be carried out:
1. auto shutdown when no input is detected within specified time to save power.
2. wake up function
3. integrate more sensor or inputs to activate finger scanning within predetermined scenario
4. use actuator to use for an application
STEP 1: Enrolling the Fingerprint and Connecting the FPS Sensor and LCD
please follow the instructions given from adafruit tutorial http://www.adafruit.com/product/751 on how to connect the fingerprint sensor to the arduino during enrollment process. download the software for windows and install in your computer. enrolling the fingerprint using the software makes the process a lot easier.
make sure to add the adafruit library to your arduino library.
go to http://arduino.cc/en/Tutorial/LiquidCrystalSerial for tutorial of the LCD and the instructions on how to connect the components.
STEP 2: Load the Fingerprint Sketch With LCD Sketch
copy and paste the codes below which i had modified in order to accommodate fingerprint scanning and display the results on LCD.
/***************************************************
This is an example sketch for our optical Fingerprint sensor
Designed specifically to work with the Adafruit BMP085 Breakout ----> http://www.adafruit.com/products/751
These displays use TTL Serial to communicate, 2 pins are required to interface Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit!
Written by Limor Fried/Ladyada for Adafruit Industries. BSD license, all text above must be included in any redistribution ****************************************************/
/**********************MODIFIED BY PELEGREN of bedRoonics Labs**********************************/
/********************** ARDUINO FINGERPRINT SCANNER with 16x2 LCD monitor***************/
#include
#include
#include
#include
int getFingerprintIDez();
// pin #2 is IN from sensor (GREEN wire)
// pin #3 is OUT from arduino (WHITE wire)
SoftwareSerial mySerial(2, 3);
LiquidCrystal lcd(9, 8, 7, 6, 5, 4); // initialize the library with the numbers of the interface pins
Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial);
void setup()
{ Serial.begin(9600); // initialize the serial communications:
lcd.begin(16,2); lcd.setCursor(0,0); lcd.print("Scan your finger");
pinMode(13,OUTPUT);
pinMode(12,OUTPUT);
pinMode(11, OUTPUT);
pinMode(A0, INPUT);
finger.begin(57600); // set the data rate for the sensor serial port }
void loop() // run over and over again
{
getFingerprintID();
delay(100);
digitalWrite (13,HIGH);
}
uint8_t getFingerprintID()
{ uint8_t p = finger.getImage();
switch (p)
{
case FINGERPRINT_OK:
lcd.clear();
lcd.print(" Image taken... ");
delay(1000);
break;
case FINGERPRINT_NOFINGER:
return p;
case FINGERPRINT_PACKETRECIEVEERR:
return p;
case FINGERPRINT_IMAGEFAIL:
return p;
default:
return p; }
// OK success!
p = finger.image2Tz();
switch (p) {
case FINGERPRINT_OK:
break;
case FINGERPRINT_IMAGEMESS:
return p;
case FINGERPRINT_PACKETRECIEVEERR:
return p;
case FINGERPRINT_FEATUREFAIL:
return p;
case FINGERPRINT_INVALIDIMAGE:
return p;
default:
return p; }
// OK converted!
p = finger.fingerFastSearch();
if (p == FINGERPRINT_OK)
{
lcd.clear();
lcd.print(" Found match! ");
digitalWrite(11, HIGH);
delay(1000);
digitalWrite(11,LOW); // turn on green LED to indicate match
}
else if(p == FINGERPRINT_NOTFOUND)
{
lcd.clear();
lcd.setCursor(0,0);
lcd.print(" Did not match! ");
delay(1000);
lcd.clear();
lcd.setCursor(0,0);
lcd.print(" scan finger! ");
return p;
}
else
{ return p; }
// IF FOUND A MATCH............
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Found ID #");
lcd.print(finger.fingerID);
lcd.setCursor(0,1);
lcd.print("confidence ");
lcd.print(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!
digitalWrite(13, LOW);
delay(10);
digitalWrite(13, HIGH);
delay(10);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Found ID # ");
lcd.print(finger.fingerID);
lcd.setCursor(0, 1);
lcd.print("confidence ");
lcd.print(finger.confidence);
return finger.fingerID;
}
75 Comments
ibenkos 9 years ago
I realy want to build this!!! :) but do you have a picture of the schematics , I don't know how to build it
pelegren 9 years ago
i am happy you are inspired by this. i will add the schematics which i missed to do. thank you.
chrisjarboe 6 years ago
great project. was wondering if you had a chance to upload the revised edition? thanks in advance
ibenkos 9 years ago
thank you :)
pelegren 9 years ago
this is the connection when enrolling the fingerprint. please follow the instructions given by adafruit.. https://learn.adafruit.com/adafruit-optical-finger...
snreddy715 8 years ago
i am getting error while enrolling finger print..i am getting following error.
Arduino: 1.5.5 (Windows 7), Board: "Arduino Duemilanove or Diecimila, ATmega328"
enroll:26: error: 'Adafruit_Fingerprint' does not name a type
enroll.ino: In function 'void setup()':
enroll:34: error: 'finger' was not declared in this scope
enroll.ino: In function 'uint8_t getFingerprintEnroll(uint8_t)':
enroll:64: error: 'FINGERPRINT_OK' was not declared in this scope
enroll:65: error: 'finger' was not declared in this scope
enroll:67: error: 'FINGERPRINT_OK' cannot appear in a constant-expression
enroll:70: error: 'FINGERPRINT_NOFINGER' was not declared in this scope
enroll:73: error: 'FINGERPRINT_PACKETRECIEVEERR' was not declared in this scope
enroll:76: error: 'FINGERPRINT_IMAGEFAIL' was not declared in this scope
enroll:87: error: 'finger' was not declared in this scope
enroll:89: error: 'FINGERPRINT_OK' was not declared in this scope
enroll:92: error: 'FINGERPRINT_IMAGEMESS' was not declared in this scope
enroll:95: error: 'FINGERPRINT_PACKETRECIEVEERR' was not declared in this scope
enroll:98: error: 'FINGERPRINT_FEATUREFAIL' was not declared in this scope
enroll:101: error: 'FINGERPRINT_INVALIDIMAGE' was not declared in this scope
enroll:112: error: 'FINGERPRINT_NOFINGER' was not declared in this scope
enroll:118: error: 'FINGERPRINT_OK' was not declared in this scope
enroll:121: error: 'FINGERPRINT_OK' cannot appear in a constant-expression
enroll:124: error: 'FINGERPRINT_NOFINGER' was not declared in this scope
enroll:127: error: 'FINGERPRINT_PACKETRECIEVEERR' was not declared in this scope
enroll:130: error: 'FINGERPRINT_IMAGEFAIL' was not declared in this scope
enroll:143: error: 'FINGERPRINT_OK' was not declared in this scope
enroll:146: error: 'FINGERPRINT_IMAGEMESS' was not declared in this scope
enroll:149: error: 'FINGERPRINT_PACKETRECIEVEERR' was not declared in this scope
enroll:152: error: 'FINGERPRINT_FEATUREFAIL' was not declared in this scope
enroll:155: error: 'FINGERPRINT_INVALIDIMAGE' was not declared in this scope
enroll:166: error: 'FINGERPRINT_OK' was not declared in this scope
enroll:168: error: 'FINGERPRINT_PACKETRECIEVEERR' was not declared in this scope
enroll:171: error: 'FINGERPRINT_ENROLLMISMATCH' was not declared in this scope
enroll:180: error: 'FINGERPRINT_OK' was not declared in this scope
enroll:182: error: 'FINGERPRINT_PACKETRECIEVEERR' was not declared in this scope
enroll:185: error: 'FINGERPRINT_BADLOCATION' was not declared in this scope
enroll:188: error: 'FINGERPRINT_FLASHERR' was not declared in this scope
This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
how to rectify this error?
aidenv 7 years ago
Go to Sketch in the menu bar, Include Library, Library Manager, and search Adafruit Fingerprint
Jamie Toeg 7 years ago
You should try downloading the fingerprint scanner library from git hub otherwise the arduino cant make sense of the code. Instructions can be found here https://www.arduino.cc/en/Guide/Libraries
Best regards, Jamie
pelegren 9 years ago
follow this diagram to connect LCD
pelegren 9 years ago
follow this diagram to connect fingerprint sensor for loading of main program
TheRealRocketBurns 9 years ago
This is really cool, but maybe you should upload the code in a file and give s little explanation of it in the actual instructable, so others can modify it.
pelegren 9 years ago
great. thanks for the suggestion. i will work on it and make sure it happens.
Racel19 2 years ago
What kind of adaptor power supply will I use?
HAI2504 4 years ago
Ken Rhomar Olindang 5 years ago
{ uint8_t p = finger.getImage();
^
trial:214: error: expected '}' at end of input
}
^
exit status 1
a function-definition is not allowed here before '{' token
urvashij 5 years ago
superthick 6 years ago
I have a huge question! First I used the instruction video by adafruit to solder the ends of the cables that come with the fingerprint sensor but it seems to always run out of power, it does power on but it just lasts a tenth of a second then turns off. What can I do about the cables, is it the breadboard I should change? (but I don't think so) it just doesn't show the blue light!
kwemboi eric 6 years ago
just wanted to talk about the finger print module hanging off this is just because the power supplied by the arduino being very little to power the whole of your circuit and what i would recommend you to do is that????????????
Build a stable power supply circuitthat will enable you to power your fingerprint module..
thank me later when it works out
superthick 6 years ago
I made it work!! but it came up with this compilation error:
Arduino:1.6.11 (Windows 7), Tarjeta:"Arduino/Genuino Uno"
C:\Users\BERNA\Documents\Arduino\yo\enroll\enroll.ino: In function 'void setup()':
enroll:48: error: a function-definition is not allowed here before '{' token
{
^
enroll:60: error: a function-definition is not allowed here before '{' token
{ uint8_t p = finger.getImage();
^
enroll:226: error: expected '}' at end of input
}
^
exit status 1
a function-definition is not allowed here before '{' token
Este reporte podría tener más información con
"Mostrar salida detallada durante la compilación"
opción habilitada en Archivo -> Preferencias.
215198669 6 years ago
How can i store the fingerprint image on Mysql database and retrive them again and check the exitance of the fingerprint on the database using the library