Wiring for use with Arduino

Once you've tested the sensor, you can now use it within a sketch to verify a fingerprint. We'll need to rewire the sensor. Disconnect the green and white wires and plug the green wire into digital 2 and the white wire to digital 3. (For ESP8266 use 4 & 5, for devices with Hardware UART use 0 & 1)

It is normal for the sensor to blink the LED quickly once powered, after that the LED will be off until you've started to request data from it

If your sensor has different wires, The first wire from the left should be the black wire ground, then the two data pins, RX is the white wire, TX is the green wire then the red power wire. You'll have to cut, strip and solder the wires.

If your sensor has all the same-color wires, The first wire from the left is ground, then the two data pins, then power. You'll have to cut, strip and solder the wires.


RX is the same as the White wire
TX is the same as the Green wire

Arduino UNO & Compatible Wiring

This example sketch uses pins 2 and 3 for software serial (on ATmega328P type boards by default) - Not all boards support Software Serial on all pins so check board documentation! For example on ESP8266 we used 4 & 5

You can power the sensor from 3.3V or 5V

In the diagrams below we show the wires plugged directly into the Arduino. However, this does not work well because the wires are so thin and they dont make contact. You should solder thicker solid core wires to each wire, to make good contact

Hardware Serial Wiring

If you have a device with hardware serial, you should use that instead. Often this is pins #0 and #1

Next, you'll need to install the Adafruit Fingerprint sensor library (also available from github).

Open up the Arduino Library Manager:

Type in Fingerprint until you see the Adafruit Fingerprint library show up!

Click Install! That's it. Now you should be able to select the File→Examples→Adafruit_Fingerprint→fingerprint example sketch.

Soft & Hard Serial

By default the sketch uses software serial (Arduino UNO & compatibles). If you are using a device with Hardware Serial, e.g does not have a USB-Serial converter chip, use that instead! Usually those are on pins 0 & 1

// On Leonardo/Micro or others with hardware serial, use those! #0 is green wire, #1 is white
// uncomment this line:
#define mySerial Serial1

// For UNO and others without hardware serial, we must use software serial...
// pin #2 is IN from sensor (GREEN wire)
// pin #3 is OUT from arduino  (WHITE wire)
// comment these two lines if using hardware serial
//#include <SoftwareSerial.h>
//SoftwareSerial mySerial(2, 3);

If necessary, uncomment/comment lines for hardware serial support


Upload it to your Arduino as usual. Open up the serial monitor at 9600 baud and when prompted place your finger against the sensor that was already enrolled.

You should see the following:

The 'confidence' is a score number (from 0 to 255) that indicates how good of a match the print is, higher is better. Note that if it matches at all, that means the sensor is pretty confident so you don't have to pay attention to the confidence number unless it makes sense for high security applications.

Of course you have to have enrolled a fingerprint first! If you did this using the Windows program, that's good to go. If you have not yet, you should at least have gotten a Found fingerprint sensor! printout. You can go ahead to the next step to enroll fingerprints.

If you get Did not find fingerprint sensor :( check your wiring, maybe swap the RX and TX wire as that's a common issue

If you want to have a more detailed report, change the loop() to run getFingerprintID() instead of getFingerprintIDez() - that will give you a detailed report of exactly what the sensor is detecting at each point of the search process.

Last updated on 2017-12-28 at 05.54.55 PM Published on 2012-11-05 at 04.06.38 PM