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: UART, passwd: Tuple[int, int, int, int] = (0, 0, 0, 0))[source]

UART based fingerprint sensor.

check_module() bool[source]

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

close_uart()[source]

close serial port

compare_templates() int[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() int[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() int[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: int) int[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() int[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: str = 'char', slot: int = 1) List[int][source]

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

get_image() int[source]

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

image_2_tz(slot: int = 1) int[source]

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

load_model(location: int, slot: int = 1) int[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() int[source]

Returns the system parameters on success via attributes.

read_templates() int[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: List[int], sensorbuffer: str = 'char', slot: int = 1) bool[source]

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

set_led(color: int = 1, mode: int = 3, speed: int = 128, cycles: int = 0) int[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: int, param_val: int) int[source]

Set the system parameters (param_num)

soft_reset()[source]

Performs a soft reset of the sensor

store_model(location: int, slot: int = 1) int[source]

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

verify_password() bool[source]

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