Fingerprint: external scanner with USB, database, SDK

Dávid Ondruš
Touch4IT
Published in
3 min readAug 1, 2018

--

A lot of mobile devices today have a built-in fingerprint scanner for user authentication purposes. But what if we want to use fingerprint recognition for unlimited number of users stored in database on one device with some extra data attached to users?

Solution

I’ve used Android tablet with USB OTG support. There are many fingerprint scanners available on the market and usually they cost around 100 EUR per device. I’ve used DigitalPersona U.are.U 4500 because drivers were easy to find for all operating systems and also I’ve found a working library for Android to get a raw image from fingerprint scanner to my host device (Android tablet is USB host in this case).

Device

DigitalPersona U.are.U 4500 is the external fingerprint scanner with USB 2.0 cable. OTG cable is needed for connection with Android device (USB -> microUSB).

Library

asia.kanopi.tools:fingerscan:0.1 is simple to use because it offers only a few methods. The main method “scan” accepts handlers so progress of fingerprint scan can be tracked. The result is in the form of byte[] as raw image. To use it with SDK, it needs to be converted to 24-bit V3 bitmap.

Status of fingerprint scanner

SDK

I’ve used SDK called “IDKit Fingerprint SDK Mobile”. It’s possible to try it for free. After initialization it creates SQLite database where all fingerprint data and custom data are stored. Each person using the application is an object of type “User” which holds fingerprints of that person (all 10 human’s finger positions are supported) and also custom data in the form of byte[]. Custom data can be anything, it’s stored as BLOB in the database.

Finger position info attached to each fingerprint

Since raw image needs to be converted, SDK has own method called “convertRawImage2Bmp”. I’ve tried everything I could but for me it didn’t work. It disrupted every input image so much it looked like an old television without signal so I had to use custom implementation attached below in class.

Custom data

In my case, I needed to store some Strings and Booleans such as first name, surname, date of birth, active, etc. They were all parts of my custom object “LocalUser”. All “Serializable” objects can be serialized into byte[] with org.apache.commons:commons-lang3:3.5 — SerializationUtils.serialize(Serializable).

How it works

When a person scans fingerprint, fingerprint is lighten up, captures image and then sends it to a connected USB host device. IDKit SDK tries to match this image against all images (fingerprints) stored in database (1:N). What exactly is considered a match and what isn’t is defined by customizable SDK setting “threshold”. If a match is found, it returns the “User” object that holds that one matched fingerprint. Then it’s possible to extract custom data from that “User” and deserialize it back to the custom object “LocalUser”.

--

--

Dávid Ondruš
Touch4IT

Software Architect | Lead Developer | Backend Developer & Team Leader | davidondrus.sk