Fingerprint enrollment (Enroll) is registering human fingerprint on fingerprint sensor with Arduino and LCD display. The registration data is stored using a unique ID stored on the memory of the fingerprint sensor.
Hardware Requirement
- Arduino Uno Board
- Fingerprint Sensor (Unknown Type)
- LCD 16*2
- 3 Push Button
- Power supply +5 Volt
- Jumper
Schematic
Arduino - Fingerprint Sensor Wiring
Arduino - LCD Wiring
Arduino - Buttons Wiring
Source Code/Sketch
#include <Adafruit_Fingerprint.h>
#include <SoftwareSerial.h>
#include <LiquidCrystal.h> INKUBATEK
LiquidCrystal lcd(8, 9, 10, 11, 12, 13);
uint8_t id;
uint8_t getFingerprintEnroll();
// 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(){
pinMode(4, INPUT);
pinMode(5, INPUT);
pinMode(6, INPUT);
digitalWrite(4, HIGH);
digitalWrite(5, HIGH);
digitalWrite(6, HIGH);
delay(500);
lcd.begin(16, 2);
lcd.clear();
lcd.print(" Pendaftaran");
lcd.setCursor(0,1);
lcd.print(" sidk jari");
delay(2000);
lcd.clear();
lcd.print("Test Koneksi");
// set the data rate for the sensor serial port
finger.begin(57600);
if (finger.verifyPassword()) {
lcd.setCursor(0,1);
lcd.print("OK !");
} else {
lcd.setCursor(0,1);
lcd.print("ERROR !");
while (1);
}
delay(2000);
}
void readnumber() {
while(digitalRead(6)){
if(digitalRead(4)==0){
id++;
delay(300);
}
if(digitalRead(5)==0 && id > 0) {
id--;
delay(300);
}
lcd.setCursor(6, 1);
lcd.print(id);
}
delay(300);
}
void loop() // run over and over again
{
lcd.clear();
lcd.print("Tentukan no ID");
lcd.setCursor(0, 1);
lcd.print("No ID:");
readnumber();
lcd.clear();
lcd.print("Letakkan Jari ");
delay(2000);
while (! getFingerprintEnroll() );
}
uint8_t getFingerprintEnroll() {
int p = -1;
lcd.clear();
lcd.print("Tunggu Sampai");
lcd.setCursor(0, 1);
lcd.print("No ID:");
lcd.print(id);
lcd.print(" Benar !");
while (p != FINGERPRINT_OK) {
p = finger.getImage();
switch (p) {
case FINGERPRINT_OK:
lcd.clear();
lcd.print("sidik diambil");
break;
case FINGERPRINT_NOFINGER:
break;
case FINGERPRINT_PACKETRECIEVEERR:
lcd.clear();
lcd.print("komunikasi error");
break;
case FINGERPRINT_IMAGEFAIL:
lcd.clear();
lcd.print("sidik error");
break;
default:
lcd.clear();
lcd.print("Error tidak");
lcd.setCursor(0, 1);
lcd.print("diketahui");
break;
}
}
delay(1000);
// OK success!
p = finger.image2Tz(1);
switch (p) {
case FINGERPRINT_OK:
lcd.clear();
lcd.print("konversi sidik");
break;
case FINGERPRINT_IMAGEMESS:
lcd.clear();
lcd.println("sidik kacau");
return p;
case FINGERPRINT_PACKETRECIEVEERR:
lcd.clear();
lcd.print("komunikasi error");
return p;
case FINGERPRINT_FEATUREFAIL:
lcd.clear();
lcd.print("FiturFingerprint");
lcd.setCursor(0, 1);
lcd.print("tidak ditemukan");
return p;
case FINGERPRINT_INVALIDIMAGE:
lcd.clear();
lcd.print("FiturFingerprint");
lcd.setCursor(0, 1);
lcd.print("tidak ditemukan");
return p;
default:
lcd.clear();
lcd.print("Error tidak");
lcd.setCursor(0, 1);
lcd.print("diketahui");
return p;
}
delay(1000);
lcd.clear();
lcd.print("Lepas Jari");
delay(1000);
p = 0;
while (p != FINGERPRINT_NOFINGER) {
p = finger.getImage();
}
lcd.print(" ID:"); lcd.println(id);
p = -1;
lcd.setCursor(0,0);
lcd.print("Letakkan jari lg");
while (p != FINGERPRINT_OK) {
p = finger.getImage();
switch (p) {
case FINGERPRINT_OK:
lcd.clear();
lcd.print("sidik diambil");
break;
case FINGERPRINT_NOFINGER:
break;
case FINGERPRINT_PACKETRECIEVEERR:
lcd.clear();
lcd.print("komunikasi error");
break;
case FINGERPRINT_IMAGEFAIL:
lcd.clear();
lcd.print("sidik error");
break;
default:
lcd.clear();
lcd.print("Error tidak");
lcd.setCursor(0, 1);
lcd.print("diketahui");
break;
}
// OK success!
delay(1000);
lcd.clear();
p = finger.image2Tz(2);
switch (p) {
case FINGERPRINT_OK:
lcd.print("konfersi sidik");
break;
case FINGERPRINT_IMAGEMESS:
lcd.print("sidik kacau");
return p;
case FINGERPRINT_PACKETRECIEVEERR:
lcd.print("komunikasi error");
return p;
case FINGERPRINT_FEATUREFAIL:
lcd.clear();
lcd.print("FiturFingerprint");
lcd.setCursor(0, 1);
lcd.print("tidak ditemukan");
return p;
case FINGERPRINT_INVALIDIMAGE:
lcd.clear();
lcd.print("FiturFingerprint");
lcd.setCursor(0, 1);
lcd.print("tidak ditemukan");
return p;
default:
lcd.clear();
lcd.print("Error tidak");
lcd.setCursor(0, 1);
lcd.print("diketahui");
return p;
}
// OK converted!
delay(1000);
lcd.clear();
lcd.print("sidikID:");
lcd.print(id);
lcd.print(" dibuat");
delay(1000);
p = finger.createModel();
if (p == FINGERPRINT_OK) {
lcd.clear();
lcd.print("sidik jari");
lcd.setCursor(0, 1);
lcd.print("Cocok!");
} else if (p == FINGERPRINT_PACKETRECIEVEERR) {
lcd.clear();
lcd.print("komunikasi error");
return p;
} else if (p == FINGERPRINT_ENROLLMISMATCH) {
lcd.clear();
lcd.print("Sidik Jari");
lcd.setCursor(0, 1);
lcd.print("Tidak Cocok!");
return p;
} else {
lcd.clear();
lcd.print("Error tidak");
lcd.setCursor(0, 1);
lcd.print("diketahui");
return p;
}
delay(2000);
lcd.clear();
lcd.print("ID:"); lcd.print(id);
p = finger.storeModel(id);
if (p == FINGERPRINT_OK) {
lcd.setCursor(0, 1);
lcd.print("Disimpan!");
} else if (p == FINGERPRINT_PACKETRECIEVEERR) {
lcd.clear();
lcd.print("komunikasi error");
return p;
} else if (p == FINGERPRINT_BADLOCATION) {
lcd.clear();
lcd.print("tdk dpt disimpan");
lcd.setCursor(0,1);
lcd.print("pd lokasi trsbt");
return p;
} else if (p == FINGERPRINT_FLASHERR) {
lcd.clear();
lcd.print("kesalahan tulis");
lcd.setCursor(0,1);
lcd.print(" ke flash");
return p;
} else {
lcd.clear();
lcd.print("Error tidak");
lcd.setCursor(0, 1);
lcd.print("diketahui");
return p;
}
delay(3000);
}
#include <SoftwareSerial.h>
#include <LiquidCrystal.h> INKUBATEK
LiquidCrystal lcd(8, 9, 10, 11, 12, 13);
uint8_t id;
uint8_t getFingerprintEnroll();
// 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(){
pinMode(4, INPUT);
pinMode(5, INPUT);
pinMode(6, INPUT);
digitalWrite(4, HIGH);
digitalWrite(5, HIGH);
digitalWrite(6, HIGH);
delay(500);
lcd.begin(16, 2);
lcd.clear();
lcd.print(" Pendaftaran");
lcd.setCursor(0,1);
lcd.print(" sidk jari");
delay(2000);
lcd.clear();
lcd.print("Test Koneksi");
// set the data rate for the sensor serial port
finger.begin(57600);
if (finger.verifyPassword()) {
lcd.setCursor(0,1);
lcd.print("OK !");
} else {
lcd.setCursor(0,1);
lcd.print("ERROR !");
while (1);
}
delay(2000);
}
void readnumber() {
while(digitalRead(6)){
if(digitalRead(4)==0){
id++;
delay(300);
}
if(digitalRead(5)==0 && id > 0) {
id--;
delay(300);
}
lcd.setCursor(6, 1);
lcd.print(id);
}
delay(300);
}
void loop() // run over and over again
{
lcd.clear();
lcd.print("Tentukan no ID");
lcd.setCursor(0, 1);
lcd.print("No ID:");
readnumber();
lcd.clear();
lcd.print("Letakkan Jari ");
delay(2000);
while (! getFingerprintEnroll() );
}
uint8_t getFingerprintEnroll() {
int p = -1;
lcd.clear();
lcd.print("Tunggu Sampai");
lcd.setCursor(0, 1);
lcd.print("No ID:");
lcd.print(id);
lcd.print(" Benar !");
while (p != FINGERPRINT_OK) {
p = finger.getImage();
switch (p) {
case FINGERPRINT_OK:
lcd.clear();
lcd.print("sidik diambil");
break;
case FINGERPRINT_NOFINGER:
break;
case FINGERPRINT_PACKETRECIEVEERR:
lcd.clear();
lcd.print("komunikasi error");
break;
case FINGERPRINT_IMAGEFAIL:
lcd.clear();
lcd.print("sidik error");
break;
default:
lcd.clear();
lcd.print("Error tidak");
lcd.setCursor(0, 1);
lcd.print("diketahui");
break;
}
}
delay(1000);
// OK success!
p = finger.image2Tz(1);
switch (p) {
case FINGERPRINT_OK:
lcd.clear();
lcd.print("konversi sidik");
break;
case FINGERPRINT_IMAGEMESS:
lcd.clear();
lcd.println("sidik kacau");
return p;
case FINGERPRINT_PACKETRECIEVEERR:
lcd.clear();
lcd.print("komunikasi error");
return p;
case FINGERPRINT_FEATUREFAIL:
lcd.clear();
lcd.print("FiturFingerprint");
lcd.setCursor(0, 1);
lcd.print("tidak ditemukan");
return p;
case FINGERPRINT_INVALIDIMAGE:
lcd.clear();
lcd.print("FiturFingerprint");
lcd.setCursor(0, 1);
lcd.print("tidak ditemukan");
return p;
default:
lcd.clear();
lcd.print("Error tidak");
lcd.setCursor(0, 1);
lcd.print("diketahui");
return p;
}
delay(1000);
lcd.clear();
lcd.print("Lepas Jari");
delay(1000);
p = 0;
while (p != FINGERPRINT_NOFINGER) {
p = finger.getImage();
}
lcd.print(" ID:"); lcd.println(id);
p = -1;
lcd.setCursor(0,0);
lcd.print("Letakkan jari lg");
while (p != FINGERPRINT_OK) {
p = finger.getImage();
switch (p) {
case FINGERPRINT_OK:
lcd.clear();
lcd.print("sidik diambil");
break;
case FINGERPRINT_NOFINGER:
break;
case FINGERPRINT_PACKETRECIEVEERR:
lcd.clear();
lcd.print("komunikasi error");
break;
case FINGERPRINT_IMAGEFAIL:
lcd.clear();
lcd.print("sidik error");
break;
default:
lcd.clear();
lcd.print("Error tidak");
lcd.setCursor(0, 1);
lcd.print("diketahui");
break;
}
// OK success!
delay(1000);
lcd.clear();
p = finger.image2Tz(2);
switch (p) {
case FINGERPRINT_OK:
lcd.print("konfersi sidik");
break;
case FINGERPRINT_IMAGEMESS:
lcd.print("sidik kacau");
return p;
case FINGERPRINT_PACKETRECIEVEERR:
lcd.print("komunikasi error");
return p;
case FINGERPRINT_FEATUREFAIL:
lcd.clear();
lcd.print("FiturFingerprint");
lcd.setCursor(0, 1);
lcd.print("tidak ditemukan");
return p;
case FINGERPRINT_INVALIDIMAGE:
lcd.clear();
lcd.print("FiturFingerprint");
lcd.setCursor(0, 1);
lcd.print("tidak ditemukan");
return p;
default:
lcd.clear();
lcd.print("Error tidak");
lcd.setCursor(0, 1);
lcd.print("diketahui");
return p;
}
// OK converted!
delay(1000);
lcd.clear();
lcd.print("sidikID:");
lcd.print(id);
lcd.print(" dibuat");
delay(1000);
p = finger.createModel();
if (p == FINGERPRINT_OK) {
lcd.clear();
lcd.print("sidik jari");
lcd.setCursor(0, 1);
lcd.print("Cocok!");
} else if (p == FINGERPRINT_PACKETRECIEVEERR) {
lcd.clear();
lcd.print("komunikasi error");
return p;
} else if (p == FINGERPRINT_ENROLLMISMATCH) {
lcd.clear();
lcd.print("Sidik Jari");
lcd.setCursor(0, 1);
lcd.print("Tidak Cocok!");
return p;
} else {
lcd.clear();
lcd.print("Error tidak");
lcd.setCursor(0, 1);
lcd.print("diketahui");
return p;
}
delay(2000);
lcd.clear();
lcd.print("ID:"); lcd.print(id);
p = finger.storeModel(id);
if (p == FINGERPRINT_OK) {
lcd.setCursor(0, 1);
lcd.print("Disimpan!");
} else if (p == FINGERPRINT_PACKETRECIEVEERR) {
lcd.clear();
lcd.print("komunikasi error");
return p;
} else if (p == FINGERPRINT_BADLOCATION) {
lcd.clear();
lcd.print("tdk dpt disimpan");
lcd.setCursor(0,1);
lcd.print("pd lokasi trsbt");
return p;
} else if (p == FINGERPRINT_FLASHERR) {
lcd.clear();
lcd.print("kesalahan tulis");
lcd.setCursor(0,1);
lcd.print(" ke flash");
return p;
} else {
lcd.clear();
lcd.print("Error tidak");
lcd.setCursor(0, 1);
lcd.print("diketahui");
return p;
}
delay(3000);
}
How it Works
1. Connect the Arduino with Peripherals needed
2. Plug in the Power Source on the device
3. Compile and upload the script program above to your arduino
4. First initial LCD display
Enroll
Fingerprint
5. Connection test between Fingerprint sensor and Arduino
Connection Test
OK !
6. Press the UP Button to decide ID number of fingerprint
Insert ID Number
ID Number :
7. Press OK button
Put the fingerprint on the sensor
Release the finger
8. Release it
9. if it is registered, LCD will display correct data or id
ID Number : 3
equal
Video for Project V - 33. Enroll The Fingerprint Data With LCD (Arduino Based)
Required File
No comments:
Post a Comment