Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Secure Smart Door Lock System Based On A

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

Jour of Adv Research in Dynamical & Control Systems, Vol.

12, 01-Special Issue, 2020

Secure Smart Door Lock System based on


Arduino and Smartphone App
Khaoula Karimi, Laboratory of Engineering Sciences and Energies, Polydisciplinary Faculty of Ouarzazate, Ibn Zohr University
Agadir, Morocco. E-mail: karimi.khaoula92@gmail.com
Mustapha Kabrane, Laboratory of Engineering Sciences and Energies, Polydisciplinary Faculty of Ouarzazate, Ibn Zohr
University Agadir, Morocco. E-mail: mustaphakabrane@gmail.com
Oudani Hassan, Laboratory of Engineering Sciences and Energies, Polydisciplinary Faculty of Ouarzazate, Ibn Zohr University
Agadir, Morocco. E-mail: hassan.oudani@gmail.com
Abdessamad Badouch, Laboratory of Engineering Sciences and Energies, Polydisciplinary Faculty of Ouarzazate, Ibn Zohr
University Agadir, Morocco. E-mail: abdessamad.badouch@gmail.com
Salahddine Krit, Laboratory of Engineering Sciences and Energies, Polydisciplinary Faculty of Ouarzazate, Ibn Zohr University
Agadir, Morocco. E-mail: salahddine.krit@gmail.com
Abstract--- Most people have a heavy keychain. It is too difficult to keep their home keys. In case of loss, it is a
stress factor, and sometimes even of financial consequence. In this paper, we present many ideas to implement an
intelligent security lock based on a smart home door locking system. The main purpose of this article is to present
two methods of locking the door of a smart home; 1) using voice commands (lock and unlock the door), and 2)
control the lock by facial recognition using an Android app. The proposed system has a speech recognition section
that uses speech recognition Google API and an Android application developed to take a face photo of the user using
the camera on the mobile phone. Through a face recognition algorithm, the system will compare the taken photo
with the faces stored in the database.
Keywords--- Smart Home, Door Locking System, Android App, Arduino Board.

I. Introduction
Recently, security is a challenge taken up by the research of home automation. A secure home is a home with a
secure access. A connected lock is one of the most important parts of a smart home. Door security has evolved and
several technologies have been implemented for security and remote control of doors. The Smart locker is able to
open and lock the door in real time and store the history of access activity.
Actually, with the use of smartphones, controlling the door access is possible remotely, from anywhere and
anytime. Many Android apps are developed to allow the homeowner to monitor the locking door system for more
security and save. Several technologies and protocols are used for implementing a smart door locking system. The
wireless-based smart locking system uses Bluetooth and Wi-Fi for communication between the smartphone and the
door locking system.
Biometric recognition is a technique based on physiological and behavioral characteristics of a person to identify
this person [1]. The most used of this biometric recognition, especially in IoT security, are face recognition,
fingerprint, voice command, iris, etc… [2]. The choice of biometric method depends on the level of security that we
need also the hardware appliances which we want to use. For example, voice commands, face recognition, or
signature are more used to remote control a smart home using a smartphone. But of these three-techniques face
recognition is the most secure for the control access.
The present paper aims to present several aspects of the smart door locking system. Voice command and face
recognition are the two methods designed for implementing a smart door locking system using an Android App. In
the rest of this paper, we find: Section 2 presenting the background and related works. Section 3 describes the smart
locking system by analyzing and presenting the system architecture, and Section 4 concludes this paper.

II. Related Works


With the growth of vision technologies, many kinds of research are focused on access control by tracking and
localization of persons using a camera. The important causes of the implementation of an access control system are
to help ensure safety and create an easy entrance/exit doors, especially in public places. The author [3] implements

DOI: 10.5373/JARDCS/V12SP1/20201088
ISSN 1943-023X 407
Received: 17 Nov 2019/Accepted: 14 Dec 2019
Jour of Adv Research in Dynamical & Control Systems, Vol. 12, 01-Special Issue, 2020

an automatic door control system on a TI DM368 as a hardware platform, DSP platform and a camera installed on a
wall. They present a system that is able to detect a person’s face and if this person wants to access the door or not,
by analyzing their trajectory. The face recognition is done with a digital camera, and algorithms were developed in
C and executed under the Linux platform for analyzing the trajectory. The disadvantage of this system is that it has a
fixed angle of view, which does not ensure full security. This kind of system that uses monocular or single CCTV
cameras [4],[5] is limited because they allow monitoring a fixed area and does not give enough information about
the location of the users, nor the access history.
Due to the advancements in home automation, many research papers designed smart locking systems with
different technologies and appliances.
The authors [6] use digital keys to control security and they propose a door locking system based on an ARM7
controller and an Android smartphone using Bluetooth as a wireless connection protocol. The proposed system
allows the user to control the door over a short-range from the door via Bluetooth protocol, and also to check the
door’s status. In this system, when the bell rings, the camera will capture a video of the person at the door, and send
this video to the homeowner, who decides to give that person the key or not. The main problem is that the
homeowner cannot lock or unlock the door at a long-range from it. The homeowner should be in the Bluetooth
activation area. Also, the new visitor cannot open the door until he or she gets the key from the homeowner. So,
what can be done if the owner is unreachable?
Taewan Kim et. al [7] design a smart door phone using both sound localization and face recognition in order to
identify visitors’ faces. When the visitor is in front of the door, the camera is rotated in the direction of the sound
source (voice of the visitor) to improve the face recognition. The proposed system is based on 4 microphones that
are installed to locate the visitor’s position. The authors [7] implemented the system on an FPGA (Field
Programmable Gate Array) chip, hardware IP (Intellectual Property) for sound localization and software approach
with an MCU (Microcontroller Unit). They chose to use only one FPGA chip in order to minimize the system size
and to save power consumption.
Arpita Mishra et al. [8] have presented an automatic password-based door locking system. The password consists
of 4 digits. The user has 3 chances to type the password correctly. If the user enters an incorrect password for the
third time, then the controller sends an alert to the homeowner through GSM. The aimed objective of this system is
to provide security for the homeowner using a low-cost system. But the problem of the system that uses a password
for security access [8-9-10] is that anyone can have a chance to type the password correctly, especially if the
system’s owner doesn't change the password regularly, and also when the system doesn't allow the user to change
the password when the power is broken.
Most of the other smart home systems use voice command in their mobile devices for control.
Sunčica Milivojša et. al [11], implement a voice command interface for smart home automation systems. Also,
they describe some of the supported command patterns. This command patterns can be used for specifics appliances.
For this paper, the ANTLR is used to implement the command parser component to create the structured input for
the home automation web service, fulfilling user commands. In this case, there is a probability where a burglar can
use the voice command stored in the database, to enter the home.

III. Smart Door Security Lock


The aim of implementing a smart door Lock login by using an Android-based smartphone is to open the door
through commands given to the electronic devices connected to this door, via Android phone, which turns our house
into a “Smart home” and solves the security issues related to locking and unlocking a door. Our objectives are to
present a smart door locking system that is simple and easy to use, with high accuracy and fewer errors, and more
secure.
3.1 System Architecture
To improve a secure entrance, we propose the design of a smart door locking system. (See Error! Reference
source not found.) that is showing the main system architecture.

DOI: 10.5373/JARDCS/V12SP1/20201088
ISSN 1943-023X 408
Received: 17 Nov 2019/Accepted: 14 Dec 2019
Jour of Adv Research in Dynamical & Control Systems, Vol. 12, 01-Special Issue, 2020

Fig. 1: Architecture System


3.2 Lock Appliance
The lock appliance consists of electronic components to lock and unlock the door remotely using the Android
App. The hardware components used are:
 Arduino Uno
An Arduino board is used to program and code the action of our system's devices. It consists of a programmed
circuit board and can be considered a microcontroller. It is an open source prototype platform and it presents an
Arduino Integrated Development Environment (IDE) that allows the user to program instructions on the board. In
our project, we used the Arduino Uno board; we wrote the appropriate program in C language, then uploaded it onto
the microcontroller.
The main advantage of using that board is that it can execute the program automatically, low cost and it consumes
less than 12 V.
 The Arduino Wi-Fi Shield
The Arduino Wi-Fi shield is an add-on board for Arduino. It allows Arduino to connect to the internet wirelessly
using Wi-Fi. This board is based on HDG104 wireless LAN 802.11b/g System in-Package [12].
 Solenoid Lock
It is an electric bolt for controlling a door lock. The state of its lock tongue depends on the status of the input
current; the lock tongue will extend when the current is not broken. So, the door is unlocked when the power is on
and while the solenoid is powered on. In case of power failure, the door still locked and not opened, so it is a secure
locking system.
Several types of electric bolt exist and we can distinguish them according to the number of input wires. For our
system, we used a Solenoid Lock shown in Figure 2. It is a two-wire electric bolt, because it is more widely used for
doors and it is easy to implement and to control.
3.3 Android App
The homeowner can control the door lock through an Android App. This app allows the user to choose the way
to control the lock system: voice commands or face recognition in Fig.2. It is developed using the Android library
(based on a C++ library) for face recognition and an Android library for getting a voice command. The first step is
user authentication: the user should log in the app with the right login and password in order to be able to monitor
the smart home devices. After that, the user can control the door locking.

DOI: 10.5373/JARDCS/V12SP1/20201088
ISSN 1943-023X 409
Received: 17 Nov 2019/Accepted: 14 Dec 2019
Jour of Adv Research in Dynamical & Control Systems, Vol. 12, 01-Special Issue, 2020

Fig. 2: Interface for Chosen the Control Method


3.4 Voice Control
The main advantages of voice control are that is simple and easy to use. Locking the door using the voice
command does not require any effort; a simple command (open the door) is enough. Several voice recognition
engines and frameworks exist, like the Jasper platform, Alexa Voice Services, and Bing Speech API … [13].
In our system, we use the speech recognition Google API to control the lock/unlock of the door using a human
voice command. The main advantages of this API are that it can convert Audio speech to text, and that it has a vast
database and it’s easy to implement [14].

Fig. 3: Interface for Voice Commands Fig. 4: Voice Command Process


The user sends a voice command to the smartphone with its microphone through the interface presented in Fig.3,
which converts the speech to text using the speech recognition Google API, then, analyzes this text to interpret the
message and then sends the locking command to the door. The process for voice command is shown in Fig.4.
In the Text Analysis phase, the text obtained from Google API will be analyzed and interpreted for performing a
specific action.
The Text Analysis is based on three steps, as shown in Fig.5.
1. Splitting the text into words.
2. Looking for the word “Door”

DOI: 10.5373/JARDCS/V12SP1/20201088
ISSN 1943-023X 410
Received: 17 Nov 2019/Accepted: 14 Dec 2019
Jour of Adv Research in Dynamical & Control Systems, Vol. 12, 01-Special Issue, 2020

3. Looking for the words “Open”, “Close”, “Lock” or “Unlock”.


4. Sending the command to Arduino to achieve the action.

Fig. 5: Diagram of Text Analyzing


The converted command is sent to the Arduino board through the web services. A sketch is used to associate the
text with the appropriate code. In case the text is not found, an error message is sent to the App. Otherwise, the
command will be executed and the door will be opened or closed.
3.5 Face Recognition
Face recognition is a biometric technique used by smart door locking systems, because it is secure and allows the
control of home access. Many algorithms have been developed for face recognition algorithm, including PCA,
Kernel Methods, 3-D Face Recognition Bayesian Framework, ICA, Active Appearance Model (AAM),
Evolutionary Pursuit (EP), SVM and Linear Discriminant Analysis (LDA).
As shown in Fig.6 , The basic principle of this facial recognition algorithm is to store the features of people's
reference photos, then take the features extracted from a face image of an unknown person and compare them with
those that are already stored, to find a match to identify that unknown one [15].

Fig. 6: Face Recognition Process

DOI: 10.5373/JARDCS/V12SP1/20201088
ISSN 1943-023X 411
Received: 17 Nov 2019/Accepted: 14 Dec 2019
Jour of Adv Research in Dynamical & Control Systems, Vol. 12, 01-Special Issue, 2020

On the basis of the comparisons of face recognition algorithms [16, 17], we have used a PCA based face
recognition which consists of two phases: training phase and test phase.
At the training stage, we transform the images of the training set into a set of Eigen faces. Next, we calculate the
weights for each image of the training set and store it, then when we receive an unknown image, we calculate the
weights for this unknown image and store the weights in the vector that gather the unknown image and the training
set.
For the test stage, we take a photo of an unknown person, the columns of the matrix of images are stacked, the
average facial image is subtracted, and the gotten vector is projected onto the Eigen space. Next, we calculate The
Euclidean distance from the test image to all stored images in the database. The image with the closest distance is
selected, and the person is identified.
The goal is to find the vectors that match the distribution of face images throughout the image space. These
vectors are the eigenvectors of the covariance matrix corresponding to the original face images.
Mathematically, we consider a training database consists of M images. The images are normalized by converting
each image matrix to equivalent image vector Ti. So we construct for the reference images, by calculating the
mean of the face vectors and subtract the mean face from each of the face vectors, to obtain a normalized face
vector
=
Where it is average face vector. Then we can find the Eigen face by calculating the covariance
matrix of the vectors:
= A.A
Euclidean distance is used to find out the best match between the keys vectors of the train images the test image.
If the distance is minimal then we have a match correlation.
In our system, the homeowner should store via the training interface the images of persons who are allowed to
lock the door, these images are saved to the Arduino SD Card. Next, when the user wants to open the door, a screen
is taken of their image in the face recognition interface. Then this photo will be compared to the images stored in the
database on the microcontroller (images stored in the SD card) using the Principal Component Analysis PCA
algorithm. If the photo taken matches a reference image, the Android app will send a command to the Arduino board
to open the door Fig. 7.

Fig. 7: Steps for the Proposed Model to Lock the Door Using PCA

DOI: 10.5373/JARDCS/V12SP1/20201088
ISSN 1943-023X 412
Received: 17 Nov 2019/Accepted: 14 Dec 2019
Jour of Adv Research in Dynamical & Control Systems, Vol. 12, 01-Special Issue, 2020

IV. Result and Discussion


The proposed locking system has been tested and the face recognition using PCA was simulated.
For the first time, we tested the PCA algorithm for some images on a high lighting level. We calculate the time
taken for the face recognition of the person also the rate of recognition at this level. Second, we choose a medium
lighting level to identify a person’s images. Finally, the brightness rate has been reduced to 30% and the results have
been noted as is shown in Table1.
Table 1: Simulation of Time for Recognition and Rate of recognition for the PCA in different Lighting Levels
Lighting levels % Time for Recognition Rate of recognition%
30 42s 0
45 15s 60
60 9s 90
80 39s 1

Fig. 8: Results of PCA’s Simulation


From analyzing the obtained result in the Fig. 8, we can say that 98% of the recognition failed due to the low and
the high lighting levels; also it takes more time to identify a person face. The ideal level of light that can PCA
identify the person’s image in a short time with a high rate of face recognition is between 48% and 68%.
Another factor that decreases the rate of face recognition using the PCA is the position of the face: the images
which are captured from the front are more recognized then whose are captured from the side.
The main advantage of PCA is that it is speed, easy to implement and strong to changes in the person image, but
the drawback of this approach is that it requires a frontal view image of persons and specified lighting levels.
From this analysis and discussion, we conclude that the owner can use the 2nd choice to open his door only
when he has good lighting (daylight, light of a lamp) otherwise he must opt for the 1st choice of the command voice.

V. Conclusion
This paper presents two smart door locking systems for smart homes: voice control and face recognition. An
Android app is developed to allow the user to control in real-time the door locking system using the Android Studio
IDE. The homeowner has the choice to open or close the door via voice control or face recognition. For the first one,
a Google API for speech recognition is used. The smartphone gets the user's speech and converts it into text, and
then it will be sent to the Arduino to monitor the locking system. Regarding the second method, it’s the Principal
Component Analysis (PCA) algorithm-based face recognition. It is the most popular method for face detection. The
proposed module on the app is based on this algorithm that calculates the Euclidean distance from the unknown
person’s image to the images stored on the database, for identifying this person and allows the person to lock the
door.
The proposed system allows the homeowner to control the entrance/exit door to keep the home safe and secure.
Also, we can add more locking door systems, like a password or PIN using a Keypad Keyboard or locking the door
with a Fingerprint Sensor.

References
[1] Mecke, Lukas, et al. "Open Sesame!: User Perception of Physical, Biometric, and Behavioural
Authentication Concepts to Open Doors." Proceedings of the 17th International Conference on Mobile and
Ubiquitous Multimedia. ACM, 2018.

DOI: 10.5373/JARDCS/V12SP1/20201088
ISSN 1943-023X 413
Received: 17 Nov 2019/Accepted: 14 Dec 2019
Jour of Adv Research in Dynamical & Control Systems, Vol. 12, 01-Special Issue, 2020

[2] Obaidat, Mohammad S., et al. "Biometric Security and Internet of Things (IoT)." Biometric-Based Physical
and Cybersecurity Systems. Springer, Cham, 2019. 477-509.
[3] Yang, J., Lai, C., Sheu, H. and Chen, J. (2013). An Intelligent Automated Door Control System Based on a
Smart Camera. Sensors, 13(5), pp.5923-5936.
[4] Kieran, D., & Yan, W. (2010). A framework for an event driven video surveillance system. In 2010
Seventh IEEE International Conference on Advanced Video and Signal Based Surveillance (pp. 97-102).
IEEE.
[5] Haritaoglu, I., Harwood, D., & Davis, L. S. (2000). W4: Real-time surveillance of people and their
activities. IEEE Transactions on Pattern Analysis & Machine Intelligence, (8), 809-830.
[6] Pandurang, B., Pede, J. D. P. M. S., & Rahul, G. A. G. (2016). Smart Lock: A Locking System Using
Bluetooth Technology & Camera Verification. In International Journal of Technical Research and
Applications e-ISSN: 2320-8163, Volume 4, Issue 1 (January-February, 2016), PP. 136-139.
[7] Kim, T., Park, H., Hong, S. and Chung, Y. (2013). Integrated system of face recognition and sound
localization for a smart door phone. IEEE Transactions on Consumer Electronics, 59(3), pp.598-603.
[8] Mishra, A., Sharma, S., Dubey, S., & Dubey, S. K. (2014). Password based security lock system.
International Journal of Advanced Technology in Engineering and Science, 2(5).
[9] Oommen, A. P., Rahul, A. P., Pranav, V., Ponni, S., & Nadeshan, R. (2014). Design and Implementation of
a Digital Code Lock. International Journal of Advanced Research in Electrical, Electronics and
Instrumentation Engineering (An ISO 3297: 2007 Certified Organization), 3(2).
[10] Jain, A., Shukla, A., & Rajan, R. (2016). Password Protected Home Automation System with Automatic
Door Lock.
[11] Milivojša, S., Ivanović, S., Erić, T., Antić, M., & Smiljković, N. (2017, September). Implementation of
voice control interface for smart home automation system. In Consumer Electronics-Berlin (ICCE-Berlin),
2017 IEEE 7th International Conference on (pp. 263-264). IEEE.
[12] Store.arduino.cc. (2018). Arduino WiFi Shield. [online] Available at: https://store.arduino.cc/arduino-wifi-
shield [Accessed 25 Oct. 2018].
[13] Erić, T., Ivanović, S., Milivojša, S., Matić, M., & Smiljković, N. (2017, September). Voice control for
smart home automation: Evaluation of approaches and possible architectures. In Consumer Electronics-
Berlin (ICCE-Berlin), 2017 IEEE 7th International Conference on (pp. 140-142). IEEE.
[14] Google Cloud. (2018). Cloud Speech-to-Text - Speech Recognition | Cloud Speech-to-Text API | Google
Cloud. [online] Available at: https://cloud.google.com/speech-to-text/ [Accessed 25 Oct. 2018].
[15] Turk, M.A., & Pentland, A.P. (1991, June). Face recognition using eigenfaces. In Computer Vision and
Pattern Recognition, 1991. Proceedings CVPR'91., IEEE Computer Society Conference on (pp. 586-591).
IEEE.
[16] Singh, A., Singh, S. K., & Tiwari, S. (2012). Comparison of face recognition algorithms on dummy faces.
The International Journal of Multimedia & Its Applications, 4(4), 121.
[17] Dhere, P.K. (2015). Review of PCA, LDA and LBP algorithms used for 3D Face Recognition.
International Journal of Engineering Science and Innovative Technology (IJESIT), 4(1), 375-378.

DOI: 10.5373/JARDCS/V12SP1/20201088
ISSN 1943-023X 414
Received: 17 Nov 2019/Accepted: 14 Dec 2019

You might also like