<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>A Novel Approach for Wireless Home Automation System using IoT</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Pardeep Singh</string-name>
          <email>pardeep.maan@gmail.com</email>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Gourav Bathla</string-name>
          <email>gouravbathla@gmail.com</email>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Rahul K. Singh</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Alankrita Aggarwal</string-name>
          <email>alankrita.agg@gmail.com</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>IKGPTU</institution>
          ,
          <addr-line>Kapurthala, Jalandhar-Kapurthala, Highway, Vpo, Ibban, Punjab 144603</addr-line>
          ,
          <country country="IN">India</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>The world is rapidly changing and adopting automation systems in various fields. Home Automation is one of the fields that is working for improving the quality of life and performing house chores in an automated way using IoT. Many home automation systems have been proposed and developed by various researchers based on different hardware and software technologies. And, improvement is still in process to make these systems more economical and easy to access. This work has focused on developing a Home Automation System which can be accessed over the internet using software from anywhere and control various home appliances connected with a centralized Wi-Fi server. This IoT-based system has been designed using NodeMCU over a Wi-Fi network, that can control and monitor various home appliances and sensors. Programming is performed in Arduino IDE and Flask Framework is implied to connect with a server. This system would not only replace the conventional wall switches but also be helpful to save electricity and reduce cost with a webbased remote control application.</p>
      </abstract>
      <kwd-group>
        <kwd>1 Home Automation System</kwd>
        <kwd>IoT</kwd>
        <kwd>Smart Device Control</kwd>
        <kwd>NodeMCU</kwd>
        <kwd>Flask</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        In the last few decades, Internet has played an immense role in the growth of various sectors
related to human life such as education, business, entertainment, living standards, transportation,
traveling, social life, etc. This high-scale development in different areas has developed an idea to
connect multiple devices of the same or different fields with each other but, in a controlled way to
form an Internet of Things (IoT) [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. IoT can manage and monitor various electronic, electrical, and
mechanical systems used for a specific purpose of automation in a field [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. Data collected from all
the devices connected over IoT is stored and processed by cloud computing, which further assists
these networked devices to perform the tasks accordingly [
        <xref ref-type="bibr" rid="ref3 ref4">3,4</xref>
        ]. Figure 1 is showing an example of a
Home Automation System, where various hardware and software components are connected and
contributing to perform a specific task or objective. A Home Automation System is mainly comprised
of three different technologies designed for a specific purpose such as communication medium
between devices and controller, controller hardware or software to control the devices, and user
interface to provide input and output of user [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ].
      </p>
      <p>This work has defined a similar type of automation system which is easy to access remotely using
a web browser over a laptop or smartphone and can fully control the home devices. In summary, the
proposed system makes the following contributions:
1. A microcontroller-based (NodeMCU) based home automation system is designed and
implemented that can sync the data to a web server, display the current state of electrical devices and
provide control to change the state according to the requirement.</p>
      <p>2. A Control Program is defined using Arduino IDE and Flask API is created to connect with the
server and transfer data from the microcontroller.</p>
      <p>3. A web-based application is designed to provide GUI to users on the front end.</p>
    </sec>
    <sec id="sec-2">
      <title>2. Related Work</title>
      <p>
        Researchers have been working on all automation technologies from 1970 and tried to upgrade
them with each passing year. IoT comprised of three prime layers i.e. Application Layer,
Transmission layer and Perception Layer, which are further divided into different sub-layers [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ].
Technologies and protocols at these sub-layers are continuously in development e.g. for
communication infrared, Bluetooth [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ], Zigbee[
        <xref ref-type="bibr" rid="ref8">8</xref>
        ], GSM [9], Wi-fi, Wireless Sensors, etc. are used.
Similarly, for controller different microcontrollers, home gateway, smart routers, PCB circuits,
Arduino, Raspberry pi, etc. devices have been invented, and for user interface simple LED, PC,
Laptop, Smartphones, Web Applications, Mobile Applications have been introduced. In this way,
several combinations of these technologies have been experimented with achieving various objectives
such as cost, latency, security[10,11], ease to handle, accessibility[12], authenticity [13], etc. Further,
there are some latest research methodologies used in designing the automation system are defined.
Table 1
      </p>
      <sec id="sec-2-1">
        <title>Literature Review Summary</title>
      </sec>
      <sec id="sec-2-2">
        <title>Microcontroller GUI</title>
      </sec>
      <sec id="sec-2-3">
        <title>Merits</title>
      </sec>
      <sec id="sec-2-4">
        <title>Ardino UNO, ESP8266-01</title>
      </sec>
      <sec id="sec-2-5">
        <title>Node MCU</title>
        <p>ESP8266 Wi-Fi
module, Atmel</p>
      </sec>
      <sec id="sec-2-6">
        <title>ATmega</title>
      </sec>
      <sec id="sec-2-7">
        <title>Android</title>
      </sec>
      <sec id="sec-2-8">
        <title>Application or</title>
      </sec>
      <sec id="sec-2-9">
        <title>Web Application</title>
      </sec>
      <sec id="sec-2-10">
        <title>IFTT, Android</title>
      </sec>
      <sec id="sec-2-11">
        <title>Application, Web</title>
      </sec>
      <sec id="sec-2-12">
        <title>Browser</title>
      </sec>
      <sec id="sec-2-13">
        <title>Android</title>
      </sec>
      <sec id="sec-2-14">
        <title>Application</title>
      </sec>
      <sec id="sec-2-15">
        <title>Less costly than conventional approach</title>
      </sec>
      <sec id="sec-2-16">
        <title>Voice based command via Google Assistant</title>
      </sec>
      <sec id="sec-2-17">
        <title>Less expensive [16] [17] [20]</title>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>3. Proposed Work</title>
      <p>This work has analyzed the working of a NodeMCU ESP8266 microcontroller-based home
automation system that can be controlled through a browser over the same network or internet to
activate or deactivate devices based on sensor readings or directly. For this purpose, aHttpClient
module has been programmed over NodeMCU using Arduino IDE. This module will receive the data
of different devices and accordingly respond back to perform the tasks over the devices connected
through a controller. Figure 2 is representing the flowchart for controlling devices over the designed
system which starts with making a connection to the browser through HTTP protocol. NodeMCU
continually monitors the device sensors connected wirelessly and transfers the measurement data over
the server or cloud at regular intervals. Servers are responsible for executing the command/response
based on the data received and activate the respective actuator or device to perform the task. A
Sensor’s data is analyzed by the program and checked against the respective threshold value. The
responding signal to the respective device is activated only after the threshold is attained. Figure 3 is
representing the I/O Pins of NodeMCU and its connectivity with two relay devices. In the example
shown in the figure, relay devices are connected with pin D13 and D15, from which they received the
signals to ON or OFF. The system is using the circuit connections similar to this for the proposed
system where relay devices are connected with some appliances to control them.</p>
    </sec>
    <sec id="sec-4">
      <title>4. Implementation and Results</title>
      <p>Proposed Home Automation System is implemented by making a connection of the NodeMCU
ESP8266 wifi module with two relays on D13 and D15 pin. The controller is connected via USB to
the laptop for programming over the Flask framework. The flask is helpful in making connectivity
using Python Programming. Following are the steps that need to be processed in programming:
1. Make all the hardware connections using a breadboard, jumper wires, and voltage input.
2. Open the Arduino IDE and set up the driver for connected hardware.
3. Import the required library modules ESP8266WiFi.h and ESP8266HTTPClient.h.
4. Setup Wi-Fi network authentication and Wi-Fi server’s port number.
5. Map the General Purpose Input Output (GPIO) pins with microcontroller.
6. Wait till the Wi-Fi connection is not connected.
7. Start the server and obtain the IP address.
8. Create a HTTP Client and initialize HTTP request parameters containing sensor’s data and send
to web server’s URL.
9. If the parameters are successfully received by the server, prepare the responding parameters in
the HTTP response and send it back.
10. Create the Flask API using Python and Flask Framework.
11. Flask API is responsible for receiving and transmitting data to the browser.
Figure 4 is showing the console output generated by the Flask framework and it is showing
the effective connection with the HTTP server and generated response. Figure 5 is showing
the screenshot of a web application designed to retrieve and control the status of home
appliances.</p>
    </sec>
    <sec id="sec-5">
      <title>5. Conclusion and Future Work</title>
      <p>The work has put forwarded the design and implementation of a Wireless Home Automation
System. Comparing to other automation systems, the proposed design has reduced the latency in the
system and cost of implementation. Moreover, the system provides the freedom to control the devices
over browser from anywhere in the world. The web application to control the home appliances and
reading sensors’ data can be further connected to any database server to store this data for future
analysis. So, the work can be extended to include machine learning-based decision-maker servers that
can predict the emergency and take timely actions.</p>
    </sec>
    <sec id="sec-6">
      <title>6. References</title>
      <p>[9] Anandhavalli, D., Noorul S. Mubina, and P. Bharathi. "Smart home automation control using</p>
      <p>Bluetooth and GSM." International Journal of Informative and Futuristic Research 2.8 (2015).
[10] Tewari, Aakanksha, and Brij B. Gupta. "Security, privacy and trust of different layers in
Internetof-Things (IoTs) framework." Future generation computer systems 108 (2020): 909-920.
[11] Tewari, Aakanksha, and Brij B. Gupta. "Secure Timestamp-Based Mutual Authentication
Protocol for IoT Devices Using RFID Tags." International Journal on Semantic Web and
Information Systems (IJSWIS) 16, no. 3 (2020): 20-34.
[12] Sejdiu, Besmir, Florije Ismaili, and Lule Ahmedi. "Integration of Semantics Into Sensor Data for
the IoT: A Systematic Literature Review." International Journal on Semantic Web and
Information Systems (IJSWIS) 16, no. 4 (2020): 1-25.
[13] Salhi, Dhai Eddine, Abelkamel Tari, and Mohand Tahar Kechadi. "Using Clustering for
Forensics Analysis on Internet of Things." International Journal of Software Science and
Computational Intelligence (IJSSCI) 13, no. 1 (2021): 56-71.
[14] Vishwakarma, Satyendra K., Prashant Upadhyaya, Babita Kumari, and Arun Kumar Mishra.</p>
      <p>Smart energy efficient home automation system using iot. In 2019 4th international conference
on internet of things: Smart innovation and usages (IoT-SIU), IEEE, 2019, pp. 1-4.
[15] Vikram, N., K. S. Harish, M. S. Nihaal, Raksha Umesh, and Shetty Aashik Ashok Kumar. A low
cost home automation system using Wi-Fi based wireless sensor network incorporating Internet
of Things (IoT). In 2017 IEEE 7th International Advance Computing Conference (IACC), IEEE,
2017, pp. 174-178.
[16] Ashraf, Imran, Muhammad Umer, Rizwan Majeed, Arif Mehmood, Waqar Aslam, Muhammad
Naveed Yasir, and Gyu Sang Choi. "Home automation using general purpose household electric
appliances with Raspberry Pi and commercial smartphone." Plos one 15.9 (2020): e0238480.
[17] Jabbar, Waheb A., Tee Kok Kian, Roshahliza M. Ramli, Siti Nabila Zubir, Nurthaqifah SM
Zamrizaman, Mohammed Balfaqih, Vladimir Shepelev, and Soltan Alharbi. "Design and
fabrication of smart home with Internet of Things enabled automation system." IEEE Access 7
(2019): 144059-144074.
[18] Mahamud, Md Sadad, Md Saniat Rahman Zishan, Syed Ishmam Ahmad, Ahmed Rezaur
Rahman, Mehedi Hasan, and Md Lutfur Rahman. "Domicile-an IoT based smart home
automation system." In 2019 International Conference on Robotics, Electrical and Signal
Processing Techniques (ICREST), IEEE, 2019, pp. 493-497.
[19] Kodali, Ravi Kishore, Sasweth C. Rajanarayanan, Lakshmi Boppana, Samradh Sharma, and
Ankit Kumar. "Low cost smart home automation system using smart phone." In 2019 IEEE R10
Humanitarian Technology Conference (R10-HTC)(47129), IEEE, 2019, pp. 120-125..
[20] Stolojescu-Crisan, Cristina, Calin Crisan, and Bogdan-Petru Butunoi. "An IoT-Based Smart
Home Automation System." Sensors 21, no. 11 (2021): 3784.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <surname>Satapathy</surname>
            ,
            <given-names>Lalit</given-names>
          </string-name>
          <string-name>
            <surname>Mohan</surname>
            , Samir Kumar Bastia, and
            <given-names>Nihar</given-names>
          </string-name>
          <string-name>
            <surname>Mohanty</surname>
          </string-name>
          .
          <article-title>"Arduino based home automation using Internet of things (IoT)."</article-title>
          <source>International Journal of Pure and Applied Mathematics</source>
          <volume>118</volume>
          .
          <volume>17</volume>
          (
          <year>2018</year>
          ):
          <fpage>769</fpage>
          -
          <lpage>778</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <surname>Atzori</surname>
            , Luigi, Antonio Iera, and
            <given-names>Giacomo</given-names>
          </string-name>
          <string-name>
            <surname>Morabito</surname>
          </string-name>
          .
          <article-title>"The internet of things: A survey."</article-title>
          <source>Computer networks 54.15</source>
          (
          <year>2010</year>
          ):
          <fpage>2787</fpage>
          -
          <lpage>2805</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <surname>Dey</surname>
            , Shopan,
            <given-names>Ayon</given-names>
          </string-name>
          <string-name>
            <surname>Roy</surname>
          </string-name>
          , and
          <string-name>
            <surname>Sandip Das</surname>
          </string-name>
          .
          <article-title>Home automation using Internet of Thing</article-title>
          .
          <source>In 2016 IEEE 7th Annual Ubiquitous Computing, Electronics &amp; Mobile Communication Conference (UEMCON)</source>
          , IEEE,
          <year>2016</year>
          , pp.
          <fpage>1</fpage>
          -
          <lpage>6</lpage>
          ..
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <surname>Reddy</surname>
            ,
            <given-names>Vishwateja</given-names>
          </string-name>
          <string-name>
            <surname>Mudiam</surname>
          </string-name>
          , Naresh Vinay, Tapan Pokharna, and Shashank Shiva Kumar Jha.
          <article-title>Internet of Things enabled smart switch</article-title>
          .
          <source>In 2016 Thirteenth International Conference on Wireless and Optical Communications Networks (WOCN)</source>
          , IEEE,
          <year>2016</year>
          , pp.
          <fpage>1</fpage>
          -
          <lpage>4</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <surname>Shet</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          <article-title>Building IoT based Door sensor from NodeMCU or ESP8266</article-title>
          ,
          <year>2021</year>
          . URL: https://www.linkedin.com/pulse/building
          <article-title>-iot-based-door-sensor-from-nodemcu-esp8266- gurudas-shet/</article-title>
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <surname>Gupta</surname>
            ,
            <given-names>Brij B.</given-names>
          </string-name>
          , and
          <string-name>
            <given-names>Megha</given-names>
            <surname>Quamara</surname>
          </string-name>
          .
          <article-title>"An overview of Internet of Things (IoT): Architectural aspects, challenges, and protocols</article-title>
          .
          <source>" Concurrency and Computation: Practice and Experience</source>
          <volume>32</volume>
          , no.
          <volume>21</volume>
          (
          <year>2020</year>
          )
          <article-title>: e4946</article-title>
          . https://doi.org/10.1002/cpe.4946
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <surname>Ngerem</surname>
            , Elvis, Sanjay Misra, Jonathan Oluranti, Hernán Castillo-Beltran,
            <given-names>Ravin</given-names>
          </string-name>
          <string-name>
            <surname>Ahuja</surname>
            , and
            <given-names>Robertas</given-names>
          </string-name>
          <string-name>
            <surname>Damasevicius</surname>
          </string-name>
          .
          <article-title>"A Home Automation System Based on Bluetooth Technology Using an Android Smartphone." In Evolving Technologies for Computing, Communication</article-title>
          and Smart World, Springer, Singapore,
          <year>2021</year>
          , pp.
          <fpage>527</fpage>
          -
          <lpage>536</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <surname>Gill</surname>
          </string-name>
          ,
          <string-name>
            <surname>Khusvinder</surname>
          </string-name>
          , et al.
          <article-title>"A zigbee-based home automation system</article-title>
          .
          <source>" IEEE Transactions on consumer Electronics 55.2</source>
          (
          <year>2009</year>
          ):
          <fpage>422</fpage>
          -
          <lpage>430</lpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>