Beruflich Dokumente
Kultur Dokumente
Abstract
We’re entering a new era of computing technology that many are calling the
Internetof Things (IoT). Machine to machine, machine to infrastructure,
machine to environment, the Internet of Everything, the Internet of
Intelligent Things, intelligent systems—call it what you want, but it’s
happening, and its potential is huge.
We see the IoT as billions of smart, connected “things” (a sort of “universal
global neural network” in the cloud) that will encompass every aspect of
our lives, and its foundation is the intelligence that embedded processing
provides. The IoT is comprised of smart machines interacting and
communicating with other machines,objects, environments and
infrastructures. As a result, huge volumes of data are being generated, and
that data is being processed into useful actions that can “command and
control” things to make our lives much easier and safer—and to reduce our
impact on the environment. The creativity of this new era is boundless,
with amazing potential to improve our lives. The following thesis is an
extensive reference to the possibilities, utility, applications and the
evolution of the Internet of Things.
TABLE OF CONTENTS
ENVIRONMENTAL MONITORING 5
1.2.3 INFRASTRUCTURE MANAGEMENT 5
1.2.4 MANUFACTURING 5
1.2.5 ENERGY MANAGEMENT 6
1.2.6 MEDICAL & HEALTHCARE SYSTEMS 6
1.2.7 BUILDING & HOME AUTOMATION 6
1.2.8 TRANSPORTATION 6
1.3 AIM & OBJECTIVES 7
1.4 MOTIVATION 9
2 BACKGROUNG 10
3 METHODOLOGY 11
3.2 MODEL DESIGN 11
3.3 TECHNICAL SOLUTIONS 13
3.3.1 COMPONENTS 13
3.3.2 USING RASPBERRY PI FOR IOT 14
3.3.3. BIPOLAR DIGITAL INTEGRATED CIRCUIT ULN2003APG 20
3.3.4 PYTHON 21
3.3.5 UBIDOTS 30
3.3.6 PUTTY 33
4 CONCLUSION 38
5 FUTURE WORK 39
BIBILOGRAPHY 40
1.Introduction
1.2 . Overview
1.2.1. Applications
Monitoring and controlling operations of urban and rural infrastructures like bridges,
railway tracks, on- and offshore- wind-farms is a key application of the IoT.[66] The
IoT infrastructure can be used for monitoring any events or changes in structural
conditions that can compromise safety and increase risk.
1.2.4. Manufacturing
IoT devices can be used to enable remote health monitoring and emergency
IoT devices can be used to monitor and control the mechanical, electrical and
electronic systems used in various types of buildings (e.g., public and private,
industrial, institutions, or residential)[49] in home automation and building automation
systems.
1.2.8. Transportation
This paper addresses an IoT software-based approach on the field of Home Automation.
Common use-cases include measuring home conditions, controlling home appliances and
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 ,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
behaviour is the key to achieving the later . 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 automating 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
2 Background
IoT aims in creating a network between objects embedded with sensors, that can store,
analyse, 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 analysed 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 .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 project . Ubidots is a third party service provider that is used to control
the devices the raspberry pi access the information from the ubidots and the raspberry pi
3. Methodology
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 application, 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 isa tiny computer, that has forty GPIO pins and capable of being
programmed, so it was chosen for its simplicity and capabilities.
The next challenge, after finding a way to connect different devices together and tothe
internet was actually controlling them over the internet through a web/mobile application
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 configuration
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 Ubidots, the need of real-
time interaction, it was chosen as the most adequate solution.
An essential part of the project was designing a model for simulation, testing analysing
results .The design was prepared in such a way that the system can be arrange in any
environment so that it will be ready to use at any time.
3.3.1 Components
• RASPBERRY PI 3 MODEL B
• RELAY BOARD
- RELAYS - 4
- LED INDICATORS - 5
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
theRaspberry 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 10special 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.
RASPBERRY 3 MODEL B
Technical Specification:
Processor
GPU
• Dual Core Video Core IV® Multimedia Co-Processor. Provides Open GL ES 2.0,
hardware-accelerated
Open VG, and 1080p30 H.264 high-profile decode.
• Capable of 1Gpixel/s, 1.5Gtexel/s or 24GFLOPs with texture filtering and DMA
infrastructure
Memory
• 1GB LPDDR2
Operating System
• Boots from Micro SD card, running a version of the Linux operating system or Windows
10 IoT
Dimensions
• 85 x 56 x 17mm
Power
• Micro USB socket 5V1, 2.5A
Connectors:
Ethernet
• 10/100 BaseT Ethernet socket
Video Output
• HDMI (rev 1.3 & 1.4)
• Composite RCA (PAL and NTSC)
Audio Output
• Audio Output 3.5mm jack
• HDMI
• USB 4 x USB 2.0 Connector
CITM - CSE DEPARTMENT Page 15
HOME AUTOMATION USING IOT
GPIO Connector
The Raspberry Pi 3’s four built-in USB ports provide enough connectivity for a
mouse,keyboard, or anything else that you feel the RPi needs, but if you want to add even
Pi will begin toboot as soon as power is applied, to turn it off simply remove power. The
four built-in USB
ports can even output up to 1.2A enabling you to connect more power hungry USB devices
(This does require a 2Amp micro USB Power Supply).
The Raspberry Pi 3’s four built-in USB ports provide enough connectivity for a
mouse,keyboard, or anything else that you feel the RPi needs, but if you want to add even
more youcan still use a USB hub. Keep in mind, it is recommended that you use a powered
hub so as notto overtax the on-board voltage regulator. Powering the Raspberry Pi 3 is easy,
just plug any USB power supply into the micro-USB port. There’s no power button so the Pi
will begin toboot as soon as power is applied, to turn it off simply remove power. The four
built-in USB
ports can even output up to 1.2A enabling you to connect more power hungry USB devices
(This does require a 2Amp micro USB Power Supply)
SoC
Built specifically for the new Pi 3, the Broadcom BCM2837 system-on-chip (SoC) includes
four high-performance ARM Cortex-A53 processing cores running at 1.2GHz with 32kB
Level 1 and 512kB Level 2 cache memory, a VideoCore IV graphics processor, and is linked
to a 1GB LPDDR2 memory module on the rear of the board.
GPIO
The Raspberry Pi 3 features the same 40-pin general-purpose input-output (GPIO) header as
all the Pis going back to the Model B+ and Model A+. Any existing GPIO hardware will
USB chip
The Raspberry Pi 3 shares the same SMSC LAN9514 chip as its predecessor, the Raspberry
Pi 2, adding 10/100 Ethernet connectivity and four USB channels to the board. As before,
the SMSC chip connects to the SoC via a single USB channel, acting as a USB-to-Ethernet
adaptor and USB hub.
Antenna
There’s no need to connect an external antenna to the Raspberry Pi 3. Its radios are
connected to this chip antenna soldered directly to the board, in order to keep the size of the
device to a minimum. Despite its diminutive stature, this antenna should be more than
capable of picking up wireless LAN and Bluetooth signals – even through walls.
IntegratedCircuit ULN2003APG
Features :
3.3.4 PYTHON
To support extensions, the Python API (Application Programmers Interface) defines a set of
functions, macros and variables that provide access to most aspects of the Python run-time
system. The Python API is incorporated in a C source file by including the header
"Python.h".
The compilation of an extension module depends on its intended use as well as on your
system setup; details are given in a later section.
A Simple Example
Let's create an extension module called `spam' (the favorite food of Monty Python fans...)
and let's say we want to create a Python interface to the C library function system().gif This
function takes a null-terminated character string as argument and returns an integer. We
want this function to be callable from Python as follows:
#include "Python.h"
which pulls in the Python API (you can add a comment describing the purpose of the
module and a copyright notice if you like).
All user-visible symbols defined by "Python.h" have a prefix of `Py' or `PY', except those
defined in standard header files. For convenience, and since they are used extensively by the
Python interpreter, "Python.h" includes a few standard header files: <stdio.h>, <string.h>,
<errno.h>, and <stdlib.h>. If the latter header file does not exist on your system, it declares
the functions malloc(), free() and realloc() directly.
The next thing we add to our module file is the C function that will be called when the
Python expression `spam.system(string)' is evaluated (we'll see shortly how it ends up being
called):
CITM - CSE DEPARTMENT Page 22
HOME AUTOMATION USING IOT
static PyObject *
spam_system(self, args)
PyObject *self;
PyObject *args;
{
char *command;
int sts;
if (!PyArg_ParseTuple(args, "s", &command))
return NULL;
sts = system(command);
return Py_BuildValue("i", sts);
}
There is a straightforward translation from the argument list in Python (e.g. the single
expression "ls -l") to the arguments passed to the C function. The C function always has two
arguments, conventionally named self and args.
The self argument is only used when the C function implements a builtin method. This will
be discussed later. In the example, self will always be a NULL pointer, since we are defining
a function, not a method. (This is done so that the interpreter doesn't have to understand two
different types of C functions.)
The args argument will be a pointer to a Python tuple object containing the arguments. Each
item of the tuple corresponds to an argument in the call's argument list. The arguments are
Python objects - in order to do anything with them in our C function we have to convert
them to C values. The function PyArg_ParseTuple() in the Python API checks the argument
types and converts them to C values. It uses a template string to determine the required
types of the arguments as well as the types of the C variables into which to store the
converted values. More about this later.
PyArg_ParseTuple() returns true (nonzero) if all arguments have the right type and its
components have been stored in the variables whose addresses are passed. It returns false
(zero) if an invalid argument list was passed. In the latter case it also raises an appropriate
exception by so the calling function can return NULL immediately (as we saw in the
example).
Embedding Python is similar to extending it, but not quite. The difference is that when you
extend Python, the main program of the application is still the Python interpreter, while if
you embed Python, the main program may have nothing to do with Python -- instead, some
parts of the application occasionally call the Python interpreter to run some Python code.
So if you are embedding Python, you are providing your own main program. One of the
things this main program has to do is initialize the Python interpreter. At the very least, you
have to call the function Py_Initialize(). There are optional calls to pass command line
arguments to Python. Then later you can call the interpreter from any part of the application.
There are several different ways to call the interpreter: you can pass a string containing
Python statements to PyRun_SimpleString(), or you can pass a stdio file pointer and a file
name (for identification in error messages only) to PyRun_SimpleFile(). You can also call
The Python Package Index lists thousands of third party modules for Python.
Web and Internet Development
Python offers many choices for web development:
JSON
E-mail processing.
Support for FTP, IMAP, and other Internet protocols.
Easy-to-use socket interface.
And the Package Index has yet more libraries:
IPython is a powerful interactive shell that features easy editing and recording of a work
session, and supports visualizations and parallel computing.
The Software Carpentry Course teaches basic skills for scientific computing, running
bootcamps and providing open-access teaching materials.
Education
Python is a superb language for teaching programming, both at the introductory level and in
more advanced courses.
Some toolkits that are usable on several platforms are available separately:
GTK+
Buildbot and Apache Gump for automated continuous compilation and testing.
Roundup or Trac for bug tracking and project management.
Business Applications
Python is also used to build ERP and e-commerce systems:
Odoo is an all-in-one management software that offers a range of business applications that
form a complete suite of enterprise management applications.
Tryton is a three-tier high-level general purpose application platform
PROGRAM
bulb1="5aa7db1cc03f97139d409794"
bulb2="5aa7db24c03f97140cf7a5ab"
bulb3="5aa7db2cc03f97140cf7a5af"
bulb4="5aa7db35c03f9713ef054c6f"
from ubidots import ApiClient
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BOARD)
GPIO.setwarnings(False)
GPIO.setup(31,GPIO.OUT)
GPIO.setup(33,GPIO.OUT)
GPIO.setup(35,GPIO.OUT)
GPIO.setup(37,GPIO.OUT)
api=ApiClient(token="A1E-SvmOc0iB8TeqOQkl1Qcqho4kDV9Ue5")
dev1=api.get_variable(bulb1)
dev2=api.get_variable(bulb2)
dev3=api.get_variable(bulb3)
dev4=api.get_variable(bulb4)
while True:
var1=dev1.get_values(1)
if var1[0]['value']:
print 'Device 1 ON'
GPIO.output(31,1) #LIGHT WILL POWER ON
else:
print 'Device 1 OFF'
GPIO.output(31,0)
time.sleep(1)
var2=dev2.get_values(1)
if var2[0]['value']:
print 'Device 2 ON'
GPIO.output(33,1) #LIGHT WILL POWER ON
else:
print 'Device 2 OFF'
GPIO.output(33,0)
time.sleep(1)
var3=dev3.get_values(1)
if var3[0]['value']:
print 'Device 3 ON'
GPIO.output(35,1) #FAN WILL POWER ON
else:
print 'Device 3 OFF'
GPIO.output(35,0)
time.sleep(1)
var4=dev4.get_values(1)
if var4[0]['value']:
print 'Device 4 ON'
GPIO.output(37,1) #PHONE GETS CHARGED
else:
print 'Device 4 OFF'
GPIO.output(37,0)
time.sleep(1)
3.3.5 UBIDOTS
In line with Ubidots guiding principles, in 2018 Ubidots spun out and repurposed its first
ever cloud version as “Ubidots for Education.” Rather than retire this shared-resource
platform, Ubidots instead empowers 35,000+ students and IoT innovators to explore and
develop technology and solutions, giving all users their first device free, always!
The precursor to Ubidots, Ubidots for Education is an IoT enablement platform that give
users the tools to learn and make an impact - be it big or small.
3.3.6 .PUTTY
PuTTY is an SSH and telnet client, developed originally by Simon Tatham for the Windows
platform. PuTTY is open source software that is available with source code and is
developed and supported by a group of volunteers.
The SSH protocol was developed as a secure, encrypted replacement for the RSH protocol.
RSH is used for remote shell access to a UNIX (or UNIX-like) system and was once
popular among sysadmins before network security became the constant concern it is now.
Now, thanks to SSH, the same convenience can be had with an encrypted protocol famous
for its versatility and strong security. While OpenSSH is probably the most-used
implementation of SSH in the world, PuTTY is likely the most-used SSH client for the MS
Windows platform.
The SSH protocol was developed as a secure, encrypted replacement for the RSH protocol.
RSH is used for remote shell access to a UNIX (or UNIX-like) system and was once
popular among sysadmins before network security became the constant concern it is now.
Now, thanks to SSH, the same convenience can be had with an encrypted protocol famous
for its versatility and strong security.
While OpenSSH is probably the most used implementation of SSH in the world, PuTTY is
likely the most used SSH client for the Microsoft Windows platform.
Like OpenSSH, PuTTY is a very versatile tool for remote access to another computer. It's
probably used more often by people who want secure remote shell access to a UNIX or
Linux system than for any other purpose, though that is only one of its many uses.
PuTTY is more than just an SSH client. It supports all of the following protocols:
SSH: As already noted, SSH is an encrypted secure remote login protocol, which uses port
22 by default.
Telnet: Like rlogin, Telnet (telecommunication network) is an unencrypted remote login
protocol. It typically uses port 23 and is available on many systems other than UNIX. Like
rlogin, Telnet has waned in popularity due to privacy concerns.
In addition to the five protocols supported by PuTTY, it also supports features such as saved
session configurations, session logging, locale (language) settings, and proxy sessions.
It's a terrible idea to connect to a Web host over an unencrypted connection for management
of your Web hosting account and for file transfers. Using an unencrypted login is a good
way to get your Web hosting account "owned" by a malicious security cracker. Using a
secure, encrypted protocol like SSH for such purposes is a much better option.
SSH via PuTTY offers a quick, easy way to securely access a UNIX shell environment from
a Windows system. This is handy not only because of the obvious need some people have
for working with both Windows and UNIX/Linux systems, but also for both people who are
forced to use Windows and want access to the power of the UNIX shell and people who are
forced to use UNIX and want the convenience of their Windows environment while they do
it.
As with OpenSSH, PuTTY can be used as a secure Web proxy.
PuTTY can be used to secure TortoiseSVN connections with a Subversion server.
This is by no means an exhaustive list, but it's a good start.
4. 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 IoTs 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 toit; 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
5 . FUTURE WORK
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 amore 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 combineIoT with smart appliances autonomy.
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 theinternet
of things. In Proceedings of the 4th International Symposium on AppliedSciences 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?
anintroduction. 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-
timecomputer 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 InternationalConference on E-
Learning in Industrial Electronics, pages 23–28, Dec 2006.
[8] G´erald Santucci et al. From internet of data to internet of things. In Paper for
theInternational 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 CloudComputing 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
forsmart cities. IEEE Internet of Things Journal, 1(1):22–32, Feb 2014.
Internet of Things for Home Automation (PDF Download Available). Available from:
https://www.researchgate.net/publication/
314508660_Internet_of_Things_for_Home_Automation [accessed Apr 03 2018].