Вы находитесь на странице: 1из 33

Media Engineering and Technology Faculty

German University in Cairo

Internet of Things for Home


Automation

Bachelor Thesis

Author: Mohamed Hisham Moubarak


Supervisor: Dr. Amr Desouky
Submission Date: 15 May, 2016
Media Engineering and Technology Faculty
German University in Cairo

Internet of Things for Home


Automation

Bachelor Thesis

Author: Mohamed Hisham Moubarak


Supervisor: Dr. Amr Desouky
Submission Date: 15 May, 2016
This is to certify that:

(i) the thesis comprises only my original work toward the Bachelor Degree

(ii) due acknowledgment has been made in the text to all other material used

Mohamed Hisham Moubarak


15 May, 2016
Acknowledgments

After an intensive period of learning and developing, this note of acknowledgment is


my final touch on my thesis. I would like to reflect on the people who had mentored,
supported and helped me through this period.
First and foremost, I would like to thank my mentor and supervisor, Dr. Amr Desouky,
for his support, guidance and help through out this period. You definitely provided me
with the tools needed to choose the right direction and successfully complete my thesis.
I am truly blessed and thankful that I had to do my bachelor project with you and work
under your supervision. Thank you so much for your constant guidance, motivation and
help.
Most importantly, I would like to thank my parents for putting their trust and faith in
me, tolerating the distance and allowing me to choose my own path starting from leaving
my home city, Alexandria, and joining a university far away from them. None of that
work would have been accomplished without your trust and constant motivation. Thank
you so much for trusting and supporting me all the way long, you are always there for
me.
I would like to thank my friends for their constant support, and finally my colleagues,
who have been working with me on this project from day one, without your efforts and
collaboration, surely this project would not have been completed.

V
Abstract

This paper presents an approach for smart home automation using Internet of Things
(IoT ) integration with computer vision, web services and cross-platform mobile services.
This project aims to increase home security using the aforementioned approach. The
approach focuses on: (1) sending data and receiving instructions by sensors, cameras and
servo motors, to and from the end user, through embedding intelligence to the mentioned
gadgets using Raspberry Pi tiny computer; (2) assisting interaction of end users and home
devices through cross-platform mobile application developed using Ionic Framework; (3)
connecting the two client sides, the end user and devices, through publish/subscribe model
using PubNub Data Stream Network; (4) data representation and exchange efficiently
using JSON data format. Moreover, four use cases were implemented to demonstrate
this approach efficiency.

VI
Contents

Acknowledgments V

1 Introduction 1
1.1 Internet of Things . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Internet of Things Applications . . . . . . . . . . . . . . . . . . . . . . . 2
1.3 Aim and Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.4 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

2 Background 5

3 Methodology 6
3.1 System Architecture and Approach . . . . . . . . . . . . . . . . . . . . . 6
3.2 Model Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.3 Technical Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.3.1 Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.3.2 Using Raspberry Pi for IoT . . . . . . . . . . . . . . . . . . . . . 14
3.3.3 Using JSON for the data exchanged parsing . . . . . . . . . . . . 15
3.3.4 Using PubNub for data streaming and exchange . . . . . . . . . . 15
3.3.5 Using OpenCV for Computer vision and image processing . . . . 16
3.3.6 Using Ionic framework for web/mobile application . . . . . . . . . 16

4 Use Cases and Results 17


4.1 Use Cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4.1.1 LEDs Control and Monitoring . . . . . . . . . . . . . . . . . . . . 17
4.1.2 Door Lock Control and Monitoring . . . . . . . . . . . . . . . . . 18
4.1.3 Room Surveillance . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.1.4 Home Surveillance Car . . . . . . . . . . . . . . . . . . . . . . . . 19
4.2 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

5 Conclusion 21

6 Future Work 22

Appendix 23

VII
References 25

VIII
Chapter 1

Introduction

1.1 Internet of Things


The concept of Internet of things(IoT) was introduced by the growth of the widely
used global network known as the internet along with the deployment of ubiquitous
computing and mobiles in smart objects which brings new opportunities for the creation
of innovative solutions to various aspects of life. The concept of Internet of things(IoT)
creates a network of objects that can communicate, interact and cooperate together to
reach a common goal [1]. IoT devices can enhance our daily lives, as each device stops
acting as a single device and become part of an entire full connected system. This
provides us with the resulting data to be analyzed for better decision making, tracking
our businesses and monitoring our properties while we are far away from them [3].

Figure 1.1: Shows the evolution of internet and internet of things1 .

1
CHAPTER 1. INTRODUCTION 2

1.2 Internet of Things Applications


As the paradigm of IoT is growing, it is stepping into every aspect of our lives. This
leads to an easier life through wider range of applications, such as electronic health care
solutions [2] and Smart city concept. The concept of Smart city aims to making a better
use of resources, increasing services quality offered to the citizens, and reducing costs of
the public administrations [10]. Another application is home automation which is the
main focus of this project.

Figure 1.2: Shows different applications of internet of things in all aspects of life2 .

1.3 Aim and Objectives


This paper addresses an IoT software-based approach on the field of Home Automa-
tion. Common use-cases include measuring home conditions, controlling home appliances
and controlling home access through RFID cards as an example and windows through
servo locks [9]. However, the main focus of this paper is to maximize the security of
homes through IoT. More specifically, monitoring and controlling servo door locks, door
sensors, surveillance cameras, surveillance car and smoke detectors, which helps ensuring
and maximizing safety and security of homes.
CHAPTER 1. INTRODUCTION 3

Figure 1.3: Shows different use cases of IoT in Home Automation field3 .

A user has the following features through a mobile application in which he/she:

1. can turn on or off LED lights and monitor the state of the LED.

2. can lock and unlock doors through servo motors and monitor if the doors are locked
or unlocked.

3. can monitor if the doors are closed or opened through IR sensors.

4. is notified through email if the door is left open for too long.

5. is notified of who entered through the door as the camera captures the face image
and send it to him/her via email.

6. is notified through email if the fire detector detects smoke.

7. is able to control the surveillance car from anywhere to monitor his/her home.
CHAPTER 1. INTRODUCTION 4

1.4 Motivation
During the past few years, internet was known as a big mass that we can acquire
data from. Embedding mobile transceivers to everyday items and gadgets enabled new
forms of bi-directional communication between people with other people, and people with
things. That paradigm, known as Internet of Things, that was first introduced in 1998
by Kevin Ashton, has received recently more attention in the academia and industry [8],
and this would add a new dimension to the world of Information and communication
technology.

While that paradigm is growing and have high positive impact on many aspects of
our lives, challenging issues arise, that should be considered and addressed. The central
issues are guaranteeing security and privacy of users and their data. Another issue is fully
achieving smartness of interconnected devices by enabling their interaction. Exchanging
data and autonomous behavior is the key to achieving the latter [4].

IoT has different definitions from different perspectives, however, they all revolve
around ”things” generally, collecting, exchanging and communicating data with each
others and with people through the ”internet”. IoT helps in decision making and au-
tomating almost everything around us. The smarter life IoT vision promises in the near
future through various applications, made smart Home Automation actually possible,
starting from basically monitoring different parts of home, to actually controlling them.
Integration of IoT and Home Automation, made it possible to monitor and control homes
from different parts of the world. Some examples of applications to this are: controlling
and setting the desired temperature of the house before arriving home, turning on/off the
lights of a room and setting its intensity, running washing machine while the person is at
work, leakage or smoke detection and notification, monitoring home through surveillance
camera or car inside the house while the person is away, or remote central locking, and
many other applications.

As the field of Home Automation through IoT is a wide application in a very wide
and challenging field due to the reasons mentioned in the previous paragraphs, I chose to
work on that field as part of this thesis, specifically in maintaining and ensuring security
and safety inside home.
Chapter 2

Background

IoT aims in creating a network between objects embedded with sensors, that can
store, analyze, communicate and exchange data together over the internet. This leads
to efficient industry, manufacturing, efficient energy management, resource management,
accurate health care, smarter business decisions based on analyzed data, safer driving
through smart cars that are able to communicate together, smart home automation and
countless more applications.
As this project focuses on smart home automation through IoT, smart home concept
should be understood first. Smart homes combines common devices, found in homes,
to be able to control it. The technology originally was developed and used to control
environmental systems, but recently, almost any electrical component can be included
within the system of smart home [7].
The system designed for the home automation project presented in this paper needs
a control unit, a computer, to be able to control the different electrical devices connected
to it. Raspberry Pi, is a credit-card tiny computer, that can be plugged to a monitor,
uses standard keyboard and mouse, that enables people of different ages learn how to
program. For its simplicity and capabilities, it has been chosen to be the control unit of
this project1 .
Data stream network is the infrastructure and network that connects devices from
anywhere in the world, allowing developers to build real-time applications in a secure and
reliable manner. PubNub is the data stream network that was used in this project as the
publish/subscribe communication design provided by it allowed bi-directional connection
easily and reliably.
Cross-platform software is a software developed to be run on multiple and different
platforms such as web, iOS or Android. Ionic, is an open source SDK for developing cross-
platform applications using HTML, CSS and JS components. It was used in developing
the mobile application used in testing the developed approach in this project.

1
URL: https://www.raspberrypi.org/help/what-is-a-raspberry-pi/

5
Chapter 3

Methodology

3.1 System Architecture and Approach

The first thing that had to be thought about after choosing this topic was the system
architecture. How will the appliances and devices communicate with a web/mobile ap-
plication, receive commands and send their status? Should it be a server client protocol,
in which there is a direct connection between the devices and the application used by
the user? How will a direct connection be established over the internet? Or should the
client and server communicate through a medium channel that the messages should be
passed on before reaching the client or the server? These questions had led to exploring
different approaches and services. Raspberry Pi was chosen as the main control unit, to
connect different sensors and devices together and to the internet. The Raspberry Pi is
a tiny computer, that has forty GPIO pins and capable of being programmed, so it was
chosen for its simplicity and capabilities.

6
CHAPTER 3. METHODOLOGY 7

The next challenge, after finding a way to connect different devices together and to
the internet was actually controlling them over the internet through a web/mobile appli-
cation built using Ionic Framework. Different ways and services were explored including
setting-up port forwarding on the router. Setting-up port forwarding will change the con-
figuration of the router and expose one port of the private Local Area Network(LAN) to
the public, which is considered a security vulnerability that has to be managed carefully.
Some of the services that were explored and considered to allow the communication of the
web/mobile application with the Raspberry Pi connecting different devices are Weaved,
Pusher and AWS Mobile Hub. However, the need of real-time interaction and PubNub’s
publish/subscribe model, it was chosen as the most adequate solution.

Figure 3.1: Illustrates the publish/subscribe model provided by PubNub1 .


CHAPTER 3. METHODOLOGY 8

Figure 3.2: Illustrates the system architecture used in this home automation project.
CHAPTER 3. METHODOLOGY 9

To simplify the publish/subscribe model along with the system architecture used in
this Home Automation project, here is the explanation of the steps of constructing it:
Different sensors, cameras and servo motors were connected to the Raspberry Pi. It
was programmed to collect and publish the data, in the form of JSON string, acquired
from these devices to PubNub. Data is published from the Raspberry Pi by providing
it with the ”publish key” and the ”channel name”. The data is sent to the channel
provided by PubNub servers, and forwarded by PubNub to the subscribers of this channel.
The subscriber in this scenario, of a user acquiring data and readings by the sensors
and monitoring devices, is the web/mobile application. The ”subscription key” and
”channel name” is embedded in the web/mobile application’s code. allowing it to receive
messages forwarded by PubNub. On the other hand, in a scenario where the user wants
to send a command to home appliances, controlling the LED lights for example, the
web/mobile application is the publisher provided by the ”publish key” and the ”channel
name”. The commend is sent in the form of JSON string to PubNub servers, while the
”subscription key” and ”channel name” is embedded in the Raspberry Pi code. This
allows the Raspberry Pi to receive any published strings on the channel it is subscribed
to. Upon receiving the JSON string, the Raspberry Pi take the action specified by that
string. This allows full control and monitoring of all devices connected to the Raspberry
Pi by the user, as illustrated in the previous figure (Figure 3.2).

Figure 3.3: Here is a more specific illustration of how the mobile and connected devices
to the Raspberry Pi exchange data through PubNub.
CHAPTER 3. METHODOLOGY 10

3.2 Model Design


An essential part of the project was designing a model for simulation, testing and
analyzing results. AutoCad was used in designing the separate parts of the home model.
The design was given as an input to a laser cut machine, that cut cardboard to the
different parts of the design. After that, the model was assembled to form the room
model provided in the below figures.

Figure 3.4: Shows the top and front views of the model design.
CHAPTER 3. METHODOLOGY 11

Figure 3.5: Shows the top view of the model.

Figure 3.6: Shows the model view from an angle.


CHAPTER 3. METHODOLOGY 12

Another part of the project was the surveillance car. It was modeled by a four wheel
drive (4WD) car using four DC motors and chassis made of acrylic material. The car
motors were connected to two H-Bridges and to a Raspberry Pi to control it over the
internet.

Figure 3.7: Shows the car model components2 .

Figure 3.8: Shows the car model after assembling its components3 .
CHAPTER 3. METHODOLOGY 13

Figure 3.9: Shows the car model after connecting the Raspberry Pi and the 2 H-Bridges.

3.3 Technical Solutions

3.3.1 Components

The components that were used in the Home Automation Simulation are:

• Two RaspberryPi 2 model B: The main processing and controlling unit of the
system. One was used for the room model and the other for the surveillance car.

• Servo Motor: It acts as the door lock.

• Infrared (IR) sensor: Shows the current state of the front door, either opened or
closed.

• Web Camera: Acts as a surveillance camera for the room streaming images of that
room that are processed by the RaspberryPi. It utilizes OpenCV’s image processing
to be able to detect objects in the room.

• Smoke Detector: It detects fire, ensuring the safety of the home.

• Two H-Bridges: Each H-Bridge controls two motors, two are used to control the
four DC motors of the car.

• Wi-Fi Dongle: Attached to the Raspberry Pi through USB port to allow its con-
nection to wireless internet instead of using Ethernet cable.
CHAPTER 3. METHODOLOGY 14

3.3.2 Using Raspberry Pi for IoT

The Raspberry Pi is a low priced, credit card sized computer. It can be connected
to a computer monitor or a television through HDMI cable and HDMI port found in the
Raspberry Pi4 . It has four USB ports, allowing the connection of different peripherals to
it such as keyboard, mouse, memory stick or Wi-Fi dongle, that allows its connection to
wireless internet. As any computer, the Raspberry Pi needs an Operating System(OS)
to run on it, to allow the interaction between it and the user. Different OS choices that
can run on the Raspberry Pi are available such as Raspbian, Linux and a Windows 10
special version for the Raspberry Pi. The OS is downloaded to a micro SD card and
mounted to the Raspberry Pi’s SD memory reader. It also has Ethernet port that allows
its connection to the internet through Ethernet cable from a router.

Figure 3.10: Shows an image of the Raspberry Pi Model B+5 .

Raspbian was installed on a micro SD card that was mounted to the Raspberry Pi, that
allowed writing Python scripts. The needed hardware, such as sensors and LEDs, were
connected, using jumper wires, to the GPIO pins in the Raspberry Pi. Python scripts
were written on the Raspberry Pi, which allowed controlling and monitoring the connected
hardware for testing. The PubNub ”publish key”, ”subscription key” and ”channel name”
were embedded in the python scripts written on the Raspberry Pi, allowing data exchange
through PubNub servers.
4
URL: https://www.raspberrypi.org/help/what-is-a-raspberry-pi/
CHAPTER 3. METHODOLOGY 15

3.3.3 Using JSON for the data exchanged parsing


JSON (JavaScript Object Notation) is a data-interchange, text format that is language
independent, easy for humans to write and read, easy for machines to generate and parse.
It uses programming conventions familiar to the C-family languages programmers6 . It
consists of name/value pairs, realized as objects, which is fast and easy to be analyzed
and used by either humans or machines, therefore, it has the superiority in data exchange
over the web[5].
JSON was used in this project as the format for data exchanged through PubNub
between the Raspberry Pi and the mobile application.
{’led’:1, ’ir’:0, ’lock’:1, ’occ’:0, ’fire’:0}
The above string is an example of JSON string sent or received by the Raspberry Pi. It
consists of pairs of attribute name and the corresponding value.

3.3.4 Using PubNub for data streaming and exchange


PubNub is an API of global Data Stream Network (DSN) that is easy to be used,
allowing customers to manage real-time applications and IoT devices. The communi-
cation is enabled using publish/subscribe communication design over a channel through
PubNub servers.
PubNub vision statement as it is on its official website: ”PubNub set out in 2009 to
develop a Data Stream Network for developers to build realtime apps as easily as building
a web page. The PubNub Data Stream Network provides global cloud infrastructure and
key building blocks for realtime interactivity. We let developers spend their time on what
they do best... creating killer realtime apps!”7
Real-time is one of the most important characteristics of IoT, that should be consid-
ered and achieved when developing an IoT application. Instead of spending time, effort
and fortune to establish expensive data streaming infrastructure, different solutions and
approaches were considered such as setting-up port forwarding on private LAN router
and using services such as Weaved. However, PubNub’s vision, with over seventy SDKs
for every platform and secure publish/subscribe communication design made it the most
suitable choice for this step.
The JavaScript PubNub’s API was used in developing the web/mobile application.
The application was provided with the ”subscription key”, ”publish key” and ”channel
name” to be able to send and receive data in the form of JSON strings. The same
”subscription key”, ”publish key” and ”channel name” were provided by the Python
PubNub’s API used in developing the Python scripts on the Raspberry Pi. The latter
allowed the Raspberry Pi to exchange data in the form of JSON strings. A real-time
bi-directional communication was established successfully, by providing both ends with
the required information of the same channel through PubNub.
6
URL: http://www.json.org/
7
URL: https://www.pubnub.com/company/
CHAPTER 3. METHODOLOGY 16

3.3.5 Using OpenCV for Computer vision and image processing


OpenCV (Open source Computer Vision) library is an open source machine learning
and computer vision software library that was built to provide infrastructure for machine
perception8 and real-time computer vision applications[6].
Python OpenCV library was used in implementing a simple algorithm to allow the
Raspberry Pi to process images. The images were taken by a usb web camera. Imple-
menting the algorithm using this library allowed detecting major changes in a room and
to monitor if a person has entered the room.

3.3.6 Using Ionic framework for web/mobile application


Ionic is a free and open source SDK, built with SASS and optimized for AngularJS.
It offers a library of mobile-optimized HTML, CSS and JS tools and components for de-
veloping interactive progressive and native cross-platform applications9 . Cross-platform
applications are the applications that run on different platforms such as web browsers,
IOS and Android. It was used in this project to build web/mobile application to monitor
and control the home model mentioned before.

Figure 3.11: Shows a screen shot of the developed application for Home Automation.
8
URL: http://opencv.org/about.html
9
URL: http://ionicframework.com/
Chapter 4

Use Cases and Results

Both, the Raspberry Pi and the mobile application, are senders and receivers of data.
This applies as both publish and subscribe at the same time to the same PubNub channel.
This allowed bi-directional communication for data exchange. Accordingly, multiple use
cases were implemented and studied for result analysis.

4.1 Use Cases

4.1.1 LEDs Control and Monitoring

The LEDs, connected to the Raspberry Pi through the GPIO pins and embedded in
the model, were controlled through a mobile application developed with Ionic. A ”Light”
tab was created in the application which has a button that toggles between ”ON” and
”OFF” when clicked. The default value of the button shows the current status of the LED
lights. If the button shows the value ”OFF”, this means that the LEDs are currently
turned off. However, when the button is clicked, the value toggles to ”ON”, sending
a JSON string holding a value of 1 for ”led” attribute, {’led’:1}, to the channel the
application publishes to, through PubNub and the ”publish key”. The JSON string
received by this channel is then sent to its subscribers, the Raspberry Pi in this project’s
case. The Raspberry Pi then receives the JSON string, checking the ”led” attribute value
and turns the LEDs accordingly. The mobile application is also a subscriber to the same
channel, in which it can check the last status of the LEDs published on PubNub channel
and shows either ”ON” or ”OFF” as a default value of the button in the application.

17
CHAPTER 4. USE CASES AND RESULTS 18

4.1.2 Door Lock Control and Monitoring

A 180 degrees servo motor, acting as the door lock of the modeled room, was connected
to the Raspberry Pi through the GPIO pins. It was glued to the model’s door along with
a glued cardboard tip to lengthen the servo’s horn. A ”Lock” tab was created in the
application which has a button that toggles between ”LOCK” and ”UNLOCK” when
clicked. The default value of the button shows the action that will be taken by the
servo lock, changing its angle, when the button is pressed. If the button shows the value
”UNLOCK”, this means that the servo motor will be adjusted to 0 degree, unlocking the
door. The button’s value toggles to ”LOCK”, When the button is clicked, sending a JSON
string holding a value of 0 for ”lock” attribute, {’lock’:0}, to the channel the application
publishes to and the ”publish key” provided by PubNub. The JSON string received by
this channel is then sent to the Raspberry Pi, which receives the JSON string, checking
the ”lock” attribute value and sets the servo motor’s angle to 0 degrees, unlocking the
door.

Figure 4.1: Shows the servo door lock.

The mobile application is also subscriber to the same channel the Raspberry Pi is
a subscriber to, as discussed in 4.1.1. Therefore, it can receive messages sent by the
Raspberry Pi from the infrared (IR) sensor installed on the door. By default, the IR
beam is cut by the door frame, indicating that it is closed. When the door is opened, the
IR beam is uncut, which will send a JSON string holding a value of 1 for the ”ir” attribute,
{’ir’:1}, to PubNub. The JSON string is then forwarded to the mobile application, in
CHAPTER 4. USE CASES AND RESULTS 19

which the application will change the door status message to ”Door is opened.”. When
the door is closed, the same scenario takes place, however, the value of the attribute ”ir”
in that case, sent to PubNub and then forwarded to the mobile application, is 0, {’ir’:0},
updating the door status message to ”Door is closed.”. If the door is left open for more
than a minute, an email notification is sent to the predefined user’s email.

4.1.3 Room Surveillance

A web camera was connected to the Raspberry Pi through a USB port for the room
model surveillance. A simple motion detection algorithm was written and run using
OpenCV library to detect if the room is occupied or not. The algorithm detects major
changes in the room environment as it has the default room environment background.
If a major difference detected between the background the algorithm has and the recent
captured image, then the room is occupied, otherwise, it is not. If the room is occupied,
a JSON string holding the value of 1 for ”occ” attribute, {’occ’:1}, is published by the
Raspberry Pi, to PubNub channel. The JSON string is then forwarded by that channel
to its subscribers, the mobile application in this case. When the JSON string is received
by the mobile application, the ”occ” attribute value is checked and a message is displayed
accordingly, if the room is occupied, the message displays ”The room is occupied”, if not,
the message displays ”The room is not occupied”. This allows the user to always monitor
his/her room assuring its security.

4.1.4 Home Surveillance Car

The last part of the model was the surveillance car, which has its own Raspberry
Pi controlling it. The Raspberry Pi of the car was a publisher and a subscriber to the
same channel, the other Raspberry Pi connected to the room model publish and sub-
scribe to. This makes both Raspberry Pis able to receive the same messages, keeping
the whole system synchronous. A camera module was connected to the Raspberry Pi
of the car, which live streams to a YouTube channel, so that the user has an eye inside
the house while he/she is away. The YouTube channel link was provided to the mobile
application so that the user can control and monitor his/her home in one place. The mo-
bile application has a tab that contains four control buttons that move the car forward,
backward, left and right, along with the live video stream through YouTube, so that the
user can see what he/she is controlling, and where to direct the car. The car control is
done through sending JSON strings over PubNub. If the ”Forward” key is pressed and
held on the mobile application, a JSON string message, {’car’:forward}, is sent to the
Raspberry Pi through PubNub. Accordingly, the car starts and keeps moving forward
until the ”Forward” key is released, which sends another JSON string from the mobile
application to the Raspberry Pi over PubNub, ’car’:stop}, stopping the car and mak-
ing it ready to receive another direction command the same way as forward command.
CHAPTER 4. USE CASES AND RESULTS 20

The surveillance car can be used anytime to keep an eye of the user inside the house.
If a security or safety breach is detected through the IR sensor on the door or the fire
detector for example, the surveillance car can be a moving eye monitoring the house. It
can check lively what is going on exactly, so that the user can take decisions accordingly
and effectively.

4.2 Results
Results show that everything worked as anticipated, although some high pings in the
network may cause minor occasional lag in the connection and data exchange, however,
there was no major lag detected affecting the model control and testing. The lag maybe
a casual effect of using 3G connection, however, most home automation systems employ
DSL or Broadband connection, resulting in acceptable performance. Eventually, expected
results were met.
Chapter 5

Conclusion

Home Automation is one of the important applications of IoT. It provides easier


and leisure living for every person. In this project, an approach for developing an IoT
software-based smart home automation system was implemented and tested through the
built model. It focuses on safety and security perspective of home automation through
using some of the recent available technologies. The technologies used in implementing
this project are: The Raspberry Pi, credit-card sized computer, was used as the main
control unit of the project, in which different devices and sensors were connected to
it; PubNub, Data Stream Network, was used as the way of bi-directional connection
between the two Raspberry Pis from an end, and the mobile application from the other
end; OpenCV was used in implementing a simple motion detection algorithm, which
determines if a room is occupied; JSON was used as the data exchanged format; and
finally Ionic was used in developing the mobile application. The case studies showed
satisfying results with infrequent and acceptable lag, which maybe caused as a reason of
the usage of 3G connection.

21
Chapter 6

Future Work

IoT is having tremendous attention recently and its various applications are growing,
changing the way we live and work. This project’s main focus was on security and safety
perspective of smart home automation, which is a small part of what can be automated
and controlled inside a smart home. Future work focus would be working on actual AC
devices to implement what was simulated in the model in a real house, developing a
more advanced motion detection algorithm on surveillance cameras, and surveillance car
moving autonomously avoiding obstacles.
As there are various appliances that can be controlled and automated while being
away from home, the same approach used in implementing this project will be used
to enable control over various appliances before reaching home, saving time and effort;
Such application examples can be, monitoring temperature and humidity, and being
able to control them, controlling stoves and microwaves, locking and unlocking doors
autonomously depending on the visitor face recognition and confidence level, surveillance
car moving autonomously reaching for a security breach or safety issue to live stream
what happens so that the user can act accordingly and many others that would combine
IoT with smart appliances autonomy.

22
Appendix

23
List of Figures

1.1 Shows the evolution of internet and internet of things1 . . . . . . . . . . . 1


1.2 Shows different applications of internet of things in all aspects of life2 . . . 2
1.3 Shows different use cases of IoT in Home Automation field3 . . . . . . . . 3

3.1 Illustrates the publish/subscribe model provided by PubNub4 . . . . . . . 7


3.2 Illustrates the system architecture used in this home automation project. 8
3.3 Here is a more specific illustration of how the mobile and connected devices
to the Raspberry Pi exchange data through PubNub. . . . . . . . . . . . 9
3.4 Shows the top and front views of the model design. . . . . . . . . . . . . 10
3.5 Shows the top view of the model. . . . . . . . . . . . . . . . . . . . . . . 11
3.6 Shows the model view from an angle. . . . . . . . . . . . . . . . . . . . . 11
3.7 Shows the car model components5 . . . . . . . . . . . . . . . . . . . . . . 12
3.8 Shows the car model after assembling its components6 . . . . . . . . . . . 12
3.9 Shows the car model after connecting the Raspberry Pi and the 2 H-Bridges. 13
3.10 Shows an image of the Raspberry Pi Model B+7 . . . . . . . . . . . . . . 14
3.11 Shows a screen shot of the developed application for Home Automation. . 16

4.1 Shows the servo door lock. . . . . . . . . . . . . . . . . . . . . . . . . . . 18

1
URL: http://iottech.dk/wp-content/uploads/2014/10/evolution-of-iot.png
2
URL: http://frikiyo.es/wp-content/uploads/2016/04/internet-de-las-cosas.jpg
3
URL: https://s-media-cache-ak0.pinimg.com/736x/8d/12/ac/8d12ac256d6fc5beebba14138423d543.jpg
4
URL:https://www.pubnub.com/wp-content/uploads/2015/03/pubsub-broadcast-design-
pattern1.png
5
URL: http://www.vilartec.com.br/img/p/50-187-thickbox.jpg
6
URL: http://img.alibaba.com/img/pb/787/831/750/750831787 329.jpg
7
URL: http://www.linuxuser.co.uk/wp-content/uploads/2014/07/RaspberryPiB+.png/

24
Bibliography

[1] Luigi Atzori, Antonio Iera, and Giacomo Morabito. The internet of things: A survey.
Computer Networks, 54(15):2787 – 2805, 2010.

[2] Nicola Bui and Michele Zorzi. Health care applications: A solution based on the
internet of things. In Proceedings of the 4th International Symposium on Applied
Sciences in Biomedical and Communication Technologies, ISABEL ’11, pages 131:1–
131:5, New York, NY, USA, 2011. ACM.

[3] L. Coetzee and J. Eksteen. The internet of things - promise for the future? an
introduction. In IST-Africa Conference Proceedings, 2011, pages 1–9, May 2011.

[4] L Heuser, Z Nochta, and NC Trunk. Ict shaping the world: A scientific view, 2008.

[5] Nurzhan Nurseitov, Michael Paulson, Randall Reynolds, and Clemente Izurieta.
Comparison of json and xml data interchange formats: A case study. Caine,
2009:157–162, 2009.

[6] Kari Pulli, Anatoly Baksheev, Kirill Kornyakov, and Victor Eruhimov. Real-time
computer vision with opencv. Commun. ACM, 55(6):61–69, June 2012.

[7] V. Ricquebourg, D. Menga, D. Durand, B. Marhic, L. Delahoche, and C. Loge.


The smart home concept : our immediate future. In 2006 1ST IEEE International
Conference on E-Learning in Industrial Electronics, pages 23–28, Dec 2006.

[8] Gérald Santucci et al. From internet of data to internet of things. In Paper for the
International Conference on Future Trends of the Internet, volume 28, 2009.

[9] M. Soliman, T. Abiodun, T. Hamouda, J. Zhou, and C. H. Lung. Smart home:


Integrating internet of things with web services and cloud computing. In Cloud
Computing Technology and Science (CloudCom), 2013 IEEE 5th International Con-
ference on, volume 2, pages 317–320, Dec 2013.

[10] A. Zanella, N. Bui, A. Castellani, L. Vangelista, and M. Zorzi. Internet of things for
smart cities. IEEE Internet of Things Journal, 1(1):22–32, Feb 2014.

25

Вам также может понравиться