Software apps and online services
Hand tools and fabrication machines
Security has always been a concern of paramount importance to human beings. We have gone from protecting valuables in the past by keeping them in dungeons to safeguarding data by layers and layers of cryptographic software. Either way, ensuring the well-being of our personal belongings has always been near the top of our priority list. Our home is the best place where we keep our personal belongings. What about the security of our home? There is no doubt that our door locks play a major role in keeping our home safe.
Thanks to technology, today home security involves a wide range of software and hardware including web-based security services, biometrics and personal devices with integrated security levels. One of the biggest advances of the digital-technical age has been the introduction of biometrics into security.
Biometric door locks are now common with increased security levels and ensure the protection of our door locks. But there are two things that prevent the use of biometric locks. One is the cost of the lock which may start from $300. The other one is the lack of remote access.
So let's add some IoT flavor to make the biometric door lock more spicy.
So to ensure the security and remote access we want to think of a new way to connect our door lock to our personal devices. Let's think about our mobile phones, they have the capability to control our smart door locks through MQTT and available protocols. Then why don't we add an additional biometric firewall to that? Yeah, that's what we are gonna do.
Nowadays almost all mobile phones are equipped with fingerprint sensors. We use them to verify the biometric of the authorized person. So it can overcome the disadvantages of now existing smart door locks with an increased security level. In essence, we are going to build a smart remote door lock with additional biometric security.
As almost all smartphones are equipped with fingerprint sensors and we are using those sensors to verify the identity. The data read from the fingerprint sensor is compared with the authentic fingerprints stored in the device using a mobile application and determines whether the person is authorized or not. The data after verification is sent from mobile to a suitable cloud database, from where the smart door lock system retrieves the data. If the person authorized the smart door lock will unlock and if the person is not authorized it doesn't unlock.
These are the hardware components we used in building our project,
- Electric door lock module
- 12v 1A adapter
- Power jack
- Connection Wires
NodeMCU is an open source IoT platform. It includes firmware which runs on the ESP8266 Wi-Fi SoC from Espressif Systems, and hardware which is based on the ESP-12 module. In this project, NodeMCU forms the brain of the smart door lock. The NodeMCU retrieves data from the cloud database and makes the relay ON/OFF according to the data.
Or we can use an ESP8266 with the same code. Then use Arduino Uno to upload the code to ESP8266.
The Electric Lock Module
The electric door lock module operates at 12V which locks when the power is OFF and unlocks when the power is ON. It forms the physical part of the smart door lock.
A relay is a switching device as it works to isolate or change the state of an electric circuit from one state to another. The 12V supply is given to the electric lock module using the Relay according to the data given by the NodeMCU.
Gather all the necessary components. Then solder them properly according to the given connection schema. I used a micro soldering station to control the temperature to avoid damage of NodeMCU while soldering. Be careful not to damage the MCU while soldering as high temperatures may damage the ICs.
We have gathered all the components, connected them properly, and attached code with them. Now it's time to put them all together in an enclosure. The 3D design is made using Fusion 360 and printed at EazyFab. The design files are attached here.
We use the 12V 1A power supply to power up the NodeMCU as well the electric lock module. NodeMCU can't afford a direct 12V supply for a long time as it may damage the MCU. I used the 12V power supply just for a prototype. While building the product be sure to use a 5V power supply for the flawless working of the circuit.
The software components comprise of
- A mobile application
- Firebase real-time database
- NodeMCU code
The Mobile Application
A mobile application is used to scan the fingerprint and to verify the fingerprint and authorize the person. Once the fingerprint is verified the key for unlocking is posted to firebase real-time database. The application is made using Kodular. The screenshots of the design and code blocks are attached. Design the application as shown and code block to give it life. If you are not interested in building the app download it from here.
Firebase is a mobile and web application development platform. Firebase frees developers to focus on crafting fantastic user experiences. You don’t need to manage servers. You don’t need to write APIs. Firebase is your server, your API and your datastore, all written so generically that you can modify it to suit most needs. In our project, we use Firebase real-time database to instantly post and retrieve data so that there is no time delay.
While designing the mobile application we need to fill a thing called Firebase URL.
To find Firebase URL
- Go to Firebase
- Then go and open your project (If you have no projects create one)
- Then move to Real-Time Database in Database
- The selected URL in the screenshot is the Firebase URL
To find Firebase Auth
- Go to Firebase
- Then go to Settings > Project Settings
- From there move on to Service accounts
- Then under Database secrets tab, you can find firebase auth key
If you want to know more about setting up Firebase read the detailed guide here.
Now its time to give life to the smart lock. The code for NodeMCU is developed in C and is uploaded using Arduino IDE. Download the Firebase extension library for NodeMCU from here and add it in Arduino IDE.
Now go and download the code from this repository and replace Firebase URL and Firebase Auth with yours. Then upload the code using Arduino IDE and verify the working.
Now it is time to watch the working. Open the mobile application, click on the lock button, verify your identity and unlock the door.
1. Low Cost
All the components used in this project are very cheap and the net cost of the product will be less than $10.
2. Fast Unlocking
The fingerprint sensors equipped on mobile phones are really fast and since firebase being a real-time database with very high speed of operation the locking-unlocking process will be so fast, like less than 0.5 s.
3. Advanced Security
The Android application provided cryptographic algorithms that ensure the security of transmitting data, thus the lock gets multi-layer security.
By sharing the Android application and the firebase credentials multiple persons can access the same door.
This door lock can replace any locks. Just replace the locking mechanism with this and it will become a smart door.
In the upcoming updates, we like to include features like:
- Door lock break alert
- Face detection
- Face unlock
- Unlock notification
Can you help us out ? Because you small donations will help us to make the project to a product with increased security levels. Your donations are kindly welcomed.
PayPal ID: http://paypal.me/NekhilR
PayPal E Mail: firstname.lastname@example.org
PayPal Phone: +919496876389
BTC Wallet Address: 3GXeARC9p1E5MWp9GHQZV1ML2Z7fScoBwS