Hack Attack Tutorial: Biometric Safe using Adafruit Fingerprint Sensor

 In Tutorials

Adafruit’s Fingerprint Sensor is our go-to for biometrics projects! This compact sensor, which can store up to 162 fingerprints and comes with a ready-to-use library courtesy of the amazing people at Adafruit, will be used together with DFRobot’s Standard Servo to create a biometric “safe.” We used a regular cardboard box for instructional purposes (#WalangBudget :D) but you’re free to decorate the box any way you want! You can even use a lock-style solenoid instead of a servo to make your box wayyyy more secure.

PS: If you want to watch the video version of this tutorial instead, you can check it out at our Youtube channel or at our Facebook page. Subscribe to get the latest news and tutorials as they come out! 😀

 

STEP 1. For this tutorial, you’re going to need an Arduino-compatible MCU (we used an Arduino Uno), a fingerprint sensor, a servo, wires, and a laptop.

rendermesh-0-00-14-23

STEP 2. Once you’ve gathered all the materials, you can now start wiring! You might want to start with the fingerprint sensor first:

rendermesh-0-00-19-11

STEP 3. Once you’re done, you can now power up your (Arduino) board and open the Arduino IDE. Install the fingerprint sensor library and open the examples folder. Upload “enroll.ino” onto your board and register the fingerprints you want to use! (It’s pretty easy, the instructions on the serial port are very clear.)

STEP 4. It’s time to add the servo to your circuit! You can follow the diagram below:

rendermesh-0-00-23-10

STEP 5. Below is the edited code for the getFingerprintIDez function of “fingerprint.ino,” also from the examples folder. We used the “write” function of the Arduino Servo library to rotate the servo when it gets a match. (Make sure to add the header files and declare your variables beforehand!)

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, HIGH);
delay(1000);
digitalWrite(13, LOW);
for (pos = 0; pos <= 145; pos += 1) {
// in steps of 1 degree
myservo.write(pos);
delay(15);
}
delay(5000);

Serial.print(“Found ID ###”); Serial.print(finger.fingerID);
Serial.print(” with confidence of “); Serial.println(finger.confidence);

return finger.fingerID;

}

setupgif

STEP 6. Final step is to rig up your box with the servo! There are many ways to do this, and the final and function of the box will vary. (To see how ours ended up, check out the video version of this tutorial!)

Recommended Posts
Showing 2 comments
  • Bruno
    Reply

    Hello,
    I have development a project like you, but i would like to keep the sensor in stand-by mode (light off) until the moment to put the finger. Do you have an ideia to make it?

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.