Wednesday 27 January 2016

Cheap USB fingerprint reader (from Laptop) works with Raspberry Pi

Just connected it to Raspberry Pi.
Did software install:

> sudo apt-get install libpam-fprintd

And then testing:

> sudo fprintd-enroll
Using device /net/reactivated/Fprint/Device/0
Enrolling right-index-finger finger.
Enroll result: enroll-stage-passed
Enroll result: enroll-stage-passed
Enroll result: enroll-completed

> sudo fprintd-verify
Using device /net/reactivated/Fprint/Device/0
Listing enrolled fingers:
 - #0: right-index-finger
Verify result: verify-match (done)

So it works perfectly on Raspberry Pi.

Cheap USB Fingerprint scanner for your Linux project

Recently I bought new Lenovo Yoga 300 laptop. The choice was really fast just the day before my travel to US. Basically I bought cheapest Lenovo laptop and just paid attention to screen resolution, battery power and weight.
The very first thing was installing Ubuntu on external HDD.

It works just fine. Actually touchscreen and screen rotation are not working but everything else works.
And I found that I really missing the fingerprint scanner. It so useful under Linux when you need to do so frequently sudo commands. And with fingerprint scanner it is just simple finger swipe instead of password typing.

I looked at my old Lenovo X200 laptop and typed lsusb and found that fingerprint scanner is actually on USB bus. Aha, this is USB device.
I bought spare 42W7764 fingerprint scanner taken from Lenovo laptop. It cost me around £3 from e-bay. It came with interesting flat cable and strange connector. That connector has 16 pins but flat cable has only four tracks. I just guessed that these four tracks basically USB bus. Close look at PCB confirmed that two offside pins are ground and power and two in the middle likely some differential signal.
I cut flat cable in half  and soldered USB cable. First I soldered GND(black) and +5V(red) and then soldered green and white in the standard order as in USB connector. After connecting, Ubuntu said that USB device appeared but with a lot of bus errors. I swapped green and white and finally got next system logs:

usb 1-4.3: new full-speed USB device number 8 using xhci_hcdusb 1-4.3: New USB device found, idVendor=0483, idProduct=2016
usb 1-4.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 1-4.3: Product: Biometric Coprocessor
usb 1-4.3: Manufacturer: STMicroelectronics
usb 1-4.3: ep 0x83 - rounding interval to 128 microframes, ep desc says 160 microframes

It just works!!!
I installed libpam-fprintd and enabled fingerprint login in User settings and everything works.

I looked at other fingerprint scanners on e-bay and looks like most of them got four wires but with all different types of connectors. Likely most of them USB devices but with non standard connectors.

I think my finding could be very useful to those who need some cheap fingerprint scanner for some project especially with Linux.
Will try it on Raspberry Pi next day.