Skip to content

Fingerprint door lock based on Arduino and FPM10A optical fingerprint sensor



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. Check below, you’ll find links that help you start with different modules used here

 

 

Different modules we’ll use for this project

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.

1

 

That’s the system I’m using, I bought it for 10$ from Aliexpress as always, but here I’m only using the lock unit and not the included keypad.

 

 

 

 

 

 

0f57558dc72c71ce.jpgSo the system has a DC motor inside, and should be controlled to turn clockwise and anti-clock wise since it doesn’t have a return spring, that’s why in my project I add a L298n H-Bridge module, you can use a little IC H-Bridge it will be nice, but I had to use what I have in my hand for the moment.

 

 

 

12v-electronics-solenoid-lock-assembly-500x500

 

You can use a solenoid lock instead of the mechanism seen above, and control it by a transistor from the Arduino, your wiring then will need only one pin to control the transistor and a fewer lines.

 

 

 

Without further ado… know how your system works and adapt it.



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

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…

Wiring:

wiring 1
Fingerprint door lock system wiring 1

Ā  Ā  Ā  Ā  Ā 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.

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.

Wiring:

2.png
Fingerprint door lock system wiring 2

Ā  Ā  Ā This is the wiring for the second version, I removed the push button as the opening from inside is done now by ‘B’ button, as of course the keypad unit stays inside and it serves to enroll new fingerprints.



Libraries:

Codes:

Code 1: Scanner i2c

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

 

Code 2: FPM10A Fingerprint sensor library example – Enroll

As you can see in the video tutorial, this code serves to add new fingerprint templates to the sensor memory.

 

Code 3: Version 1

Code for the version 1: Download here or check below.

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.

 



Code 4: Version 2

Code for Version 2: Download here or check below.

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.

 

Possible improvements:

Codes are made the simple way as I’m a beginner, so they should be clear for anyone willing to improve it like entering the password it could be more secure as the user should enter a more than 4 digits or less, and the validation can be done with a button then it’s compared to the code programmed… Also you can add the deleting a template sequence, just like adding, press a button -> password -> and type the ID.

Also you can add a buzzer to ring or as an Alarm, or a PIR sensor to turn on the the system whenever a person is near the door…

Hope you like it and if there’s any problem you can contact me, don’t forget to consider a subscribe to the channel.

 

 

 

Yassine View All

Automation and Electrical Engineer, Electronics amateur trying to share my little projects.

6 thoughts on “Fingerprint door lock based on Arduino and FPM10A optical fingerprint sensor Leave a comment

Leave a Reply

Discover more from SURTR TECHNOLOGY

Subscribe now to keep reading and get access to the full archive.

Continue reading