If you’re still using traditional keyed locks, then you must be always worrying about losing the key or somebody breaking into your house. With traditional locks, there is a higher risk of keys being misplaced or getting into the wrong hands. As a result, many people are now opting for modern biometric locks to enhance the security of their houses. Unlike the traditional lock, a modern biometric lock requires no key to lock or unlock the door. You no longer need to carry a bunch of keys wherever you go, as you just have to use your fingerprint to unlock/lock the door. But as these smart locks are made using biometric sensors, they come with heavy price tags.
This DIY project will help you to build a low-cost biometric lock. We all have biometric fingerprint sensors in our smartphones. Today, I’m going to use this sensor to make a prototype of the biometric lock at just Rs 850.
Before starting this project first gather these components: –
Bill of Material
Wireless Biometric Lock – Coding
First of all, we will create a program in Arduino IDE and upload it on the Arduino development board. This Arduino program will help create communication between our smartphone and Arduino over Bluetooth. This will enable it to check commands coming from smartphones to perform tasks.
To develop the code, first we have to create a string variable that stores the unique device ID for lock, and then add the servo library. Next, we will set serial baud rate for Bluetooth communication. Here in this code, we have used the baud rate 9600 for Bluetooth communication. You can use different baud rate according to your Bluetooth HC 05. After setting baud rate of Bluetooth HC 05, set the pin for servo motor that we are going to use. (Refer fig 2).
After this, we will create a loop function to store the device ID sent by the Bluetooth in “reads” string. After that we have to create an ‘if condition’ for checking the device ID sent from the Bluetooth. If the fingerprint matches in android app then that app sends the device ID to Arduino. And if this ID matches with the one set in Arduino then the servo motor moves to unlock position.
If the Bluetooth reads the wrong fingerprint, then it automatically turns the servo to lock position. (Refer Fig .3)
We can make the app in two different ways – one in Android Studio and other in Kodular. In this project, we are going to use Kodular, which basically have different code blocks. You can make an app by combining these blocks. It is easy and saves time in coding. But for the developers who love coding, they can use Android studio. You can ask me in the comment section if you want me to make an app using android studio as well.
Use any web browser and open Kodular website to start making app.
First, we add the following components in layout for app: –
- Bluetooth Clint
- List view
- Image Button
After that join the code blocks as shown in the picture below. Then export the .apk to your PC and install that app in your phone.
Wireless Biometric Lock – Circuit Connection
As we have completed our app and uploaded the code to Arduino. Now let’s connect the components as illustrated below.
|GND||Servo Motor GND|
Servo Motor Signal Wire (Yellow coloured)
Making Wireless Biometric Lock
Next, follow the steps given in pic to prepare the lock for the biometric locking system.
Step 1. Get any broken lock from the market or from any hardware shop.
Step 2. Now attach the servo motor moving shaft to the lever of the lock as shown in the pic below.
Step 3. Then close the cover of the lock and connect all electronic components as illustrated in the connection section.
Now, power the lock and servo with a 5-6 V battery and then open the app that we have created.
After that turn on the Bluetooth of your phone and then pair the Bluetooth HC 05 with your phone. After a successful connection with Bluetooth HC 05 with your app, the Bluetooth Icon changes into Lock Icon. (Refer to Fig 9)
After that touch the fingerprint icon. When you touch the fingerprint icon, you will get a message box asking you to unlock with fingerprint. Now touch the fingerprint sensor on your phone. If it matches with the fingerprint set in your phone, then it turns the lock to ‘on position’ and at the same time the lock icon changes into unlocked icon. (Fig 10).
If you give the wrong fingerprint then the lock moves back to its locking position (Refer to Fig 11)
You can download the code from the link below-