Introduction: Arduino Fingerprint Door Lock
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:
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
- 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.