Security Surveillance and Home Automation System using IoT

Internet of Things provides connectivity and user interoperability among different systems, devices, networks and services in particular control systems. IoT can be envisioned as a network of connected devices which are capable of providing intelligent services. This paper presents a security surveillance system in buildings based on IoT using Raspberry Pi. It can be used at industries, homes and office etc, where the camera records the movement of objects and using IoT devices and the data is stored on to the server. The idea is to lock the door even from outside the house and it can be opened using the android phone itself. If some intruder tries to break or to get in anonymously, the system will detect the person and photo will be clicked by the security camera and send the message along with photo on to the owner’s mail, thus creating the evidence for our safety. Some additional features for automation like rain sensing windows using rain sensor and servo motor and automatic light on/off for saving electricity and reduce human effort with IR senor and a simple led have also been implemented in this paper. Hardware implementation has been done for the proposed model and it will be applicable for monitoring home, industry, office etc. in the absence of user.


Introduction
Now a days, digital technologies have been revolutionized where different things and people are interconnected in order to send/receive the information. It intends to benefit the people with the help of internet services. In IoT, various things like sensors and other devices are connected through internet to exchange and collect the information with each other. It enables various devices to collaborate, interact, and, learn from each other's experiences just like humans do. Using IoT billions of objects are intelligently connected in variety of applications. IoT is broadly deployed in variety of domains namely: agriculture, healthcare, smart cities. Smart buildings and smart security are becoming a reality with the combination of underlying communication and monitoring infrastructure that comprises of smart devices such as actuators, cameras, sensors, meters and RFIDs. Now days, societies have high demand for security and surveillance as there is rapid developments of embedded system and security awareness. Much research is still going on to improve the design of intelligent surveillance and security system to enhance monitoring capabilities and security of remote places. The main focus of this paper is to implement the functionality of wireless Home automation features and Home security. The model of the currently built system sends the alert message to the owner using IoT if some intruder tries to break or to get into the home anonymously. The system will detect the person and photo will be clicked by the security camera and sends the message along with photo on to the owner's mail. Whereas, the person entering in the house is identified as guest, then the owner can open the door using his mobile phone instead of triggering security alarms. The owner can do various activities like switching on various appliances inside the house, which are

EAI Endorsed Transactions on Smart Cities
Research Article also connected and controlled by the micro-controller in the system to welcome his guest.
These are main key features and the main objectives of the paper : 1. This project has been included with a face detection module with the help of raspberry pi.
2. Open cv with the cascades for the face which is combined with a camera. It can a detect a face of the person standing for a long time in front of the House.
3. For Automation it a preprogrammed process in which it does take input from the sensors and take the action as per the command give for the action for example when a sensor gives a output through GPIO 4. Pins (General Purpose Input/Output).

For
Android door lock I have used a socket connection for the raspberry pi to communicate with a android device which sends command for the raspberry pi to lock or unlock the door.
6. Using sensors like (rain sensor, IR sensor) for rain sensing windows and to automatic switch on and off the light when there are needed.

Related work
Various models for building surveillance have been proposed earlier. These models optimized the surveillance system by using ultrasonic sensors [2], photovoltaic array [3], wireless sensor networks [4]. By introducing telmonitoring, intelligent fish eye camera techniques surveillance system was improved. Though, these techniques were not able to control the surveillance operation sitting at remote place whenever the event occurred.
In [5] author suggested a intelligent and automatic system for smart home using sensor networks. The author used ZigBee and IEEE 802.15.4 to develop energy efficient smart home system and it collect the data using Passive InfraRed (PIR) Sensor, occupancy sensor and photo sensor. In [6] author proposed a smart home automation scheme using IoT and Raspberry Pi. Home appliances are connected and monitored using internet. Surveillance and sensing operation is conceded by Raspberry Pi. Motion sensor and camera were used for detecting motion and intruder at the door.

Proposed Work
In Home security there are two modules: • Smart security camera • Android door lock.
In this project face detection module has been implemented with the help of raspberry pi and Open cv with the cascades for the face which is combined with a camera, it can a detect a face of a person standing for a long time in front of the House. Then it takes a photo of the persons face and email it to the owner's mail id through SMTP protocol (Simple Mail Transfer Protocol). The architectural diagram is shown in the figure 1.
For Android door a socket connection is created for the raspberry pi to communicate with a android device which sends command for the raspberry pi to lock or unlock the door. A socket provides end to end connectivity between two programs running on the network.
Every socket has a associated port number so that the transport layer can recognize the application for which the data is destined. The endpoint address is combination of port number and IP address.

Home Automation Features
For home automation there are two modules: i) Rain sensing windows ii) Automatic light on and off. For rain sensing windows a rain sensor is used to check the rain and then when the value of the sensor become 0 (which means it is raining .) then the windows of the house automatic closes and when the value becomes 1 again(which means the rain has stopped.) the windows will automatically open itself. The rain sensor is shown in figure 3.
For automatic lights off/on a LED and a IR sensor has been used, it is simple a but a useful feature that saves electricity. The value of the IR is 1 then LED will glow and if the value is zero then the LED will not glow. In simple words if there is any person enters the room the light will switch on and it will automatically switch off when the person leaves the room.

Experimental Setup
The basic hardware setup of the proposed system is shown in Figure 4. It consists of a Raspberry Pi, relay, motor, PIR sensor. The Raspberry Pi communicates with all the other devices attached to it. The PIR sensor detects when an intruder enters in the range of it and sends that information to the Raspberry Pi. After that, the Raspberry Pi sends a signal to the web camera to take a photo. The photo taken by the web camera is temporarily stored in the local storage of the Raspberry Pi, then Raspberry Pi sends a mail to the corresponding mail id with an attachment of the image taken.
1. All the connections are connected to raspberry pi through jumper wires male and female respectively. 2. All the sensors are connected to separate GPIO pin and ground connection. 3. And the camera is connected to specific connector provided with the raspberry pi.

Pi Camera
Raspberry Pi supports a light weight and portable Pi camera module. Using the serial interface protocol MIPI camera communicate with Pi. It is normally used in image processing, machine learning or in surveillance projects. It has a fixed focus lens. The advantage of miniature size camera is that it can be installed in a small space. The most important benefit of this camera over a USB webcam is that it is able to make use of the graphics processing capability of the Broadcom CPU.

Conclusion & Future Scope
The proposed method provides a low power and low cost solution for monitoring the human presence and controlling the device from anywhere in the world. This is useful for monitoring home, industry or office etc, in the absence of the user. This can be easily controlled from anywhere by knowing the IP address of the network connected to the Raspberry Pi, so that door will be locked when intruder is inside the room.