What is an Embedded System?

How to Set Up Fingerprint Sensor With Arduino

Would you like to add a fingerprint to your project? Here is a simple tutorial to help you achieve that!

Hello guys, welcome back to another Arduino tutorial. In today’s tutorial, we will learn to use a fingerprint sensor with an Arduino board, and we will possibly make a simple practical example of this sensor, so let’s learn together!

Supplies

Components:

1. Fingerprint sensor

2. Arduino UNO

3. Male header

4. LED

Tools:

1. Soldering iron

2. Soldering wire

( Optional )

1. Solenoid lock

Step 1: Prepare the material

Step 2: Understanding the Working Principle

the fingerprint sensor we are using is an Optical Type, there exists two more types of sensor like capacitive which can be found in smartphones and ultrasonic ones, which are yet in the testing phase, and both these options are expensive, so we will focus on this optical type for this hobby electronics and similar projects.

The way this optical fingerprint sensor works is that it captures a photo of our finger ridges, and then it uses a certain algorithms to match it with stored data and displays results of the same.

few features of this sensor are as following:

  • Power supply: DC 3.8V-7.0V
  • Operating current: 65mA (Typical)
  • Interface: UART (TTL logical level)
  • Average searching time: <1s (1:500, average)
  • Security level: 5(1, 2, 3, 4, 5(highest))
  • Working environment:Temp: -20°C to +60°
  • Touch area dimension: 14.5*19.4 mm
  • Outline dimension: 54*20*20.5 mm

Step 3: Solder Male Headers to Sensor

Since the wires that come along with sensors are flexible and the ends of this wire are quite wiggly so we would add male headers ( or female headers in case if you use Arduino nano) to connect those wires to female headers on Arduino board.

You can use a helping hand or something to make your soldering task a lot easier since our header pins are small and we really don’t want to risk burning our hands with a solder iron.

Step 4: Connect the Sensor With Arduino

The connections part is very very simple, this fingerprint sensor has 6 wires, out of which we only 4 wires are useful, for Arduino interfacing, out of which 2 wires will be used for power and 2 for data.

Connections:

  • Red to 5v,
  • Black to GND,
  • Green to pin D2
  • White to pin D3

(You can also refer to connection diagram above)

Step 5: Include the Adafruits Fingerprint Library

To complete this project or tutorial, we will need the “Adafruit’s Fingerprint” library, which you can find attached in this step or Google.

To install that library, follow these steps:

Add the library by selecting Add ZIP under the SKETCH menu, INCLUDE Library options.

  • Open Arduino IDE
  • Now, select the .zip file from the location where we downloaded the file!

Step 6: Enroll the Finger Prints

first, we need to enroll the fingers into the EPROM of our Sensor module, so we will follow these steps to enroll our fingerprints.

select the enroll example.

  • Open Arduino IDE
  • Under the FILE menu, and Examples, find the Adafruit’s fingerprint library.
  • Upload the enroll example.
  • Open the Serial Monitor.
  • Select the baud rate to be 9600.
  • Enter the FingerPrint ID number when the serial monitor prompts to enter the fingerprint id number.
  • Place the finger you need to enroll on the sensor.
  • Place the finger again on the sensor once prompted by serial monitor.

Step 7: Upload the Main Code

Since we enrolled the fingerprints in the last step, now we can test if this sensor works or maybe check for a match using the following code and steps.

  • Open Arduino IDE
  • Under the FILE menu, and Examples, find the add fruits fingerprint library.
  • Select the fingerprint example.
  • Upload the fingerprint example.
  • Open the Serial Monitor.
  • Select the baud rate to be 9600.
  • Place the finger you need to test on the sensor.
  • Check for fingerprint id number for OUTPUT.

Step 8: Modify the Main Code to Interface LED ( or Solenoid)

Now let’s add a led to indicate our Fingerprint match, to do so follow these steps:

use digitalWrite(13, HIGH); delay(1000); digitalWrite(13, LOW); “on line 144 to turn on and off the LED

  • Define the LED on pin 13 as output in the void setup part
  • Find then online 135 we see a fingerprint id match loop, wherein we use if statements along with library definitions to find our fingerprint id.
  • We will give high pulse for 1 second and turn the LED off.
  • After this line and our code will turn on the LED every time sensor finds a match.

You can add a solenoid instead of this LED, and make a fingerprint door lock, which could be a brief tutorial for the future, but for this tutorial, LED indication is our Eureka!

Step 9: Conclusion

In this tutorial post, we learned how to set up a fingerprint sensor and how to use it with our Arduino, you can use this knowledge to control a door lock, and LED or any apparatus that you want to control.

So if you made a similar project, do let us know by posting your work under the “I made it” section!

 

Sources