BIOMETRIC (FINGERPRINT)UNLOCK SYSTEM

Hey guys this my first instructable
edits and requirements would be duly noted and appreciated

So my instructable is on Biometric (fingerprint) unlock system As u all know the importance of security I am not extending the introduction part

NOTE: I HAVE CREATED THIS SO THAT I COULD HELP NEWBIE ENGINEERS

COMPONENTS REQUIRED

1. ARDUINO UNO

2. FINGERPRINT MODULE R305

3. SERVO -high torque which can take upto 5 kg

4. BREADBOARD

5. JUMPERS

6. LED

7.16X2 LCD DISPLAY

8. I2C MODULE FOR LCD (PCF 8547)

9. LAPTOP/PC WITH ARDUINO IDE

LIST OF LIBRARIES TO BE INCLUDED

ADAFRUIT FINGERPRINT

PCF 8547 TESTINGLIBRARY

WIRE

SOFTWARE SERIAL

Let's start by connecting all the three different connections into a single set

uno to lcd

blue to A5

yellow toA4


we are going to connect the Arduino with the fingerprint module and LCD and start with the enrolling procedure

PROGRAM TO ENROLL

#include

#include

#include

#include

uint8_t getFingerprintEnroll(int id);
LiquidCrystal_PCF8574 lcd(0x3F); SoftwareSerial mySerial(2, 3); Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial); void setup() { Serial.begin(9600); Serial.println("fingertest"); lcd.begin(16, 2); // set the data rate for the sensor serial port finger.begin(9600); if (finger.verifyPassword()) { Serial.println("Found fingerprint sensor!"); lcd.setBacklight(255); lcd.home(); lcd.clear(); lcd.print("SENSOR FOUND"); } else { Serial.println("Did not find fingerprint sensor :("); lcd.setBacklight(255); lcd.home(); lcd.clear(); lcd.print("SENSOR NOT FOUND"); while (1); } } void loop() // run over and over again { Serial.println("Type in the ID # you want to save this finger as..."); lcd.setBacklight(255); lcd.home(); lcd.clear(); lcd.print("TYPE NUMBER"); int id = 0; while (true) { while (! Serial.available()); char c = Serial.read(); if (! isdigit(c)) break; id *= 10; id += c - '0'; } Serial.print("Enrolling ID #"); Serial.println(id); lcd.setBacklight(255); lcd.home(); lcd.clear(); lcd.print("ENROLLING ID"); while (! getFingerprintEnroll(id) ); } uint8_t getFingerprintEnroll(int id) { int p = -1; Serial.println("Waiting for valid finger to enroll"); lcd.setBacklight(255); lcd.home(); lcd.clear(); lcd.print("WAITING TO ENROLL"); while (p != FINGERPRINT_OK) { p = finger.getImage(); switch (p) { case FINGERPRINT_OK: Serial.println("Image taken"); lcd.setBacklight(255); lcd.home(); lcd.clear(); lcd.print("IMAGE TAKEN"); break; case FINGERPRINT_NOFINGER: Serial.println("."); break; case FINGERPRINT_PACKETRECIEVEERR: Serial.println("Communication error"); lcd.setBacklight(255); lcd.home(); lcd.clear(); lcd.print("COMMUNICATION ERROR"); break; case FINGERPRINT_IMAGEFAIL: Serial.println("Imaging error"); lcd.setBacklight(255); lcd.home(); lcd.clear(); lcd.print("IMAGE ERROR"); break; default: Serial.println("Unknown error"); break; } } // OK success! p = finger.image2Tz(1); switch (p) { case FINGERPRINT_OK: Serial.println("Image converted"); lcd.setBacklight(255); lcd.home(); lcd.clear(); lcd.print("IMAGE CONVERTED"); break; case FINGERPRINT_IMAGEMESS: Serial.println("Image too messy"); lcd.setBacklight(255); lcd.home(); lcd.clear(); lcd.print("MESSY IMAGE"); return p; case FINGERPRINT_PACKETRECIEVEERR: Serial.println("Communication error"); lcd.setBacklight(255); lcd.home(); lcd.clear(); lcd.print("ERROR"); return p; case FINGERPRINT_FEATUREFAIL: Serial.println("Could not find fingerprint features"); lcd.setBacklight(255); lcd.home(); lcd.clear(); lcd.print("FINGER FEATURE ERROR"); return p; case FINGERPRINT_INVALIDIMAGE: Serial.println("Could not find fingerprint features"); return p; default: Serial.println("Unknown error"); return p; } Serial.println("Remove finger"); lcd.setBacklight(255); lcd.home(); lcd.clear(); lcd.print("REMOVE FINGER"); delay(2000); p = 0; while (p != FINGERPRINT_NOFINGER) { p = finger.getImage(); } p = -1; Serial.println("Place same finger again"); lcd.setBacklight(255); lcd.home(); lcd.clear(); lcd.print("PLACE FINGER AGAIN"); while (p != FINGERPRINT_OK) { p = finger.getImage(); switch (p) { case FINGERPRINT_OK: Serial.println("Image taken"); lcd.setBacklight(255); lcd.home(); lcd.clear(); lcd.print("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"); break; } } // OK success! p = finger.image2Tz(2); switch (p) { case FINGERPRINT_OK: Serial.println("Image converted"); lcd.setBacklight(255); lcd.home(); lcd.clear(); lcd.print("CONVERTED"); break; case FINGERPRINT_IMAGEMESS: Serial.println("Image too messy"); lcd.setBacklight(255); lcd.home(); lcd.clear(); lcd.print("MESSY IMAGE"); 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.createModel(); if (p == FINGERPRINT_OK) { Serial.println("Prints matched!"); lcd.setBacklight(255); lcd.home(); lcd.clear(); lcd.print("MATCHED"); } else if (p == FINGERPRINT_PACKETRECIEVEERR) { Serial.println("Communication error"); return p; } else if (p == FINGERPRINT_ENROLLMISMATCH) { Serial.println("Fingerprints did not match"); lcd.setBacklight(255); lcd.home(); lcd.clear(); lcd.print("NO 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.setBacklight(255); lcd.home(); lcd.clear(); lcd.print("STORED"); } 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; } }

this is used to enroll the finger

proceed according to the functions provided in the serial monitor

keep baud rate in 9600

Once enrolled we have to put the finger finding program

#include

#include

#include

#include

int getFingerprintIDez(); LiquidCrystal_PCF8574 lcd(0x3F); int show; SoftwareSerial mySerial(2, 3); Servo myservo; int pos = 0;

Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial); void setup() { Serial.begin(9600); Serial.println("fingertest"); pinMode(11,OUTPUT); pinMode(12,OUTPUT); lcd.begin(16, 2); finger.begin(9600); if (finger.verifyPassword()) { Serial.println("Found fingerprint sensor!"); lcd.setBacklight(255); lcd.home(); lcd.clear(); lcd.setCursor(0, 0); lcd.print("WELCOME"); lcd.setCursor(0, 1); lcd.print("KEEP FINGER"); } else { Serial.println("Did not find fingerprint sensor :("); lcd.setBacklight(255); lcd.home(); lcd.clear(); lcd.print("sensor not found"); while (1); } Serial.println("Waiting for valid finger..."); { myservo.attach(9); // attaches the servo on pin 9 to the servo object } } 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!"); lcd.setBacklight(255); lcd.home(); lcd.clear(); lcd.print("match found"); } else if (p == FINGERPRINT_PACKETRECIEVEERR) { Serial.println("Communication error"); return p; } else if (p == FINGERPRINT_NOTFOUND) { Serial.println("Did not find a match"); lcd.setBacklight(255); lcd.home(); lcd.clear(); lcd.print("match not found"); return p; } else { Serial.println("Unknown error"); return p; } // found a match! Serial.print("Found ID #"); lcd.print(finger.fingerID); Serial.print(" with confidence of "); lcd.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! lcd.setBacklight(255); lcd.home(); lcd.clear(); lcd.print("finger found"); delay(4000); lcd.clear();lcd.home(); lcd.print("WELCOME"); digitalWrite(12,LOW); digitalWrite(11,HIGH); delay(1000); digitalWrite(11,LOW); delay(1000); digitalWrite(12,HIGH); { for (pos = 180; pos >= 90; pos -= 1) { // goes from 0 degrees to 180 degrees // in steps of 1 degree myservo.write(pos); // tell servo to go to position in variable 'pos' delay(20); // waits 15ms for the servo to reach the position } for (pos = 90; pos <= 180; pos += 1) { // goes from 180 degrees to 0 degrees myservo.write(pos); // tell servo to go to position in variable 'pos' delay(100); // waits 15ms for the servo to reach the position } } Serial.print("Found ID #"); Serial.print(finger.fingerID); Serial.print(" with confidence of "); Serial.println(finger.confidence); return finger.fingerID; }

you have successfully build your biometric unlock system

NOTE : PLEASE USE A 12V ADAPTER FOR UNO OR THE ONE PROVIDED WITH IT AND USE A 5 V SUPPLY FOR LCD (ADAPTER) AS NOT USING THESE CAUSE A LOT OF FLUCTUATION AND OVERHEATS THE UNO

for futher guide use the comment section

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Share

    Recommendations

    • Indoor Lighting Contest

      Indoor Lighting Contest
    • Make It Fly Challenge

      Make It Fly Challenge
    • Growing Beyond Earth Maker Contest

      Growing Beyond Earth Maker Contest

    2 Discussions

    Hello there!

    We're glad you want to share something with the Instructables community!

    And we’re here to help you out.

    In order to be published live on the site, Instructables must consist of the following things:

    - Multiple steps showing how you made your project

    - Written instructions in each step

    - Your own original images

    Beyond making your Instructable simply publishable, this guide (https://www.instructables.com/id/How-to-Create-a-Feature-Worthy-Instructable/) explains what is required to have your Instructables featured by our site editors. It’s very helpful, and definitely worth checking out.

    We would love to review your project again after you have made the necessary edits, and we will publish your project if it is eligible.

    If you have any questions, please feel free to ask right here or send us an email at service@instructables.com.

    Best,

    Instructables Community Manager

    1 reply
    0
    None

    Sir,i guess i have made the changes ,if any left could u please pin point it Thank you