A Low-Cost Home Security Notification System Using IoT and Telegram Bot: A Design and Implementation

Home security is a critical issue, especially for the civilians to protect their property from harm. Currently, the increase in home breaking usually occurs during school holidays and public holiday seasons. Therefore, to overcome the problem and the main objective is to design and develop a low-cost home security notification system using PIR sensor to detect movement of intruders, Raspberry Pi Camera, GPS module integrated with Raspberry Pi Zero WH to send an alert notification message with image, date, location, and time via Telegram Bot to the house owner’s and people nearby through a smart phone. The system utilizes the System Development Life Cycle (SDLC) by implementing the waterfall model as the methodology. Three experiments were conducted to examine the effectiveness of the system which is sensor detection range, response time and user acceptance test (UAT). The finding indicates that the home security notification system was efficient, effective, low-cost, and easy to use. Besides, the system can detect the presence of the intruder and send the notification message in a reasonable time. Meanwhile, the result from the UAT indicates that the proposed system has a positive impact and to be well accepted by the majority of the users. Hence, the system can help the house owners to take immediate action such as calling the neighbourhood association or police department authority when the system detects an intruder in the house.


INTRODUCTION
Security has been defined as something that protects you from any risk or danger. For instance, security at home is when you are at home with the doors and using advanced alarm system or sensors to protect your home from breaking. Therefore, in this case the home security system which is the system that incorporated electronic devices working together with central control panel to secure against burglars and other potential home intruders. Hence, home security is a fundamental necessity of family to keep home safe from an intruder to get rob (Parab & Joglekar, 2015).
The newspaper has reported many cases of home robbery in our country today, which normally happened during the school holidays and festive seasons. In 2020, Malaysia's crime index decreased by 21.4% to 65,623 cases as compared to 83,456 recorded in 2019 due to the violent and property crimes decrease by 19.5% and 21.8% respectively to 13,279 cases and 52,344 cases in 2020 (Department of Statistics Malaysia Official Portal, 2021). Property crimes are associated with four parts of a house break-in and theft, vehicles theft, snatch theft, and other thefts. Although, the statistic for house break-in and theft decreased in 2020 due to the Covid19 pandemic, loss of property is not something that can be compromised, and action must be taken to overcome the problem.
Currently, there are many home security systems already exist such as the security system that only alert with email notification and messaging. However, there are many problems occurs such as delay, non-web enabled and hard to deal with during transfer of alert to the user in situation where any unusual occurred inside the home (Tanwar et al., 2017). Meanwhile, the installation of CCTV gave us more benefits in terms of providing evidential images with a recording of the area covered. However, the CCTV provided limited view and it could be manipulated by attackers to serve their purpose. Besides, most of the home security system in the market are expensive, very complex installation and some of the system come with cost of the separated system. Some of the systems also subject to the monthly subscriptions since they are monitored by the security service company. Therefore, the system become exclusively for those people, who are affordable and willing to pay extra costs in order to support home security related system. However, in reality, the house owner may face some difficulties to know the exact current situation of their house, either they leave for a short or long period of time, especially in the incident of theft.
By the advancement of new technologies, controlling and monitoring services, especially for the home safety can be disclosed and addressed by the houseowner. The Internet of Things (IoT) can be utilized to increase the efficiency of the devices but also has economic benefits. IoT is a collection of sensors, actuators, software, electronics embedded with home appliances, physical devices, and vehicles, which connect with each other to connect and exchange data over a network without requiring human-to-human or human-to computer interaction. Recently, IoT has been applied to numerous applications (Abd Kadir et al., 2020;Filho et al., 2021;Phasinam et al., 2022) because it is low-cost, compatible and easy to develop. Therefore, the use of IoT in home security to enhance and improve the current system, especially in cases of theft involving property at home need to be considered accordingly.
In this paper, we have developed an IoT based for home security notification system. This system has been initiated to prevent any break in or theft and potential home intruders. This system detects intruders using the Raspberry Pi as a microcontroller. The microcontroller was equipped with a PIR sensor to detect the presence of any intruders and Raspberry Pi Camera to capture the image of an intruder. The system will send the notification message using Telegram Bot, which is installed in mobile phone to the respective users. Besides the Telegram Bot was used as a remote control to give commands to instantiate and activate the home security notification system remotely. The rest of this paper is organized as follows. In Section 2, the previous study is presented with the related work on home security notification system. Sections 3 presents the methodology which covers the architecture of the proposed system and model used to develop the system. Section 4 discusses the finding and results based on the experiment conducted. Finally, section 5 concludes the paper.

PREVIOUS STUDIES
A group of researchers was proposed a small prototype home-based security system by using Arduino IDE and GSM module to design a PIR sensor and temperature sensor interface. PIR sensors were used to detect any human movement and SMS alert message was send to the house owner's mobile phone (Bhavya et al., 2016). The sensor was small, cheap, low-power, easy to use and could be used to detect any deviation from normalcy. Meanwhile, Morsalin et al. (2016) introduced a smart home concept by using machine-tomachine communication through the use of Near Field Communication (NFC), password, finger print authentication and GSM module. The system worked if the intruder wanted to enter the home by breaking the password without NFC tag and fingerprint encryption, the PIR sensor was used to detect any movement from the intruder and sound a buzzer for alarm. In addition, the Android-based mobile application was used to indicate that the person is an unwanted intruder or a verified person. The houseowner also can send a message to the nearest police station to take necessary steps.
Another research was conducted for wireless home network comprising a GSM/GPRS gateway and three types of wireless sensor nodes, including door security nodes, infrared security nodes and fire alarm nodes (Zhao & Ye, 2008). This system was a low-cost project because all the microprocessors used in the sensor were 8-bit microprocessors, battery-powered to reduce power consumption, and was easy to use. Besides, wireless transceiver modules enable the system to transfer additional information such as voice and image rather than alarm signals. While, Khan et al.,(2012) also designed a low-cost security system by using the sensors integrated with microcontroller and GSM module. In additional, several sensor types such as smoke detector, sound detection, heat detection and touch sensor were used in this project. SMS technology was used to send an alert message to the owner's mobile phone using GSM module. Meanwhile, a group of researchers introduced a system that instantly alerts the user when someone enters the room using camera, IR sensor, microcontroller, and GSM module (Vigneswari et al., 2015). If the intruder has entered the room, the camera will automatically switch on and captured the images of the intruder. The user will then be notified by sending an SMS message, and the intruder images can be displayed by tapping on the link provided. Tanwar et al., (2017) proposed a home security system, capable of monitoring the home from a remote or centralized location. The system allowed users to watch all activities within the home from distance location, which ultimately gives the homeowner satisfaction. The system required motion detection using PIR sensor, a web camera to capture the image and Raspberry Pi as a microcontroller. Microcontroller is used to fetch the signal from web camera and PIR sensor and send capture images to the homeowner via email services. Meanwhile, Made et al., (2018) studied the scheme that could notify, enable an alarm and at the same time, safeguard the house. Therefore, the face identification scheme is intended and programmed to be deployed as remote checks in intelligent homes using Telegram immediate massaging apps. Another researcher also used Telegram Bot to submit order to collect the picture that is then sent back to the customer and integrated scheme in the shape of facial display and forecast of facial identification. The scheme can assist the customer to analyze the home circumstances at anytime and anywhere by using only portable devices with a user-friendly interface (Kumar, 2017). Figure 1 shows the system architecture depicts the flow of the control. Basically, the system architecture mainly consists of four components, which are Raspberry Pi Zero WH, Telegram Bot, smart phone and the sensor devices which are the main detectors to identify an intruder who is trying to break into the house. The sensor acts as input devices that give input data to the Raspberry Pi WH which then process the information and deduce through the unique algorithm, whether there is an intruder or not. The system is fully controlled by the Raspberry Pi Zero WH as a microcontroller, and this microcontroller will continuously monitor to check the input coming from sensor devices and send a message through the Telegram Bot to the smart phone in the case of intruder detection. The microcontroller is connected with different type of devices like PIR sensor, GPS Module and Raspberry Pi Zero Camera. Each sensor plays a vital role in detecting intruder if it occurs and then send an alert message to the users. Moreover, Raspberry Pi Zero WH be able to attach to all sensors and modules, and it comes up with built-in Wi-Fi and Bluetooth Low Energy (BLE) onboard. PIR sensor was used to detect body heat (infrared energy) and activates the motion sensors when the system is armed. The main function of GPS module will dynamically pinpoint the location of the house, and it will relay the coordinates of the house to the Telegram Bot with longitude and latitude. Meanwhile, Raspberry Pi camera captured the image of an intruder when the PIR sensor detects any movements. Microcontroller and smartphone devices are connected to the Internet by using the access point. This is important to ensure that the microcontroller can send an image and notification message to the users when an intruder occurs so that the user can take immediate action to prevent any worse cases such as the loss of property, even life threatening. The image and notification message received through Telegram Bot instant messaging installed in the smartphone. Besides, the Telegram Bot also was used by the house owner to give a real-time command to the system in order to activate the system, remotely. When the intruders broke out at the house, then microcontroller and sensor devices play a major rule by sending an alert message to the house owner and group members. They will receive a notification through his/her smartphone via Telegram Bot if the PIR sensor exceeds its threshold value or when the intruder is detected. Besides, the Raspberry Pi camera and GPS module captured the image of the intruder, and the coordinate of the location where the house break in occurred respectively. Then, send the notification message to the owner smart phone for the verification. Thus, the owner can take immediate action on whether to call neighborhood association or police department authority.

Model Used for the Development of the Proposed System
The System Development Life Cycle (SDLC) based on the waterfall model (Bassil, 2012) was used to develop the home security notification system. It consists of five phases such as analysis, design, implementation, testing and maintenance.

A. Analysis
This is the most important phase (Kazim, 2017) which focus on gathering all information that is needed for the project development. In this phase all information, data and problems of the project were gathered by reading article, journal and thesis form previous research. Besides, the specific web sites were referred to examine the use of the current technology in home security and notification techniques. On top of that, the current technology was observed to understand how technology can be implemented during the project development. From the information gathered, all requirements and opportunities were recognized. Besides, the activities included were the identifications of the hardware and software requirement in the development phase, scope of project, schedule of activities such as Gantt chart and the total budget. Table 1 and Table 2 show details of the hardware and software requirements. Global Positioning System (GPS) module GPS module GY-NEO6MV2 is a GPS receiver that is low cost but powerful. It comes with a small hot-start battery, and EEPROM is designed to provide better signal reception. 5 Smartphone Smartphone is used to run an application (Telegram Bot) to receive the alert notification about an intruder or breaking from Raspberry Pi and PIR sensor.

B. Design
In this phase, the researcher designed the requirement needed in the system development. It implicates the plan for solution which included the system components, system architecture, schematic diagram, flow diagram and flow chart.

C. Implementation
The process of converting the whole requirements and blueprints into the system was done where all components of hardware are assembled. The PIR sensor, GPS module and Raspberry Pi camera were connected to the Raspberry Pi Zero WH board as a microcontroller. The microcontroller was programmed in the Python language. The Python code script was written to program the entire hardware sensor functionalities with microcontroller. Besides, the microcontroller was programmed to send the specific information such as image and notification message to the users when the sensors determine the suspicious movement or intruder break into the house. Telegram application was prepared for receiving notification from microcontroller by using Telegram Bot. In addition, Telegram Bot also used to give the command to the microcontroller to activate the sensor device remotely. Figure 2(a), 2(b), and 2(c) show the captured image from the system.

D. Testing
Before implementing the new system into operation, a debugging and testing of the program for fixing bugs or error of the design were done in this phase. Besides, the installation of sensors and microcontroller was completely attached accordingly to ensure the hardware and software working without any error. Then, the system was evaluated to determine the system performance and to ensure all requirements accomplished. Three different tests were conducted toward the proposed system, which were sensor detection range testing, response time testing and user acceptance testing based on Technology Acceptance Model (TAM) (Venkatesh & Bala, 2008).

E. Maintenance
After testing phase, minor refinement was done to integrate corrections of bugs and the user's feedback which was focused mainly on fine-tuning of system, configuring, installing and usability issues. It must meet the scope of any future enhancement, future functionality, and any other added functional features to cope up with the latest future needs.

FINDINGS AND DISCUSSIONS
To evaluate the performance of the proposed system, three experiments were conducted. The first experiment was set up to detect the range of the PIR sensor to detect any movement from the intruder. Meanwhile, second experiment was to evaluate the time taken for the PIR sensor to send the information to the Telegram Bot. Finally, the third experiment to perform a user acceptance test (UAT) to the selected respondents.

PIR Sensor Detection Range Testing
The accuracy of the PIR sensor was recorded in the different distances of the sensor to detect any movement from the intruder. Table 3 shows the results of the PIR sensor detection range. From the experiment, the sensor detects an intruder at distance 0 cm to 500 cm and sends an alert notification message to the user via Telegram Bot. However, if the intruder more than 550 cm from the sensor, the sensor will not detect the presence of the intruder. The intruder cannot be detected because the intruder is not within the detection range of the sensor.

Response Time Testing
This experiment was carried out to measure the latency, which is the amount of time it takes for an application to respond to the request. The tool used for this testing was Azure Latency Test. Table 4 shows the response time for PIR sensor to send a notification message to the user when the sensor detects an intruder is trying to break into the house. The response times recorded in between 1.10 to 5.50 second to send the notification message to the Telegram Bot. Therefore, the result is acceptable because the delay recorded is reasonable in time. Besides, the house owner and the people nearby will get the notification in a reasonable time. However, the result also depends on the Internet speed of both sides, which is microcontroller and Telegram application installed in the user's smartphone.

User Acceptance Test
A User Acceptance Test (UAT) was used to measure the effectiveness and usefulness of the proposed system. The study was conducted to thirty (30) respondents of house owners. A quantitative research approach has been used for data collection by providing a survey questionnaire to the respective respondents. The experiment was conducted by given the participants opportunity to use and explore the proposed system independently. Then, they were required to answer a set of questionnaires, which consist of sixteen questions and divided into four categories. The study has successfully done to evaluate the effectiveness of the proposed system which includes perceived ease of use, perceive usefulness, attitude, and intention to use. The score value with scale 1 to 5 was given for every type of criteria identified. Each scale represents from strongly disagree (1), disagree (2), neutral (3), agree (4), and strongly agree (5). The data were analyzed using arithmetic mean technique based on the ranking score value. Then overall mean was calculated and classified into three categories, which is negative, neutral and positive based on the range of mean value in between zeros to five as shown in Table 5. This table was used to identify the level of user's acceptance toward the proposed system. The study was successfully done for each type of the criteria to evaluate the effectiveness of the proposed system. Figure 3 summarizes the results for the identified criteria and total means for each category respectively. The result showed that the respondents were satisfied and positively accepted all functionalities and features provided by the proposed work. This can be indicated by the total mean result for the perceived ease of use received 4.62 and perceived usefulness received 4.52 respectively. On the other side, most of the respondents wanted to use the home security notification system because the system is able to prevent or reduce the house break-in or theft cases based on the total mean results for both criteria, which is attitude and intention to use obtained 4.30. Meanwhile, the overall total mean for the user acceptance test was 4.44, which mean the participants positively accepted the proposed system as a tool for home security purposes.

CONCLUSION AND RECOMMENDATIONS
This paper presents an efficient solution and low-cost home security system. The Internet of Things (IoT) was the main concept used to develop the home security notification system with simple hardware at minimum cost. The outcome from this system is useful to be implemented at home to help and reduce the probability of house break-in or theft. Therefore, this system becomes a special enhancement from the existing system for home security purposes which most of the house owner are affordable to install and use this system. The system was developed and work properly to detect and send the alert notification to the smartphone house owner and a group of users using Telegram Bot instant messaging. The system utilized the IoT technology such as Raspberry Pi Zero WH as a microcontroller, GPS module, PIR sensor and Raspberry Pi camera. The image and notification message will dynamically send to the users respectively to take an appropriate action when the house break-in by intruders happened. Besides a real-time command can be used to activate the system remotely using Telegram Bot. Therefore, the system would help to prevent and reduce the number of house break-in cases.
The system was measured using user acceptance test based on the technology acceptance model to evaluate the acceptance of users towards the system. The questionnaire was divided into four categories and the test was participated by thirty respondents. Most of the respondents were satisfied with the functionalities provided by the system and found that it was a great idea to develop a system that focused on the home security notification system. Besides, another two tests conducted to evaluate the performance of the system by monitoring the response time and distance range test. The result showed the system can detect the presence of the intruder and send the notification message in a reasonable time. Hence, it appeared that the system was suitable to be used by the house owner.
In conclusion, this paper has highlighted the use of IoT technology and takes advantage of the Telegram Bot instant messenger capabilities to enhance the home security system and achieve its proposed goal effectively, the contribution lies in cost saving, provides reliable services, and alerts the house owner and group of users the presence of the intruder, thereby reducing loss and damage of the properties.