brianrho / FPM

Arduino library for the R30x/ZFMxx/FPMxx optical fingerprint sensors
105 stars 41 forks source link
arduino arduino-library fingerprint-sensor fpm10 r305 zfm-20 zfm60

FPM

This is an Arduino library for most of the FPMxx/R30x/ZFMxx/R551 optical fingerprint sensors.\ (See notes below.)

There are several examples included to demonstrate usage -- the enroll example is a great place to start, especially if you have an ESP32.\ (This is because ESP32 requires usage of its HardwareSerial ports, since the Arduino ESP32 core doesn't support SoftwareSerial. The enroll example shows how to setup those ports, guarded under the macro ARDUINO_ARCH_ESP32.)

Also included is a Python 3 script for extracting fingerprint images to a PC over a Virtual COM port. To use it:

To get the most reliability with SoftwareSerial, baud rates should not exceed 57600, especially during sustained data transfers e.g. extracting fingerprint images. (This recommendation is based off old tests with an Arduino Uno -- more powerful chips like the ESPxxxx may be able to handle higher rates just fine. Test and find out.)

A generic list of commands for these sensors can be found here. Keep in mind that not all sensors (few, really) support all commands. You'll just have to try them out for yourself.\ To match templates on your PC/server, check here.\ A device-agnostic version of this library in C.\ An Arduino library for the GT511C3 (and similar GT5x) fingerprint sensors.\

Notes

#include <HardwareSerial.h>
#include <fpm.h>

/* select UART1 */
HardwareSerial fserial(1);

FPM finger(&fserial);
FPMSystemParams params;

void setup(void) {
    Serial.begin(57600);

    /* ESP32 RX = IO25, TX = IO32 */
    fserial.begin(57600, SERIAL_8N1, 25, 32);

    /* the rest of the code follows, same as in the examples */
    if (finger.begin()) {
        ...
    }
}

void loop(void) {
    ...
}