Project Overview
Automation is rapidly advancing home security around the world. I wanted to experiment with home locks using Arduino, so I created this automated door lock system.
I designed a Bluetooth chat app for android where I can issue commands to Arduino that unlocks the door for me. I integrated open source libraries to build an android app to test the functionality of my project.
This allowed me to test whether all functions of my project worked perfectly. Afterward, I integrated another feature that accessed bio-metric readings through my smartphone sensor; thus unlocking the door.
My Contribution
I prototyped an effective solution for Home Automation by automating home locks in Pakistani Homes. The locking mechanism can be controlled using a mobile app.
You can control the locking, unlocking features by using a built-in biometric feature through your mobile phone that connects with the automated device.
Furthermore, I used MQTT to allow multiple locks around the household that could communicate with one another using their very own Internet of Things network.
Schematic Overview
To design the circuit for my project, I used materials such as Arduino Nano as the micro-controller, HC-05 as the Bluetooth module, 2 10K Resistors, Servo motor for mechanism, and jumper cables to emulate the project.
To build the schematics I used Easy EDA for drawing the circuit diagram and tested it using Proteus as it follows standard industry practices to build integrated circuits. Afterward, I tested the prototype using Proteus to validate that both software and hardware were working seamlessly together as needed.
Once the tests resulted positive, I moved on to design its PCB using Easy EDA on a double-layer DIP PCB board to build the final product.


Android App For Door Lock
I designed an Arduino app using Kodular to create a dual feature that locked and unlocked the door on request. These actions were made possible by leveraging an "Internet of things" network of user input from the mobile app and the microcontroller(Arduino).
The app verified the user input through the fingerprint sensor and unlocked the door when pressed. Furthermore, Arduino notifies the user about the current state of the door whether it's in a locked or unlocked state.



Basic functionality
To access the following features, a user has to interact with the mobile app, by choosing the above options given to them; mainly, open door, close door accordingly. This sends a signal to the micro-controller that issues a command to perform the programmed feature. See video as demonstration:
Using Bio-metric Sensor
To add a layer of security to the above product, I incorporated a bio-metric sensor feature into the mobile app. This prompted the user to add their fingerprint whenever it was needed to lock or unlock the door.
In case of unwanted access, only the user with the "recorded fingerprint" in the system could be provided access to the door.
In this particular Arduino code, i use the following library
Function for Door Lock
Here is the code responsible for locking unlocking door
This function is responsible for locking the door this function sweeps the servo motor to 0° angle.
Function for unlocking door
Here is the code responsible for locking unlocking door:
This function is responsible for locking the door this function sweeps the servo motor to an 86° angle. When my app authenticates the user biometry signature it sends a string via Bluetooth and Arduino call this function in the instant.
Servo current state
This part of the code gets the current position of the servo motor which tells the user about the current state of the lock lever and sends it back to your app and the app responds to these values respectively.
If the door is locked app sends a signal to Arduino to unlock and vice versa.
Servo library has a built-in function in its library that reads the current position of the Servo motor this function fetches position data of servo and sends it to the user on its app telling the current state of the door lock and keeping the user updated.
Avaliablity of Serial
In void loop() sectin of arduino which is responsible for taking decision wether to lock or unlock door and send current state of door to user on app.
This part of the code checks the Serial availability of HC05 whether there is any string or value transmitted through the user or not.
Door unlock
When biometric sensor varify user fingerprint impression on there smartphone and door is in lock position, it send on over Bluetoth when arduino detect that string it call the unlock_servo() function before that it verify the current position of door lock then take action accordingly.
Door Lock
When biometric sensor varify user fingerprint impression on there smartphone and door is in lockdown mode , it send on over Bluetoth when arduino detect that string it call the lock_servo() function before that it verify the current position of door lock then take action accordingly. and also tell the app about current position of lock lever.
Coclusions
I was able to solve problem of home security using arduino and a along with Bluetooth module and an android pap that control the door. The problems I ran into were lack of range of my Bluetooth module (HC05) that Is 10 meters but in future i use internet protocol to enhance the process over my network and use MQTT inorder to communicate between all my IOT Devices i.e. Door locks and instead of servo i use solenoid locks and app also need some advancement.