Intelligent Image Capturing Alarm System Using Raspberry Pi

Home surveillance system assumes an essential part in this present day living style to help recognizing illegal activities. In this proposed paper, an intelligent image capturing alarm system to protect locker was developed. Raspberry Pi 2 is used as the main controller (server). At the point when any conceivable intrusion is identified, a webcam installed to Raspberry Pi 2 will capture the picture of the intruder. In the meantime, the spotlight or light of the house which represented by an LED will be turned "ON" alongside an alarm sound from a buzzer which is fixed as an output. Taking everything into account, this improvement offers reasonable and easy to use surveillance alarm system


Introduction
In present days, the system of home security turns into an indispensable issue with the expanding cases of home breaking or thievery cases. Moreover, the system of home surveillance is essential since the house owner wants to screen their home's circumstances by identifying any undesirable and illegal activity [1]. Years ago, the traditional home surveillance systems have obtained much demand. As time passes, the technology of traditional home surveillance systems has evolved and offers many exciting benefits to the user. These improvements have conquered the weakness of traditional security systems such as power loss caused by the turning on and turning off the process [2]. Home surveillance security system is a smart method for controlling and observing at home by utilizing information technology. Thus, this security system additionally gives a helpful, adaptable and secured environment that improves life quality. Hence, the internet services have become more familiar with these devices and services which are being used to control the recent home surveillance security system.
Recently, the necessity of home surveillance security system is turning out to be extremely important and it is oftentimes utilized in the house or residence [3], business firms [4][5][6], robotics [7][8][9] and also for traffic monitoring systems [10]. The purpose of home surveillance security system is essentially used to screen the activities, behavior or other changes in information in order to manage or protect personal belongings. These days, this surveillance system is being installed at home to monitor and avoid any unwanted activities to occur. Thus, the owner can quickly take necessary actions in case of any aggravations [11].
As house break-in cases increasingly rapidly, there is multiple intelligent home security system that is being developed with many necessary features [12]. One of the fundamental reasons that bring about the increase in the rate of this case is the failure in intruder confirmations [13]. In fact, these failures lead to prolonged crimes. A smart alarm system is developed in this paper to be installed in the locker to overcome the intruder confirmation issues. The development works in a way that when an object's movement or action passes through infrared radiation and blocks it. Therefore, the movement will be automatically detected by the motion detector thus the image of the moving object will be captured using the camera module installed. As a result, the snapped picture will be sent to the user or the house owner via email as an attachment. In respect to that, the proposed development will manage to capture an image upon detecting intruder's motion. Furthermore, a quick move to make a report to the authorized party with the intruder's image as an evidence can be made.
Besides that, an increase in locker break-in cases can occur due to the owner and the authorized party's late action or movement. Owner's lack of awareness of the unwanted incidents may cause this incident to occur often. Therefore, the system is developed to produce an alarm sound to alert surround people. Not only that, a notification will be sent via email to notify the owner that an intrusion had occurred in the house.
This paper introduces a new technique by using Linux system software development with a USB camera (UVC compatible) attached together to it [14]. The locker security system proposes a proper system that is convenient for the user to access. Besides that, some theft happens over and over due to lack of evidence. Hereby, the proposed project will give us enough evidence on the thief and makes it easier to make a report to the authorized party.
In this era of technology, exploration towards a product that costs reasonable price and capable of solving ideas is increasing. A small embedded microcontroller with a flexible platform utilization of the hardware projects is known as the Raspberry Pi. The Raspberry Pi 2 crosses off both criteria [15]. Raspberry Pi is a card-sized minicomputer that can either operate on mains or battery power. It has Linux as its operating system.

Research Method
This section will discuss on the development using a Raspberry Pi 2 based real-time image capturing alarm system. The intruder will be detected using passive infrared (PIR) sensor's infrared (IR) radiation. The changes in radiation field are checked by the sensor. At the point when an intrusion happens, the presence of an intruder will be detected by the developed system and an image of an intruder will be captured simultaneously. From there on, an email will be sent to the user with the captured image as an attachment.
Meanwhile, an LED will be turned on simultaneously in this developed system. The LED will be a replacement for house lamp due to the high cost of the lamp. Not only that, this system will also trigger an alarm sound to alert the house owner or surround people using a buzzer. Figure 1 demonstrates the design system block diagram The designed system generally consists of an Raspberry Pi 2, a PIR sensor, a camera module (Logitech C270 webcam), an LED, and a buzzer. Here, the PIR sensor is set as the input while the outputs are camera module, LED, and buzzer. This system works by reading the input from the passive infrared radiation (PIR) sensor continuously. Normally the output of the sensor will be low.
In case, if any changes in infrared radiation detected, the output will turn on high. Once the output of passive infrared radiation (PIR) sensor turns high, it will automatically trigger the camera module to capture an image as it is set. In the meantime, an LED will be turned on. This LED will indicate that intrusion is happening and will alert surround people. Not only that, a buzzer was installed in the output that will trigger alarm sound when an intrusion occurs. After that, an email will be generated with the snapped picture as an attachment to the user's email address. In order to install and configure the email in Raspberry Pi 2, the system will require SMTP library [16]. SMTP is defined as Simple Mail Transfer Protocol. Raspberry Pi 2 will be connected to the internet and acts as a server to this system. The Raspberry Pi 2 as the main microcontroller will control the input and then the output of the system. As a conclusion, the system will assist the house owner to make a report to authorized party with the intruder's image as an evidence. Since notification via email is included, a configuration is made to the Raspberry Pi 2 to install the SMTP library. The software and hardware components developed are integrated together. Finally, the analysis and verification are conducted to the system performance.

Results and Discussion
In this section, the overall system of intelligent image capturing alarm system to protect locker using Raspberry Pi will be tested and simulated. The outcome of the research will be discussed. Each element focused to be accomplished by this project is verified here. The steps to test every one of those components will be clarified in this part also.

Intelligent Image Capturing Alarm System to Protect Locker Using Raspberry Pi
Hardware and Software Results Figure 2 shows the intelligent image capturing alarm system to protect locker using Raspberry Pi setup. The Raspberry Pi is powered by a 5V micro USB supplied from a laptop. A TP-Link WiFi dongle is inserted into the USB port to connect the Raspberry Pi to the internet. The PIR sensor which acts as the input is connected to the GPIO 4 of the Raspberry Pi. Thus, the buzzer is connected to the GPIO 18 of the Raspberry Pi. Furthermore, the LED is connected to the GPIO24. At the point when each of the hardware consists of the PIR sensor, WiFi dongle, C270 webcam, LED and buzzer have been installed to the Raspberry Pi and the webcam successfully activated, the entire system program will be run. After that, the whole system will be tested accordingly.
The result demonstrates that the system can perform the operation as desired. At the point a movement or changes in infrared radiation detected, the sensor will be activated. PIR motion sensor will give output HIGH, 1 if motion detected and output LOW, 0 if no movement is detected. The HIGH, 1 output of the sensor will trigger the webcam to capture the picture, turn "ON" the LED and turn "ON" the buzzer respectively. Next, the system will send an email to user to notify the possible intrusion. Not only that, the captured image will be attached to the email as attachment and it will enable the user to identify the intruder. Lastly, when the email was effectively sent, the LED will turn "OFF" and the buzzer will turn "OFF" [13][14]. Figure 3 shows the results interface in Putty terminal. The GPIO 4 shows 1 when motion was detected. After that, the webcam will capture the image of the intruder and send to user's email. The GPIO 4 resets to 0 once the email was successfully sent.

Analysis on WiFi Dongle bandwidth
In order to study the range that the WiFi dongle would be able to detect without lose the connectivity between the Raspberry Pi and the router. The analysis was performed by a test using the Raspberry Pi with a WiFi dongle. For this analysis, the Raspberry Pi was connected to the laptop via WiFi dongle and the software Iperf was used to measure the bandwidth. Figure 6 shows the strength of bandwidth detected by Wifi dongle against the distance of the WiFi dongle from Internet router in metres. From this analysis, it is proven that the dongle could be used up to a distance of 70m without losing connection and at distance around 70m keeping bandwidth superior to 2.2 Mbps which was the sufficient bandwidth usage of the system.

Analysis the effect of the internal walls to the wireless signal
The total time taken for the system to send an email alert to the user with the presence of internal walls was recorded. The respective cycle starts from the moment motion is being detected by the PIR sensor until an email notification is sent to the user. A total of 10 tests is made under a stable and fixed internet connectivity at a fixed distance of 6m. Figure 7 shows the data collected from the analysis carried out. The average time taken for the system to detect a motion and send an email to the user with the existence of internal walls is approximately 14.67s. Despite the fact that the Wi-Fi data transmission uses digital signal, the real signal uses analogue radio waves. This analogue radio waves are highly sensitive to interference just in the same way as the radio in the car. For  example, when a car is being driven through an underground tunnel, the signal will be weaker. As a result, the driver will either hear a noise or complete dropout of the radio channel. Thus. The same impact occurs to the Wi-Fi signal. Figure 8 shows three different laptops which are placed in three different rooms in a house. Based on the Figure 9 above, it shows that the full signal strength is gained by the laptop placed directly above the internet router. This is because it is the closest to the router which acts as signal generator and scientifically proven that the wireless signal are capable of penetrating a ceiling without any. Figure 8. Router connected to three laptops in the living room As the laptop in the loft are further away, it may receive a slightly weaker signal and the user may experience some performance issues. Apart from that, the third laptop which is placed in the kitchen experiences the weakest. Although it is near to the router. This is due to the blocked signal by load bearing wall.
In fact, there are several layer behind this walls which are mainly from substantial material. For example, the wall constructed by using bricks, concretes and stones. This factor plays a huge role in signal between the router and Wi-Fi device. Slowness and intermittent connections are also the impact of the factor.

Analysis on the wireless signal when testing in an open space
This analysis was made in a circumstances where the WiFi dongle was connected to the router at a distance of 6 m. There was no walls or any sort of block in between this devices. Figure 9 show data taken for complete cycle during ten tests. The average time taken is calculated as: The average time taken for the system to detect a motion and send an email to the user within an open space is approximately 12.73s. In comparison to analysis in part 3.3, there is a slight difference in timing for the system to complete a full cycle. The total cycle meant here is the time taken for the system to detect a motion via PIR motion sensor, trigger an alarm via buzzer sound. Turn ON LED which represent the house lamp, capture image of the intruder through Logitech C270 webcam and lastly send an email notification with picture of the intruder as an attachment. The whole process took about 14.67s for analysis with internal walls and 12.73s for the analysis within an open space.
As a conclusion, at both the situations the system will be able to send the email to the user successfully. However, in an open space without any internal walls blocking the wireless signal the system sends the email notifications a little faster in an average time difference of 1.94s.

Analysis on the performance of the PIR sensor with distance
The PIR motion sensor analysis was based on motion detection performance validation. The trials were conducted for motion detection at various ranges starting from within 1 m to 7 m range in distance. This process was done during trials in which 10 instances of movement was recorded each for less 1 m, 3 m, 5 m and 7 m ranges respectively.
Besides, the probability of detection (Pd) based on these 10 iterations was calculated for each range. In every one of the trials, the sensitivity potentiometer of the PIR sensor was set for maximum value, 7m range.
From the analysis in Figure 10, it was observed that when the distance is up to 3m range, the probability of detection (Pd) is around 0.9. At 4m range, the Pd is 0.7. However, the Pd reduces to 0.6 for 5m and 6m range. Furthermore, the probability of detection further decreases to 0.4 when detection range is at 7m [3].

Conclusion
Based on the research works, there are three objectives that have been discuss. The first objective is to develop system that can reduce the locker break-in cases. It was successfully develop system that intruders can be caught by image capture. The second objective is to alert the owner on possible locker intrusion. This objective is achieved when intrusion triggers an alarm sound to alert the surround people and sends email notification to the user. Besides that, the objective to develop a notification system for the user via email notification with the picture as an attachment have been achieved from this project. Hereby, the user will be able to identify the intruder. As a conclude, an intelligent image capturing alarm system to protect locker using Raspberry Pi has been effectively created by desired objectives and specifications. Apart from that, this system can be improved to make more advanced and reliable by using internet of things [18].

Performance of PIR sensor with
Distance