Unlock a Door With Your Fingerprint

48,575

735

10

Introduction: Unlock a Door With Your Fingerprint

About: Kinoma hardware products and software solutions are designed to take connected device ideas to prototype and production. Developers adopt the Kinoma platform to build IoT products in JavaScript, and to make th…

We built a biometric fingerprint-controlled lock prototype. A fingerprint scanner is used to capture and store the fingerprints of authorized users. When the scanner recognizes a user, a solenoid plunger disengages and opens the lock.

Parts List:
The fingerprint scanner module is powered by an ARM Cortex M3 CPU, which controls the on-board optical sensor and fingerprint recognition. Fingerprints are stored and processed by the module, which supports a UART protocol for communicating with a host application. The solenoid is powered from Kinoma Create and controlled by a digital output pin.

Step 1: Wiring

The protoboard is connected to the solenoid and Kinoma Create back header pins. The fingerprint scanner is also connected to the back header UART TX and RX pins.

Both front pin headers are configured for +5V and pin 51 is configured as a digital output. The application programmatically configures the front pins and displays the Pins Settings dialog.

Step 2: Protoboard

The solenoid used to lock and unlock the door requires two additional bits of electronics: a transistor and a flyback diode. The transistor acts as a switch for the 5v power supply from Kinoma Create, allowing us to turn on and off that current to the solenoid using our 3.3v digital out pin. The diode helps to protect Kinoma Create from electrical surges generated by the solenoid, dissipating flyback energy as heat through the solenoid rather than as a power spike into the Kinoma Create’s digital output pin.

Step 3: Application Overview

The KinomaJS application opens to a screen that displays a list of registered fingerprints. Three buttons are provided at the bottom of the screen to interact with the scanner.

The Register button kicks off the fingerprint capture and registration flow. Once fingerprint registration is complete, the user associates his or her name with the fingerprint using the Kinoma Create on-screen keyboard. The registered fingerprint is added to the displayed list. The Authorize button is used to validate a fingerprint against the list of registered users. The door is unlocked and a success sound is played if the fingerprint scanned matches a registered user. If the fingerprint is not authorized, the door remains locked and the application plays a failure sound. The Clear button removes all registered fingerprints from the displayed list and clears the fingerprint scanner module storage.

Step 4: The Code

The project includes the KinomaJS application and BLLs to control the fingerprint scanner and solenoid.

The GT511C3.js serial BLL controls the scanner functions, including fingerprint registration, storage, recognition and the CMOS LED. The JavaScript implementation is based on the Windows SDK demo software provided by ADH technology, the manufacturer of the fingerprint scanner module. The solenoid.js digital output BLL controls the door lock by engaging and disengaging the 5V solenoid. Audible and visual feedback is provided when fingerprint authorization succeeds or fails. WAVE files are played using the KinomaJS Media object and PNG images displayed using KinomaJS Texture and Skin objects. The complete project, including code, assets and BLLs is available here on GitHub.

Step 5: Fingerprint Processing

The scanner module does all the work required to capture, store and match fingerprint images. The application controls the scanner by calling functions in the GT511C3.js BLL. The BLL functions in turn send commands to the module via the Kinoma Create serial pins.

A fingerprint capture requires pressing and releasing the finger on the scanner three times. The fingerprint is registered and stored after the third press. The application uses a KinomaJS Behavior instance to implement a state machine that processes each of the three fingerprint scans. To start scanning, a prompt is displayed, the LED is turned on and the code waits for acknowledgement that the finger is pressed on the scanner:

The is_finger_pressed BLL function is called every 200 milliseconds by invoking a repeated polling hardware pins request. The result is sent to the application fingerPressed handler.

The handler notifies the application by distributing the onFingerPressed and onFingerReleased events to the application behavior, which in turn advances the state machine to capture once the finger is pressed.

Step 6: Fingerprint Images

The fingerprint scanner captures fingerprints to a binary template format and stores the templates in an on-board database. In addition to the fingerprint templates, the scanner provides the ability to read the raw fingerprint image. The application displays the fingerprint image on the Kinoma Create screen.

The get_rawimage BLL function is invoked to retrieve the raw fingerprint image from the scanner.

The function returns a memory chunk containing the 160 x 120 raw fingerprint image at 32 bits per pixel. The application lightens the pixels for display.

A KinomaJS Picture object is instantiated to display the fingerprint image. Picture can display a variety of image file formats, including PNG, JPEG, GIF and BMP. Since the fingerprint image is just raw pixels, the application builds a BMP file in JavaScript to wrap the pixels in a format that can be displayed by Picture.

Finally the application instantiates a FingerprintPicture template to display the fingerprint BMP image file. Since the raw image is rotated sideways, the Picture behavior rotates the image 90 degrees about the center for display.

The fingerprint list, including references to the saved fingerprint image files is stored as JSON in a preferences file.

The preferences file is read at application launch and included in the instantiating data used to build and display the list.

Step 7: Finish!

Once the prototype is wired up, simply run the serial-fingerprint-lock sample application from Kinoma Studio. Enjoy!

This project is always a crowd pleaser and was demonstrated this year at SXSW Interactive, Maker Faire Bay Area and World Maker Faire New York.

If you got stuck along with way, we’re here to help — come visit us at our forum and let us know how we can help.

Be the First to Share

    Recommendations

    • Big and Small Contest

      Big and Small Contest
    • Game Design: Student Design Challenge

      Game Design: Student Design Challenge
    • Make It Bridge

      Make It Bridge

    10 Comments

    1
    Kiiiza Ritah
    Kiiiza Ritah

    5 years ago

    Nyc project, i wud like to carry it out, bt i dont knw how to code, wat can i do....??

    0
    1828672351
    1828672351

    Reply 4 weeks ago

    Yes

    0
    1828672351
    1828672351

    Tip 4 weeks ago on Introduction

    Nice project but I do not no the code for the 3rd one help me please help

    1
    Bentley_Maniac
    Bentley_Maniac

    7 years ago

    any idea how to make this using the bio fingerprint scanner from a Dell Vostro?

    It has 6 wires in its tape.

    0
    Kinoma
    Kinoma

    Reply 7 years ago

    I'd try to identify the original manufacturer and part number of the part - maybe you can get the pinouts and data sheet for it.

    0
    korbindallas
    korbindallas

    7 years ago

    The scanner link take you to the supplier and it's $50. The rest can't be more than 10-15

    0
    ckerr5
    ckerr5

    7 years ago

    Any one have a guess at an approximate cost for all the required stuff for this? I'm just looking for a ballpark answer cause I'm curious.

    0
    chazkapow
    chazkapow

    7 years ago

    excellent for electrics learning, thanks

    0
    kikinick1234
    kikinick1234

    7 years ago

    brilliant instructable :D like it!