Professional Documents
Culture Documents
ABSTRACT
Home automation includes centralized control for lighting, HVAC (heating,
ventilation and air conditioning) and appliance management. Generally, houses are
equipped with an independent control panels to control all of the systems.
Moreover, those control panels are often not related each other. So, a complicated,
reliable and compactable smart home will be presented in this thesis. This Internet
of Things smart home will be integrated with web technologies and the control
system of smart home. A sophisticated framework for smart home is based on
internet of things, building automation and wireless sensor network. The system
was developed to use wireless technologies in order to reduce cost and complexity.
Sensors and wireless sensor networks are being deployed around the world,
measuring local and global environmental conditions. IoT smart home technology
enables to safe human lives, be convenient living cultures enhance the comfort and
reduce energy consumption. The internet of things allows household devices that
live inside smart homes to seamlessly communicate through the internet at the
application level through standardized web technologies and protocols.
Technologies like short-range wireless communication, RFID and real-time
localization are becoming largely common, allowing the internet to penetrate into
the real world of the physical objects. Formulas for an important design parameter
of the system with the Internet of Things will be derived in this thesis. Web-based
smart homes will provide flexible solutions to challenges such as home
automation, energy awareness and energy conversation.
ii
ABSTRACT....................................................................................................................................................... i
LIST OF ABBREVIATIONS ............................................................................................................................... 3
LIST OF EQUATIONS ...................................................................................................................................... 3
LIST OF FIGURES ............................................................................................................................................ 3
LIST OF TABLES .............................................................................................................................................. 3
1 Introduction .......................................................................................................................................... 3
1.1 Motivation..................................................................................................................................... 3
1.2 Objectives of the thesis................................................................................................................. 4
1.3 Organization of Thesis................................................................................................................... 4
2 Background Theory ............................................................................................................................... 5
2.1 Control system .............................................................................................................................. 5
2.2 Wireless sensor network............................................................................................................... 5
2.3 Microcontrollers............................................................................................................................ 6
2.3.1 ESP8266................................................................................................................................. 6
2.3.2 Arduino.................................................................................................................................. 6
2.3.3 Raspberry Pi .......................................................................................................................... 7
2.4 TCP/IP ............................................................................................................................................ 8
2.5 Wi-Fi ............................................................................................................................................ 12
2.6 Bluetooth .................................................................................................................................... 12
2.7 Internet of things ........................................................................................................................ 13
2.8 Sensor devices............................................................................................................................. 13
2.8.1 Ultrasonic Sensor ................................................................................................................ 13
2.8.2 DHT22 Temperature and Humidity Sensor ......................................................................... 14
2.8.3 RFID (RC522) ....................................................................................................................... 15
2.8.4 Gas Sensor(MQ2) ................................................................................................................ 15
2.8.5 LDR ...................................................................................................................................... 16
2.9 Building automation theory ........................................................................................................ 16
2.9.1 Data structures.................................................................................................................... 17
2.9.1.1 Data types ....................................................................................................................... 17
2.9.1.2 Data points ...................................................................................................................... 19
3
LIST OF ABBREVIATIONS
LIST OF EQUATIONS
LIST OF FIGURES
LIST OF TABLES
1 Introduction
Many electronics devices such as household appliances are becoming smarter
and smarter. They are equipped with embedded microprocessors and wireless
transceivers, offering limited communication capabilities and providing smart
behavior. Everyday objects are fitted with small, cheap mobile processors, sensors
and actuators. Sensors and wireless sensor networks are being deployed in smart
home solutions, measuring with precision the environmental conditions inside the
home environment. Their advanced sensing functionalities and their increasing
accuracy enable the development of smart home applications that offer advanced
automation. Residences are transformed into smart homes, incorporating
embedded sensors and actuators, and pervasive technology. Typical computing
devices include smart phones, embedded sensors and actuators, radio-frequency
identification (RFID) chips and smart cards. In the near future, homes will offer
new automation possibilities to their residents, increasing their comfort level. By
now, residential smart meters have been introduced in our lives as sensor devices
that measure in small time intervals the energy consumption of a house. Moreover,
smart power outlets are devices that measure the consumption of individual
electrical appliances and control their operation in real-time. It is expected that
smart appliances would handle automatically their function optimally in order to
save energy and perform their task effectively. Smart home equipment with smart
meter, smart appliances and smart power outlets enable the extension of smart
homes into energy-aware environments.
1.1 Motivation
In this thesis, the main contribution is the development of an application
framework for smart homes and the presentation of an inclusive approach for
developing smart home applications based on reusing Web standards. Even though
a number of energy-related applications are discussed, we do not present a novel
technology for energy efficiency. The main innovation lies in the fact that existing
4
2 Background Theory
2.1 Control system
2.3.1 ESP8266
Wi-Fi Module (ESP8266): The ESP8266 ESP-01 is a Wi-Fi module that
allows microcontrollers access to a Wi-Fi network. This module is a self-
contained SOC (System on a Chip) that doesnt necessarily need a microcontroller to manipulate
inputs and outputs as you would normally do with an Arduino, for example, because the ESP-01
acts as a small computer. Depending on the version of the ESP8266, it is possible to have up to 9
GPIOs (General Purpose Input Output). Thus, we can give a microcontroller internet access like
the Wi-Fi shield does to the Arduino, or we can simply program the ESP8266 to not only have
access to a Wi-Fi network, but to act as a microcontroller as well. This makes the ESP8266 very
versatile, and it can save you some money and space in your projects.
2.3.2 Arduino
Arduino is an open source single-board microcontrollers for building digital devices and
interactive objects that can sense and control objects in the physical world. Arduino board
designs use a variety of micropro-cessors and controllers. The boards are equipped with sets of
digital and analog input/output (I/O) pins that may be interfaced to various expansion boards
(shields) and other circuits. The boards feature serial communications interfaces, including
Univer-sal Serial Bus (USB) on some models, which are also used for loading programs from
personal computers. The microcontrollers are typically programmed using a dialect of features
7
from the programming languages C and C++. In addition to using traditional compiler
toolchains, the Arduino project provides an integrated development environment (IDE) based on
the Processing language project.
2.3.3 Raspberry Pi
The set of open source technologies now exist that combine the power of the PC,
the communication and multimedia technologies of the web, the ability to interact
with the environment of a microcontroller, and the portability of a mobile device.
8
This provides the perfect set of factors allowing us to build cheap devices for our
homes that can interface with commercial devices, but can be tailored for our own
needs while also providing a great tool for learning about technology. For those
familiar with Arduino devices, the Raspberry Pi combined with its shields provide
an all-in-one medium for creating devices without the need for a separate PC or
Macgiving us an alternative to solutions that currently exist. Also, thanks to the
Raspberry Pi's mission of providing an educational tool for those interested in
programming, the addition of the Arduino shield will provide a mechanism for
those who wish to move from writing software that manipulates the Raspberry Pi,
to software that manipulates their environment and provides a pathway for learning
about electronics. This could have the positive effect of bolstering the ranks of
home-brew and Maker clubs with an eye towards home automation and lead to an
ever-greater diversity of tools being produced for the public.
The Raspberry Pi is built off the back of the Broadcom BCM2835. The BCM2835 is a multimedia
application processor geared towards mobile and embedded devices.
On top of this, several other components have been included to support USB, RCA, and SD card
storage.
www.it-ebooks.info
2.4 TCP/IP
Fuzzy control system Transmission Control Protocol (TCP) and Internet Protocol (IP) are two
distinct computer network protocols. A protocol is an agreed-upon set of procedures and rules.
When two computers follow the same protocolsthe same set of rulesthey can understand
each other and exchange data. TCP and IP are so commonly used together, however, that TCP/IP
has become standard terminology for referring to this suite of protocols.
Transmission Control Protocol divides a message or file into packets that are transmitted over the
internet and then reassembled when they reach their destination. Internet Protocol is responsible
for the address of each packet so it is sent to the correct destination. TCP/IP functionality is
divided into four layers, each with its own set of agreed-upon protocols:
The Datalink layer consists of methods and protocols that operate only on a link, which
is the network component that interconnects nodes or hosts in the network. Protocols in
the layer include Ethernet and ARP.
The Internet or Networking layer connects independent networks to transport the
packets containing the data across network boundaries. Protocols are IP and ICMP.
9
The Transport layer handles communications between hosts and is responsible for flow
control, reliability and multiplexing. Protocols include TCP and UDP.
The Application layer standardizes data exchange for applications. Protocols
include HTTP, FTP, POP3, SMTP, and SNMP.
TCP/IP technically applies to network communications where the TCP transport is used to
deliver data across IP networks. A so-called "connection-oriented" protocol, TCP works by
establishing a virtual connection between two devices via a series of request and reply messages
sent across the physical network.
Most computers users have heard the term TCP/IP even if they don't know what it means. The
average person on the internet works in a predominately TCP/IP environment. Web browsers, for
example, use TCP/IP to communicate with Web servers. Millions of people use TCP/IP every
day to send email, chat online and play online games without knowing how it works.
10
GPIO Pins CPU/GPU SD card port Micro USB Power USB Ethernet Audio RCA HDMI
Dimensions
The Raspberry Pi is a small device coming in at 85.60mm x 53.98mm x 17mm and weighing only
45g. This makes it perfect for home automation, where a small device can be placed in a case and
mounted inside an electrical box, or replace an existing thermostat device on a wall.
HDMI port
The High Definition Multi-media Interface (HDMI) port allows the Raspberry Pi to be hooked up
to high-definition televisions and monitors that support the technology. This provides an additional
option to the composite RCA port for video and additionally supports audio.
Should you wish to stream video and audio from the web to your TV, this is the port you would
want to use.
SD card port
The main storage mechanism of the Raspberry Pi is via the SD card port. The SD card will be where
we install our operating system and will act as our basic hard disk. Of course, this storage can be
expanded upon using the USB ports.
CPU
Early in this chapter we touched upon ARM the British manufacturers of central processor unit
(CPU) cores. The Raspberry Pi comes equipped with a 700 MHz, ARM1176JZF-S core part of the
ARM 11 32-bit multi-processor core family.
The CPU is the main component of the Raspberry Pi, responsible for carrying out the instructions of
a computer program via mathematical and logical operations.
The Raspberry Pi is in good company using the ARM 11 series and has joined the ranks of the
iPhone, Amazon Kindle, and Samsung Galaxy.
GPU
The graphics-processing unit (GPU) is a specialized chip designed to speed up the manipulation of
image calculations.
In the case of our Raspberry Pi, it comes equipped with a Broadcom VideoCore IV capable of
hardware accelerated playback and support for OpenGL.
www.it-ebooks.info
12
Ethernet port
The Ethernet port is the Raspberry Pi's main gateway to communicating with other devices and the
Internet. You will be able to use the Ethernet port to plug your Raspberry Pi into a home router such
as the one you currently use to access the Internet, or a network switch if you have one set up.
GPIO pins
The General Purpose Input/Output (GPIO) pins on the Raspberry Pi are the main way of connecting
with other electronic boards such as the Arduino.
As the name suggests, the GPIO pins can accept input and output commands and thus can be
programmed on the Raspberry Pi.
The Arduino shields will be attached to the GPIO via a bridge shield allowing us to transfer data
from sensors soldered to the device back to the Raspberry Pi. This is especially useful in home
automation projects, where we may wish to store sensor data or manipulate motors based upon a
program running on the Raspberry Pi's operating system.
Having touched upon the technical capabilities of the Raspberry Pi, we will now look at the Arduino and the
Raspberry Pi to Arduino shield, a way to connect the two technologies via the GPIO pins. [ 12 ]
2.5 Wi-Fi
Wireless _delity or Wi-Fi is based on IEEE 802.11a/b/g/n (10) standards for
wireless local area networks. It allows wireless connection to the internet at
broadband speeds. The architecture is comprised of several components that
interact with each other to provide a wireless local area network (10) such as the
physical layer and data link layer. Moreover, MAC procedures are de_ned for
accessing the physical layer. In a Wi-Fi based network each cell is a basic service
set(BSS). BSS comprises of a set of Wi-Fi stations and clients connect to such
stations. Wi-Fi therefore de_nes a distributed coordination function (11) among
the peers.
2.6 Bluetooth
Bluetooth is based on a wireless radio system that is designed to remove the need
for cables for short-range devices, such as mice, printers etc. A network that
includes such devices is called a wireless personal area network. Topologies that
are de_ned in Bluetooth are named Piconet and Scatternet. A Piconet is a WPAN
that consists of two or more devices. One of them serves as a master and the
other are slaves. All of the devices in a Piconet are synchronized with each other
using the clock of the master. Slaves communicate only to the master. Master
can communicate with any device. Further, Scatternet comprises of di_erent
Piconets that overlap time and space. Two or more Piconets can be connected
with each other to form a Scatternet. A Bluetooth device can be a part of di_erent
13
Piconets at the same time. This allows the data to ow beyond the range of a
single Piconet. A device can only be a master in one Piconet, but a slave in many
Piconets (10).
Since it is known that sound travels through air at about 344 m/s (1129 ft/s), you can take the
time for the sound wave to return and multiply it by 344 meters (or 1129 feet) to find the total
round-trip distance of the sound wave. Round-trip means that the sound wave traveled 2 times
the distance to the object before it was detected by the sensor; it includes the 'trip' from the sonar
sensor to the object AND the 'trip' from the object to the Ultrasonic sensor
2.8.5 LDR
A Light Dependent Resistor (LDR) or a photo resistor is a device whose
resistivityis a function of the incident electromagnetic radiation. Hence, they are
light sensitive devices. They are also called as photo conductors, photo conductive
cells or simply photocells.
They are made up of semiconductor materials having high resistance. There are
many different symbols used to indicate a LDR, one of the most commonly used
symbol is shown in the figure below. The arrow indicates light falling on it.
Reliability
Reliability is one of the key factors when one is considering of buying a new device,
vehicle, household item etc. The same applies for home automation systems. If
there is no error detection or correction in a system, there is no way to _nd out if
a command got through to the device it was intended unless you can physically
see or touch the machine. Specially in home automation systems the reliability
in handling some devices is crucial. For instance, a smoke detector managed by
the home automation system required high levels of reliability from the device
and from the system controller.
This format is used to represent any number. High precision has to be used
to represent both float and double formats well. The application must also be
careful about real overflow / underflow caused by exceeding precision limit.
Such violations should be reported, but functionality preserved. A possibility
of maintaining some functionality during overflows is rounding to the
precision limit. Optional parameters:
Minimal Value
Maximal Value
Step (indicates maximal precision-rounding while reading the
variable)
Increment (never smaller than step)
The main difference between Step and Increment is that Step is used for
reading, while increment for setting the variable. If Step of temperature is
set to 0.1C, than the real temperature value of 20.73195C appears as
20.7C. Even though the temperature preset for A/C can be modified by
0.1C, we might want to set the Increment to 0.5C so that the user can set
the temperature faster using up/down control.
String
A dynamic implementation is suitable to avoid length limits.
List
A finite ordered list of choices. Loop parameter indicates whether the first
item also follows the last one.
Timestamp
Specifies exact date and time
Percentage
This is not as common data type as the ones above, but Percentage is a very
convenient way of expressing a relative number for example the light is
turned to 30%, laundry machine progress 80% finished and so on.
Percentage is basically a Real value, but we have to be careful about the
conversion. In middle layer, the conversion between Percentage and Real or
Integer is very natural if Minimal / Maximal Values are defined:
= 100%
On the other hand, for mapping between layers we often consider 0=0% and
1=100%.
= 100%
19
Other properties are dependent on the Data type. They include for example:
Min/max value
Increment
Step
Timestamp: time of measurement or last change of the value
Min/max alarm level: exceeding this value causes alarm
others
We will add following optional parameters to all the data points:
Type
Type specifies what kind of object the data point represents. All types are
organized in a customizable hierarchical tree, such as:
ON/OFF
SWITCH LIGHT
DIMMABLE
LIGHTING WINDOW
MULTIMEDIA
20
HVAC