Part

Fingerprint sensor, R30x / AS608

An optical sensor with its own template library on serial at 57600 baud: image, search, enroll.

See every part
  • 4 pins
  • 4 settings
  • In 1 project
  • In 1 lesson
Drawn live by the editor's own code, at the size you see it.
At a glance

The Fingerprint sensor, R30x / AS608 in brief

What it is, and every setting the properties panel gives it.

The optical fingerprint sensor here is the R30x and AS608 family (R307, ZFM-20, Adafruit’s), with a glass window that glows red. It does all the work itself: it images the finger, turns the image into a character file, combines two into a template and searches its own flash library, while the board only sends packets. Its pins are VCC, GND, TX and RX, at 57600 baud with 3.3 V logic. On an Uno it goes on SoftwareSerial, the sensor’s TX into pin 2 and its RX from pin 3; on an ESP32, on a hardware port such as Serial2. Mokxi models the ZhianTec packet format (EF 01, the address, identifier, length, contents and checksum) and the commands Adafruit_Fingerprint uses, from getImage, image2Tz and fingerFastSearch to createModel, storeModel and getTemplateCount, each answered after 5 ms. A finger is a number: hold a fingertip under the glass. Fingers 1 and 2 are enrolled from the start (the enrolled property), the library holds 162 (capacity), and verifyPassword checks the password property. The classic mistake is swapping TX and RX. Real prints, image upload, the LED, security levels and search time are not modeled, and every match scores 100.

Family
Inputs
Pins
4
baud
57600
enrolled
2
capacity
162
password
0

A circuit built around it, running and explained: the Fingerprint sensor simulator.

Pins

4 pins

Named as the editor names them, so a wire lands where you expect it.

Pin
What it does
VCC
Supply.
GND
Ground.
TX
Out of the sensor: wire it to the board's receive pin.
RX
Into the sensor: wire it to the board's transmit pin.
How to use it

How to use an optical fingerprint sensor with an Arduino

The sensor is a serial device at 57600 baud. On an Uno it goes on SoftwareSerial: the sensor’s TX into pin 2, its RX from pin 3, VCC to 5 V and GND to GND, and Adafruit_Fingerprint finger(&sensorSerial) talks to it. finger.begin(57600) then finger.verifyPassword() proves the wiring before anything else.

A check is three calls: getImage() takes a picture of the finger on the glass, image2Tz() turns it into a character file, and fingerFastSearch() looks it up, leaving the match in finger.fingerID. In this door lock fingers 1 and 2 are enrolled and finger 3 is a stranger: hold finger 1 under the sensor and the servo latch opens for three seconds, hold finger 3 and the red light blinks. If verifyPassword() fails, the usual cause is TX and RX swapped.

Part pin
Board pin
TX
Pin 2
RX
Pin 3
VCC
5 V
GND
GND

On an ESP32, pass a hardware port such as &Serial2 to Adafruit_Fingerprint instead of SoftwareSerial.

Arduino Uno: fingerprint door locklive0.000 s 0.00x
Click to open it in the editor
This is the simulator itself, running here. Click anything to open it in the editor.
One check, from the door lock sketch
if (finger.getImage() != FINGERPRINT_OK) return;
if (finger.image2Tz() != FINGERPRINT_OK) return;
if (finger.fingerFastSearch() == FINGERPRINT_OK) {
  Serial.print("Welcome, finger #");
  Serial.println(finger.fingerID);
}
How it is modeled

What is true about the Fingerprint sensor, R30x / AS608, here

In its help article’s own words: what the simulation gets right, and where it stops.

Modeled

The packets. EF 01, the address, a packet identifier, a length, the contents and a checksum, both ways, as the module's manual lays them out. A packet with a wrong checksum is answered with an error.

The commands. Take an image (no finger answers 0x02), image to character file, compare, search, combine two files into a template (two different fingers will not combine), store, load, delete, empty the library, read the system parameters, verify the password and count the templates.

Enrolling. Two images of the same finger, combined and stored at a page, are found by a search afterwards; the template count goes up.

Not modeled

Real prints: a finger is a number, and two images match when they are the same finger. The match score is a fixed 100, a placeholder. The image upload commands, the LED, the security levels and the time a real search takes are not modeled; the answers come after a fixed 5 ms.

From Fingerprint sensor, in full.

Projects

See the Fingerprint sensor, R30x / AS608 in a project

One built-in project uses it. It opens in the editor, already wired.

Lessons

Where it turns up in a lesson

One lesson places it in its own circuit.

Boards

The boards it is shown on

This board has a built-in project with the Fingerprint sensor, R30x / AS608 in it.

Libraries

Arduino libraries for the Fingerprint sensor, R30x / AS608

Built in, so the sketch compiles with nothing to install. Each page has the calls, the wiring and an example to run.

Wire up the Fingerprint sensor, R30x / AS608

Open the editor and push it into the breadboard. It is free, and it runs on your own machine.