How To Use It? - lhiep/optical-fingerprint-scanner GitHub Wiki
How to use it?
Important Note: This simplified tutorial will NOT work for "native USB" based Arduinos like the Leonardo, Micro, Zero, etc... Visit Adafruit website for information on those specific boards. The tutorial below is ONLY for the Arduino Uno and Arduino Mega.
Connection
4-Wire Module
Depending on the fingerprint scanner, it may have 4 or 5 wires. The scanner from Adafruit has 4 wires: A ground, a VCC, a TX, and a RX. The GND will be connected to ground, the VCC will be connected to 5V, TX and RX will be connected to any digital pins on the Arduino as they can be configured within the code. An example can be seen below.
5-Wire Module
An additional 3.3V wire may be required on certain model of the fingerprint scanner. An example can be seen below.
Wire Color Code
Blue (Touch VCC): This is should be connected to the 3.3V
Yellow (Touch Data): This pin will provide a high signal when a finger is touching the glass.
Red (VCC): This pin can accept 3.8V to 7V DC and provides the power for the module.
Green (TX): Output pin, must be connected to the RX on the Arduino.
White (RX): Input pin, must be connected to the TX on the Arduino.
Black (GND): Ground pin
Installing The Library
Installing the library is very simple. First open up the library manager.
Next search for the Adafruit Fingerprint Sensor Library and click install.
Fingerprint Enrollment
There are two ways to enroll a fingerprint. One way is directly through the Arduino code library. The second way is to use the SFGDemo software. The advantage of using the software to enroll fingerprints is that users of the sensor will not be able to add additional fingerprints, thus enable a more secure system. In order to use the software, the RX wire (WHITE) must be connected to pin 0, and the TX wire (GREEN) must be connected to pin 1 on the Arduino Uno.
Next, a blank sketch must be downloaded into the Arduino. The blank sketch can be found in the Adafruit Fingerprint Sensor Library.
The software is very straightforward and easy to use. It even shows you a picture of your fingerprint after every scan if the preview checkbox is enabled.
A full tutorial on the software can be found on the Adafruit website.
Using the Arduino Library
While the software requires the Sensor to use pin 0 and 1 on the Arduino, those pins should be avoided when not using the Arduino as a USB-Serial converter. A recommended default is pin 2 for the TX wire (GREEN) and pin 3 for the RX wire (WHITE). If other pins are used, modify the code accordingly. An example can be seen below.
Loading the example sketches is similar to loading the blank sketch shown above. The examples include implementation of securing the device with a password, delete fingerprints, empty the fingerprint database, enrolling new fingerprints, and show information about the existing fingerprints. The detailed documentation of each example as well as each function used within the examples can be found on the GitHub repository for the library. An example that incorporates these features can be found on the main page of this GitHub repository.
For a more detailed tutorials, visit Adafruit.