Arduino Fingerprint Door Lock

Introduction: Arduino Fingerprint Door Lock

About: Hi, I'm an electronics and Arduino amateur, I try to share with you my experience and little projects, hope you like it. visit my youtube channel for more projects goo.gl/KSZVRG

Hello, and welcome to this project, actually it includes two projects but they’re pretty much the same, it’s a door lock system based on an Arduino UNO board, FPM10A optical fingerprint sensor and a LCD i²c screen, but for the other version we include a keypad.

And sure don’t forget about the locking system that you’re willing to control, and following this your wiring and codes may change but don’t worry it would be easy

Step 1: Tools

The hardware needed for this project are:

- Arduino board, here I'm using an UNO

- Adafruit FPM10A optical fingerprint sensor

- LCD i²c screen

- And for the second version of the project you'll need a keypad, here I'm using 4x4

And don't forget about your door lock system, I used the one in the picture (10 Bucks from chinese store) but I used only the lock unit, and since that unit has a DC motor that should turn in both directions I had to use my L298n dual H-bridge module, you can use a little IC H bridge if you want, but it depends on the system you're using, you can replace all by a transistor and a solenoid lock...

Before you continue make sure you know how to use all the elements mentionned above, as it will make your project easy to adapt and spot any problem:


Arduino uno + 4×4 Keypad Matrix + LCD i2c screen

Interfacing FPM10A (50DY) Fingerprint sensor with Arduino

Arduino LCD I2C simple use and direct write from serial monitor

Step by step on how to use the L298n dual H-bridge driver with Arduino

Step 2: Version 1

The first version uses: LCD + fingerprint sensor + l298n (to control the system) + push button with a resistor (I used 1k).

For the first version, you need to upload the “Enroll” code first from the fingerprint library (down bellow), and use it to add a fingerprint, upload it and open the serial monitor then type the ID and press “Enter” then follow the steps as in the fingerprint tutorial. Then upload the second code and add the names you want for each user, upload the code and here we go, the fingerprint templates are stored in the modules internal flash drive. Once the code begin working, the Arduino is constantly waiting for a finger to place on the sensor, otherwise if you’re inside just press the button to open, if the finger is valid (is in the database) it will opens the lock and shows a message and the name related to the fingerprint ID, if the ID isn’t paired with a name it will show some strange things :D…

That’s pretty much my wiring, so you won’t be confused by the push button, actually instead of getting the high level from the Arduino 5v pin which requires me to add other wires (and it will be more messy) I just put the pin 8 on High and I read the button state from pin 9 which has a pull-down resistor.

Step 3: Version 2

As you can see in the 1st version you have to use a computer (or whatever you use to program you Arduino) in order to add new templates to the module flash drive, that’s why I made this more embedded version that requires only power source to work, and the new templates are now added via a keypad (which meant to stay on the inside as this project is based on access by fingerprint only, you can combine it with my other project based on keypad only, you’ll have to do some modification but they’re easy).

The keypad is placed inside which means you can open the lock by pressing a button here I’ve chosed ‘B’ as ‘A’ is for adding a new person.

To add new finger template press ‘A’ it will ask you for password that’s already in the code ‘1’ ‘2’ ‘3’ ‘4’, you can modify it there, you enter the code then you enter the ID number as a 3 digits format, examples “001” , “021” or “115” you can enter IDs from 1 to 127, after tapping the ID it will ask you to place the finger, remove it and place it again…Job done. And as the first version it waits for a valid fingerprint to open the lock.

This is the wiring for the second version, I removed the push button as the opening from inside is done now by ‘B’ button.

Step 4: Libraries and Codes

Libraries:

-Download LCD i2c NewLiquidCrystal library

-Download keypad library

-Download FPM10A optical fingerprint sensor

Codes:

- Download i2c Scanner in case you have a different address for your LCD

-The first code in the version 1 is the “Enroll” code from the fingerprint library

Second code for Version 1: Download here

Code for Version 2: Download here

The code I made for the first version is based on “Fingerprint” example from the library just instead of showing the ID on the Serial monitor (which means that the finger print template is in the database) it triggers the whole opening sequence otherwise (which means that the module failed to find match in the database) it shows a simple message on the screen.

The code for the second version is based on both “Fingerprint” and “Enroll” examples, and just like the first version but this time I added the “Enrolling” feature and you can add the ID from the keypad instead of the Serial monitor.

Be the First to Share

    Recommendations

    • Make It Bridge

      Make It Bridge
    • Game Design: Student Design Challenge

      Game Design: Student Design Challenge
    • For the Home Contest

      For the Home Contest

    13 Comments

    0
    ArdeleanD1
    ArdeleanD1

    Question 4 months ago on Step 4

    If i change the dual h bridge with a small relay module (1 channel), what should I change in my code?

    0
    mingmouks
    mingmouks

    2 years ago

    Can I use Arduino nano instead of Arduino uno

    0
    salah_0174
    salah_0174

    2 years ago

    sir please if i used R307 Optical fingerprint instead of Adafruit FPM10A optical fingerprint sensor that's will be ok ?
    or there will be a modification for the code ?

    thanks in advance .

    0
    AYassineLebouiha
    AYassineLebouiha

    Reply 2 years ago

    Hello, I've never used the R307 before, but you have to check if it can work with the library I've used or not.
    If not you have to use suitable library and the functions that go with it.

    0
    danielpcorona
    danielpcorona

    3 years ago

    may sound like a dumb question, but im using the arduino mega 2560 as apposed to the uno, when i load the code, everything works just fine except for the sensor, it just flashes its light but doesnt scan, any idea as to why this happens?

    0
    AYassineLebouiha
    AYassineLebouiha

    Reply 3 years ago

    Hello,
    Yes you can use an Arduino Mega, but make sure you are using the correct pins, is there a special message shown on the serial monitor?

    0
    danielpcorona
    danielpcorona

    Reply 3 years ago

    no there is no message at all, im also using slightly different components. im using the QAPASS 1602A for the LCD and the finger sensor that you can get from adafruit, https://www.adafruit.com/product/751 . im not too sure if this is why its not working properly

    0
    AYassineLebouiha
    AYassineLebouiha

    Reply 3 years ago

    Well first I recommend you to use only the finger print sensor with the Arduino IDE serial monitor... All you have to do is to wire your sensor only with Arduino board, install the libraries and check for example the "enroll" or "fingerprint" examples from the library.
    After doing thisI recommend also to wire the LCD with Arduino and run a simple code to test if it's working okay too.
    This will help you to find the problem. Update me with the results.

    0
    danielpcorona
    danielpcorona

    Reply 3 years ago

    i think my sensor might be fried because o get a message on the serial number that reads "did not find fingerprint sensor"

    0
    AYassineLebouiha
    AYassineLebouiha

    Reply 3 years ago

    No I don't think that the sensor is fried... It's just a pin difference on the Mega
    Here's something I found on Arduino website
    "Not all pins on the Mega and Mega 2560 support change interrupts, so only the following can be used for RX: 10, 11, 12, 13, 14, 15, 50, 51, 52, 53, A8 (62), A9 (63), A10 (64), A11 (65), A12 (66), A13 (67), A14 (68), A15 (69)."

    But as you can notice in my project I'm using an Uno board, I used pins 2 and 3 for RX and TX.

    So just place the RX wire on a pin that can support RX interruption like mentionned above and on the code you have SoftwareSerial mySerial(2, 3); change the 2 with the other supported pin.

    If you still have problems you can go with Hardware Serial, but try that first.

    0
    danielpcorona
    danielpcorona

    Reply 3 years ago

    i got it to work!! thank you!!

    0
    Sai Thanuja
    Sai Thanuja

    3 years ago

    sir please tell us how to upload the code..code is not working ,,,it is showing errors in the header files....please help me out

    0
    AYassineLebouiha
    AYassineLebouiha

    Reply 3 years ago

    Hello, make sure you have installed your libraries correctly, and don't have two or more with the same name, check also your Arduino and port...

    You didn't give the error name or message, so I can't help more for the moment.