Verification using Fingerprint Sensor

Recently, I bought a fingerprint sensor to use in my project and is useful as an alternative method for identity verification. For example, it could be used for opening doors, lock, safes and many more. Since I’m at it, I thought, “Why not make a simple tutorial on how to use it?” Therefore, I’d decided to write a simple tutorial on how to interface a fingerprint sensor with an Arduino.

Overview

ard_fing_sens_1

This all-in-one optical fingerprint sensor powered by a high performance DSP chip, AS601. The chip does the image rendering, calculation and finger print recognition. This fingerprint sensor module uses serial UART, so it’s easy to link it up to the Arduino. We would be using the Adafruit fingerprint library to makes it easier to interface the module with the Arduino.

In this tutorial, I’ll be making a simple device that will make certain sound when fingerprints are detected. An small screen will be used to display the ID and the confidence level of the fingerprint, and a buzzer will be used to make 2 different tones for certain range of fingerprint confidence, which will be determined by the threshold value.

 

Demo

 

Circuit

Here are some photos on what the circuit will look like:

 

Parts required

We’ll be using the Arduino Nano in this tutorial. Alternatively, you can also choose to use the Arduino Uno instead if you not have an Uno.

  • Arduino Nano x 1
  • Fingerprint Sensor Module x 1
  • 0.96″ I2C OLED Screen x 1
  • Buzzer x 1
  • Jumper wires
  • Breadboard x 1

 

Schematics

This is the schematics of the project. The buzzer will be connected to digital pin D9, the OLED screen to A4 (SDA) & A5 (SCL) respectively, and lastly the fingerprint sensor to digital pins D2 & D3. The OLED will have a 3.3V input, whereas the fingerprint sensor module will have a 5V input.

ard_finger_sch

 

Libraries

adafruit_logo

Before starting, we have to download the Adafuit fingerprint library. Download it here or here. Extract the zip and rename the file as “Adafruit_Fingerprint_Sensor_Library” instead of  the default “Adafruit-Fingerprint-Sensor-Library” (As the arduino library do not allow library name with hyphens). Copy the entire file to your Arduino Library directory. (Should be located in your Program Files directory)

 

Enrolling your fingerprint

Before starting the verification of your fingerprints, you have to register them first. To do that, open the “enroll” example from the Adafruit Fingerprint library. This program will register your fingerprint to the sensor’s database.

[File > Example > Adafruit_Fingerprint_Sensor_Library> Enroll]

Upload this program into the Arduino. When the upload is completed, open the Serial Monitor. It should display “Type in the ID # you want to save this finger as…” after the sensor is detected. [ Having problem detecting the sensor? Please refer to the troubleshooting section. ]

We will be registering the right thumb as ID #1, so type in 1 in the Serial monitor & hit enter. The Serial Monitor should now display “Enrolling ID #1, Waiting for valid finger to …..”. Follow the instructions on the monitor. Once done, open the “fingerprint” example from the Adafruit Fingerprint library to test the sensor.

 

Testing the Sensor

Upload the “fingerprint” sketch & open the Serial Monitor. When it displays “Waiting for valid finger…”, place your thumb on the sensor & the ID of the finger print will be displayed. The level of confidence will also be displayed. What does the level of Confidence represents? It actually represents how much does your current fingerprint “match” to the one recorded in the sensor database. [Having problem detecting the sensor? Please refer to the troubleshooting section.]

 

Arduino Code – The main one

After all the testing is done, let’s move on to the main code of the project. Copy the following code & upload it to your Arduino. We’ll be setting a threshold for the confidence level of the sensor, which will cause the buzzer to either play the ”Valid fingerprint’ tone, or the ‘invalid fingerprint’ tone. The threshold variable will have a default value of 100, you can change it accordingly if you want to.

 

 Troubleshooting

Having problems with the sensor? Below are some solution that can hopefully resolve your problems. If you still have any questions, feel free to ask it at the comments section.

 

“Did not find fingerprint sensor :(“

Double check all your connections of the Fingerprint sensor. Did you connect the green & yellow wire wrongly? You may have swapped the wire around & connected it to the wrong pins.

 

There is no light from the sensor!

Check your breadboard connections. Did you connect the 5V wire of the sensor to the terminal rail? Or have you forgotten to connect the terminal rail to the Arduino’s 5V pin?

 

The OLED display is not displaying anything!

Try resetting the Arduino by pressing the reset button & see whether anything appears. If not, check your SDA & SCL connections. Have you accidentally swapped it around? Double check your connections with the schematics above. After there is still nothing, check whether you have connected the display to the 3.3V pin or the ground pin.

 

 

Share this post:

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *