Wireless Home Automation System Using Iot
Wireless Home Automation System Using Iot
Wireless Home Automation System Using Iot
2/2017 17
Nowadays, the chance of having an automated home is no longer a fancy luxury, but a reality
accessible to a wide range of consumers, because smart home systems have replaced those that
only automated the home in the past. More and more solutions based on IoT are being devel-
oped to transform homes into smart ones, but the problem is that the benefits of home automa-
tion are still not clear to everyone as they are not promoted enough, so we cannot talk about a
broad mass of consumers already using integrated or DIY solutions to improve their lives. In
this paper, I will present a home automation system using Arduino Uno integrated with relevant
modules which are used to allow remote control of lights or fans, changes being made on the
basis of different sensors data. The system is designed to be low cost and expandable, bringing
accessibility, convenience and energy efficiency.
Keywords: Home automation, Arduino Uno, Appliances remote control, IoT
been transposed as much as possible into real- people want to use this solution, the result ob-
ity, so today we are facing with talking houses tained has clearly demonstrated that the most
that originally existed only in books or films of them want to benefit from the functionali-
and integrated technologies where everything ties of a smart home without too much effort,
is interconnected and the possibilities are end- leaving everything in the providers of such
less. services’ jobs. [5]
However, the existing works were mainly fo-
2 Literature Review cused on switching and controlling home ap-
The aim of this section is to establish a base of pliances or connected devices rather than re-
the existing literature, and to present different motely monitoring of home environment
HAS with their features, benefits or limita- which is the focus of nowadays systems.
tions.
Shortcomings of existing technologies were 3 System Analysis
mentioned in 2013 in a paper which intro- In my opinion home automation systems
duced a convenient and flexible smart home (HAS) face three main challenges: high costs,
system based on IoT. There was presented a vulnerability, and difficulty in achieving secu-
demo version of the system which used a rity. The main purposes of this paper is to de-
phone to query and control the system locally sign and implement a HAS using IoT, capable
and remotely. The experimental results shown of controlling and automating the next sys-
that the system could provide a real-time man- tems: lightening, cooling, gate locking and
agement for the home and it is considered that seismic warning, through an easy and conven-
with the introduction of IoT the research and ient Android application. The proposed sys-
implementation of home automation are get- tem has a great flexibility based on Wi-Fi
ting more popular. [2] technology used to interconnect and control a
In 2014, another paper presented a flexible, part of the modules (the relay, LEDs) and its
low-cost automated home system, which is distributed sensors (motion sensor) to HAS
based on a mobile application for Android server, all being developed around Arduino
which communicates with the micro-web Uno. The Android application is named
server from the Arduino Ethernet. The pro- “HomeControl”, and it represents the key to
posed design is based on the management an automated home. Besides remote control of
control of energy systems such as lightings, devices and a lot of discussion when we have
security, heating, air conditioning, fire or in- guests, this application was designed to ease
trusion detection using a siren and email noti- the lives of those who use it, helping them to
fications. [3] manage efficiently their time or costs, because
In the same year, another relevant paper pre- it was developed from the idea of energy effi-
sented the necessary background regarding ciency, aspects that are not neglected today at
the IoT paradigm. They evaluated a subset of all.
50 important projects based on research and When time becomes too short, the solution is
commercial solutions appeared over the last to try avoid the routine or other things that
decade (2001-2011). A major objective of this does not need us physically, becoming others’
paper was to help elderly/ handicapped people duties. By automating various actions previ-
by controlling various home appliances and ously undertaken by humans, the possibility
provide security using Android phone/tablet. of time decrease becomes a real benefit. For
So, the solution is designed for an Android example, if the living-room temperature ex-
phone upon a home automation system which ceeds a preset value, the user can choose to
uses Arduino Mega ADK and embedded de- turn the air conditioning automatically on, and
vices/sensors. [4] also set the operating time. Activating or de-
In April 2016, according to a study made by activating sensors is also an important require-
Comcast on how the notion of house automa- ment as there may be times when we want a
tion is understood, with an emphasis on how different behavior of the HAS. In case of an
DOI: 10.12948/issn14531305/21.2.2017.02
Informatica Economică vol. 21, no. 2/2017 19
evening party at the pool, users would cer- 4 System Design and Implementation
tainly not want the lighting in the yard to be In this section I will detail the functionalities
based on motion detection, but permanent. of the software component through which the
Gate control is another great advantage of the control of the hardware components is
DIY home automation system I implemented. achieved, together with the objectives defined
If one resident is upstairs and another one in the previous paragraph and I will present
comes with luggage or has no keys, he/she can the design methodology on the basis of which
open him/her with just a click from the mobile the information system was developed. I will
device used. Another advantage of SI also give an overview of the system by repre-
achieved is to be effective and prompt in get- senting the activities undertaken by a user
ting a response on vibration monitoring that is through a mobile device, using the CASE tool
designed to simulate a possible earthquake. Visual Paradigm. The functional requirements
Depending on the sensitivity chosen in the ap- underlying the development of the “Home-
plication and assuming the sensor is active, its Control” application will be determined and
role is to start the buzzer, which will notify the modeled using the use case diagram (Figure
residents of the house that an earthquake is 1). This illustrates the interaction between the
happening. Does it seem complicated? No, ra- system and the users, or other external com-
ther ideal. ponents named actors, and the actions they
want to accomplish.
4.1 Proposed Home Automation System the Figure 3 and it consists of different mod-
The proposed model of the HAS is shown in ules.
DOI: 10.12948/issn14531305/21.2.2017.02
20 Informatica Economică vol. 21, no. 2/2017
Some of them are based on sensors like: tem- “HomeControl”, in order to connect exhaust-
perature, motion, light or seismic, through ively various devices belonging hypotheti-
which is retrieved the data from the environ- cally to subsystems of a house, improving the
ment. The rest: Wi-Fi, LEDs, buzzer, relay life quality of the inhabitants.
and the stepper motor have independent func-
tions that control and modify the system be- 4.2 Hardware Design
havior. The picture provides an overview of 4.2.1 Arduino Uno
the circuit, and the highlighted components Arduino Uno is an open-source development
will be described in the next section. board that can be resembled with a mini com-
As a simple mention, because I will detail fur- puter. It is built around the ATmega328P mi-
ther how the system was created, two bread- croprocessor which allows it to capture and
boards were used to multiply the number of interpret environmental data from a series of
pins belonging to Arduino Uno/ ESP8266 sensors and perform various actions on con-
board, integrating the elements of the circuit nected devices, such as displaying infor-
as I wished. The main purpose of the system mation obtained on an LCD screen, changing
was to automate the following elements: light- the LEDs colors and so on. The microproces-
ing system (using LEDs), air conditioning (us- sor is capable of running code very similar to
ing a mini-propeller) or the gate (using a step- C++, having some domain-specific libraries
per motor) and to manage the environmental which add alternative names for some types
information received from the following sen- and customizes functions. [6] The technical
sors: motion, light, seismic or temperature. specifications of the board will be presented
For controlling the system, I mentioned before later in Table 1, along with the ESP8266 char-
that I developed a mobile application named acteristics and the components are shown in
Figure 4.
DOI: 10.12948/issn14531305/21.2.2017.02
Informatica Economică vol. 21, no. 2/2017 21
In the implemented system, the role of Ar- Chip (SOC) with integrated TCP/IP protocol
duino Uno is to control and integrate some of that allows any other microcontroller to access
the modules used, hosting the code that man- the Wi-Fi network. This integrated circuit
ages their behavior. So I am talking about the (Figure 5) is built on a microcontroller (not a
integration of the following modules: motion microprocessor, because it does not have
sensor, temperature sensor, light sensor, seis- RAM, flash or I/O ports) and has advanced pe-
mic sensor, LCD screen and buzzer. ripherals such as the ESP-12 Wi-Fi module. It
can operate independently and perform ac-
4.2.2 ESP8266 Wi-Fi Module tions better than Arduino Uno.
The ESP8266 Wi-Fi Module is a System on a
Via the GPIO pins, the board can be integrated all wireless network functions from another
with specific sensors or devices, having application processor. [6] Its specifications
enough processing and storage capacity. are detailed in Table 1.
ESP8266 is capable of hosting and taking over
DOI: 10.12948/issn14531305/21.2.2017.02
22 Informatica Economică vol. 21, no. 2/2017
The ESP8266 module has three modes of op- connects the electronic components very eas-
eration: ily and without soldering, using male to male
1. Access Point (AP) - The Wi-Fi module acts wires (with pins at both ends).
as a wireless network or access point (hence
the name), allowing other devices to connect
to it. A bidirectional communication is estab-
lished between the module and the devices
connected to it via Wi-Fi.
2. Station (STA) - The ESP8266 module can
connect to an access point (AP), such as the
Wi-Fi router used in the home. This allows
any device connected at the same Wi-Fi net-
work to communicate with the module re-
motely, building a local network.
3. Access point and station - in this mode, it
acts both in AP and STA mode. Fig. 6. The breadboard
In the system I implemented, I used the Wi-Fi
module in STA mode, to represent a control Its role in making the circuit is to allow the
point between the objects connected to the supply and connection of as many modules as
network and the mobile device, also con- possible, representing a bridge between com-
nected to the same network as ESP8266. This ponents and a major power supplier.
module allows the users to create an autono-
mous web server using various libraries by 4.2.4 The Relay Module
which the client (the mobile application) can The 8 electromechanical relay module from
efficiently control and manage the LEDs, light the next picture (Figure 7) allows 8 different
sensor, motion sensor and the stepper motor electrical devices to be controlled via 8 Ar-
attached to the gate, receiving power through duino digital ports. [6]
the 8-relay module. Thus, through the mobile Its role within the circuit is to turn on/off the
application that connects to the HTTP server power of the devices connected to it: the
and sends requests, various responses are re- LEDs, the light and motions sensors or the
turned depending on the needs of each user. stepper motor, using the information received
from the Wi-Fi module.
4.2.3 The Breadboard
The breadboard (Figure 6) is a device that
DOI: 10.12948/issn14531305/21.2.2017.02
Informatica Economică vol. 21, no. 2/2017 23
I chose to use it with the light sensor to control 4.2.10 Seismic Sensor
the automatic lighting in the garden. When it The seismic sensor (Figure 13, left) is a com-
gets dark and a person arrive at home or ponent that senses mechanical vibration. In
leaves, the LEDs will light up, allowing order to accomplish the project I decided to
him/her to lock/unlock quickly and easily. complete its functionality using a buzzer.
DOI: 10.12948/issn14531305/21.2.2017.02
Informatica Economică vol. 21, no. 2/2017 25
In the mobile application, the user has the abil- facilities offered by the Arduino and Android
ity to change the intensity of the lights, but platforms, along with the utility of the SQLite
also to choose a predefined environmental SGBD. The interface between the user and the
program such as “reading”, “disco” or “relax- database is represented by the mobile applica-
ing” which imitate the reality obtained for ex- tion and was created using Android Studio
ample with Philips Hue. IDE. Regarding the back-end part, the data-
base control and management is made from
4.3 Software Design the mobile application, while the elements
The information system presented in this pa- that make up the circuit are controlled through
per has been implemented by highlighting the the mobile application, Arduino and Wi-Fi
board.
The application, “HomeControl” was devel- sponds to version 5.0 “Lollipop”, thus cover-
oped on the Android OS using version 6.0 ing around 63% of the devices which are cur-
“Marshmallow”, which has associated level rently using the Android OS. The develop-
23 of the programming interface (API). Ac- ment for controlling and managing the ele-
cording to the next chart (Figure 15), this ver- ments that make up the circuit meant pro-
sion is the most used at the moment, and be- gramming the Arduino microcontroller and
cause the device I own supports this version I the Wi-Fi module through special rules for or-
chose it. ganizing written code in C ++. Thus, I created
In the circumstances that it is possible to make two programs (called sketches) one for each
an application compatible with one or more component mentioned before, using the offi-
versions of the Android platform I chose as cial development environment Arduino IDE.
minimum SDK the API level 21, which corre-
DOI: 10.12948/issn14531305/21.2.2017.02
26 Informatica Economică vol. 21, no. 2/2017
4.4 Setup Implementation So, the generally connection used to power all
In this section I will describe how I connected the modules is noted in the paper as relation X
a part of the hardware components to obtain and involved the next two steps:
the system, starting from Arduino Uno and 1 I linked the Vcc (+) to the breadboard power
ESP8266 boards, to some specific devices line (+)
connected and controlled by them. 2 I linked the Gnd (-) to the breadboard ground
I will start with the Arduino board, which ac- line (-)
cording to the technical specifications from The concept of these two links mentioned
Table 1, has 14 digital pins used to send only above and represented in Figure 16 is also
signals, 6 analog pins to receive/send data used to link all the modules to the breadboard,
from/to the connected components and 5 so I will start to detail how the light sensor
power supply pins, all shown in Figure 4 from connects.
section 4. In the following presentations, the
power supply pin (plus) is called Vcc, the mi-
nus is called Gnd, and the one used to re-
ceive/send signals or data Out or D0. This
board can be powered externally or directly
from the computer via USB and the sensors
are used to receive environmental infor-
mation, on the basis of which I have decided
what actions should happen.
Under these circumstances, to Arduino Uno I
decided to connect modules that do not re-
quire changing parameters just thresholds,
such as the light sensor, motion sensor, seis- Fig. 16. Standard links between Arduino and
mic sensor, LCD screen or the buzzer, and I breadboard
am going to describe how they were con- To get the information from the light sensor I
nected to the board in the following para- connected the Out pin (D0) to the third ana-
graphs. Since Arduino has a limited number log pin of Arduino 1, and to supply power to
of power pins, I needed to use a breadboard to the module I applied the relation X (links no
supply power to all the components and create 2 and 3), using the breadboard. All these con-
an explicit circuit. nections are shown in Figure 17.
DOI: 10.12948/issn14531305/21.2.2017.02
Informatica Economică vol. 21, no. 2/2017 27
The module is linked to an analog pin because the temperature sensor, I coupled its signal pin
values are read by the sensor and they need to D0 to the 4th analog pin from Arduino 1. Fig-
be transferred to Arduino for further interpre- ure 18 also shows the links between the bread-
tation. board and the Arduino Uno.
The next connected sensor is the temperature As the light sensor, this one is connected to an
one. The way it receives power is identical to analog pin too, because environmental values
what I have previously presented for the are read and transmitted to Arduino for inter-
breadboard and the light sensor (relation X: pretation.
links no 2 and 3). To receive information from
The following two components: the seismic linked the output pin D0 to the 4th Arduino dig-
sensor and the buzzer will be presented in par- ital pin 1, and regarding the buzzer I linked
allel. The way they receive power is the same the Out pin, D0, to the 3rd digital pin from Ar-
as I have previously presented (relation X: duino 1’. The connections described can be
links no 2 and 3). seen in the figures shown below 19 (front) and
To get information from the seismic sensor I 20 (back).
DOI: 10.12948/issn14531305/21.2.2017.02
28 Informatica Economică vol. 21, no. 2/2017
Fig. 19. Seismic Sensor and Buzzer Connections (back – left, front - right)
When the specialized sensor detects a vibra- ESP8266. In order to benefit from the mod-
tion, signals will be sent to the board, and if ule's functionality, I linked its Vcc (+) pin to
this vibration exceeds the threshold preset in the breadboard plus the Gnd (-) pin to minus
application, signals will be sent to the buzzer, (relation X). In order to manage the power
which will produce a series of sounds such as supply through the first relay of the module, I
an earthquake warning. coupled the IN1 pin to the GPIO_14 pin of the
The last two components for which I de- ESP board 0, as shown in Figures 20 and 21.
scribed the way they are connected in the sys- Running one of the relays involves writing the
tem are the 8-relay module and the LEDs LOW value on the GPIO pin of the Wi-Fi
module. board with which it is paired. Thus, by press-
ing the existing button in the mobile applica-
tion, used to control the lights, a request to the
server will start the relay. Regarding the lights
supply power, there will be written LOW on
GPIO_14 to start the relay so that the LEDs
are on. Otherwise, HIGH will be written on
GPIO_14 to stop the relay and the power of
the lights.
The last connection explained is for the Ne-
oPixel LEDs. To connect this module in order
to perform various light changes, I linked the
Fig. 20. Relay Module connected to elements as follows: the input of the first relay
ESP8266 was connected to the breadboard power line
(plus) 1 and its output to the Vcc (+) 1’ pin of
They are connected and controlled by the the LEDs, so setting on/off the relay will cause
the lights to go on/off too.
DOI: 10.12948/issn14531305/21.2.2017.02
Informatica Economică vol. 21, no. 2/2017 29
DOI: 10.12948/issn14531305/21.2.2017.02
30 Informatica Economică vol. 21, no. 2/2017
In Figure 23 are presented the temperature for the house lighting system, giving the user
changes happened at the intervention of exter- different possibilities regarding LEDs colors,
nal factors, increasing from 23.43 ° C to 28.81 such as Philips Hue bulbs. The courtyard
° C. LEDs and the others used only for mono-
2) Control of the lighting system assures the chrome light can be controlled manually using
management of the courtyard lamps based on the first button from the menu as shown in
the light and motion sensors, for which inten- Figure 24, left.
sities will be set as threshold trigger and also
Fig. 24. Monochrome LEDs Control (left) and NeoPixel LEDs Control (right)
To create various light games from the appli- placed in the center of the menu.
cation menu, the user can select the top right In Figure 25 is presented the result of combin-
button that renders initially a monochrome ing red, green and blue colors at different in-
light with a brightness of 10% (Figure 24, tensities.
right), having the possibility to change the
LEDs’ colors in real time or to create a new
lighting profile from Settings, the button
DOI: 10.12948/issn14531305/21.2.2017.02
Informatica Economică vol. 21, no. 2/2017 31
References
[1] M. Miller, The Internet of Things: How
Fig. 26. Stepper Motor Control Smart TVs, Smart Cars, Smart Homes,
and Smart Cities Are Changing The
4) Gate automation was realized using a step- World. (pp 81-83). Indianapolis, IN: Que.
per motor (Figure 26) and I think it represents [2] Y. Liu Y., Study on Smart Home System
a big advantage for those who own an auto- Based on Internet of Things Technology.
mated house. For example, when they are in In Informatics and Management Science
their cars or they have big luggage, only one IV. vol. 207, (pp. 73-81). W. Du, Ed:
click can represent the rescue. Springer London.
[3] S. Kumar, Ubiquitous Smart Home Sys-
6 Conclusion tem Using Android Application. In Inter-
From my point of view, the information sys- national Journal of Computer Networks &
tem is in its start-up phase, which I would call Communications (IJCNC) Vol.6, No.1.
it a first version. In this sense, I already have Retrieved April 04, 2017, from
ideas on future developments and I started to https://www.researchgate.net/publica-
document about the upgrade implementation. tion/260127438_ Ubiqui-
Therefore, in the future I'm going to move the tous_Smart_Home_System_Using_An-
local database on the server, to implement the droid_Application
voice control option and also to integrate mul- [4] C. Perera, A. Zaslavsky, Christen P. &
tiple sensors into the circuit to increase the Georgakopoulos D. (2013), Context
Aware Computing for The Internet of
DOI: 10.12948/issn14531305/21.2.2017.02
32 Informatica Economică vol. 21, no. 2/2017
DOI: 10.12948/issn14531305/21.2.2017.02