Fingerprint Door Lock system using Arduino and Smart phone

Fingerprint Door Lock System using Arduino

Traditional key based door locks are now slowly going out of the trend and electronically controlled door locks are getting popular in the market with increasing IoT based environment. People are now building IoT controlled home which not only gives easiness to control the devices but also add more security to your home. There are many IoT controlled locks are available like Web controlled Door Lock, Face Recognition Door Lock, etc.

In this project, we are going to build a Biometric Lock using Arduino Nano with Bluetooth Module, Solenoid Lock, and Android Phone. Apart from hardware, a mobile application is also used to scan and verify the fingerprint and send the confirmation ID to Arduino through Bluetooth. Here we will use Smart Phone Finger Print Sensor to lock and unlock the door lock.

 

Components Required

  • Arduino Nano
  • Bluetooth Module (HC05)
  • Relay Module
  • Solenoid Lock
  • Buzzer
  • LED
  • Jumper Wires

 

Solenoid Lock

In a conventional door lock, there is a key to pull or push the latch, and we have to operate it manually, but in a solenoid lock, the latch can be operated automatically by applying a voltage. Solenoid lock has a low-voltage solenoid that pulls the latch back into the door when an interrupt (Pushbutton, Relay, etc.) is activated. The latch will retain its position until the interrupt is enabled. The operating voltage for the solenoid lock is 12V. You can also use 9V, but it results in slower operation. Solenoid door locks are mainly used in remote areas to automate operations without involving any human effort.

Solenoid Door Lock

 

Circuit Diagram

The circuit diagram for Fingerprint Door Lock using Arduino is given below: 

Fingerprint Door Lock Circuit Diagram

Connections for this project are very simple. Here we are only connecting a solenoid lock, relay module, and a Bluetooth module with Arduino Nano. The input pin of the relay is connected to the pin 9 of Arduino Nano while VCC and Ground pins are connected to 5V and GND pin of Nano. 5V and GND pins of the Bluetooth module are connected to 5V and GND of Nano while Tx and Rx pins are connected to Rx and Tx of Nano respectively. The positive pin of the buzzer is connected to pin 7 of Arduino and the negative pin is connected to GND of Arduino.

Bluetooth is a very useful wireless communication medium to build IoT projects, we previously used Bluetooth to build many IoT projects

Fingerprint Door Lock Setup

 

Code Explanation

The complete code for Fingerprint Lock using Arduino is given at the end of the page. The stepwise description of the code is given below.

The Arduino Nano and Bluetooth module communicate via serial communication and this makes the code very simple. Since we are using the Arduino’s hardware serial pins (Rx & Tx) and not software serial, we don’t need to include a library for Serial Communication.

The basic function of the code is to monitor the incoming serial data and compare it with pre-defined conditions, if the fingerprint is authorized then open the lock else keep it locked.

 

So start the code by declaring a variable to hold the data received from the Bluetooth and define the Arduino pins to which the Relay and buzzer are connected.

int value1;
#define relay 9
const int buzzer = 7;

 

Inside the setup() function, start the serial communication with a baud rate of 9600 and also set the pinMode for the Relay and buzzer pins.

void setup()
 {
  Serial.begin(9600);
  pinMode(relay, OUTPUT); 
  pinMode(buzzer, OUTPUT);
  digitalWrite(relay, LOW);

 

Next, inside the loop() function, check for the availability of data from the Bluetooth module, if the data is available, then read the data and store it in a variable. After that, use an if statement to compare it and see if it is a 1 or 0. If the data is 1, then open the lock, and if it’s 0, then keep it locked.

void loop()
 {
  while(Serial.available()==0);
  value1 = Serial.read();
  Serial.print(value1);
  if (value1==1)
  {
    Serial.print("Unlocking");
    digitalWrite(relay, LOW);
  }
  if (value1==0)
  {
   digitalWrite(relay, HIGH);
   Serial.print("Locking");
  }
}

 

Android App for Arduino based Fingerprint Door Lock

The app for this project was designed using the Kodular app inventor. Creating an app using Kodular is very simple; you can make an app by combining the blocks according to the flow chart of your project.

To create an app with Kodular, navigate to Kodular.io and create an account if you don’t have one, Login to your account, and then click on the ‘Create Apps’ option.

Android App Kodular For Fingerprint Door Lock System

 

After that, you will be taken to the Projects screen. Click on the ‘Create Project’ button to create a Project. 

Create Project using Kodular

 

Name the app and click ‘Finish’. The project will be created and you will be taken to the Designer page of the project. Now on the Designer page, add these four components from Components Palette to create a layout for the app: Bluetooth Client, Fingerprint, List Picker, and Image Button. List picker and Button can be found in ‘User Interface’ while Fingerprint and Bluetooth can be picked from ‘Sensors’ & ‘Connectivity’.

Kodular Creater

 

Screen properties can be changed by changing the properties for each block.

Kodular Properties

 

After that, move to the ‘Blocks’ screen to build the app using the blocks.

Kodular.IO Platform

 

Now scroll down, click on the ‘List_Picker1’ and drag & drop the first code block as shown in the image:

List Picker in Kodular

 

In the next step, click on the ‘Control’ block and then drag & drop the first code block on the Viewer screen.

Kodular Control Blocks

 

After that, go to the ‘Bluetooth_client1’ block and select the ‘Bluetooth_client.connect’ code block.

Kodular Bluetooth Client

 

Then go to the ‘List_Picker’ block and select the ‘Selection code block’ as shown in the below image.

Kodular Configuration

 

Now in the next step, again go to ‘List_Picker’ block and select the ‘List_Picker. Text to’ code block as shown in the below image.

Kodular Setup

 

After that, go to the ‘Text’ block and select the first code block.

Text Block In Kodular

 

With this, the first code block is finished. We need to create three more code blocks to call the fingerprint sensor of the Android phone and authenticate the fingerprint. The complete code block is shown in the below picture. Use this picture to join the rest of the code blocks.

Fingerprint Door Lock using Kodular

When all the blocks are connected, export the .apk file on your laptop or you can directly export the apk to your phone using the QR Code.

The .aia and .apk file of this app can be downloaded from here.  

 

3D Printed Casing for Biometric Lock

Here I designed a 3D printed casing for this Biometric Lock. For that, I measured the dimensions of the Perfboard and LED hole. The design looked something like this below once it was done.

Chesis For Fingerprint Door Lock System

Chesis Top Of Fingerprint Door Lock System

After that, I exported it as an STL file, sliced it based on printer settings, and finally printed it. The STL file is available for download from Thingiverse and you can print your own casing using it.

 

After printing the case, assemble the circuit into the casing and it looks something like below.

Fingerprint Door Lock System Working

 

Testing the Fingerprint Door Lock using Arduino Project 

After installing the .apk and connecting the hardware as per the circuit diagram, connect the Arduino to the laptop and upload the code (Remove the TX & Rx pins before uploading the code). After that, turn on the Bluetooth of your phone and then pair the Bluetooth module with your phone. 

Now open the app and click on the Bluetooth icon, and connect with the Bluetooth module. 

Biometric Door Lock

Once the Bluetooth module connects with the app, the Bluetooth icon changes into Lock Icon. 

After that, touch the fingerprint button and it will ask you to scan your finger on the fingerprint sensor. If the fingerprint is authentic, then it will open the door else the door will remain in a locked position.

This is how you can use your smart phone’s fingerprint sensor to control a door lock. A working video and complete code are given below.

Code

int value1;
#define relay 9
const int buzzer = 7; 
void setup()
{
    Serial.begin(9600);
    pinMode(relay, OUTPUT);
    pinMode(buzzer, OUTPUT); 
    digitalWrite(relay, LOW);
}
void loop()
{
  Serial.print("Reading");
  while(Serial.available()==0);
  value1 = Serial.read();
  Serial.print(value1);
  if (value1==1)
  { 
    Serial.print("Unlocking");
    digitalWrite(relay, LOW);
    digitalWrite(buzzer, HIGH); 
    delay(1000);        
    digitalWrite(buzzer, LOW); 
  }
  if (value1==0)
  {
      digitalWrite(relay, HIGH);
      Serial.print("Locking");
  }
}

Video

33 Comments

I am just commenting to make you understand of the perfect experience my wife's daughter encountered browsing your blog. She picked up some details, not to mention what it is like to have a marvelous coaching nature to get certain people with no trouble comprehend chosen specialized subject areas. You truly did more than my expected results. Thanks for presenting the priceless, dependable, revealing and also cool guidance on this topic to Ethel.

I must express some thanks to this writer just for bailing me out of this type of challenge. Because of exploring throughout the search engines and getting thoughts which are not powerful, I thought my life was gone. Existing minus the strategies to the issues you have sorted out by means of your entire article is a critical case, and those which might have in a negative way affected my career if I hadn't discovered your website. Your actual training and kindness in dealing with a lot of things was important. I don't know what I would've done if I hadn't come upon such a solution like this. It's possible to at this time relish my future. Thanks so much for this professional and result oriented help. I will not think twice to recommend the sites to anyone who should get guide on this subject matter.

Needed to post you that very little remark to finally thank you so much yet again for all the breathtaking techniques you've contributed here. It's so shockingly open-handed of you to convey unhampered what exactly a number of us could have sold for an e-book to earn some dough on their own, primarily considering the fact that you could possibly have done it if you decided. The concepts also worked as the great way to recognize that someone else have the identical interest like my own to realize way more in regard to this problem. I am sure there are millions of more fun occasions ahead for people who browse through your blog post.

I would like to voice my affection for your generosity in support of men who really need assistance with that matter. Your personal dedication to passing the solution all over had been pretty insightful and have in most cases encouraged guys just like me to achieve their targets. This important guidelines can mean much a person like me and much more to my office colleagues. Thank you; from each one of us.

I want to express appreciation to this writer for bailing me out of this predicament. As a result of exploring throughout the the net and getting things which were not pleasant, I was thinking my life was done. Living devoid of the solutions to the difficulties you've fixed by means of your good short article is a serious case, and the ones that could have in a negative way damaged my career if I hadn't discovered your blog. Your main capability and kindness in playing with a lot of stuff was helpful. I am not sure what I would have done if I had not discovered such a subject like this. I am able to at this point look ahead to my future. Thanks for your time very much for the reliable and result oriented guide. I won't be reluctant to recommend your web page to any individual who would need assistance about this matter.

Thank you for all your valuable work on this web site. Debby really loves doing investigations and it's really easy to understand why. Many of us notice all relating to the powerful tactic you deliver very useful guidelines via the web blog and therefore foster response from other people on the matter while our own girl is truly studying a great deal. Take advantage of the rest of the year. You are doing a remarkable job.

I want to get across my appreciation for your generosity supporting folks who have the need for guidance on this one idea. Your special dedication to getting the solution up and down had become remarkably insightful and have surely helped some individuals just like me to reach their dreams. Your own interesting suggestions denotes so much a person like me and far more to my colleagues. Thanks a lot; from everyone of us.

I as well as my guys appeared to be analyzing the best guides located on your web page and so then I got a horrible feeling I never thanked the website owner for those techniques. Most of the young men ended up as a result passionate to see all of them and now have in truth been loving these things. We appreciate you actually being considerably considerate and also for picking some perfect topics most people are really desperate to know about. My honest regret for not saying thanks to you earlier.

I would like to express my passion for your kindness in support of those individuals that actually need assistance with in this situation. Your real dedication to passing the message all through was definitely invaluable and has continually empowered guys just like me to attain their pursuits. Your invaluable useful information implies a lot a person like me and even further to my peers. Warm regards; from all of us.

I am writing to make you know of the nice encounter my friend's girl undergone browsing your web page. She mastered numerous details, which include what it's like to possess an excellent teaching mindset to have the mediocre ones with ease know just exactly some tortuous matters. You really did more than readers' desires. I appreciate you for offering the insightful, trustworthy, edifying and also unique tips on this topic to Mary.

Thank you so much for giving everyone a very wonderful chance to read critical reviews from this web site. It is usually so good and stuffed with a lot of fun for me personally and my office mates to search your web site minimum 3 times per week to find out the latest stuff you have got. Of course, we are always astounded with the gorgeous hints served by you. Selected 4 ideas in this post are surely the most suitable we have all had.

A lot of thanks for each of your efforts on this site. Ellie take interest in getting into investigation and it is easy to see why. Almost all hear all concerning the dynamic tactic you offer both interesting and useful solutions through the blog and boost contribution from others on the theme then our own child has been learning so much. Have fun with the rest of the year. Your doing a useful job.

I am commenting to let you be aware of of the useful experience my friend's daughter gained using yuor web blog. She noticed a wide variety of issues, which included how it is like to possess a marvelous coaching mindset to let a number of people completely thoroughly grasp a number of problematic topics. You undoubtedly exceeded our desires. Thank you for providing such good, dependable, educational and also cool tips about your topic to Mary.

There are some attention-grabbing points in time on this article however I don抰 know if I see all of them center to heart. There may be some validity but I will take hold opinion till I look into it further. Good article , thanks and we wish extra! Added to FeedBurner as well

I needed to create you a bit of observation in order to give many thanks the moment again with your unique tips you have contributed here. This is wonderfully generous of people like you to present publicly what a number of people might have made available as an ebook to get some dough on their own, precisely considering that you might well have done it in case you considered necessary. Those tactics additionally acted to provide a good way to comprehend many people have the identical zeal just like mine to find out more with respect to this issue. I think there are some more pleasant periods ahead for many who browse through your blog post.

I precisely had to thank you very much again. I do not know what I would've gone through without the recommendations provided by you about my theme. It was a very challenging crisis in my opinion, however , being able to view this skilled form you managed it forced me to weep with fulfillment. I'm happy for the assistance and as well , expect you realize what a great job your are undertaking teaching many others thru a blog. Most probably you've never got to know all of us.

Thanks for all of your hard work on this web site. Kate really loves managing research and it is easy to see why. Most people hear all concerning the dynamic ways you offer very useful guidance via this blog and as well attract contribution from the others on this concern then our favorite princess is really starting to learn a whole lot. Have fun with the rest of the year. You have been carrying out a stunning job.

I as well as my guys appeared to be viewing the great helpful hints found on your web blog while instantly came up with a terrible feeling I had not expressed respect to the web site owner for those tips. Those guys were consequently warmed to study them and have now in truth been enjoying those things. Thank you for genuinely simply accommodating and for deciding on this sort of extraordinary subject areas most people are really desperate to be informed on. My sincere regret for not saying thanks to sooner.

Thanks so much for providing individuals with a very memorable possiblity to discover important secrets from here. It really is so excellent plus full of a lot of fun for me and my office mates to visit your site at a minimum thrice in 7 days to find out the latest guidance you have. Not to mention, we are usually astounded with the astounding secrets served by you. Some 1 facts on this page are undeniably the finest we've had.

I enjoy you because of all your work on this website. Kim enjoys conducting investigation and it's really easy to understand why. My spouse and i learn all of the powerful means you render helpful tips and hints via your web blog and in addition welcome participation from other people on that theme so our own child is certainly studying so much. Enjoy the remaining portion of the year. You're conducting a glorious job.

I'm also writing to let you know what a nice discovery my wife's child went through checking your webblog. She noticed several issues, which include what it is like to have an excellent giving nature to have the rest smoothly thoroughly grasp several tricky issues. You really surpassed our own expectations. Thanks for showing such beneficial, trusted, edifying not to mention cool tips about that topic to Tanya.

I simply desired to say thanks again. I am not sure the things that I would have achieved in the absence of those tricks discussed by you directly on this subject matter. It became the frightening dilemma in my view, however , seeing your well-written approach you solved it made me to weep with fulfillment. I am thankful for this support and then trust you realize what a great job your are accomplishing teaching the mediocre ones with the aid of your site. More than likely you haven't met all of us.

I simply wanted to say thanks yet again. I'm not certain what I could possibly have accomplished without these tricks shared by you directly on such a theme. It was before a real fearsome situation in my view, but noticing a new skilled manner you managed the issue took me to jump over happiness. I will be happy for the guidance and then sincerely hope you really know what a great job you are always doing training others through the use of a web site. I'm certain you have never met any of us.

I want to express appreciation to the writer for bailing me out of this difficulty. As a result of checking throughout the internet and coming across techniques which were not productive, I thought my entire life was over. Existing devoid of the strategies to the issues you have fixed all through your entire website is a serious case, and the ones which might have in a negative way affected my career if I hadn't come across your web blog. Your main ability and kindness in controlling a lot of stuff was crucial. I don't know what I would have done if I hadn't discovered such a thing like this. I am able to at this time relish my future. Thanks for your time very much for your professional and result oriented help. I will not be reluctant to propose your blog post to any person who needs to have support on this issue.

I really wanted to make a remark to say thanks to you for some of the awesome ways you are placing at this website. My prolonged internet look up has at the end of the day been recognized with wonderful facts and strategies to share with my good friends. I would admit that most of us site visitors are really fortunate to exist in a notable network with so many lovely individuals with great basics. I feel extremely privileged to have come across your entire web page and look forward to tons of more brilliant times reading here. Thanks a lot once more for a lot of things.

There are definitely a variety of particulars like that to take into consideration. That is a nice point to convey up. I provide the ideas above as basic inspiration however clearly there are questions just like the one you bring up the place a very powerful factor shall be working in sincere good faith. I don?t know if greatest practices have emerged around things like that, however I am certain that your job is clearly recognized as a good game. Each girls and boys feel the influence of only a moment抯 pleasure, for the remainder of their lives.

Add new comment

The content of this field is kept private and will not be shown publicly.

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.