Fingerprint Recognition
| Difficulty | Advanced |
|---|---|
| Category | Communication |
| Supported boards | Arduino Uno R3 and compatible ATmega328P boards |
| Time needed | 70 minutes |
| Prerequisites | Reading RFID Cards with an RC522 |
| Tested board | Not yet verified |
| Tested on | Not yet verified |
| Arduino IDE version | Not yet verified |
| Library | Not yet verified |
What it does
An optical fingerprint sensor with a processor of its own. It photographs a finger, extracts the features, and stores or compares them on the module, sending the Arduino nothing more than “this is number 7” or “no match”.
That division of labour is why it works on an Uno at all. Fingerprint matching is far beyond a 2 KB microcontroller; the module does it and hands back an answer.
It is also a genuine step up from the RFID reader for access control, and this page is careful about exactly how far that step goes.
Before you begin
Required parts and tools
- An Arduino Uno or compatible board.
- One fingerprint module. This is Siratek product 3026, an AS608-based optical sensor on a
DY50board. - Resistors for a divider, 1 k and 2 k, or a level converter.
- Four jumper wires, and a way to connect to the module’s six-pin JST plug.
The connector, and the wire colours
The module has a six-pin JST connector with a short cable. The photographs show all six wires in the same colour, so the colours tell you nothing and you must go by position.
Four of the six are the ones you need: power, ground, the module’s transmit and the module’s receive. The remaining two are a touch-detect output and its supply on boards that have it.
With no reliable colour code, the safe procedure is:
- Find the pinout printed on the board or in the supplier’s listing for your batch.
- Identify ground and power with a multimeter before connecting anything, with the cable unplugged from the module: continuity from a known ground pad on the board to one of the pins.
- Connect power and ground only, and check the sensor’s window lights.
- Only then connect the two data lines.
That takes five minutes and avoids putting 5 V into a data pin.
It is a 3.3 volt device
The AS608 runs at 3.3 V logic, with a supply range that usually accepts 3.6 to 6 V.
So the same arrangement as the HC-05 and the GPS: the module’s transmit line is fine into an Uno, and the Arduino’s transmit line needs a 1 k and 2 k divider before the module’s receive pin.
An ESP32 avoids the question, being 3.3 V throughout.
Default baud rate
57600, not 9600. That trips people who copy a serial sketch from elsewhere, and the symptom is garbled replies or no reply at all.
The rate can be changed on the module, but there is no reason to.
What is stored, and what is not
Worth being precise, because this is where the security conversation starts.
The module does not store images. It stores a template: a compact description of the minutiae, the points where ridges end or split. A template cannot be turned back into a readable fingerprint image.
Templates live on the module, in numbered slots, up to a few hundred depending on the model. They survive power being removed. Your Arduino stores nothing.
So the data on the module is better than a photograph, and it is still biometric data about a real person.
How good is this, really
An honest comparison with the RFID reader, since both end up in door projects.
Better than RFID in one important way. A card can be handed to someone else, lost, or cloned in seconds with a cheap reader. A finger cannot be lent out casually.
Still a hobby device. Optical sensors of this class can be fooled by a good-quality reproduction of a fingerprint. Published research has defeated sensors in this category repeatedly, and nothing about this module suggests it is an exception.
And the serial link is the weak point. The module says “match, number 7” over a plain serial line with no authentication. Anyone who can reach that wire can say the same thing to your Arduino. The sensor is not the easiest thing to attack; the two wires behind it are.
So, where it is appropriate:
- A workshop door, a tool cabinet, a time-and-attendance log: yes, and it is pleasant to use.
- A front door, a safe, anything protecting money: no. Use a certified lock.
And a point about people, not technology
A fingerprint is not a password. If it is compromised, it cannot be changed, and the same finger opens every other system that person has enrolled in.
If you build something that enrols other people’s fingerprints:
- Tell them what is stored and where.
- Tell them how to be removed, and actually remove them when asked.
- Do not keep the data longer than the project needs it.
- Keep the module physically secure, since the templates live on it.
None of that is difficult, and a project that collects biometric data from colleagues or family without mentioning it is a poor thing to have built.
Pin reference
| Module wire | Connect to | Purpose | Notes |
|---|---|---|---|
VCC |
Uno 5V |
Power | 3.6 to 6 V typical |
GND |
Uno GND |
Ground | |
TX |
Uno D2 |
Module out | 3.3 V; an Uno reads it |
RX |
Uno D3 through a divider |
Module in | 3.3 V input |
Wiring steps
- Unplug the USB cable.
- Identify the six positions on your module, with a meter, before connecting anything.
GNDtoGND,VCCto5V.- Plug in and check the sensor window glows. That proves power without risking a data pin.
- Unplug again. Module
TXtoD2. - From
D3, a 1 k resistor to a free row, 2 k from that row to ground, moduleRXto that row. - Plug in.
Software and libraries
Install Adafruit Fingerprint Sensor Library through Library Manager. Record the version.
Minimal working example
Confirm the module answers before anything else.
// Siratek: is the sensor there, and how many prints are stored?
#include <SoftwareSerial.h>
#include <Adafruit_Fingerprint.h>
SoftwareSerial sensorSerial(2, 3);
Adafruit_Fingerprint finger = Adafruit_Fingerprint(&sensorSerial);
void setup() {
Serial.begin(9600);
while (!Serial) {
;
}
finger.begin(57600); // 57600, not 9600
if (!finger.verifyPassword()) {
Serial.println("Siratek: no sensor found.");
Serial.println(" Check the baud is 57600, check TX and RX are crossed,");
Serial.println(" and check the divider on the module's RX line.");
while (1) {
delay(100);
}
}
Serial.println("Siratek: sensor found.");
finger.getTemplateCount();
Serial.print("stored prints: ");
Serial.println(finger.templateCount);
}
void loop() {
}
verifyPassword() is misleadingly named: it is a handshake with the module’s default password, and it simply means “the module answered”. A failure here is always baud rate, wiring, or the divider.
Enrolling a finger
// Siratek: store one finger in a numbered slot.
// The module asks for the same finger twice and compares the two.
bool enrol(uint8_t id) {
Serial.print("Place the finger... ");
while (finger.getImage() != FINGERPRINT_OK) {
delay(100);
}
if (finger.image2Tz(1) != FINGERPRINT_OK) {
Serial.println("could not read that image");
return false;
}
Serial.println("lift the finger.");
delay(1500);
while (finger.getImage() != FINGERPRINT_NOFINGER) {
delay(100);
}
Serial.print("Place the SAME finger again... ");
while (finger.getImage() != FINGERPRINT_OK) {
delay(100);
}
if (finger.image2Tz(2) != FINGERPRINT_OK) {
Serial.println("could not read that image");
return false;
}
if (finger.createModel() != FINGERPRINT_OK) {
Serial.println("the two did not match: try again");
return false;
}
if (finger.storeModel(id) != FINGERPRINT_OK) {
Serial.println("could not store it");
return false;
}
Serial.print("stored as number ");
Serial.println(id);
return true;
}
Taking the finger twice is the module checking its own work: if the two readings do not produce the same template, it refuses rather than storing a poor one. A finger that repeatedly fails to enrol is usually dry, dirty or placed at a different angle each time.
Keep a note of which number is whose. The module stores a template against a number and nothing else; the names live in your sketch or your head.
Matching
// Siratek: check a finger against what is stored.
int identify() {
if (finger.getImage() != FINGERPRINT_OK) {
return -1; // no finger present
}
if (finger.image2Tz() != FINGERPRINT_OK) {
return -1;
}
if (finger.fingerFastSearch() != FINGERPRINT_OK) {
return 0; // a finger, but not a known one
}
return finger.fingerID;
}
void loop() {
int id = identify();
if (id > 0) {
Serial.print("matched number ");
Serial.print(id);
Serial.print(", confidence ");
Serial.println(finger.confidence);
if (finger.confidence < 50) {
Serial.println(" low confidence: treating as no match");
return;
}
// act on the match here
} else if (id == 0) {
Serial.println("finger not recognised");
}
delay(300);
}
Check the confidence figure, not just the match. The module returns a score alongside the identity, and a low one means it found the closest stored template rather than a convincing match. Accepting any match at all is how a door opens for the wrong person; setting a floor costs two lines.
The right floor depends on your sensor and your users. Enrol a few fingers, print the confidence for genuine and non-genuine attempts, and choose from what you see.
Deleting
finger.deleteModel(id); // one slot
finger.emptyDatabase(); // everything
Build deleteModel() into anything that enrols other people. Being able to remove someone is part of collecting the data in the first place.
Expected result
“Sensor found” and a stored count at startup. Enrolment succeeding after two clean presses of the same finger. A match within a second, with a confidence figure that is clearly higher for the enrolled finger than for anyone else’s.
A dry finger reads poorly. Breathing on the fingertip genuinely helps, which is worth knowing before concluding the sensor is faulty.
Troubleshooting
| Symptom | Likely cause | Check or fix |
|---|---|---|
| “No sensor found” | Baud rate | It is 57600, not 9600 |
| “No sensor found”, baud correct | TX and RX not crossed |
Module TX to the Arduino’s receive |
| Garbled replies | Logic levels | Fit the divider on the module’s RX |
| Window does not light | Power or the wrong wire | Identify the pins with a meter |
| Enrolment always fails | Finger dry, dirty or moving | Breathe on it; keep the angle the same |
| “The two did not match” | Different part of the finger each time | Place it the same way twice |
| Matches the wrong person | Accepting any match | Check the confidence figure |
| Match works, nothing happens | Return value not checked | fingerID is only valid after a successful search |
| Count is not what you expect | Templates survive power off | emptyDatabase() to start again |
| Works on an ESP32, not an Uno | 3.3 V logic | Use a level converter |
Next steps
- Easier first: Reading RFID Cards with an RC522, which this compares against throughout.
- Related: Switching Bigger Loads with a Relay, and its safety section, if something must actually open.
- Next project: an attendance log writing a name and a timestamp to an SD card, with the DS3231 supplying the time.
Sources and attribution
All text, wiring guidance and code in this tutorial are original Siratek work.
- AS608 and DY50 module documentation for the default baud rate, the logic level, the template storage and the command set.
- Adafruit Fingerprint Sensor Library documentation for the calls used.
- The
AS608chip marking, theDY50-2V1board marking and the six-pin JST connector with single-colour cable were read from the Siratek product photographs for item 3026.
The assessment of what this sensor is and is not suitable for reflects the published literature on optical fingerprint sensors of this class, and the note about the unauthenticated serial link follows from how the module communicates. Confidence thresholds vary between sensors and users and are presented as something to measure. No third-party tutorial text, diagrams, photographs or code has been reproduced here.

