Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

Smart Home Automation System

BY Maqsood Ur Rahman
Mohammed Anees
Mohammed arsalaan
Mohammed sulaiman
Smart Home Automation System-a review

Abstract : Home automation has achieved a lot of popularity in recent years, as day-to-day life is getting
simpler due to the rapid growth of technology. Almost everything has become digitalized and
automatic. In this paper, a system for interconnecting sensors, actuators, and other data sources with
the purpose of multiple home automations is proposed. The system is called q-Toggle and works by
leveraging the power of a flexible and powerful Application Programming Interface (API), which
represents the foundation of a simple and common communication scheme. The devices used by q-
Toggle are usually sensors or actuators with an upstream network connection implementing the q-
Toggle API. Most devices used by q-Toggle are based on ESP8266/ESP8285 chips and/or on Raspberry
Pi boards. A smartphone application has been developed that allows users to control a series of home
appliances and sensors. The q-Toggle system is user friendly, flexible, and can be further developed by
using different devices and add-ons.

Keywords : Internet of Things, homeautomation, Smarthomes, sensors

Introduction : home to be connected to the Internet enables


users to remotely monitor and control them.
The Internet of Things (IoT) is a system that
These include light switches that can be turned
allows devices to be connected and remotely
on and off by using a smartphone or by voice
monitored across the Internet. In the last years,
command, thermostats that will adjust the
the IoT concept has had a strong evolution, being
indoor temperatures and generate reports about
currently used in various domains such as smart
energy usage, or smart irrigation systems that
homes, telemedicine, industrial environments,
will start at a specific time of a day, on a custom
etc. Wireless sensor network technologies
monthly schedule, and thus will control water
integrated into the IoT enable a global
waste. Smart home solutions have become very
interconnection of smart devices with advanced
popular in the last years.
functionalities. A wireless home automation
network, composed of sensors and actuators One of the greatest advantages of home
that share resources and are interconnected to automation systems is their easy management
each other, is the key technology to making and control using different devices, including
intelligent homes. A “smart home” is a part of smartphones, laptops and desktops, tablets,
the IoT paradigm and aims to integrate home smart watches, or voice assistants. Home
automation. Allowing objects and devices in a automation systems offer a series of benefits;
they add safety through appliance and lighting network solution. The ESP8266EX version is one
control, secure the home through automated of the most integrated Wi-Fi chips in the industry.
door locks, increase awareness through security In addition to its Wi-Fi functionalities, ESP8266EX
cameras, increase convenience through integrates an enhanced version of L106 Diamond
temperature adjustment, save precious time, series 32-bit processor from Tensilica (company
give control, and save money based in Silicon Valley, in the semiconductor
domain), with on-chip SRAM. ESP8266EX has
seventeen GPIO pins, which can be assigned to
2.Materials and Methods various functions by programming the
appropriate registers, two power pins, one
2.1 System Architecture and Design : ground pin, reset pin, and two clock pins. The
The classic Ethernet and/or a Wi-Fi local network devices used by q-Toggle are usually sensors or
are usually enough for a working q-Toggle setup. actuators with an upstream network connection.
The different hardware used in the system Keeping the device firmware updated is probably
includes Raspberry Pi 3 or 4 boards (any model), one of the most essential tasks, and it is often
ESP 8266 Wi-Fi modules, and smart devices. The neglected when dealing with a large number of
Raspberry Pi version used for this project is devices. Q-Toggle facilitates this task by allowing
Raspberry Pi 4, due to the improvements updates of the firmware very simply for devices
brought, as compared to previous versions. For of different types and models. The q-Toggle API
example, Raspberry Pi 1 and 2 do not have is an intuitive HTTP API that enables remote
Bluetooth (it is needed for controlling the controlling of basic hardware ports, such as
thermostats). An important feature of the GPIOs or Analog -to-digital converters (ADC).
Raspberry Pi is the row of general-purpose 1. The idea behind q-Toggle is to control
input/output (GPIO) pins. A 40-pin GPIO header programmable systems having a TCP/IP
is found on all current Raspberry Pi boards. The stack via simple HTTP requests.
three roles of a Raspberry Pi board in a q-Toggle 2. Device management—general status
setup are the following: the board could act as a and configuration of the device;
q-Toggle device when it is equipped with 3. Port management—port information
peripherals (sensors or relay boards), it could and configuration;
also act as a master hub for other devices, and, 4. Port values—reading and writing values
finally, it could help install the ESP firmware on from and to ports;
some devices, when running Tuya Convert OS 5. Notifications—event notifications;
(Tuya is a Chinese smart devices platform that 6. Reverse API calls—API calls via reverse
offers cloud services for ESP8266/ESP8285- HTTP requests.
based devices). Tuya Convert OS helps replace
this proprietary Tuya firmware with a custom
firmware, without disassembling the device. An
important fact is that it works only for Tuya-
based devices.

The main part of the home automation system


based on IoT is the microcontroller. The ESP 8266
Wi-Fi module represents a set of efficient highly
integrated wireless Systems on Chip (SoCs),
which provides a complete and standalone Wi-Fi
but also on laptops/desktop machines. Firstly,
the application should be installed and, being a
PWA, it should be added to the home screen.
After installation, the q-Toggle app will be found
in the applications list of the device, and it can be
uninstalled whenever the user wants to. When
the user logs in for the first time an admin with
an empty password should be used. However, for
security reasons, it is highly recommended to set
a password in the Settings page of the app.

Fig Q-Toggle Topology


The q-Toggle ecosystem is composed of a q-
Toggle Server, q-Toggle OS, Esp-Q-Toggle, add-
ons, and other tools and packages that are
specific to certain setups and use cases. The main
component is q-Toggle Server, which is written in
Python. It acts as a hub and provides the user-
friendly web app. Q-Toggle OS is an operating
system (OS) ready to be used with Raspberry Pi
boards and runs q-Toggle Server. Esp Q-Toggle is
a custom firmware for ESP8266/ESP8285 devices
and implements the q-Toggle API. Finally, add-
ons are optional pieces of software that enhance
the functionality of q-Toggle Server. A device
used by q-Toggle will describe itself, indicating its
configuration, its supported optional
functionalities, and what ports it exposes. Each
port, in its turn, will describe itself, indicating its Figure :Logging into Q-Toggle server First time (a)
identifier, type, configuration, and so on. By and setting used password (b) .
combining master–slave relationships between The dashboard is the section where users
simple devices and hubs in a network, a complex will spend most of the time when using q-Toggle
tree topology is obtained. Thus, a large number Server. Here, they can create panels and groups
of smart devices can be easily managed. The type of panels. In the panel edit mode, the user can
of communication is Wi-fi or Ethernet. perform various tasks, for example add, move
Consumers could operate at any level in the around, remove, resize, or configure widgets.
hierarchy, thus limiting the access inside the Widgets usually require selecting one or more
network to any desired subtree. ports. Ports values will be displayed and/or
changed by the widget upon interaction.
2.2 Configuring the Web Application

Q-Toggle Server provides a user-friendly


interface, named frontend, which comes in the
form of a progressive web application (PWA). It is
designed to be used on smartphones, tablets,
Figure :Creating Panels (a) and Grouping of Figure: Adding, Removing (a) and
Panels (b). Configuring Ports(b)
The ports section is only accessible to
administrators. In this section, the user may add,
remove, and configure ports. If users have slave
devices management enabled in q-toggle
server.configuration (by default they are
enabled), the first thing they will have to do is to
select the device whose ports will be edited. The
first device in the list represents the hub (the
master device) itself. An important fact is that
only administrators can add, remove, and
configure slave devices.

Figure : Adding, Removing(a) and


Configuring Slave Devices(b).

Toggle app is linked with the q-Toggle


Server package. This means that users will get an
app update whenever they update their q-Toggle
Server installation. Since q-Toggle is a web app,
the update process is done automatically by the
Figure :Working with Widgets Dashboard browser, when the user reopens or refreshes the
Layout(a) and Widget Properties(b). app. The user can either close it and reopen it, or
he/she can use the pull-to-refresh function to
make sure the app is up to date.
3.Real Home Case Study

The use of q-Toggle in a real home will be


presented. The scenario consists of a two-floor
house with five rooms, two bathrooms, kitchen,
pantry, shed, garage, and garden. In this case, q-
Toggle is used for various purposes, such as:

1. Controlling the indoor temperature


(thermostats and air conditioning (A/C)).
2. Controlling the lights (on–off).
3. Monitoring the power and the energy.
4. Controlling the doors—gates, garage
door, or both at the same time (open–
close).
5. Security—the alarm.
6. Garden sprinklers.

3.1 Controlling Temperature and A/C Figure :Controlling Indoor Temperature


The purpose of controlling the indoor This case study home is provided with nine
temperatures is to maintain thermal comfort and smart thermostats. Thanks to temperature
to save energy cost. In this case, the thermostats sensors, the heat system will start only when the
system offers the following advantages: the temperature falls under a set value (this value is
ability to access and control the indoor set on Q-Toggle app, for each room). For this
temperature anytime and from anywhere using project, six Smart Wi-Fi Touch Thermostat
q-Toggle app on the mobile phone, the ability to Temperature Wireless Controllers, connected to
monitor and separately set the temperature in the power line) and three Equivalents eq-3
individual rooms (not every room has the same Bluetooth smart thermostats, which run on
heating requirements), and, finally, the ability to batteries, have been used.
enable scheduling (lower the temperature The A/C can be controlled to turn on and
during the day, when nobody is home, or during off without using the remote, by using the Q-
vacation). In this way, manual adjustments are Toggle app. This task can be done using a smart
eliminated to save time and effort. plug for the A/C machine. Controlling the
degrees is a feature that can be very easily
implemented in q-Toggle, if necessary, and it will
look similar to the case of thermostats.

3.2 Controlling the Lights


The proposed lighting control system on
the Q-Toggle app One of its main advantages is,
of course, the comfort. Smart lights can, without
any doubts, make our everyday life easier.
Another advantage is related to energy saving.
Big houses, with many rooms, can waste a lot of
energy by simply leaving the lights on where they
are not needed. In addition, many people forget
the lights on somewhere in the house, when
going to bed or leaving the house. In these cases,
it is easy to see where lights are on and to control home solutions provide for the reduction of
them using the mobile app. In addition, a smart individual carbon footprint, give off zero
lighting control system supports home security emissions, and reduce overall environmental
by providing increased protection. For example, damage. For this case study, thirty-three
this means that while away on holiday, the photovoltaic (PV) panels have been installed, in
lighting system could periodically switch on and two stages: the first sixteen panels and then
off lighting in the house, as if someone were
another seventeen panels.
actually home. The light can be controlled
through Q-Toggle app, or using Google Home Solar installations require a dedicated solar
assistant and the voice command “turn on/off inverter that converts solar power from the PV
the light in ... room”. Q-Toggle is compatible with system into an alternating current. Inverters that
Amazon Alexa as well. The devices used for are able to inject the excess of energy into the
controlling the lights are Son off Touch with one,
grid are called on-grid (or grid-tie) inverters and,
two, or three channels.
in many countries, are subject to stricter rules
than those that work off-grid. One of the most
notable requirements for a grid-tie inverter is the
anti-islanding protection: in case of a grid power
outage, the inverter must immediately stop
injecting energy, thus protecting electrical
workers and upstream equipment. For this case
study, the PV power inverters are from the
following brand manufacturers: Fronius for PV1
and MPP Solar for PV2.

Figure : Switching on and off lights with Q-Toggle


App (a) and the Son off Touch device(b).

3.3 Energy and Power Monitoring

The whole world is looking for sustainable and


energy efficient solutions to make our planet
greener, so the use of renewable energy sources,
such as solar energy to the maximum efficiency
possible is the best solution. Photovoltaic panels
convert the sun’s rays into electrical power and
have become more affordable than ever.
Combining the energy savings of solar systems
with the smart technology, the benefit of
renewable energy in a home is maximized. Home
solutions can be fully automated using solar Figure : Monitoring the Energy with Q-toggle (a)
power. In addition to cutting energy bills and
and two inverters Fronius Symo (b),MPP Solar(c).
providing energy efficiency, solar power-based
Solar energy can also be stored in batteries. (b) House Power
When using batteries of a relatively large (c) Gris Consumed Power\
capacity, the energy accumulated over the day (d) Grid Produced Power
can be consumed during the night or during rainy
days. Systems with smaller capacities may only
be used as a backup, in case of grid outages, 3.4 Access Control and Security
being able to supply the house with energy for a
limited number of hours. An inverter that is Access control involves controlling entrances,
capable of switching between grid, solar, and gates and doors, in this case study, the gates and
battery energy sources, depending on various the garage door, specifically. Various options can
configurable conditions, is called a hybrid be chosen: to fully open or close only the gates,
inverter. MPP Solar is such a hybrid inverter. only the garage door, or both at the same time,
or to keep half open one of them or both. Access
The aim for monitoring the power is to see how control can be done manually, using the app, and
much energy the house is using and to become by vocal commands, using Google assistant on a
more aware of the energy use and, thus, of the smart watch. To control gate motors and the
money spent. An electricity monitor also helps garage door, we used two Blitzwolf SS1smart
identify any high energy appliance accidentally relay boards that enable remote
left switched on. Moreover, an important goal of opening/closing. This allowed us to mimic the
power monitoring is the detection of abnormal conventional gate remote control using our Wi-
conditions in voltage when the electrical network Fi-based system.
is undersized, and there are a lot of voltage
variations. A smart power meter allows a The home security system consists of a master
continuous monitoring of all the important control panel, the keypad (when not using the Q-
parameters when it comes to electricity: active, Toggle app), motion sensors, and the siren. The
reactive, or apparent power, power factor, Q-Toggle app is provided with the options to arm
current, voltage, frequency, and total energy and disarm the security system. Arming and
consumption. The device is based on ESP8266 disarming can be performed by voice commands
and integrates a high current switch that can be as well, using Google Assistant/smart watch. We
used to remotely cut off energy supply, in case of have also implemented the Sleep option, which
an emergency. can be used during the night and arms only the
ground floor of a house, for security reasons.

Figure :Monitoring Power with Q-Toggle App


Figure : Access Control(a) and Security(b) with Q-
(a) AC input Voltage Toggle
If motion is detected downstairs during the
night, the alarm will trigger. Arming and
Disarming, using Sleep mode, can be done
manually, using the Q-Toggle app, but also using
an extra light switch, placed upstairs (for more
comfort). The alarm system used in this case
study is a Paradox MG5050 alarm. A custom
integration module has been developed using a
Raspberry Pi board to be able to control the
alarm unit remotely.

3.5 Controlling the Irrigations

Automated irrigation systems help people


control the water used in their gardens or fields
and, thus, to avoid water waste, to save energy
and time, and to minimize water bills. Using an
automatic system based on valves instead of the Figure Controlling the Irrigation System with Q-
classical manual irrigation also avoids human Toggle(a) and The YL 69 sensor(b).
errors, for example forgetting to irrigate one day,
In the automatic case, without sensors, the user
not being able to do it, or forgetting to turn off
is able to set schedules, by turning on the Enable
the water after irrigation. The proposed irrigation
schedule button. The adjustments can be made
system is based on Raspberry Pi and controls a
on the last four slides in the app: Morning factor,
number of pop-up sprinklers. The system inside
Evening factor, Morning time, and Evening time.
the well contains: electric valves (Rain Bird
The user is able to select the time in the morning
DV/DVF valves), one standard 1.1 kW water
and evening when the irrigation should start but
pump, a Raspberry Pi board connected to the
also select the amount of water by adjusting the
house LAN, and a pressure switch (Easy Press II
Morning/Evening factor. A time-controlled
model, with a maximum pressure of 10 bar). The
sprinklers system not only eliminates the chore
user is able to select two modes: the manual one
of hand watering but also saves water, time,
where he can start and stop irrigations whenever
energy, and of course money. The sensors and
he wants and in which zone he wants and an
actuators used for the presented case study,
automatic mode, with or without humidity
along with their main characteristics. Of course,
sensors.
in the architecture of q-Toggle, any kind of sensor
or actuator can be used.
that we do not accidentally run out of storage
due to excessive logging.
Events are actually inputs whose values change.
These inputs are usually mapped to physical
ports whose logic state may change, but they can
also be virtual ports, which are obtained as
combinations of other inputs, using Excel-like
expressions.

Abbreviations

API Application Programming Interface


Heating, Ventilation and Air
Figure Architecture of Q-Toggle HVAC
Conditioning
The Q-Toggle Architecture is composed of HTTP Hypertext Transfer Protocol
Master hub connected to the house LAN and six
IoT Internet of Things
hubs connected to the Master hub.
JSON JavaScript Object Notation
(a) Upstairs hub—controls lightning and
HVAC systems upstairs Message Queuing Telemetry
MQTT
(b) Downstairs hub—controls lighting and Transport
temperatures downstairs
PWA Progressive Web App
(c) Power hub—in charge with energy and
power monitoring REST Representational state transfer
(d) Garage hub—controls lights,
TCP- Transmission Control Protocol-
temperature, and access
IP Internet Protocol
(e) Alarm controller—motion monitoring
and alarm system control
(f) Irrigation controller—controls the
irrigation system in the garden
The communication between the Master hub References :
and the other hubs is done wirelessly except with
the Garage hub and the Power hub, which is 1) El-Hajj, M.; Fadlallah, A.; Chamoun, M.;
wired. Serhrouchni, A. A Survey of Internet of
Interoperability and communication between Things (IoT) Authentication
devices is achieved by adopting a single, unitary, Schemes. Sensors 2019, 19, 1141.
and extensible API across all devices that are part 2) Spadacini, M.; Savazzi, S.; Nicoli, M.
of a q-Toggle system. Wireless home automation networks for
For logging purposes, we use the Python logging indoor surveillance: Technologies and
module that captures logging from all modules experiments. EURASIP J. Wirel.
and sends it to a log file, which is used for Commun. Netw. 2014, 2014, 6
auditing and debugging purposes, if needed. 3) Lee, K.-M.; Teng, W.-G.; Hou, T.-W. Point-
System-level logs are gathered in the same n-Press: An Intelligent Universal Remote
manner into dedicated log files. Moreover, all log Control System for Home
files are rotated on size and age conditions, so Appliances. IEEE Trans. Autom. Sci.
Eng. 2016, 13, 1308–1317.
4) Puri, V.; Nayyar, A. Real time smart home automation system. In Proceedings of
automation based on PIC the 2015 IEEE International Conference
microcontroller, Bluetooth and Android on Research in Computational
technology. In Proceedings of the 3rd Intelligence and Communication
International Conference on Computing Networks (ICRCICN), Kolkata, India, 20–
for Sustainable Global Development 22 November 2015; pp. 77–80.
(INDIACom), New Del-hi, India, 16–18 12) Huang, F.-L.; Tseng, S.-Y. Predictable
March 2016; pp. 1478–1484. smart home system integrated with
5) Asadullah, M.; Ullah, K. Smart home heterogeneous network and cloud
automation system using Bluetooth computing. In Proceedings of the 2016
technology. In Proceedings of the 2017 International Conference on Machine
International Conference on Innovations Learning and Cybernetics (ICMLC), Jeju,
in Electrical Engineering and Korea, 10–13 July 2016; Volume 2, pp.
Computational Technologies (ICIEECT), 649–653.
Karachi, Pakistan, 5–7 April 2017; pp. 1– 13) Kodali, R.K.; Jain, V.; Bose, S.; Boppana, L.
6. IoT based smart security and home
6) Anandhavalli, D.; Mubina, N.S.; Bharath, automation system. In Proceedings of
P. Smart Home Automation Control the 2016 International Conference on
Using Bluetooth and GSM. Int. J. Inf. Computing, Communication and
Futur. Res. 2015, 2, 2547–2552. Automation (ICCCA), Noida, India, 29–30
7) Baraka, K.; Ghobril, M.; Malek, S.; Kanj, April 2016; pp. 1286–1289.
R.; Kayssi, A. Low Cost Arduino/Android- 14) Singh, U.; Ansari, M.A. Smart Home
Based Energy-Efficient Home Automation System Using Internet of
Automation System with Smart Task Things. In Proceedings of the 2019 2nd
Scheduling. In Proceedings of the 2013 International Conference on Power
5th International Conference on Energy, Environment and Intelligent
Computational Intelligence, Control (PEEIC), Noida, India, 18–19
Communication Systems and Networks, October 2019; pp. 144–149. Bhatt, A.;
Madrid, Spain, 5–7 June 2013; pp. 296– Patoliya, J. Cost effective digitization of
301. home appliances for home automation
8) Zamora-Izquierdo, M.A.; Santa, J.; with low-power WiFi devices. In
Gomez-Skarmeta, A.F. An Integral and Proceedings of the 2016 2nd
Networked Home Automation Solution International Conference on Advances in
for Indoor Ambient Intelligence. IEEE Electrical, Electronics, Information,
Pervasive Comput. 2010, 9, 66–77 Communication and Bio-Informatics
9) Froiz-Míguez, I.; Fernández-Caramés, (AEEICB), Chennai, India, 27–28
T.M.; Fraga-Lamas, P.; Castedo, L. Design, February 2016; pp. 643–648.
Implementation and Practical Evaluation
of an IoT Home Automation System for
Fog Computing Applications Based on
MQTT and ZigBee-WiFi Sensor
Nodes. Sensors 2018, 18, 2660.
10) Li, Z.M.; Song, M.; Gao, L. Design of
Smart Home System Based on
Zigbee. Appl. Mech. Mater. 2014, 635–
637, 1086–1089.
11) Vivek, G.; Sunil, M. Enabling IOT services
using WIFI-ZigBee gateway for a home

You might also like