adafruit_fingerprint

This library will let you use an Adafruit Fingerprint sensor on any UART to get, store, retreive and query fingerprints! Great for adding bio-sensing security to your next build.

  • Author(s): ladyada

Implementation Notes

Hardware:

Software and Dependencies:

class adafruit_fingerprint.Adafruit_Fingerprint(uart, passwd=(0, 0, 0, 0))[source]

UART based fingerprint sensor.

check_module()[source]

Checks the state of the fingerprint scanner module. Returns OK or error.

close_uart()[source]

close serial port

compare_templates()[source]

Compares two fingerprint templates in char buffers 1 and 2. Stores the confidence score in self.finger_id and self.confidence. Returns the packet error code or OK success

count_templates()[source]

Requests the sensor to count the number of templates and stores it in self.template_count. Returns the packet error code or OK success

create_model()[source]

Requests the sensor take the template data and turn it into a model returns the packet error code or OK success

delete_model(location)[source]

Requests the sensor delete a model from flash memory given by the argument location. Returns the packet error code or OK success

empty_library()[source]

Requests the sensor to delete all models from flash memory. Returns the packet error code or OK success

Asks the sensor to search for a matching fingerprint template to the last model generated. Stores the location and confidence in self.finger_id and self.confidence. Returns the packet error code or OK success

Asks the sensor to search for a matching fingerprint starting at slot 1. Stores the location and confidence in self.finger_id and self.confidence. Returns the packet error code or OK success

get_fpdata(sensorbuffer='char', slot=1)[source]

Requests the sensor to transfer the fingerprint image or template. Returns the data payload only.

get_image()[source]

Requests the sensor to take an image and store it memory, returns the packet error code or OK success

image_2_tz(slot=1)[source]

Requests the sensor convert the image to a template, returns the packet error code or OK success

load_model(location, slot=1)[source]

Requests the sensor to load a model from the given memory location to the given slot. Returns the packet error code or success

read_sysparam()[source]

Returns the system parameters on success via attributes.

read_templates()[source]

Requests the sensor to list of all template locations in use and stores them in self.templates. Returns the packet error code or OK success

send_fpdata(data, sensorbuffer='char', slot=1)[source]

Requests the sensor to receive data, either a fingerprint image or a character/template data. Data is the payload only.

set_led(color=1, mode=3, speed=128, cycles=0)[source]

LED function – only for R503 Sensor. Parameters: See User Manual for full details color: 1=red, 2=blue, 3=purple mode: 1-breathe, 2-flash, 3-on, 4-off, 5-fade_on, 6-fade-off speed: animation speed 0-255 cycles: numbe of time to repeat 0=infinite or 1-255 Returns the packet error code or success

set_sysparam(param_num, param_val)[source]

Set the system parameters (param_num)

soft_reset()[source]

Performs a soft reset of the sensor

store_model(location, slot=1)[source]

Requests the sensor store the model into flash memory and assign a location. Returns the packet error code or OK success

verify_password()[source]

Checks if the password/connection is correct, returns True/False