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,
indoor temperatures and generate reports about
being currently used in various domains such as
energy usage, or smart irrigation systems that
smart homes, telemedicine, industrial
will start at a specific time of a day, on a custom
environments, etc. Wireless sensor network
monthly schedule, and thus will control water
technologies integrated into the IoT enable a
waste. Smart home solutions have become very
global interconnection of smart devices with
popular in the last years.
advanced functionalities. A wireless home
automation network, composed of sensors and One of the greatest advantages of home
actuators that share resources and are automation systems is their easy management
interconnected to each other, is the key and control using different devices, including
technology to making intelligent homes. A smartphones, laptops and desktops, tablets,
“smart home” is a part of the IoT paradigm and smart watches, or voice assistants. Home
aims to integrate home automation. Allowing automation systems offer a series of benefits;
objects and devices in a
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
door locks, increase awareness through security industry. In addition to its Wi-Fi functionalities,
cameras, increase convenience through ESP8266EX integrates an enhanced version of
temperature adjustment, save precious time, L106 Diamond series 32-bit processor from
give control, and save money Tensilica (company based in Silicon Valley, in the
semiconductor domain), with on-chip SRAM.
ESP8266EX has seventeen GPIO pins, which
2.Materials and Methods can be assigned
various to by programming the
functions
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 devices used by q-Toggle are usually sensors or
network are usually enough for a working q- actuators with an upstream network connection.
Toggle setup. The different hardware used in the Keeping the device firmware updated is
system includes Raspberry Pi 3 or 4 boards (any probably one of the most essential tasks, and it
model), ESP 8266 Wi-Fi modules, and smart is often neglected when dealing with a large
devices. The Raspberry Pi version used for this number of devices. Q-Toggle facilitates this task
project is Raspberry Pi 4, due to the by allowing updates of the firmware very simply
improvements brought, as compared to for devices of different types and models. The q-
previous versions. For example, Raspberry Pi 1 Toggle API is an intuitive HTTP API that enables
and 2 do not have Bluetooth (it is needed for remote controlling of basic hardware ports,
controlling the thermostats). An important such as GPIOs or Analog -to-digital converters
feature of the Raspberry Pi is the row of (ADC).
1. The idea behind q-Toggle is to control
general-purpose input/output (GPIO) pins. A 40-
programmable systems having a TCP/IP
pin GPIO header is found on all current
stack via simple HTTP requests.
Raspberry Pi boards. The three roles of a
2. Device management—general status
Raspberry Pi board in a q-Toggle setup are the
and configuration of the device;
following: the board could act as a q-Toggle 3. Port management—port information
device when it is equipped with peripherals and configuration;
(sensors or relay boards), it could also act as a 4. Port values—reading and writing values
master hub for other devices, and, finally, it from and to ports;
could help install the ESP firmware on some 5. Notifications—event notifications;
devices, when running Tuya Convert OS (Tuya is 6. Reverse API calls—API calls via reverse
a Chinese smart devices platform that offers HTTP requests.
cloud services for ESP8266/ESP8285- 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 Figure :Logging into Q-Toggle server First time (a)
port, in its turn, will describe itself, indicating its and setting used password (b) .
identifier, type, configuration, and so on. By
The dashboard is the section where users
combining master–slave relationships between
will spend most of the time when using q-Toggle
simple devices and hubs in a network, a complex
Server. Here, they can create panels and groups
tree topology is obtained. Thus, a large number
of panels. In the panel edit mode, the user can
of smart devices can be easily managed. The
perform various tasks, for example add, move
type of communication is Wi-fi or Ethernet.
around, remove, resize, or configure widgets.
Consumers could operate at any level in the
Widgets usually require selecting one or more
hierarchy, thus limiting the access inside the
ports. Ports values will be displayed and/or
network to any desired subtree.
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
Panels (b). (a) and 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 : Removing(a) and


Adding,
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
Figure :Working with Widgets Dashboard automatically by the browser, when the user
Layout(a) and Widget Properties(b). reopens or refreshes the 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 smart thermostats. Thanks to temperature
and to save energy cost. In this case, the sensors, the heat system will start only when the
thermostats system offers the following temperature falls under a set value (this value is
advantages: the set on Q-Toggle app, for each room). For this
ability to access and control the indoor project, six Smart Wi-Fi Touch Thermostat
temperature anytime and from anywhere using Temperature Wireless Controllers, connected to
q-Toggle app on the mobile phone, the ability to the power line) and three Equivalents eq-3
monitor and separately set the temperature in Bluetooth smart thermostats, which run on
individual rooms (not every room has the same batteries, have been used.
heating requirements), and, finally, the ability to The A/C can be controlled to turn on and
enable scheduling (lower the temperature off without using the remote, by using the Q-
during the day, when nobody is home, or during Toggle app. This task can be done using a smart
vacation). In this way, manual adjustments are plug for the A/C machine. Controlling the
eliminated to save time and effort. 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 home solutions provide for the reduction of
control them using the mobile app. In addition, individual carbon footprint, give off zero
a smart lighting control system supports home emissions, and reduce overall environmental
security by providing increased protection. For damage. For this case study, thirty-three
example, this means that while away on holiday, photovoltaic (PV) panels have been installed, in
the lighting system could periodically switch on
two stages: the first sixteen panels and then
and off lighting in the house, as if someone
another seventeen panels.
were 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
Figure : Monitoring the Energy with Q-toggle (a)
solar power. In addition to cutting energy bills
and two inverters Fronius Symo (b),MPP
and providing energy efficiency, solar power-
Solar(c).
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 3.4 Access Control and Security
outages, being able to supply the house with
energy for a limited number of hours. An Access control involves controlling entrances,
inverter that is capable of switching between gates and doors, in this case study, the gates and
grid, solar, and battery energy sources, the garage door, specifically. Various options can
depending on various configurable conditions, be chosen: to fully open or close only the gates,
only the garage door, or both at the same time,
is called a hybrid inverter. MPP Solar is such a
or to keep half open one of them or both.
hybrid inverter.
The aim for monitoring the power is to see how Access control can be done manually, using the
much energy the house is using and to become app, and by vocal commands, using Google
more aware of the energy use and, thus, of the assistant on a smart watch. To control gate
money spent. An electricity monitor also helps motors and the garage door, we used two
identify any high energy appliance accidentally Blitzwolfboards
relay SS1smart 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 Fi-based system.
network is undersized, and there are a lot of
voltage variations. A smart power meter allows The home security system consists of a master
a continuous monitoring of all the important control panel, the keypad (when not using the
parameters when it comes to electricity: active, Q- Toggle app), motion sensors, and the siren.
reactive, or apparent power, power factor, The Q-Toggle app is provided with the options
current, voltage, frequency, and total energy to arm and disarm the security system. Arming
consumption. The device is based on ESP8266 and disarming can be performed by voice
and integrates a high current switch that can be commands as well, using Google Assistant/smart
used to remotely cut off energy supply, in case watch. We have also implemented the Sleep
of an emergency. option, which 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
(a) AC input Voltage
Q- 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
the water after irrigation. The proposed
Enable schedule button. The adjustments can be
irrigation system is based on Raspberry Pi and
made on the last four slides in the app: Morning
controls a number of pop-up sprinklers. The
factor, Evening factor, Morning time, and
system inside the well contains: electric valves
(Rain Bird DV/DVF valves), one standard 1.1 kW Evening time. The user is able to select the time
water pump, a Raspberry Pi board connected to in the morning and evening when the irrigation
the house LAN, and a pressure switch (Easy should start but also select the amount of water
Press II model, with a maximum pressure of 10 by adjusting the Morning/Evening factor. A time-
bar). The user is able to select two modes: the controlled sprinklers system not only eliminates
manual one where he can start and stop the chore of hand watering but also saves water,
irrigations whenever he wants and in which time, energy, and of course money. The sensors
zone he wants and an automatic mode, with or and actuators used for the presented case study,
without humidity sensors. along with their main characteristics. Of course,
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
HVAC Conditioning
Figure Architecture of Q-Toggle

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 Transport
(b) Downstairs hub—controls lighting and
temperatures downstairs PWA Progressive Web App
(c) Power hub—in charge with energy and
power monitoring REST Representational state transfer
(d) Garage hub—controls
TCP- Transmission Control Protocol-
lights, temperature, and access IP Internet Protocol
(e) Alarm controller—motion monitoring
and alarm system control
(f) Irrigation controller—
controlsthe irrigation system in the
garden References :
The communication between the Master hub
and the other hubs is done wirelessly except 1) El-Hajj, M.; Fadlallah, A.; Chamoun, M.;
with Serhrouchni, A. A Survey of Internet of
the Garage hub and the Power hub, which is Things (IoT)
wired. Authentication Schemes. Sensors 2019,
Interoperability and communication between 19, 1141.
devices is achieved by adopting a single, unitary, 2) Spadacini, M.; Savazzi, S.; Nicoli, M.
and extensible API across all devices that are Wireless home automation networks for
part of a q-Toggle system. indoor surveillance: Technologies and
For logging purposes, we use the Python logging experiments. EURASIP J. Wirel.
module that captures logging from all modules Commun. Netw. 2014, 2014, 6
and sends it to a log file, which is used for 3) Lee, K.-M.; Teng, W.-G.; Hou, T.-W. Point-
auditing and debugging purposes, if needed. n-Press: An Intelligent Universal Remote
System-level logs are gathered in the same Control System for Home
manner into dedicated log files. Moreover, all Appliances. IEEE Trans. Autom. Sci.
log files are rotated on size and age Eng. 2016, 13, 1308–1317.
conditions, so
4) Puri, V.; Nayyar, A. Real time smart automation system. In Proceedings of
home automation based on PIC the 2015 IEEE International Conference
microcontroller, Bluetooth and Android on in
technology. In Proceedings of the 3rd Research
International Conference on Computing Intelligence Computational
Networks (ICRCICN), and 20–
Kolkata, India,
for Sustainable Global Development 22 November 2015; pp. 77–80.
(INDIACom), New Del-hi, India, 16–18 Communication
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,
6. L. 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 Automation System Using Internet of
Home Things. In Proceedings of the 2019 2nd
Automation System with Smart Task International Conference on Power
Scheduling. In Proceedings of the 2013 Energy, Environment and Intelligent
5th International Conference on Control (PEEIC), Noida, India, 18–19
Computational Systems and Networks,
Communication October 2019; pp. 144–149. Bhatt, A.;
Intelligence,
Madrid, Spain, 5–7 June 2013; pp. 296– Patoliya, J. Cost effective digitization of
301. home appliances for home automation
8) Zamora-Izquierdo, Santa, J.; with low-power devices. In
M.A.;
Gomez-Skarmeta, A.F. An Integral and WiFi Proceedings of 2016
Networked Home Automation Solution the
International Conference on2nd 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. February 2016; pp. 643–648.
Design, 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