Arduino projects

How to make a fingerprint scanner using Arduino UNO

How to make a fingerprint scanner using Arduino UNO

Although you can use passwords and keys to access security systems, both methods are inconvenient and easy to forget. In this article, we will mainly learn how to use the FPM10A with the Adafruit Arduino library to make a biometric fingerprint system.

How to make a fingerprint scanner using Arduino UNO

Required Components

● FPM10A fingerprint module

● Arduino Uno development board

● Arduino IDE

Installing and using the library

The first step in using the FPM10A is to install the Adafruit Fingerprint Library, which can be done using the Library Manager. Open the Arduino IDE and navigate to Sketch > Include Library > Manage Libraries .

How to make a fingerprint scanner using Arduino UNO

When the Library Manager loads the search results for “Fingerprint”, the first result should be Adafruit Fingerprint Sensor Library. Install that library.

How to make a fingerprint scanner using Arduino UNOOnce the library is installed, it’s time to create a new Arduino project. Click File > New and save the project in its own folder. At this point, open the project folder and copy the “fingerprint.h” file into it.

How to make a fingerprint scanner using Arduino UNO

This is a special header file I wrote to make the fingerprint library easier to use. The header file has only three functions:

●    fingerprint_setup() – configures the serial port to 9600 baud and connects to the module

●    readFingerprint() – a polling function that returns -1 if any invalid events occur, or something else if a successful print is found

●    enrollFingerprint(int id) – adds the fingerprint with ID “id” to the system.

To include this file in your project, simply use the include command as follows:

  1. #include “fingerprint.h”

Copy code

The first function you need to call in the setup() function is fingerprint_setup(), which automatically connects to the module and confirms that everything is working correctly.

  1. void setup()
  2. {
  3.   fingerprint_setup();
  4. }

Copy code

To add a new fingerprint, call the enrollFingerprint(id) function. The function returns -1 if an error occurs, but other values ​​​​indicate successful fingerprint enrollment. The ID passed to this function is a link to the scanned fingerprint, and each fingerprint has a unique ID number.

  1. enrollFingerprint(0x01);

Copy code

Making and using a fingerprint scanner

Since it uses the serial port for communication, it is very easy to get this module working. However, since the Arduino Uno has only one hardware serial port, you will need to use the software serial port to communicate with the fingerprint module using pins 2 and 3 (the hardware serial port is reserved for PC communication).

The ribbon cable that comes with the FPM10A module is not suitable for hobbyists as it comes in a 1.27mm pitch package, so I cut one side off and exposed the wires to connect to the jumper wires.

How to make a fingerprint scanner using Arduino UNO

How to make a fingerprint scanner using Arduino UNO

When you launch this project it will first ask you to place your finger on the scanner. If the scanner is able to read your fingerprint it will ask you to remove and then replace the finger on the scanner. This will cause the scanner to successfully add your fingerprint to ID 1 and leaving your finger on the scanner will cause the system to grant access.

How to make a fingerprint scanner using Arduino UNO

The project can be easily expanded to include electromagnetic locks and relays that only allow authorized users to make changes and unlock the system. When you’re ready, install your new scanner to doors, cabinets, safes, windows, electrical systems, computers, and more!

The complete code for this project is as follows:

  1. #include “fingerprint.h”
  2. void setup()
  3. {
  4.   fingerprint_setup();
  5. }
  6. void loop()
  7. {
  8.   // Create a new fingerprint entry
  9.   enrollFingerprint(0x01);
  10.   delay(1000);
  11.   // Request entry
  12.   Serial.println(” \nUSER LOGIN REQUEST…PLACE FINGER ONTO SENSOR \n”);
  13.   while(readFingerprint() == -1);
  14.   Serial.println(” \nACCESS GRANTED \n”);
  15.   Serial.println(” \nFingerprint confidence : ” + String(confidence) + ” \n”);  
  16.   delay(3000);
  17. }

Copy code

Back to top button