• 검색 결과가 없습니다.

Home Security System Based on IoT

N/A
N/A
Protected

Academic year: 2021

Share "Home Security System Based on IoT"

Copied!
8
0
0

로드 중.... (전체 텍스트 보기)

전체 글

(1)

IoT 기반 홈 보안 시스템

김강철*ㆍDing-Hua Wang**ㆍ한석붕***

Home Security System Based on IoT

Kang-Chul Kim*ㆍDing-Hua Wang**ㆍSeok-Bung Han***

요 약

본 논문은 휴대폰에서 사용할 수 있는 IoT 기반 홈 보안 시스템을 개발한다. 제안된 시스템은 데 이터를 수집하는 센서, 카메라, 게이트웨이와 Xively 플랫폼으로 구성된다. 라즈베리파이는 3 종류 의 센서로부터 데이터를 수집하고, Xively로 데이터를 전송하고, 카메라의 영상화면을 인터넷을 통 하여 휴대폰의 클라이언트로 전송한다. 서버는 Xively, 라즈베파이에 존재하는 소켓 서버와 Google 에 있는 이메일 서버로 구성된다. 제안된 시스템은 움직임, 화재 위험, 가스 누출이 발생하면 이메 일, 텍스트 문자와 영상화면을 전송하고, 라즈베리파이를 통하여 가스 밸브를 제어할 수 있다. 실험 결과로부터 가스 누출 등으로 위험이 발생하면 사용자는 이메일, 문자 메서지를 전송받고, WIFI 또 는 LTE를 통하여 스마트폰으로 집내의 영상화면을 볼 수 있다는 것을 확인하였다.

ABSTRACT

This paper aims to build a home security system based on IoT to monitor a home on a mobile phone. The system consists of data gathering sensors, camera, gateway and Xively platform. The Raspberry Pi collects data from the three sensors and sends the data to Xively, and sends the video stream of home to a client in a smart phone through a internet. The servers are composed of Xively, socket server in Raspberry Pi and E-mail server in Google. The proposed system transmits e-mail, text message, and video stream when there are motion, fire, and gas leakage, and can control the gas valve through Raspberry Pi. The experimental results show that a user gets ‘emergency E-mail’ and text message and watches the video stream of the home through WIFI or LTE on a smart phone.

키워드

Home Security, Raspberry Pi, Gas Leakage, Motion Detection, Xively, IoT.

홈 보안, 라즈베리 파이, 가스 누출, 움직임 감지, Xively, 사물 인터넷.

* 전남대학교 컴퓨터공학과 ([email protected])

** 전남대학교 컴퓨터공학과 ([email protected])

*** 교신저자 : 경상대학교 전자공학과 ㆍ접 수 일 : 2016. 10. 26

ㆍ수정완료일 : 2017. 02. 13 ㆍ게재확정일 : 2017. 02. 24

ㆍReceived : Oct. 26, 2016, Revised : Feb. 13, 2017, Accepted : Feb. 24, 2017 ㆍCorresponding Author : Seok-Bung Han

Dep. of Electronics Engineering, Gyeongsang National University, Email : [email protected]

Ⅰ. Introduction

IoT(: Internet of things) is the most popular technology in recent years. It changes people’s

living ways and makes “things” be intelligent or smart. IoT refers to the combination of the device and the internet through a huge network in order to facilitate the identification and management.

http://dx.doi.org/10.13067/JKIECS.2017.12.1.147

(2)

With the rapid development of economy and the increased urban population dramatically, theft, burglary, robbery and other incidents have been rising. These incidents take serious influences to the stable life of people. People want to check the home situations at any time in any place. As the technology of communication, sensors and IoT has developed, home security has entered the era of intelligence. An intelligent home security system collects sensor’s data, and send the information to the user via the internet, no matter where the user is. The user can monitor the situation of a home with smart phone.

This study aims to get the information on home security. It provides a way for users to see the video stream, gas leakage and fire of a home from website or mobile phone. The proposed system is implemented by IoT platform(such as Xively), which provides the connection between users and the hardware devices.

In the following section II, the related works of several smart systems are introduced. In section III, the proposed system are introduced. System implementation is described in section IV, and the results of the system are shown in section V.

Finally, conclusions are described in section VI.

Ⅱ. Related Work

Many IoT systems about the smart home have been developed in recent years.

Sarthak Jain[1] presented a home automation system based on Raspberry Pi. The system controls devices such as electric power monitoring, light control, security at home by the command from the E-mail. The advantage of this system is to control many devices at home. But this system does not have camera, so it cannot capture the video or the photo from the user’s home and the user cannot see the situations of the home.

Nitin Sinha[2] proposed a sensing and monitoring system based on Xively, which detects smoke, humidity and temperature by using the MQ-2 and DHT11 sensors. The data are collected and sent by Raspberry Pi. Xively manages and analyzes the data and shows them by the graphic. Users can check it in the website or the mobile phone. The advantage of the system is that it stores the data in the cloud server and users can check it at the any time through the internet.

Siwakorn Jindarat[3] implemented a smart farm monitoring system using Raspberry Pi and Arduino.

This system is built to manage the chicken farming by using a smart phone. The system can monitor the temperature, humidity and climate quality through a smart phone. It is convenient for farmer to use the system at any time.

Alper Gurek[4] presented a home automation system based on Android. This system allows user to control the home appliances through the Android application. The advantage of the system is that it can add the sensor easily because the algorithms to control the sensor at home are almost same.

H.EIKamchouchi[5] presented a home automation system based on SMS(: Short Message Service).

The system mainly contains GSM(: Global System for Mobile communication) model and micro controller model. The GSM model exchanges data between users and the system through the SMS technology. The controller is the brain of the system to control the sensors and GSM model. The system supports a wide range of the smart home, like home security, power management, etc.

Se-Eon Park[6] presented a home system to monitor the power of the appliances which connect with the Arduino. The system rings the smart phone when the power of appliances over the limit power value.

Jeong-Won Kim[7] presented a smart home system to monitor environment of the home with Raspberry Pi. The system has various sensors to

(3)

collect the data and shows data through the internet interface.

There are many platforms used in the IoT system, like Xively. and above most researches focus on connecting the users and their home by single board computer, such as Raspberry Pi, Arduino.

In this paper, we design the home security system based on Xively, socket server, E-mail server and text message with the Raspberry Pi. It has the camera to see the video stream, the gas sensor to detect the gas leakage, the flame sensor to detect fire and the motion sensor to detect the movement. We also use the motor to lock the valve.

Ⅲ. System Structure

The system structure is shown in Fig. 1. It mainly has two parts: the local part and the cloud part.

Fig. 1 Diagram of the Proposed System The hardware of the system consists of a Raspberry Pi, a gas sensor, a motion sensor, a fire sensor, a motor and a Raspberry Pi camera:

MQ-2 is a sensor to detect the combustible gas.

The electrical conductivity of the sensor increases with the increase of the concentration of combustible gas in the air[8]. MQ-2 sensor detects the gas leakage of home, and it is connected to the GPIO Pin 12 of Raspberry Pi. The data are collected and sent to the Xively by Raspberry Pi.

Xively collects and analyzes the data by Xively’s own servers. Finally, Xively shows the data in the graphic at Xively’s webpage. The Raspberry Pi controls the motor to close the valve when the gas leakage is over the limit value.

Raspberry Pi[9] has CPU, GPU, RAM, USB port, Ethernet port, HDMI port and GPIO(General Purpose Input Output) pins. It is connected with the sensor, keyboard, mouse, internet and monitor of the system.

Motion sensor(HC-SR501) is used to detect human or animal motions by infrared light[10].

Motion sensor is connected to the Pin 11 of the Raspberry Pi. It detects the movement of the human and outputs a TRUE value to the Raspberry Pi when there is movement. The Raspberry Pi analyzes the signal then sends ‘emergency E-mail’

and text message to users.

The camera module includes a sensor and lens;

it needs to wait for instructions from Raspberry Pi.

It has a 5-million-pixel sensor to capture an image and to record 1080p video. The camera can be inserted into the CSI interface on the Raspberry Pi, and it is using I2C protocol. Raspberry Pi camera is connected to the CSI interface of the Raspberry Pi. It captures the video of the home and the video data are collected by the Raspberry Pi, then the Raspberry Pi makes the video stream and sends it to the socket server.

LM393 uses a special infrared tube to detect the flame, and then the brightness of the flame is changed into level signal. Flame sensor detects the fire’s infrared ray which wavelength is in the range of 760 nm to 1000 nm. The system sends the risk E-mail when the fire is detected.

(4)

1. # Xively setting

2. FEED_ID = “ enter feed_id ” 3. API_KEY = “ enter api_key ” 4. api = xively.XivelyAPIClient(API_KEY) 5. # Send the data to Xively

Ⅳ. System Implementation 4.1 Xively’s implementation

.Xively is a platform built for the IoT. It includes directory services, data services, a trust engine for security, and web-based management application. Fig. 2 shows the flowchart of the Xively operation.

Fig. 2 The flowchart of Xively operation In the first part of the flowchart, we set up the Xively. Table 1 shows the code of Xively setting.

There are two important parameters: FEED_ID and API_KEY, which ensure the system to be able to connect to the Xively’s server. The system detects the connection of the MQ-2 when the input of Pin 12 is TRUE, and the Raspberry Pi starts to collect the data, and sends it to the Xively.

Table 1. Python code of the Xively Setting

4.2 Socket server’s implementation

The socket interface is one of several application programming interfaces to the communication protocols[11]. Stream sockets provide a reliable connection-oriented service such as TCP[12]. The connection between the socket processes is divided into three steps: server monitor, client request, connection confirmation. Socket monitors the client connection requests in real-time. When the server side of the socket receives the connection request from the client socket, the server responds to the client and tries to send the data[13].

Fig. 3 is the diagram of socket processing. The socket server runs on Raspberry Pi and the client processing runs on smart phone in our system. For the server side, the IP address and network port bind to the socket firstly. After that, server enters to the listen state and wait the incoming attempt.

When the incoming attempt is accepted, the server creates a new TCP connection from the remote client. After the connection is created, client and server start to exchange the data each other.

Fig. 3 Socket processing

Fig. 4 is the network flow for the socket part in our system. The Raspberry Pi connects to the router through the cable and communicate to the mobile phone through the internet. When the socket

(5)

1. # connects to the socket 2. server_socket = socket.socket () 3. server_socket.bind ( “IP hosts”, “ port ” ) 4. server_socket.listen ()

5. # accept the connection

6. connection_1 = erver_socket.accept () [0].makefile() 7. # record the video

8. try:

9. camera.start_recording (connection_1, format = ‘h264’) 10. finally:

11. connection.close() 12. socket_server.close()

client tries to connect to the server, it connects to the external IP of the router. But the socket client cannot find the Raspberry Pi through the external IP. So the port forwarding technology which gives a unique port of external IP to socket sever is used to make sure that socket client can find the socket server in local network. The router forwards a port of external IP to the Raspberry Pi and the socket client connects to this port to communicate with the Raspberry Pi. The client can connect to the server through the Wi-Fi or LTE(Long Term Evolution).

Fig. 4 System network flow

Fig. 5 is a flowchart for socket server operation.

After the Raspberry Pi camera is connected to Raspberry Pi, the Raspberry Pi reads the signal for camera ready from the CSI interface, and initializes the camera. When the system gets the signal from the socket, the camera begins to record the video and the Raspberry Pi sends it to the socket. Then socket server outputs the video stream in real-time, users can see the video through the network video player.

Fig. 5 The flowchart of socket server operation Table 2 shows the code of socket sever. The IP address and the port of network are set up and the socket starts to send the data stream to the cloud when the connection of the socket is accepted. The data stream can be seen in real-time.

Table 2. Python code of the socket

4.3. Text message implementation

E-mail is good for notification, but sometimes user may ignore the E-mail. Text message is made to fix it.

(6)

To use the SIM(subscriber identity module) card by using Raspberry pi, we change the USB mode into 3G network modem firstly. Then we deploy the network configuration to ensure 3G wireless card can detect the 3G network.

Gammu is the name of the project, which is used to control the phone. We use the gammu software to manage the 3G wireless card and employ python to send the text message.[17] The system sends the emergency message to user’s phone when the leakage of gas is detected. Shown in Fig. 6.

Fig. 6 Flowchart of text message

Ⅴ. Experimental Results

In this paper, the implemented system like Fig. 7 detects the gas leakage, fire situation, moving object and user can see the video stream of the home by using the E-mail, text message and VLC(Video LAN client) via the smart phone.

Fig. 7 Home Security System

When the moving objects, fire or gas leakage have been detected, the system sends the

‘emergency E-mail’ and text message them to users. Fig. 8 shows the ‘emergency E-mail’ of moving object from the system. And Fig. 9 shows the text message of gas leakage. After users read the “risk E-mail”, they can see the video stream in the network video stream player.

Users need to type the IP address of their home’s network into the VLC. Then the users can check the situation of the home. Fig.10 shows the situation of the home on mobile phone after the movement has been detected.

Fig. 8 The ‘emergency E-mail’ for moving object

Fig. 9 The text message for gas leakage

(7)

Fig. 10 The video stream after the movement is detected

To help the user get the trend of data and predict the situation of home when the data change, the Raspberry Pi sends the data of gas leakage, fire detection and movement detection to the Xively platform. Xively analyzes the data and shows it with a graph. User checks it from their mobile phone. Fig. 11 shows the gas leakage graph in the Xively.

Fig. 11 Gas leakage in Xively

VI. Conclusions

This paper implements a home security system to be able to monitor the home with three sensors through smart phone. The system monitors the gas, fire and movement situation of the home. The

Raspberry Pi collects the sensor data, sends the data to the server and controls the motor to lock the gas valve.

The user gets the ‘emergency E-mail’ and text message when the contretemps in the home are detected. and can see the video stream with the VLC via the smart phone.

We are going to make an Android application to control the system and add more functions to the system.

References

[1] S. Jain, A. Vaibhav, and L. Goyal. “Raspberry Pi based Interactive Home Automation System through E-mail,” Conf. International Conference on Reliability, Optimization and Information Technology, Faridabad, India, Apr.

2014. pp. 277-280.

[2] N. Sinha, K. E. Pujitha, and J. S. R. Alex.

“Xively Based Sensing and Monitoring System for IoT,” Conf. International Conference on Computational Collective Intelligence Technologies and Application, Tamilnadu, India, Aug. 2015.

pp. 1-6.

[3] S. Jindarat and P. Wuttidittachotti. “Smart Farm Monitoring Using Raspberry Pi and Arduino,” Conf. International Conference on Computer, Communications, and Control Technology, Sarawak, Malaysia Aug. 2015. pp.

284-288.

[4] A. Gurek, C. Gur, C. Gurakin, M. Akdeniz, and S. K. Metin. “An Android Based Home Automation System,” Conf. High Capacity Optical Networks and Enabling Technologies, Magosa, Cyprus, Feb. 2013. pp. 121-125.

[5] H. EIKamchouchi and A. EIShafee. “Design and Prototype implementation of SMS based home automation system,” Conf. International Conference on Electronic Devices, Systems and Applications, Kuala Lumpur, Malaysia Nov.

(8)

2012. pp. 162-167.

[6] S. Park, C. Hwang, and D. Park. “Internet of Things(IoT) ON system implementation with minimal Arduino based appliances standby power,” J. of the Korea Institute of Electronic Communication Sciences, vol. 10, no. 10, Oct.

2015, pp.1175-1182.

[7] J. Kim, “A Smart Home Prototype Implementation Using Raspberry Pi,” J. of the Korea institute of electronic communication sciences, vol. 10, no. 10, Oct. 2015, pp.

1139-1144.

[8] P. Dempsey and K. Sangani, “The Teardown,”

J. of Engineering & Technology, vol. 9, no. 5, June 2014, pp. 86-87.

[9] E. Upton and G. Halfacree, Raspberry User Guide. John Wiley & Sons Ltd. 2012.

[10] A. Bradbury and B. Everard, “Learning Python With Raspberry Pi,” John Wiley & Sons Ltd, 2014.

[11] IBM. “TCP/IP Tutorial and Technical Overview,” Int. Technical Support Organization, Jun, 2006, pp. 410-420.

[12] B. Hall, “Beej’s Guide to Network Programming,” Version 3.0.20, Dec, 2016, pp.

20-30.

[13] W. Qingcheng, C. Guohua, and M. Ning.

“Research and Development of Ethernet Communication System in Numerical Control Workshop,” Int. J. of Future Generation Communication and Networking, vol. 7, no. 6, Dec. 2014, pp. 51-58.

저자 소개

김강철(Kangchul kim) 1981년 서강대학교 전자공학과 학사 1983년 서강대학교 전자공학과 석사 1996년 경상대학교 전자공학과 박사 현재 전남대학교 전기전자통신컴퓨터공학부 교수

※ 관심분야 : 임베디드시스템, NoC, IoT Pattern Rec ognition

Ding-Hua Wang 2015년 8월 : Beijing Institute of Petr ochemical Technology university, com munication engineering 졸업(공학사) 2015년 9월 ∼ 현재 : 전남대학교 대학원 컴퓨터공 학과 재학

※ 관심분야 : IoT, Embedded system

한석붕(Seok-Bung Han) 1982년 한양대학교 전자공학과 학사 1984년 한양대학교 대학원 전자공 학과 석사

1988년 한양대학교 대학원 전자공 학과 박사

1992년 ~ 1993년 Stanford University, 연구교수 2002년 ~ 2003년 Cornell University, 연구교수 1988년 ~ 현재 경상대학교 공과대학 전자공학과 교수

※ 관심분야 : SoC 설계 및 테스트 전력 IC 설계 및 IoT 용 초저전력 IC 설계

수치

Fig.  1  Diagram  of  the  Proposed  System The  hardware  of  the  system  consists  of  a  Raspberry  Pi,  a  gas  sensor,  a  motion  sensor,  a  fire  sensor,  a  motor  and  a  Raspberry  Pi  camera:
Table  1.  Python  code  of  the  Xively  Setting
Fig.  5  is  a  flowchart  for  socket  server  operation.
Fig.  6  Flowchart  of  text  message
+2

참조

관련 문서

Since every classical or virtual knot is equivalent to the unknot via a sequence of the extended Reidmeister moves together with the forbidden moves, illustrated in Section 2,

A resolver sends a query message to a local server to find the IP address for the host “chal.fhda.edu.”. Make format of the query and response messages separately. -shows the

The index is calculated with the latest 5-year auction data of 400 selected Classic, Modern, and Contemporary Chinese painting artists from major auction houses..

The “Asset Allocation” portfolio assumes the following weights: 25% in the S&P 500, 10% in the Russell 2000, 15% in the MSCI EAFE, 5% in the MSCI EME, 25% in the

1 John Owen, Justification by Faith Alone, in The Works of John Owen, ed. John Bolt, trans. Scott Clark, "Do This and Live: Christ's Active Obedience as the

PBAC involves employing a private blockchain to provide an unforgeable and auditable foundation for smart home systems, that can thwart illegal data access, and ensure the

• In the traditional layer based data model heights are treated as attributes to the objects, not as a part of the geometry.. But the real world

 to create a conceptual schema and external schemas in the data model of the selected DBMS.