Smart Door Locking System using Facial Recognition on IoT and Android
We all want comfort in our everyday life and we want to get things done in a quick and effective way. The innovation and continuous advancement in technology have led to the creation of new phenomena such as IoT (Internet of Things), Edge Computing, machine learning, and whatnot. Internet Of Things
2025-06-28 16:35:18 - Adil Khan
Smart Door Locking System using Facial Recognition on IoT and Android
Project Area of Specialization Computer ScienceProject SummaryWe all want comfort in our everyday life and we want to get things done in a quick and effective way. The innovation and continuous advancement in technology have led to the creation of new phenomena such as IoT (Internet of Things), Edge Computing, machine learning, and whatnot. Internet Of Things is used to connect various components together in a system and intelligently integrate them. Integrating and analyzing such technologies leads to the creation of hybrid ideas solving much of the everyday problems that an average human being faces.
Let’s take the example of a mother who is carrying her 1-year-old and trying to unlock her home. What a hassle would it be to grab the child in one hand and try to look for the keys with the other? Similarly, let’s take another example of a mother who is out shopping without taking her spare keys with her and her teenage daughter in her carelessness sleeps inside the house due to an exhausting day at school. It would be a very problematic situation for both parties if the daughter is a deep sleeper. A very interesting example would be someone living through a pandemic trying to be as hygienic as possible to save themselves from a deadly virus like the novel coronavirus. With the advent of technology, we can now have solutions to such everyday problems that do bug us but are not big enough to be creating a roar but we would definitely be thankful to a person giving us some ease by providing a favorable and inexpensive solution.
We aim to solve such issues by developing a face recognition system that will be able to unlock your door by giving access to permitted friends and family profiles. Our system will include various modes out of which we will implement in home mode and the rest of the modes will be implemented in the future. The face recognition system will be integrated with a smart lock by Raspberry Pi which will lock and unlock depending on the user at hand. Our system would give ease of access to people by providing a hands-free and contact-less unlocking system with personalized greetings.
Project ObjectivesOur objective is to develop an AI and ML-based face recognition system that will be able to unlock your door by recognizing friends and family from an already specified database of the permitted users. Our system will include various modes. The face recognition system will be integrated with a smart lock which will lock and unlock depending on the user at hand. As more people are inclined towards AI-based and IoT based systems, such a system would provide ease of access to people by providing a hands-free and contact-less unlocking system.
The proposed system aims to make the locking and unlocking of doors hassle-free, keeping in mind the new need of the hour known as ‘Contactless’ security system due to COVID-19. Unlike traditional unlocking techniques, users will not have to touch anything including a doorknob for key nor touch screen for the fingerprint scanner. This system will recognize family and friends via facial recognition, will greet them, and then will open the door for them after a predefined time. The system will also announce the arrival of the guests to house members. For this FYP the scope of the system will just be till In-home mode (basic mode), however, in the future, we aim to implement Night and out-home mode as well.
The system will also store the scans of people which it was unable to recognize for up to one month and will notify the owner with an option to contact authorities if an unauthorized person’s face is detected by the system multiple times indicating suspicious activity. There will be an android application as well via which the owner can remotely monitor and access the system. The system will ensure security by switching to traditional unlocking if it is unable to correctly recognize a person
Project Implementation Method ImplementationWe have used Python language to create the facial recognition module. Juypter and PyCharm have been used as IDEs. Libraries like Matplotlib, Scikit-learn, Pandas, and Seaborn were used for visualization. For developing/coding the module we have used the following libraries: OpenCV, NumPy, face-recognition, gTTS, playsound, OS, datetime, time, and TensorFlow.
• NumPy has been used as a data structure; to store images captured in an array.
• OpenCV has been used to read and resize the images captured from the camera.
• face_recognition was used for recognizing faces in a shot and finding their location. Furthermore, it was also used for encoding and manipulation of images.
• gTTS was used for text to speech conversion of the personalized greetings.
• Playsound was used to play the personalized greetings if a match was found.
• OS was used to read stored images from the given directory.
• Datetime was used for timestamping the person.
• Time was used for controlling the duration of obtaining input via webcam.
• TensorFlow was used to implement deep learning with the aim of maximizing the efficiency of our facial recognition module.
For the development of the Android Mobile Application, we have used Android Studio as IDE and Java as the language. Firebase services have been used for;
• Integration
• Database
• Storage, and
• Authentication
For the smart locking device, we have used Raspberry Pi, Raspberry Pi’s camera and screen as hardware, and MotionEyeOS for video surveillance services along with motors and a locking cylinder for the door lock.
Benefits of the Project BenefitsFollowing are the benefits of our project:
Hands-free and Keyless Unlocking with Face RecognitionA lot of times we are carrying things when we reach home and sometimes we are in a hurry and forget our keys. Our system would allow the user to be free from the hassles of the traditional system and feel the power of technology by having complete access to their homes and the system through their phones.
Surveillance of Anyone trying to enter your HomeThese systems significantly reduce the need for hirable security personnel that cost a lot. With human beings, there is always a chance of error as human beings get tired and need a considerable number of breaks but with a facial recognition system for security, you can be protected 24/7 with very little chance of error.
Cost-Effective SolutionMost existing systems are highly complicated with a heavy price tag. Our system aims at being an affordable solution to the security problems of an everyday household.
Personalized Friends and Family GreetingsAll profiles added in the system would have a personalized greeting that can be added through the app. Personalized greetings are a good way to cheer up the guest or yourself.
Enhanced SecuritySecurity is of utmost importance in a smart-lock home system and research on the application of face recognition in fields like law enforcement is proof that it is a reliable solution to swift and secure unlocking with desirable. A crime report compiled from the University of North Carolina’s Department of Justice and Criminology states that 60% of the convicted burglars would scan for surveillance cameras and 40% of them choose a different target trying to avoid it. Facial recognition systems are an extension of such systems.
Hygienic and Germ-FreeThe facial recognition market is expected to grow to over 1.3 billion devices by 2024 and, COVID-19 has also played a major role in increasing this market. Nowadays people desire contactless transactions and the following system provides contactless security. The IoT market is also growing double the rate than it was predicted by the researchers. IoT is required for any software to connect to hardware such as sensors, etc.
2-Factor Authentication in the Case of SuspicionIf someone is constantly trying to get into our home and access is denied, then we lock the home and require a manual passcode of the owner through his own device only to ensure that no unauthorized person enters our home.
Technical Details of Final Deliverable Technical Details OverviewWe wish to solve the issues of a common man that is trying to enter theory home without any hassle. It’s 2021 and the world of technology and IoT which means that the items that we use every day need certain upgrades. Our system would allow people to secure their houses without any keys or passcodes. All we need is the face of the person and if he is allowed access to our database then he can enter our home.
Technical RequirementsWe have used Python language to create the facial recognition module. Juypter and PyCharm have been used as IDEs. Libraries like Matplotlib, Scikit-learn, Pandas, and Seaborn were used for visualization and OpenCV, NumPy, face-recognition, gTTS, playsound, OS, datetime, time, and TensorFlow for facial recognition system. For the development of the Android Mobile Application, we have used Android Studio as IDE and Java as the language. Firebase services have been used for integration, database, storage, and authentication. For the smart locking device, we have used Raspberry Pi, Raspberry Pi’s camera and screen as hardware, and MotionEyeOS for video surveillance services along with motors and a locking cylinder for the door lock.
Learning OutcomesBy developing this project, we were able to acquire the following concept and skills:
- Learning one of the major domains of AI/ML i.e., Facial Recognition.
- Able to work in languages like python and java and implement its libraries extensively.
- Work with services like Firebase for authentication and storage.
- Implementation of application development on Android Studio.
- Implementation of facial recognition module in IDEs like Juypter and PyCharm.
- Understanding and implementing the concepts of IoT.
- Learning how to integrate hardware components, sensors, and software to form a complete system.
Our systems aim to make things as simple and concise for the user as possible by providing them with straightforward instructions and tutorials. All they need is to install their app and use the interface that they are already familiar with like adding and removing profiles and setting the modes. We already do such things in apps like the Contact App, Alarm App etc. We have made the user interface according to the usability principles so that we are able to make things easier for the user. Moreover, other components of our system like the Smart Lock and Raspberry Pi Camera are fairly simple as they just have a couple of functions that they need to perform.
Final Deliverable of the Project HW/SW integrated systemCore Industry ITOther Industries Others , Security Core Technology OthersOther Technologies Artificial Intelligence(AI), Internet of Things (IoT)Sustainable Development Goals Industry, Innovation and Infrastructure, Sustainable Cities and Communities, Partnerships to achieve the GoalRequired Resources| Item Name | Type | No. of Units | Per Unit Cost (in Rs) | Total (in Rs) |
|---|---|---|---|---|
| Total in (Rs) | 79000 | |||
| Resberry pi | Equipment | 2 | 8500 | 17000 |
| Respberry pi Camera | Equipment | 2 | 3500 | 7000 |
| Respberry Pi Touch screen | Equipment | 1 | 7500 | 7500 |
| Motors | Equipment | 5 | 250 | 1250 |
| Circuitry | Equipment | 5 | 250 | 1250 |
| Website Hosting | Equipment | 1 | 6500 | 6500 |
| Mobile Application Development and Publication | Equipment | 1 | 5000 | 5000 |
| Fire Base Database | Equipment | 1 | 5500 | 5500 |
| IBM Watson Services | Equipment | 1 | 6500 | 6500 |
| 3D printing services | Equipment | 2 | 5000 | 10000 |
| logistic cost | Miscellaneous | 1 | 9500 | 9500 |
| Locking Cylinders | Equipment | 4 | 500 | 2000 |