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 two things 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 spicier.
What We Are Going to Build?So to ensure security and remote access we want to think of a new way to connect our door lock to our devices. Let's think about our mobile phones, they can control our smart door locks through MQTT and available protocols. Then why don't we add a 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 biometrics 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.
How We Are Going to Build It?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 is 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,
- NodeMCU
- Electric door lock module
- Relay
- 12v 1A adapter
- Power jack
- Connection Wires
The NodeMCU
NodeMCU is an open-source IoT platform. It includes firmware that runs on the ESP8266 Wi-Fi SoC from Espressif Systems, and hardware that 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.
The Relay
A relay is a switching device as that 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 to 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 to verify the fingerprint and authorize the person. Once the fingerprint is verified the key for unlocking is posted to the Firebase realtime database. The application is made using Kodular. 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.
FirebaseFirebase 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 the 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 the 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 the Database secrets tab, you can find Firebase auth key
If you want to know more about setting up Firebase read the detailed guide here.
NodeMCU - CodeNow it's 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 to Arduino IDE.
Now go and download the code from this repository and replace the 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.
What's Amazing?All the components used in this project are very cheap
1. Fast Unlocking
The fingerprint sensors equipped on mobile phones are really fast and since firebase is a real-time database with a very high speed of operation the locking-unlocking process will be very fast, less than 0.5 s.
2. Advanced Security
The Android application provides cryptographic algorithms that ensure the security of transmitting data, thus the lock gets multi-layer security.
3. Shareable
By sharing the Android application and the Firebase credentials multiple persons can access the same door.
4. Portability
This door lock can replace any lock. Just replace the locking mechanism with this and it will become a smart door.
5. Touch-Free
It's a completely touchless product.
What in the Future?In the upcoming updates, we like to include features like:
- Door lock break alert
- Face detection
- Face unlock
- Unlock notification
We're proud to be a team of tech enthusiasts, constantly pushing the boundaries of innovation with our exciting projects. If you're as passionate about technology as we are, then show your support by joining our Patreon or Buy Me a Coffee page
Patreon: https://www.patreon.com/coderscafetech
Buy Me a Coffee: https://www.buymeacoffee.com/coderscafetech
Feel free to check out our YouTube channel for more awesome projects:
Comments