design and fabrication of smart home with internet of things...

16
Received August 1, 2019, accepted September 3, 2019, date of publication September 23, 2019, date of current version October 16, 2019. Digital Object Identifier 10.1109/ACCESS.2019.2942846 Design and Fabrication of Smart Home With Internet of Things Enabled Automation System WAHEB A. JABBAR 1,2 , (Senior Member, IEEE), TEE KOK KIAN 1 , ROSHAHLIZA M. RAMLI 1 , (Member, IEEE), SITI NABILA ZUBIR 1 , NURTHAQIFAH S. M. ZAMRIZAMAN 1 , MOHAMMED BALFAQIH 3,4 , (Member, IEEE), VLADIMIR SHEPELEV 3 , AND SOLTAN ALHARBI 4 1 Faculty of Electrical and Electronics Engineering Technology, Universiti Malaysia Pahang, Pekan 26600, Malaysia 2 IBM Centre of Excellence, Universiti Malaysia Pahang, Gambang 26300, Malaysia 3 Automobile Transportation Department, South Ural State University, 454080 Chelyabinsk, Russia 4 Computer and Networks Engineering Department, Jeddah University, Jeddah 23218, Saudi Arabia Corresponding author: Waheb A. Jabbar ([email protected]) This work was supported by Universiti Malaysia Pahang (UMP), under the grant scheme number RDU190304, and the Ministry of Education, Malaysia under the FRGS research Grant No. FRGS/1/2018/TK04/UMP/02/11 (RDU190133). ABSTRACT Home automation systems have attracted considerable attention with the advancement of communications technology. A smart home (SH) is an Internet of Things (IoT) application that utilizes the Internet to monitor and control appliances using a home automation system. Lack of IoT technology usage, unfriendly user interface, limited wireless transmission range, and high costs are the limitations of existing home automation systems. Therefore, this study presents a cost-effective and hybrid (local and remote) IoT-based home automation system with a user-friendly interface for smartphones and laptops. A prototype called IoT@HoMe is developed with an algorithm to enable the monitoring of home conditions and automate the control of home appliances over the Internet anytime and anywhere. This system utilizes a node microcontroller unit (NodeMCU) as a Wi-Fi-based gateway to connect different sensors and updates their data to Adafruit IO cloud server. The collected data from several sensors (radio-frequency identification, ultrasonic, temperature, humidity, gas, and motion sensors) can be accessed via If This Then That (IFTTT) on users’ devices (smartphones and/or laptops) over the Internet regardless of their location. A set of relays is used to connect the NodeMCU to homes under controlled appliances. The designed system is structured in a portable manner as a control box that can be attached for monitoring and controlling a real house. The proposed IoT-based system for home automation can easily and efficiently control appliances over the Internet and support home safety with autonomous operation. IoT@HoMe is a low cost and reliable automation system that reduces energy consumption and can notably provide convenience, safety, and security for SH residents. INDEX TERMS Smart Home, IoT, NodeMCU, adafruit IO, MQTT, google assistant. I. INTRODUCTION Home automation systems have attracted considerable atten- tion with the advancement of communications technol- ogy [1], [2]. A smart home (SH) is an Internet of Things (IoT) application that allows users to control and monitor home appliances in real time over the Internet [3], [4]. An SH is a home with an automated system that comprises sensors, The associate editor coordinating the review of this manuscript and approving it for publication was Baoping Cai . actuators, and controllers to enhance comfort, automation, safety, and security for a better life quality of residents [5]. In the modern world, smart devices, such as smartphones, smart televisions (TVs), smart washing machines, smart refrigerators, and smart sensors, have become involved in every aspect of people’s daily lives (Figure 1). Such smart devices are capable of communicating and interacting with one another to form a smart environment [6]. An automation system should be developed to manage the communication between smart devices within SHs. VOLUME 7, 2019 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see http://creativecommons.org/licenses/by/4.0/ 144059

Upload: others

Post on 21-May-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Design and Fabrication of Smart Home With Internet of Things …umpir.ump.edu.my/id/eprint/26227/1/Design and Fabrication... · 2019-10-25 · W. A. Jabbar et al.: Design and Fabrication

Received August 1, 2019, accepted September 3, 2019, date of publication September 23, 2019, date of current version October 16, 2019.

Digital Object Identifier 10.1109/ACCESS.2019.2942846

Design and Fabrication of Smart HomeWith Internet of Things EnabledAutomation SystemWAHEB A. JABBAR 1,2, (Senior Member, IEEE), TEE KOK KIAN1,ROSHAHLIZA M. RAMLI1, (Member, IEEE), SITI NABILA ZUBIR1,NURTHAQIFAH S. M. ZAMRIZAMAN1, MOHAMMED BALFAQIH 3,4, (Member, IEEE),VLADIMIR SHEPELEV3, AND SOLTAN ALHARBI41Faculty of Electrical and Electronics Engineering Technology, Universiti Malaysia Pahang, Pekan 26600, Malaysia2IBM Centre of Excellence, Universiti Malaysia Pahang, Gambang 26300, Malaysia3Automobile Transportation Department, South Ural State University, 454080 Chelyabinsk, Russia4Computer and Networks Engineering Department, Jeddah University, Jeddah 23218, Saudi Arabia

Corresponding author: Waheb A. Jabbar ([email protected])

This work was supported by Universiti Malaysia Pahang (UMP), under the grant scheme number RDU190304, and the Ministry ofEducation, Malaysia under the FRGS research Grant No. FRGS/1/2018/TK04/UMP/02/11 (RDU190133).

ABSTRACT Home automation systems have attracted considerable attention with the advancement ofcommunications technology. A smart home (SH) is an Internet of Things (IoT) application that utilizesthe Internet to monitor and control appliances using a home automation system. Lack of IoT technologyusage, unfriendly user interface, limited wireless transmission range, and high costs are the limitations ofexisting home automation systems. Therefore, this study presents a cost-effective and hybrid (local andremote) IoT-based home automation system with a user-friendly interface for smartphones and laptops.A prototype called IoT@HoMe is developed with an algorithm to enable the monitoring of home conditionsand automate the control of home appliances over the Internet anytime and anywhere. This system utilizesa node microcontroller unit (NodeMCU) as a Wi-Fi-based gateway to connect different sensors and updatestheir data to Adafruit IO cloud server. The collected data from several sensors (radio-frequency identification,ultrasonic, temperature, humidity, gas, and motion sensors) can be accessed via If This Then That (IFTTT)on users’ devices (smartphones and/or laptops) over the Internet regardless of their location. A set of relaysis used to connect the NodeMCU to homes under controlled appliances. The designed system is structuredin a portable manner as a control box that can be attached for monitoring and controlling a real house.The proposed IoT-based system for home automation can easily and efficiently control appliances overthe Internet and support home safety with autonomous operation. IoT@HoMe is a low cost and reliableautomation system that reduces energy consumption and can notably provide convenience, safety, andsecurity for SH residents.

INDEX TERMS Smart Home, IoT, NodeMCU, adafruit IO, MQTT, google assistant.

I. INTRODUCTIONHome automation systems have attracted considerable atten-tion with the advancement of communications technol-ogy [1], [2]. A smart home (SH) is an Internet of Things (IoT)application that allows users to control and monitor homeappliances in real time over the Internet [3], [4]. An SH isa home with an automated system that comprises sensors,

The associate editor coordinating the review of this manuscript and

approving it for publication was Baoping Cai .

actuators, and controllers to enhance comfort, automation,safety, and security for a better life quality of residents [5].In the modern world, smart devices, such as smartphones,smart televisions (TVs), smart washing machines, smartrefrigerators, and smart sensors, have become involved inevery aspect of people’s daily lives (Figure 1). Such smartdevices are capable of communicating and interacting withone another to form a smart environment [6]. An automationsystem should be developed to manage the communicationbetween smart devices within SHs.

VOLUME 7, 2019 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see http://creativecommons.org/licenses/by/4.0/ 144059

Page 2: Design and Fabrication of Smart Home With Internet of Things …umpir.ump.edu.my/id/eprint/26227/1/Design and Fabrication... · 2019-10-25 · W. A. Jabbar et al.: Design and Fabrication

W. A. Jabbar et al.: Design and Fabrication of Smart Home With Internet of Things Enabled Automation System

FIGURE 1. SH environment.

Many automation systems have been developed, andsome of them are used as commercial products in themarket [7]–[16]. Some of these products are adopted to con-trol home appliances either locally or remotely. With theinvention of microcontrollers, the costs of electronic controlhave rapidly decreased at the end of the last century, andhome automation has emerged. Home automation systemshave not beenwidely spread and such systems still consideredthe domain of hobbyists or the rich. Various automationtechnologies, such as remote control for TVs, fans, air con-ditioners, and music players, have been used to equip homeappliances with the required systems for easy monitoring andcontrol [17], [18]. With the widespread introduction of elec-tricity into homes and the rapid advancement of informationtechnology, a new era of controlling home appliances hasstarted by using mobile devices with short-range commu-nication interfaces, such as Bluetooth and ZigBee [19], andby Wi-Fi networks and GSM modules [7]. All these systemsand technologies are useful for indoor control of home appli-ances and does not allow residents to monitor and controltheir homes from the outside. Although such systems allowinteraction with inhibitors to provide convenience, comfort,safety, and energy efficiency at all times, they have manylimitations in functionality and communication range [20].Most of these systems do not utilize the powerful features ofthe emerging IoT technology, which aims to connect billionsof smart devices (phones, laptops, sensors, and actuators) tothe Internet.

At present, majority of homes have some of the‘‘smartness’’ because various devices have built-in sensors orelectronic appliance controllers [21]. Devices within an SHsystem can be linked with one another and reached through

an access point (AP) to monitor home conditions and controlhome appliances [22]. For instance, lights, thermostats, TVs,door locks, cameras, washing machines, and refrigerators canbe monitored and controlled via an all-in-one SH automationsystem. Such a system becomes an IoT-based automation sys-temwhen it is provided with access to the Internet [23]. Homeautomation systems have many benefits, such as reductionof electric consumption and energy costs. In addition, homeautomation systems increase home security and safety [24].For example, some systems can notify homeowners when anymotion is detected at home while they are not around, andsome of the appliances can report to fire stations in case offire. IoT can be utilized to improve the existing home automa-tion systems by introducing a main control over the Internet.

The main part of the home automation system basedon IoT is the microcontroller. A node microcontrollerunit (NodeMCU) Wi-Fi-based controller board [25] is anopen-source platform for IoT applications and is used as themain microcontroller in this project. NodeMCU is basicallyused to gather data obtained by sensors and uploads the datato the IoT server. In addition, this microcontroller receivescommands given by users via smartphones/laptops to performspecific tasks [26].

NodeMCU consists of a physical programmable circuitboard similar to any other development board such asArduino or Raspberry Pi. NodeMCU can be programmedon Arduino software, which is an integrated developmentenvironment (IDE) to write the instruction codes and uploadsthem to the microcontroller. An advanced form of SHautomation system is the use of gadgets to access and controlall home appliances and sensors. The commonly used gadgetsare developed as mobile apps on top of operating systemsof smartphones, such as Android/iOS or as web-based dash-boards integrated to open-source IoT platforms [27]. Withthe aid of IoT cloud computing servers, all data obtainedfrom sensors are aggregated and analyzed to become valuableinformation for addressing specific requirements when theyare uploaded to the server. All data can be used to displaythe reading patterns in terms of graphs and detect possibleoccurring problems and provide recommendations or alert theuser. IoT can create new innovation concepts that can be usedfor the development of SHs to provide intelligence, comfort,safety, and better quality of life.

This study presents the design, fabrication, and valida-tion of an IoT-based portable automation system calledIoT@HoMe for SHs. It enables IoT automation and mon-itoring of SHs by using NodeMCU as microcontroller andInternet gateway. IoT@HoMe utilizes several sensors tomon-itor various home-related parameters, such as temperature,humidity, gas leakage, motion, radio-frequency identifica-tion (RFID), and water level. Several actuators are used toperform control activities of home appliances, such as switch-ing of lights and fans, control of doors and windows, andoperation of motors and pumps. Furthermore, a user-friendlygraphical user interface (GUI) is developed to facilitate theinteraction between users and the SH. An SH prototype is

144060 VOLUME 7, 2019

Page 3: Design and Fabrication of Smart Home With Internet of Things …umpir.ump.edu.my/id/eprint/26227/1/Design and Fabrication... · 2019-10-25 · W. A. Jabbar et al.: Design and Fabrication

W. A. Jabbar et al.: Design and Fabrication of Smart Home With Internet of Things Enabled Automation System

constructed to implement and validate the effectiveness of theproposed IoT@HoMe system. The developed system aims toautomate home appliances, increase safety and security, andenhance life quality and convenience.

The remaining part of this paper is structured asfollows: Section II introduces the background and relatedwork. Section III presents the prototype and fabrication ofSH. Section IV describes the design, architecture, implemen-tation, and functionalities of the developed IoT@HoMe sys-tem. Section V discusses the experimental results. Section VIprovides the conclusion.

II. BACKGROUND AND RELATED WORKSA. MOTIVATIONS AND PROBLEM STATEMENTThe advantages of SH automation systems include ease andaccessibility, energy reduction, convenience, comfort, peaceof mind, entertainment, safety, and security. A study hasbeen conducted to identify the problems in existing homeautomation systems. Most existing systems are unsuitablefor many users because of their high costs and difficulty inmaintenance. In addition, existing home automation systemslack IoT technologies and have unfriendly user interfaces.Some existing SH automation systems do not consider safetyand security. Safety and security are important elements inany SH to avoid incidents. Some existing SHs have insuffi-cient features and functionalities because the original installermay not have adequate knowledge of the installation andcommission of the system. Existing systems have limitedwireless transmission range connectivity because they utilizeshort-range wireless interfaces, such as ZigBee, Bluetooth,and Wi-Fi.

Considerable home automation systems are available inthe market. These systems can be classified into two maincategories, namely, local control and remote/global control,which differ based on their concept for operation. Basically,local control systems use an in-home controller with a sta-tionary or wireless communication technology to connectto the central hub or gateway, and users can only con-trol home appliances locally. Remote/global control systemsallow users to control home appliances from anywhere overthe Internet using their smartphones/laptops.

Home automation systems should provide a user-friendlyinterface to efficiently monitor and control home appliances.To address these issues and minimize the limitations ofhome automation systems, the present study introduces acost-effective and hybrid (local and remote) IoT@HoMeautomation system to extend the range of connectivity andallow users to control their homes easily and efficiently viaa user-friendly interface using smartphones and/or laptopsregardless of time and location. The proposed system con-siders safety and security. The system cost is considered byusing NodeMCU and free mobile apps to manage, moni-tor, and control home appliances and conditions over theInternet.

B. RESEARCH CONTRIBUTIONSThe main contribution of this study is the development ofan efficient, low cost, and portable IoT@HoMe system tocontinuously monitor home conditions and comfortably con-trol home appliances over the Internet regardless of time andlocation. To fulfill these requirements, this study adopts thefollowing objectives and contributions:(i) Design and fabrication of an SH prototype that facil-

itates the monitoring and control of home appliancesusing an IoT platform and supports home safety byutilizing NodeMCU as a gateway to connect the systemto the Internet.

(ii) An algorithm for smart home monitoring and automa-tion base on IoT.

(iii) Implementation of an innovative portable IoT add-onautomation controller (IoT@HoMe) as a box that canbe attached for monitoring and controlling a real house.

(iv) Validation of IoT@HoMe system functionalities interms of automation, security, and safety and evaluationof the performance of the developed system.

The design and fabrication of an SH prototype are based onIoT. The proposed system integrates Wi-Fi for local controland IoT for enabling remote control and monitoring via anIoT platform and ubiquitous evaluation of activities. Thiscondition allows the independence of mobile provider anduser location. NodeMCU is used as a microcontroller andWi-Fi as a communication protocol. The messages sent fromthe Wi-Fi-connected microcontroller managed system canbe received by the users on their smartphone or computerfrom any distance by ensuring that the electronic devicesare connected to the Internet. NodeMCU is programmed onArduino software (IDE). This software helps to writes thecodes and upload the program onto the chip of the micro-controller. The system can be merged to the switches andsensors of home appliances to allow efficient control. Severalsensors are attached to the controlled household appliancesand placed throughout the home to track activities and events,and the sensed data are wirelessly sent to a gateway. Thesystem is integrated with alarm devices to detect any securitythreat. The proposed system provides safety and comfort,especially for elderly and disabled people.

C. RELATED WORKSSHs represent a concept rather than actual structures. Sci-ence fiction has provided the concept of home automationfor decades, and has been demonstrated by the AmericanAssociation of House Builders in 1984, thereby definingSHs. An SH is the integration of technology that enablesusers to achieve a better quality of living. SH is a voiceassistant for the remote control of all home appliances.SH can help to improve security, comfort, convenience, andenergy management. SH aids elderly and disabled peopleby providing them a safe and secure environment. Basically,SHs can be categorized into two types, namely, wired and

VOLUME 7, 2019 144061

Page 4: Design and Fabrication of Smart Home With Internet of Things …umpir.ump.edu.my/id/eprint/26227/1/Design and Fabrication... · 2019-10-25 · W. A. Jabbar et al.: Design and Fabrication

W. A. Jabbar et al.: Design and Fabrication of Smart Home With Internet of Things Enabled Automation System

wireless systems. Wired systems use optical fibers, bus lines,and power lines. Wireless systems are a combination of asender and a receiver. At present, many new applicationsuse wireless technology, such as radio waves or infrared,to communicate with other devices. SHs can simultaneouslywork on wireless and wired systems. SH automation systemshave gradually become all-purpose portable controllers thatprovide convenience to people in their daily routines.

An SH is an environment where heterogeneous and elec-tronic devices are connected together to deliver smart servicesto individuals. IoT-based SHs are an important part of theproposed and developed smart cities worldwide. An SH isdesigned to improve the standard of living, safety, security,and reduce energy consumption and resources. In addition,SH plays an important role in community development.Thus, the key features of SHs include real-time monitor-ing, safety from hackers, remote control, and fire and gasalarms. As sensitive and personal data are managed betweenSHs, security and privacy solutions must be developed toprotect users and corporate data from infringement whileensuring reliable services [28]. Generally, IoT is a rela-tively new development, which enables existing homes tohave strong computing and communication capabilities withthe rapid development of the Internet and communicationtechnologies.

In an SH environment, smart appliances can be directlyconnected to the home network, and the commands are givenby users to individually control each appliance. Smart devicescan automatically react when commands are given eitherthrough voice, smartphone, or computer. Majority of con-trol applications are interrelated to lighting, motion, secu-rity, entertainment, and temperature. The use of smartphonesand computers are crucial because they are technologicalbenchmarks in the modern era. Users can bring these gadgetsanywhere and directly configure them through the Internetto link with online devices. IoT is a catchword in whichthe objects are interrelated and connected through networkdevices [29]. IoT is an enormous network of linked objectsand humans, which collects and shows the required dataand surroundings by using a large number of devices ofall sizes. Devices, such as smartphones and computers, arelinked to sensors and connected to IoT networks. The data areintegrated from various devices and imply analytic Internetwaves to show the most valuable data with the devices builtto meet specific needs. IoT can precisely specify the usefuland useless data. These data can be applied to detect patterns,form recommendations, and detect possible problems thatmay occur [30]. However, IoT is expected to be an unusualtrend in the future. In this section, previous IoT-related studieson SHs are reviewed. A large number of studies have focusedon SHs. Accordingly, studies on SHs are reviewed with theproliferation of home appliances in the IoT. The findingsand recommendations of this study contribute to a broadunderstanding of advanced user attitudes toward privacy inSHs. Thus, some of the related work in home automation areprovided.

In [7], an SH automation control using Bluetooth and GSMmodule was proposed. The objective of this study is to helphandicapped and elderly people to control home appliancesfrom remote places. People usedBluetooth andGSMwirelesscommunications to control the home. Bluetoothwas also usedto control the appliances indoor andGSM to control the appli-ances outdoor. Bluetooth can reduce system costs becausemost cellphones and laptops have this built-in application.Users can monitor and control the appliances from remoteplaces by sending SMS through GSM. However, such a sys-tem has limitations in the two cases. Bluetooth has a limitedrange and data rate, and GSM is expensive because of SMScosts. Reference [8] proposed SH automation based on sensortechnology that can automatically control home appliancesusing Android-based smartphones as a remote controller.The authors utilized Raspberry Pi as the microcontroller andBluetooth as the communication protocol. Wi-Fi was usedto connect the smartphone to the Raspberry Pi controller,which was connected with smart appliances to the samenetwork AP. All sensors updated their data to a local servervia Raspberry Pi. However, the user cannot access the serverand cannot directly use the smartphone to send the commandsto the Raspberry Pi controller when he is outside the rangeof Wi-Fi AP.

In [9], a home automation and environmental monitoringsystem was developed using Arduino Mega 2560 microcon-troller with Bluetooth module. Several sensors and switcheswere used to control home appliances through websites orAndroid applications. The website controls Arduino by pass-ing information to it as codes. Arduino Mega is more expen-sive than NodeMCU, and the use of Bluetooth is unsuitablefor SH applications due to its limited features. A MessageQueuing Telemetry Transport (MQQT)-based home automa-tion system using ESP8266 was presented by [10]. Actuatorsand sensors were connected to ESP8266, and MQTT wasused for control and monitoring. Wi-Fi was used as the com-munication for the prototype, and devices were controlled byMQQT using ESP8266. Arduino IDE was used to programthe ESP8266 module as MQTT. MQTT resulted in lowbandwidth and low power consumption. ESP8266 board wascheaper than othermicrocontrollers, such as Raspberry PI andArduino UNO. However, only limited functionalities wereused for switching. Safety and security issues were ignored,and the developed system was not validated.

A Wi-Fi-based home automation system was designedand implemented by [3]. The developed prototype allowedusers to control and monitor the home through Wi-Fi byusing Arduino Mega integrated with Android-based applica-tion known as Virtuino. However, the prototype had limitedconnectivity, can only perform local control, and the remotecontrol of the developed system should be enabled based onIoT to allow users to control it using a webserver even whenthey are not around their house. The prototype also lackedautomation of windows and doors and did not consider thesafety and security of SH. A similar system using ArduinoMega with IoT was presented by [12]. The interconnected

144062 VOLUME 7, 2019

Page 5: Design and Fabrication of Smart Home With Internet of Things …umpir.ump.edu.my/id/eprint/26227/1/Design and Fabrication... · 2019-10-25 · W. A. Jabbar et al.: Design and Fabrication

W. A. Jabbar et al.: Design and Fabrication of Smart Home With Internet of Things Enabled Automation System

system consisting of an Arduino microcontroller was usedto connect to an Ethernet shield, which was connected to amodem with Internet connection. A relay was connected tothe devices and through an HTML page with an assignedIP address. However, the system did not consider home sur-roundings and was not implemented.

Reference [13] reported the design and implementationof flexible approaches to realistic testing in an SH environ-ment Fog-IoT, where this framework was executed and testedwith consideration of the specificities of the environment.This study summarized the flexibilities of the frameworkthat allowed IoT application developers to provide flexibleservices in a cyber-physical, dynamic, and heterogeneousFog-IoT environment. This framework avoided re-launchingof the entire application when failure occurred, limited thespread of failures, and retrieved the application and the infras-tructure entities through reshaping and restoration of a consis-tent state of the application, which included the consistencywith respect to the PW. The framework was evaluated on atestbed inspired by [14], resulting in an actual SH applicationreproduction. Practical experiments showed the recovery andfeasibility of the approach with acceptable delay from theuser’s point of view [31].

Reference [15] used RFID tags to successfully identify var-ious elements within a smart refrigerator. This technique wasused to improve home security but required many elementswithin the home. These elements included home populationwith RFID tags, which were difficult to implement consider-ing the memory lapses of humans. Although many SHs haveutilized IoT, they are vulnerable to various attacks [32]. Thus,home appliances can be connected to a wired or wirelessnetwork through a home gateway, where an attack on thehome gateway can immediately lead to an attack on the entirehome network, which is where an external connection canbe made [33]. However, an individual can attack an intercon-nected device, such as a gateway or field device, by using itsnetwork or local communication interface to attack the deviceand can impersonate a device by using a wrong certificate.

Reference [34] designed and implemented an SH intelli-gent system based on Ethernet to monitor power consumptionin real time through tracking devices in the home using anIntel Galileo Gen 2 board, which can be used in homes andcommunities. The proposed system worked through voicecontrol with real-time monitoring, which allowed the remotecontrol and monitoring of electrical devices and keys with orwithout an Android-based application. In other words, thisstudy presented a smart and intelligent system for energymanagement and security based on IoT with an independentand portable power control, where users can oversee thepower management and security of their homes even whenthey are not around. The power consumption was reduced,and resource utilization was maximized through real-timetracking and monitoring of electrical appliances and homesecurity. Different sensors were used to monitor the devicesin real time andmaintain home security. The proposed systemwas remotely controlled and monitored using an Android

app through an Internet or intranet connection. The resultsof this study provided multiple benefits, such as keeping theusers in constant touch with their homes with the optionto control switching devices through their voices or simpletouches on their smartphones, delivering electricity bills athome, and monitoring resource usage to reduce electricalpower consumption. The experimental results explained thatthe proposed system is suitable for energy management andsecurity.

Reference [35] introduced a web-based IoT architectureusing GSM to implement SH applications and presented aGSM-based design control system of SH. This work sug-gested a structure to enable users to monitor and control smartdevices through the Internet, where the users give commandsthrough the web, and the user input is converted to GSM–SMS commands. The proposed structure creates an interfacebetween the SH and users through the Internet and GSMand provides a GSM-based wireless connection from the webserver to the SH. These commands are sent to the integratedsystem module, which is placed anywhere in the world andcan be directly connected to the devices the through GSMnetwork. In addition, the module is controlled through anIoT agent by the GSM network. The user commands areexecuted and analyzed using a microcontroller to controlany electronic objects, such as lights and home appliances,and sends an acknowledgment. The prototype collects andtransmits data throughGSM–SMS. The initial test proves thatthe prototype is capable ofmonitoring and controlling devicesin the published environment and has many advantages, suchas zero data loss, rapid delivery, ease of use, flexibility, lowcost, and energy efficiency.

Reference [36] introduced an IoT-based system for effi-cient energy management of devices and security. The mainconcept of this work is to control home appliances usingsmartphones throughWi-Fi as the connection protocol, whichprovides the information on the required software and hard-ware components. The IoT structure used in smart houses isdescribed as follows: First, all the devices are connected toa device called smart central control, which is linked to theswitch for each connected device and thus enables access toeach individual device. Subsequently, the device is connectedto the Internet through a router, which enables the user toconnect as needed.

Reference [37] described a Frugal Labs IoT (FLIP) plat-form for building SHs that enabled IoT. This work discussedthe SH functions and applications and provided the FLIParchitecture with SH services through FLIP using the pro-posed system. The proposed system controls the SH environ-ment based on FLIP, which is flexible and extendable to userneeds with security concerns and can be implemented as peruser requirements.

Reference [38] presented a system that managed homeappliances through IoT, where the temperatures, fire, and gaswere controlled by using different sensors, and their valueswere displayed on an LCD. This type of system is useful whenthe user is away because it monitors temperature, detects

VOLUME 7, 2019 144063

Page 6: Design and Fabrication of Smart Home With Internet of Things …umpir.ump.edu.my/id/eprint/26227/1/Design and Fabrication... · 2019-10-25 · W. A. Jabbar et al.: Design and Fabrication

W. A. Jabbar et al.: Design and Fabrication of Smart Home With Internet of Things Enabled Automation System

TABLE 1. Summary of SH systems.

liquid petroleum gas leakage and fire, and provides briefinformation on household safety when fire and gas leakageare detected. In other words, the gas sensor detects the leakageand immediately alerts the user through an SMS to the mobilephone and the people at home by turning on the siren anddisplaying the message on an LCD screen. Similarly, an SMSis automatically sent, and the spray engine is turned on whenfire is detected. The proposed system determines a range oftemperatures, fire, and gases because it uses different sensors.Thus, a message via GSM is received when the range of givenvalues increases, where these values are stored on a server forfuture reference and displayed on an LCD screen. In addition,the data uploaded to the web server are updated and can beretrieved from anywhere in the world. In summary, IoT isused to enhance the safety standards, where the communica-tion between sensors and transducers is wirelessly resolvedby using one chip through Wi-Fi.

Reference [39] provided information on home automa-tion and security systems using different techniques, suchas Arduino and GSM and Android applications to controlhome appliances. The number of people inside the houseincreases each time an individual enters the house; thus, homeautomation mode applications are turned on and securitylights are also switched on with alarm. Moreover, the numberof people that enters the house is displayed on an LCD screen.However, in ‘‘home automation’’ mode, the number of peoplebecomes zero, and applications are turned off when the roomis empty, making the system power efficient. In addition,anyone can control their home devices through an Androidmobile app, which reduces human labor. At the same time,a text message is sent to the homeowner’s mobile phone whensomeone enters under security mode, indicating that a personis inside the home. Thus, the alarm can be turned on throughSMS or Android app.

For the sake of brevity, SH systems-related studies havebeen reviewed, summarized and compared in Table 1. Theproposed IoT@HoMe system is also included the comparisonto emphasis on its main features with respect to the existingsystems. As it is presented in the table, the proposed systemaims at overcoming the limitations of the existing system andsupported with a real implementation scenario for validationpurposes. To the best of our knowledge, only few studieswere supported with a real implementation of their proposedsystems either in prototype or real house.

III. DEVELOPMENT OF SH PROTOTYPEA. METHODESThis section describes the methodology adopted in this study,which includes systematic organization of different researchphases in conjunction with the detailed design and imple-mentation of the IoT@HoMe system and SH prototype.In addition, the selection of components and their integrationare explained to fulfill the design objectives. The flowchartin Figure 2 illustrates the conceptual framework of this study.The research starts by identifying the problems encounteredin existing SH systems. Most considerable problems of theavailable systems in the market are their high initial imple-mentation costs and unfriendly user interfaces. The modelingphase focuses on the selection of materials and componentsfor building the SH prototype and developing the IoT@HoMesystem. The SH is designed on NX10 software, and the proto-type is fabricated using plywood. The design and implemen-tation of the IoT@HoMe automation system are conducted.Wiring and connection between different components (bulb,fan, motor, and sensor) in the SH prototype to the attachedIoT@HoMe system (NodeMCU, relay board, DC source,and others) are installed and tested. After the connection ofthe microcontroller and components, coding is performed to

144064 VOLUME 7, 2019

Page 7: Design and Fabrication of Smart Home With Internet of Things …umpir.ump.edu.my/id/eprint/26227/1/Design and Fabrication... · 2019-10-25 · W. A. Jabbar et al.: Design and Fabrication

W. A. Jabbar et al.: Design and Fabrication of Smart Home With Internet of Things Enabled Automation System

FIGURE 2. Flowchart of research activities.

realize the required tasks. Then, the design is rechecked toidentify whether any problem exists with the system func-tionalities. Testing is conducted to validate the system effec-tiveness. The system returns to the previous phase, which isenhancement and optimization, when any problem is found.The system is finalized when it exhibits good performance.

B. SH DESIGNThe SH is designed on NX10 software based on the require-ments. The prototype design includes master bedroom, bed-room 1, bedroom 2, toilet 1, toilet 2, kitchen, living room,and a porch. Its outside measurement is 100 cm × 100 cm.Thewindows are closed and opened through a slidingmotion.The upper part of thewindows uses a steel rod as the base. Thedoors have a motor installed at the upper side for openingand closing. A motion sensor is connected to the door todetect motions and automatic closing and opening. An RFIDsensor is placed outside the house, where the owner scans theaccess card to enter the house. A tank is installed at a highposition to enable smooth water flow. An ultrasonic sensor isplaced in the tank to detect the water level. Three metal rodsare installed in the center of the tank. The tank is connectedoutside the house prototype. Overall, the SH prototype isimplemented with the IoT@HoMe system. Figure 3 showsthe overall design and layout of the SH prototype.

FIGURE 3. Design of SH prototype using NX10 software.

C. SH FABRICATIONThe plant layout is designed on NX10, as previously shown.The SH prototype is fabricated using plywood, as shownin Figure 4. The plywood is cut into specific measurementsand dimensions using a table saw. The spotted area is drilledto attach the wood using screws. The plywood is attached atthe base of the house prototype by using hammer, screws, andwood glue to strengthen the attachment. The SH prototypeconsists of three bedrooms, namely, bedroom 1, bedroom 2,and master bedroom. Two toilets, kitchen, and living roomare included. The plywood is cut based on the design onNX10 software. Plywood is used because it is affordable,widely available, sturdy, and can be cut easily. The prototypeis painted to improve its appearance. A primer is applied onthe surface before painting with the selected color. A smoothsurface is an important feature of the prototype.

Doors and windows are installed with the required mecha-nisms for door automation. Metal rods are used to ensure thatthe doors andwindowsmove in a sliding direction. A portableceiling made of glass is created for transparency purposes.All sensors and actuators are installed in predefined placesto sense the considered stimuli. The wiring of lights, sensors,and appliances are installed and arranged on the ceiling andwalls, as shown in Figure 5. Plugs are used as terminals

VOLUME 7, 2019 144065

Page 8: Design and Fabrication of Smart Home With Internet of Things …umpir.ump.edu.my/id/eprint/26227/1/Design and Fabrication... · 2019-10-25 · W. A. Jabbar et al.: Design and Fabrication

W. A. Jabbar et al.: Design and Fabrication of Smart Home With Internet of Things Enabled Automation System

FIGURE 4. SH prototype fabrication.

for the wiring to facilitate the connection with the portableIoT@HoMe system. A fabricated casing for the developedIoT@HoMe system is attached to the prototype for the mon-itoring and control of the SH prototype. A water tank isinstalled and fixed. The prototype is furnished and decorated.Decorations are important in this phase to make the SH look

FIGURE 5. Wire installation.

FIGURE 6. NodeMCU.

beautiful and show the identity of the specific places. Dec-orations, such as beds, cupboards, dining table, and kitchencabinet, are created and placed in their specific areas.

IV. DEVELOPMENT OF IOT@HOMEAUTOMATION SYSTEMA. SELECTION OF COMPONENTSHardware and software components are crucial and essentialin the design of the IoT@HoMe system for successful andsmooth SH automation. The components used to fabricatethe IoT@HoMe automation system are listed as follows:NodeMCU ESP8266Wi-Fi controller board, 12 V DC Powersource, 8-channel 5 V DC relay module, HCR04 ultrasonicmodule, PIR motion sensor, DHT11 temperature and humid-ity sensor, MQ2 gas sensor, Light-emitting diode (LED)bulbs, Mini fan, 1.5 V DC motor, RFID, 12 V DC brushlesssubmersible water pump, and Plywood for SH prototype. Thesoftware components are listed as follows: Nx Siemens soft-ware, Adafruit.IO, Arduino IDE software, MQTT protocolserver, and If This Then That (IFTTT).

After the selection of components, we design and fabricatethe IoT@HoMe automation system. The system hardwarecomponents are discussed. NodeMCU (Figure 6), which isa low-cost thumb-sized microcontroller, is used as the centralcontrolling unit in this system. NodeMCU is an open-sourcesoftware and development board that is embedded with asystem-on-chip called ESP8266, which helps users to pro-totype IoT products using Lua script lines similar to Pythonand Ruby.

NodeMCU has a 32-bit Tensilica Xtensa LX106 coreclocked at 8 MHz. It is a self-contained Wi-Fi networkingsolution that acts as a bridge between existing microcon-trollers to Wi-Fi and is capable of running self-containedapplications. NodeMCU can easily connect to components,

144066 VOLUME 7, 2019

Page 9: Design and Fabrication of Smart Home With Internet of Things …umpir.ump.edu.my/id/eprint/26227/1/Design and Fabrication... · 2019-10-25 · W. A. Jabbar et al.: Design and Fabrication

W. A. Jabbar et al.: Design and Fabrication of Smart Home With Internet of Things Enabled Automation System

such as sensors and actuators, through its integrated built-in 20 kb of RAM, 10 GPIOs, 4 megabytes of on-boardstorage, and TCP/IP. A built-in USB connector links to thecomputer using a USB cable to upload the codes, which issimilar to other development boards available in the market,such as Arduino and Raspberry Pi. Compared with ArduinoUNO, NodeMCU has many other good features, such as lowcost, simplicity, smartness, a built-in power regulator, and apowerful processor.

An 8-channel 5 V DC relay module is used in this studyto perform the switching of various actuators, such as fans,lights, and pumps. The relay is energized or reenergized basedon the received signals from the NodeMCU, which receivesthe commands from the user or the sensors. The relay boardovercomes the limitation of the control voltage generated bythe controller, and 3.3–5 V DC voltage is used to control240 V ac appliances.

Several sensors are utilized in this study for different pur-poses. An HCR04 ultrasonic sensor is used to measure thewater level in the water tank. The ultrasonic sensor sendsa feed to the NodeMCU to trigger the relay to switch ONthe brushless submersible water pump and feed water to thetank when the water level is low. The sensor sends data to theNodeMCU to stop the pump when the water level is full.

A DHT11 temperature sensor is used because of its advan-tages, such as low cost, long-term stability, excellent quality,fast response, strong anti-interference ability, long-distancesignal transmission, digital signal output, relative humidityand temperature measurement, and precise calibration. Thistemperature sensor is used to detect the temperature andhumidity of the room. It triggers the buzzer when the temper-ature is higher than the room temperature. It also sends datato the NodeMCU, which sends a command to switch ON themini fan in the prototype or air conditioning (AC) system inthe real implementation of the system.

A PIR motion sensor is utilized to detect the presenceof humans in the home and is sent to the NodeMCU,which responds by taking the proper action. For example,the obtained signals from PIR can be used to open/closethe doors or to switch ON/OFF the lights. In addition, PIRsensor output can trigger the buzzer and send notificationsto the server when a person is detected for security purposeswhen the homeowner is away. Similarly, MQ2 gas sensor isutilized in this system to detect gas leakage at home. This gassensor is sensitive to a range of gases and is used indoors atroom temperature. An analog signal is sent to the NodeMCUand IoT server and notifies the user when smoke is detected.This sensor is used to increase the safety of SH against anygas leakage or fire. Another sensor for security purposes isRFID, which is used to identify the user access card ID andtrigger the relay to open the door. This sensor only allowspeople who have predefined access cards to open the doorsand updates their information to the server via NodeMCU,thereby increasing the security level of SH.

Our system uses several actuators as examples for realhome appliances. These actuators can be extended or replaced

with any home appliance, such as TV, ovens, refrigerators,washing machines, and AC systems. The consideration forsuch replacement is the rated current of the utilized relayboard based on the connected loads. LED bulbs are usedas the main lighting source in the developed SH prototypebecause these bulbs are energy efficient and compatible withour system and modern houses. Low-power bulbs are usedin the SH prototype, which require only 30–60 milliwatts tooperate. These LED bulbs use more durable and shockproofmaterials compared with other glass bulbs. The lights aredistributed in different parts of the home and connected tothe relay board to be controlled by the IoT system.

In our study, a mini axial fan is used in the kitchen forventilation purposes. Additional fans can be utilized in therooms for cooling. An AC system can be connected in actualsituation with a similar principle of operation. Users canturn ON/OFF the fan through Adafruit IO server or MQTTDash by energizing/deenergizing the related relay. Similaractuators for cooling can be directly controlled by the tem-perature sensor as another option for automation. In addition,a 1.5 V DC motor is used to automatically control the slidingdoors. The motor is controlled by the relay and microcon-troller. Users can open the door by tapping their access cardwith RFID.

At the beginning of the experiment, the motor speed iscontrolled with a potentiometer at 5 V. However, the bat-tery voltage rapidly drops. A MOSFET is used to controlthe motor speed by connecting the MOSFET between themotor and switching power supply. The MOSFET temper-ature increases, and the potentiometer is burned. This con-dition occurs because of high voltage supply, causing thedamage of the MOSFET and potentiometer. An MD10-POTmotor driver is used that enables the users to easily control theDCmotor direction and speed. Users can instantly control theDC motor when the battery and DC motor are connected toMD10-POT. The motor speed is successfully controlled withthe implementation of the MD10-POT motor driver. Similarmotors can be used in real houses with different ratings tocontrol the sliding doors and windows. In our project, weuse one motor as an example. Another actuator, a 12 V DCbrushless submersible water pump (Figure 7) is used to pumpthe water to the tank when the water level is lower than theminimum threshold value and stops the water pump when thewater level reaches the maximum threshold value. This waterpump is controlled by the signal obtained from the ultrasonicsensor, which updates the data to the NodeMCU and controlsthe relay connected to the pump.

System software components are selected and developed.Adafruit.IO (Figure 8) is an open-source and free IoT serverthat utilizes the data. Adafruit.io is easy to use and allowssimple data connection with minimal programming. In thisstudy, Adafruit.io is used as the IoT server for our sys-tem to monitor home conditions and control home appli-ances through the Internet with MQTT protocol. The sensingdata, which include sensor measurements and relay status(ON or OFF), are uploaded to the server through the

VOLUME 7, 2019 144067

Page 10: Design and Fabrication of Smart Home With Internet of Things …umpir.ump.edu.my/id/eprint/26227/1/Design and Fabrication... · 2019-10-25 · W. A. Jabbar et al.: Design and Fabrication

W. A. Jabbar et al.: Design and Fabrication of Smart Home With Internet of Things Enabled Automation System

FIGURE 7. Brushless submersible water pump.

FIGURE 8. Adafruit.IO.

NodeMCU microcontroller. The command is sent to theNodeMCU through the MQTT server when users remotelycontrol the system using their laptops or smartphones. TheNodeMCU sends a signal to switch ON/OFF to the relayswitches based on what the users pressed on Adafruit.io webGUI using their fingertips.

MQTT is a TCP-based publish messaging protocoldesigned for lightweight machine-to-machine communica-tions. At present, these IoT devices and sensors communicatewith each other on the back end without human knowledge.MQTT is originally developed by IBM based on a hub-and-spoke model. Basically, an MQ broker is required to enableMQTT. The MQ broker is a full-featured, message-orientedmiddleware broker that allows clients to send short one-hopmessages to the broker and receives messages when theysubscribe to a certain topic. Furthermore, IFTTT is utilized inthe software development of our project. This free web-basedservice is used to create chains of simple conditional state-ments called applets. An applet is triggered by the changesthat occur within other web services. In this project, IFTTToperates on Adafruit IO web that uses a platform to sendnotifications to the user’s smartphone when an abnormalsituation is detected by Adafruit IO. In addition, it is used toconnect Adafruit with Google Assistant. For example, a noti-fication is triggered through IFTTT when the temperaturesensor exceeds the normal value. Users can obtain up-to-dateinformation on their house through IFTTT. Users can useGoogle Assistant to control their home appliances.

Arduino IDE is an application that is used to write codesand uploads them to the NodeMCU board. In this project,Arduino IDE is used for coding, debugging, and testing thefunctionalities of the IoT@HoMe system and its components.Arduino IDE has other features, such as a debugging area

FIGURE 9. System testing on breadboard.

in case of abnormal conditions to support various Arduinoboards, additional libraries, and a serial monitor for com-municating with the board. Arduino libraries are usuallyexpressed as dot CPP files based on software abstractioncalled wiring. Wiring allows the easy control of hardwareports through simple functions without consulting data sheetsand being delayed in pin mapping. Thus, Arduino uses thebits of C and C++, but the general flow and structure of thecode are heavily based around C.

B. DESIGN ENHANCEMENT AND OPTIMIZATIONThe implemented hardware system in the SH prototype isevaluated, and the design is enhanced and optimized whenany error exists until the system can perform well. This phaseis important to improve the system performance and detecterrors. Thus, the problems encountered during the previousphases are identified and fixed. This step is repeated until asuccessful implementation is achieved. For example, beforestarting the real implementation of our system, LED bulbs areused as replacements for actuators to read the output. Aftercompiling all the programming codes into NodeMCU, theactuators, such as fan, motors, buzzer, bulbs, and relay mod-ule are used for the real testing of the breadboard, as shownin Figure 9. All the installed wiring connections are checkedwith a multimeter. The wires are marked and named to helpthe user to clearly verify every part of the system connection.Furthermore, the wires are isolated and covered with blacktape for protection and organization, as shown in Figure 5.In this phase, the system is evaluated to prove that all sensors,actuators, and NodeMCU are functioning effectively.

C. IMPLEMENTATION OF IOT@HOMEThe main contribution of this work is the development ofan innovative market-ready portable controller (IoT@HoMe)that can be implemented in real houses to continuouslymonitor home conditions and comfortably manage homeappliances through the Internet regardless of time and place.In addition to the proposed algorithm (Algorithm 1) forhome automation and control that implemented in NodeMCUmicrocontroller.

In this study, NodeMCU is selected for the SH pro-totype because of its capabilities and cost effectiveness.

144068 VOLUME 7, 2019

Page 11: Design and Fabrication of Smart Home With Internet of Things …umpir.ump.edu.my/id/eprint/26227/1/Design and Fabrication... · 2019-10-25 · W. A. Jabbar et al.: Design and Fabrication

W. A. Jabbar et al.: Design and Fabrication of Smart Home With Internet of Things Enabled Automation System

FIGURE 10. IoT@HoMe portable box with two NodeMCUs and plugterminals.

Several sensors, such as temperature and humidity, gas,RFID, ultrasonic, and motion sensors, are used to ensure thatthe system is smart and safe. Several experiments for individ-ual sensors and actuators are conducted on the breadboardbefore starting the final implementation and fabrication ofthe developed system. Thus, the proper materials and com-ponents for the system are selected.

The IoT@HoMe is designed to be portable; thus, it canbe implemented (plug and play) in the fabricated prototypeand suitable to be attached to a real house. Connectors areused on the wire terminals for easy plug and play, as shownin Figure 10. The IoT@HoMe system is installed in the SHprototype and retested after the testing of hardware imple-mentation. The system is enhanced and optimized when anyerror exists until the system can fully function as proposed.Figure 10 shows the two microcontrollers working smoothlywith the sensor and relay in the developed IoT@HoMeportable automation system.

As part of software implementation, two GUIs are devel-oped for monitoring and controlling the SH prototype.The first GUI is a web-based dashboard integrated to theAdafruit.IO web server. This GUI includes several indica-tors to display the obtained readings from the implementedsensors in addition to several switches to control variousactuators. The second GUI is a smartphone-based interfaceusing MQTT mobile apps that are available on Google Play.The two GUIs are synchronized, and users have two optionsfor monitoring and controlling the SH. Additional detailson the developed GUIs and their usage in our IoT@HoMeautomation system are presented in Section V.

D. OVERALL SYSTEM ARCHITECTUREThe overall system architecture of the developed IoT@HoMeautomation system is illustrated in Figure 11. In this study,the NodeMCU sends the data collected by the sensor tothe MQTT server (Adafruit.IO) and responds to the com-mands given by the user from the server to the system, suchas ON/OFF switching of actuators similar to LEDs. TheNodeMCU uses the embedded Wi-Fi module to connect tothe Internet. Users can monitor the data on the server by

Algorithm 1 Smart Home Monitoring and AutomationAlgorithmRequire: Monitor home conditions and control homeappliances locally and remotelyEnsure Real-time monitoring (temperature, humidity,motion, gas, light and water level),and remotely control home appliances (lights, fans, waterpump, doors, RFID)1: DefineWi-Fi Access Point Username/PW2:DefineAdafruit_MQTTAIO_KEY&Google Assistant

& IFTTT Server3: Define NodeMCU.GPOI for Relay board // Forswitching actuators (lights, motor, fan, buzzer andappliances)

4: Define NodeMCU.GPOI for sensors // For gettingsensors data

5: D← Darkness value // From LDR sensor6: T← Temperature value // From DHT_117: H← Humidity value // From DHT_118: G← Gas value // From MQ2 gas sensor9: M← Motion value // From HC-SR501 PIR

sensor10: A← RFID value // From RFID sensor11: L← Water level value // From HC-SR04

ultrasonic sensor12: Set threshold SENSORS values:DTH , TTH , HTH , GTH ,

LTH13: Initialize IoT@HoMe // Switching ON the system at

t = 014: NodeMCUs are connected to the Internet via Wi-Fi AP15: Adafruit MQTT server is connected to Google

Assistant and IFTTT16: NodeMCUs acquire the sensors data17: for each round do18: Get L, T, H, G, M, A, and W19: Upload data to Adafruit MQTT Server overWi-Fi20: Update status of sensors/actuators in Adafruit

MQTT Server21: Synchronize data toMQTT Dash App. using

Smartphone22: Case 1 (LDR)23: if (D >= DTH ) then24: Switch ON lights25 else26: Switch OFF lights27: break;28: Case 2 (DHT_11)29: if (T >= TTH || H>= HTH ) then30: Switch ON fan/AC31: Notify user via IFTTT ‘‘Temp./Hum. are High!’’32 else33: Switch OFF fan/AC34: break;35: Case 3 (MQ2)36: if (G >= GTH ) then

VOLUME 7, 2019 144069

Page 12: Design and Fabrication of Smart Home With Internet of Things …umpir.ump.edu.my/id/eprint/26227/1/Design and Fabrication... · 2019-10-25 · W. A. Jabbar et al.: Design and Fabrication

W. A. Jabbar et al.: Design and Fabrication of Smart Home With Internet of Things Enabled Automation System

Algorithm 1 (Continued.) Smart Home Monitoring andAutomation Algorithm

37: Switch ON Ventilation FAN38: Notify user via IFTTT ‘‘Gas leakage!’’39 else40: Switch OFF V_Fan41: break;42: Case 4 (HC-SR501 PIR)43: if M is detected then44: Notify user via IFTTT ‘‘motion detected at the

main entrance!’’45: break;46: Case 5 (RFID)47: if A is detected due to access card tag then48: Open the door49: break;50: Case 6 (HC-SR04)51: if (L <= LTH ) then52: Switch ON Water pump53: Notify user via IFTTT ‘‘Water tank level LOW!’’54: break;55: end for56: User monitors all sensors data in real-time remotely via

MQTT Dash App57: Remotely control appliances via

MQTT Dash App/Google Assistant58 END

logging in using any electronic device that can access theInternet and control lights, fans, and motors. RFID is usedto control the door relay by tapping the access card. Usersreceive notifications through IFTTT on their smartphonesbased on the sensor readings. For example, an output signalis transmitted to NodeMCU when the temperature is higherthan 30 ◦C, which triggers IFTTT to send a notification to theuser. The PIR motion sensor triggers the buzzer and sendsa notification when a stranger enters the house. The gasand temperature sensors update the data to NodeMCU andtrigger the ventilation and cooling fans. The ultrasonic sensorcollects the data through the sensor and controls the waterpump relay. All sensors are connected to the input GPIOs ofNodeMCU, and actuators are their output. The system oper-ates based on the developed coding in the microcontroller.Samples of sensors and actuators are used in the developedprototype. However, this system can be expanded by includ-ing many sensors and actuators in actual implementation.The flowchart of the system operation mechanism is shownin Figure 12.

V. EXPERIMENTAL RESULTS AND VALIDATIONThis section presents the results to verify the functionalitiesof the implemented IoT@HoMe system in the fabricatedSH prototype. Thus, IoT@HoMe successfully controls homeappliances (lights, doors, pumps, fans, and others) and mon-itors various stimuli, such as temperature, humidity, gas,

FIGURE 11. IoT@HoMe system architecture.

FIGURE 12. Flowchart of system operation.

water level, and motion using mobile phones/laptops throughAdafruit IO, MQTT Dash, and Google Assistant. Users canmonitor and control the SH prototype anytime and anywhereby connecting to the Internet. One of the achievements of thisstudy is the utilization of artificial intelligence in controllinghome appliances by enabling Google Assistant voice com-mands to help people with disabilities. Users have multipleoptions by developing multi-dashboards and can utilize anydevice by connecting to the Internet regardless of time andlocation to monitor and control the home.

NodeMCU is connected to the predefinedWi-Fi network tocontinuously connect the IoT@HoMe system to the Internet.Users can use anymobile device, laptop or personal computerto log in to Adafruit IO, MQTT Dash, and Google Assistantapplications to access the developed control system, whichuplinks the sensor data from NodeMCU and downlinks theused commands to NodeMCU. Thus, users can control allelectrical appliances and monitor the motion, temperature,gas, water level, and humidity of the house. Figure 13 showsthe GUI for the monitoring of SH through Adafruit IO andMQTT Dash. Users can obtain up-to-date information fromthe sensors through the Adafruit IO platform or MQTT Dash.In addition, users can switch ON/OFF the light bulbs usingthe buttons on the GUI. Electrical appliances, such as bulbs,

144070 VOLUME 7, 2019

Page 13: Design and Fabrication of Smart Home With Internet of Things …umpir.ump.edu.my/id/eprint/26227/1/Design and Fabrication... · 2019-10-25 · W. A. Jabbar et al.: Design and Fabrication

W. A. Jabbar et al.: Design and Fabrication of Smart Home With Internet of Things Enabled Automation System

FIGURE 13. House prototype with electrical appliances controlled viaMQTT Dash and Adafruit IO.

fans, and water pumps, can also be controlled and monitoredusing Adafruit IO and MQTT Dash.

Google Assistant is an add-on functionality that enablesthe control of home appliances using voice commands,

FIGURE 14. (a) Google Assistant and (b) IFTTT notification.

as demonstrated in Figure 14 (a). Furthermore, all utilizedsensors can be used in the next step to fully automate thelight and home appliances to reduce energy consumption. Thedata obtained from the sensors are utilized for subsequentprocessing to increase the safety and security of SHs. IFTTTis utilized with Adafruit IO to define the limits for abnormalsensing data and sends notifications to users’ smartphoneswhen these values exceed the predefined limits. For example,the bar color changes from yellow to blue when the gassensor exceeds the value of 650, the data are sent throughIFTT, and a notification is sent to the user’s smartphone,as shown in Figure 14 (b). A DHT22 sensor can detectabnormal temperature that may be due to a fire at home,and Adafruit sends feeds to IFTTT to notify users on theirsmartphones when the temperature exceeds the threshold.The motion sensor can detect any motion at the main entranceand notifies the residents. Such functionality can increase thesafety and security of SHs.

An RFID card to access the home is the automationand security consideration in this study. The main gateof the home is automatically opened using a DC motorwhen a user tags the RFID card. This developed circuitperforms effectively and RFID detects the right accesscard, which turns on the relay circuit that powers themotor to open the door. The RFID circuit is connected toNodeMCU with the motion sensor to control home securitythrough IoT.

The effectiveness of the developed system is validatedby evaluating its functionalities on the fabricated SH proto-type. All electrical appliances and sensors can be controlledand monitored using Adafruit IO, MQTT Dash, and GoogleAssistant. Figure 15 shows the top view of the SH prototypeand the attached IoT@HoMe controller that enables homeautomation through the IoT platform. Maintaining rapid andaccurate reading of the sensors is one of the issues encoun-tered during the testing phase in this study. In the beginning,a 16-channel analog multiplexer was utilized to increasethe number of analog ports due to the limited number ofNodeMCU pins. The sensors connected to the multiplexer

VOLUME 7, 2019 144071

Page 14: Design and Fabrication of Smart Home With Internet of Things …umpir.ump.edu.my/id/eprint/26227/1/Design and Fabrication... · 2019-10-25 · W. A. Jabbar et al.: Design and Fabrication

W. A. Jabbar et al.: Design and Fabrication of Smart Home With Internet of Things Enabled Automation System

FIGURE 15. Top view of the validated SH prototype.

did not provide accurate readings during testing, and switch-ing ON/OFF appliances was delayed. We could not solvethis issue after several experiments, and we added anotherNodeMCU controller to replace the multiplexer and over-come the problem. Subsequently, the system without analogmultiplexer was tested, and all sensors were functioning welland provided accurate readings to the server. The switchingdelay of home appliances was reduced, and the responsewas fast. Another issue encountered during system imple-mentation was related to the RFID system. For example,relay circuit was shorted when it was connected to batterywires. This issue was solved by placing an insulator on top oftwo circuits to prevent any possibility of short circuit. UsingNodeMCU as the controller in our project was an advantageand a challenge at the same time. In existing home automationsystems, several microcontrollers, such as Arduino Mega,Arduino UNO, Raspberry Pi, and NodeMCU, have beenutilized.

In our previous study, Arduino UNO with ESP8266 Wi-Fiwas used. However, after several experiments, the systemstill failed to perform remote control over the Internet andwas not utilized in this study. We performed an experimenton NodeMCU, which worked perfectly and fulfilled therequirements of this project. The NodeMCU can be eas-ily controlled by the computer and smartphone through theInternet. In addition, the NodeMCU facilitated editing anduploading the codes using Arduino IDE whenever necessarywith the micro USB port still in place. However, low powersupply and limited number of ports occurred due to the largenumber of relays and sensors used in this project. Thus,we used two NodeMCUs. The first NodeMCU was used tocontrol the relay and monitor the sensor, whereas the secondNodeMCU was utilized for security system implementation,which included RFID and motion sensor.

An Adafruit account was created to enable control andmonitoring of the SH. This account can be logged in throughthe webserver where the application for the smartphone is notprovided. The Adafruit account did not fulfill this require-ment due to the objective of the project, which was remotecontrol of SH. To address this situation, an MQTT DASH

smartphone application was created to connect and link withthe Adafruit account. This application has a simple GUIdesign, where its color, title, and size can be selected by theuser. Users can easily control and monitor their SHs within afew seconds through this application.

This project was implemented using Google Assistantto control the switch ON/OFF button. This implementationused IFTTT to trigger the Adafruit system. Users can eas-ily control their homes by speaking to Google Assistanton their smartphones. Google Assistant triggers Adafruitwith specific feeds and turns ON/OFF the light. This func-tion helps elderly people to use mobile applications andimprove their mobility. Google Assistant was implementedbecause of its user-friendly features, which are updatedwith each new generation and are applicable for use byelderly people.

VI. CONCLUSION AND FUTURE WORKThis study presented the design, fabrication, and implemen-tation of a portable, user-friendly, and low-cost automationsystem for SHs based on IoT. The developed IoT@HoMesystem can be easily implemented in a real house to allowreal-time monitoring of home conditions and control of homeappliances. Several sensors and actuators were connectedto the NodeMCU controller, which updated the data to theIoT server. The obtained data from the sensors (tempera-ture, humidity, motion, gas, and RFID) can be monitored viaMQTTDashmobile application andAdafruit IOWeb via lap-tops/PC. For security and safety purposes, the user receivesnotifications on their mobile phones about any abnormalcondition at home via the IFTTT server. Control of homeappliances can be easily and efficiently conducted by usingMQTT/Adafruit IO GUI or through voice commands usingGoogle Assistant. The results of this study are promising,and the developed system can increase the safety, security,intelligence, and comfort of users. The proposed systemcan be expanded with additional sensors and actuators. Thedeveloped system can also be improved to make it suitablefor future commercialization. Our next study will use solarpanels to power the control box rather than using batteries tomake the proposed system energy efficient and environmentfriendly. We will optimize all circuits using printed circuitboards to save space and minimize the risk of connectionlosses or short circuits.

REFERENCES[1] M. Daneshvar, M. Pesaran, and B. Mohammadi-Ivatloo, ‘‘Transactive

energy in future smart homes,’’ in The Energy Internet. Amsterdam,The Netherlands: Elsevier, 2019, pp. 153–179.

[2] R. Sinha, S. Patil, L. Gomes, and V. Vyatkin, ‘‘A survey of static formalmethods for building dependable industrial automation systems,’’ IEEETrans. Ind. Informat., vol. 15, no. 7, pp. 3772–3783, Jul. 2019.

[3] W.A. Jabbar,M.H.Alsibai, N. S. S. Amran, and S. K.Mahayadin, ‘‘Designand implementation of IoT-based automation system for smart home,’’ inProc. Int. Symp. Netw., Comput. Commun.(ISNCC), Jun. 2018, pp. 1–6.

[4] H. Ning, F. Shi, T. Zhu, Q. Li, and L. Chen, ‘‘A novel ontology consistentwith acknowledged standards in smart homes,’’ Comput. Netw., vol. 148,pp. 101–107, Jan. 2019.

144072 VOLUME 7, 2019

Page 15: Design and Fabrication of Smart Home With Internet of Things …umpir.ump.edu.my/id/eprint/26227/1/Design and Fabrication... · 2019-10-25 · W. A. Jabbar et al.: Design and Fabrication

W. A. Jabbar et al.: Design and Fabrication of Smart Home With Internet of Things Enabled Automation System

[5] W. Li, T. Logenthiran, V.-T. Phan, and W. L. Woo, ‘‘A novel smart energytheft system (SETS) for IoT-based smart home,’’ IEEE Internet Things J.,vol. 6, no. 3, pp. 5531–5539, Jun. 2019.

[6] W. A. Jabbar, W. K. Saad, and M. Ismail, ‘‘MEQSA-OLSRv2:A multicriteria-based hybrid multipath protocol for energy-efficient andQoS-aware data routing in MANET-WSN convergence scenarios of IoT,’’IEEE Access, vol. 6, pp. 76546–76572, 2018.

[7] D. Anandhavalli, N. S. Mubina, and P. Bharathi, ‘‘Smart home automationcontrol using Bluetooth and GSM,’’ Int. J. Informative Futuristic Res.,vol. 2, no. 8, pp. 2547–2552, 2015.

[8] B. Davidovic and A. Labus, ‘‘A smart home system based on sensortechnology,’’ Facta Universitatis, Ser., Electron. Energetics, vol. 29, no. 3,pp. 451–460, 2015.

[9] N. David, A. Chima, A. Ugochukwu, and E. Obinna, ‘‘Design of a homeautomation system using arduino,’’ Int. J. Sci. Eng. Res., vol. 6, no. 6,pp. 795–801, 2015.

[10] R. K. Kodali and S. Soratkal, ‘‘MQTT based home automation systemusing ESP8266,’’ in Proc. IEEE Region 10 Humanitarian Technol. Conf.(R10-HTC), Dec. 2016, pp. 1–5.

[11] A. ElShafee and K. A. Hamed, ‘‘Design and implementation of a WIFIbased home automation system,’’World Acad. Sci., Eng. Technol., vol. 68,pp. 2177–2180, Aug. 2012.

[12] S. S. Imran, J. Vignesh, V. K. Singh, and D. T. ArunPrasath, ‘‘Smart homeautomation based on IoT using arduino mega,’’ in Proc. Int. Conf. CurrentRes. Eng. Sci. Technol. (ICCREST), 2016, pp. 2348–8379.

[13] U. Ozeer, L. Letondeur, F.-G. Ottogalli, G. Salaün, and J.-M. Vincent,‘‘Designing and implementing resilient IoT applications in the fog: A smarthome use case,’’ in Proc. 22nd Conf. Innov. Clouds, Internet Netw., 2019,pp. 230–232.

[14] L. Letondeur, F.-G. Ottogalli, and T. Coupaye, ‘‘A demo of applicationlifecycle management for IoT collaborative neighborhood in the Fog:Practical experiments and lessons learned around docker,’’ in Proc. IEEEFog World Congr. (FWC), Oct./Nov. 2017, pp. 1–6.

[15] D. M. Konidala, D.-Y. Kim, C.-Y. Yeun, and B.-C. Lee, ‘‘Security frame-work for RFID-based applications in smart home environment,’’ J. Inf.Process. Syst., vol. 7, no. 1, pp. 111–120, 2011.

[16] A. A. Zaidan, B. B. Zaidan, M. Y. Qahtan, O. S. Albahri, A. S. Albahri,M. Alaa, F. M. Jumaah, M. Talal, K. L. Tan, W. L. Shir, and C. K. Lim,‘‘A survey on communication components for IoT-based technologies insmart homes,’’ Telecommun. Syst., vol. 69, no. 1, pp. 1–25, Sep. 2018.

[17] J.-S. Chou and N.-S. Truong, ‘‘Cloud forecasting system for monitoringand alerting of energy use by home appliances,’’ Appl. Energy, vol. 249,pp. 166–177, Sep. 2019.

[18] J. G. Bhatt, ‘‘Building automation systems: Recent trends, design anddevelopment,’’ in Rapid Automation: Concepts, Methodologies, Tools,and Applications. IGI Global, 2019, pp. 376–409. [Online]. Available:https://www.igi-global.com/chapter/building-automation-systems/222439

[19] S. G. Varghese, C. P. Kurian, V. I. George, A. John, V. Nayak, andA. Upadhyay, ‘‘Comparative study of ZigBee topologies for IoT-basedlighting automation,’’ IETWireless Sensor Syst., vol. 9, no. 4, pp. 201–207,2019.

[20] W. Ejaz and A. Anpalagan, ‘‘Internet of Things for smart cities: Overviewand key challenges,’’ in Internet of Things for Smart Cities. Cham,Switzerland: Springer, 2019, pp. 1–15.

[21] K. Christantonis, ‘‘Data mining for Smart Cities,’’ Ph.D. disserta-tion, Int. Hellenic Univ., Thermi, Greece, 2019. [Online]. Available:https://repository.ihu.edu.gr//xmlui/handle/11544/29275

[22] S. Popli, R. K. Jha, and S. Jain, ‘‘A survey on energy efficient narrowbandInternet of Things (NBIoT): Architecture, application and challenges,’’IEEE Access, vol. 7, pp. 16739–16776, 2019.

[23] C. Woodford, (2009/2018) Smart Homes and the Internet ofThings. Accessed: Aug. 2019. [Online]. Available: https://www.explainthatstuff.com/smart-home-automation.html

[24] K. Bradfield and C. Allen, ‘‘User perceptions of and needs for smart hometechnology in South Africa,’’ in Advances in Informatics and Computing inCivil and Construction Engineering. Cham, Switzerland: Springer, 2019,pp. 255–262.

[25] (2019). NodeMCU. [Online]. Available: https://www.nodemcu.com[26] A.Mattoo and S. Kumar, ‘‘Internet of Things: A progressive case study,’’ in

Handbook of IoT and Big Data. Boca Raton, FL, USA: CRC Press, 2019,pp. 251–273.

[27] K. Halvens, Understanding the Architecture of the Modern Linux Operat-ing System. Mountain View, CA, USA: Cumulus, ed, 2018.

[28] Z. Shouran, A. Ashari, and T. K. Priyambodo, ‘‘Internet of Things (IoT) ofsmart home: Privacy and security,’’ Int. J. Comput. Appl., vol. 182, pp. 3–8,2019.

[29] M. Edmonds and N. Chandler, How Smart Homes Work.Accessed: Aug. 2019. [Online]. Available: https://home.howstuffworks.com/smart-home.htm

[30] J. Clark, ‘‘What is the Internet of Things?’’ in Internet of ThingsBlog. 2016. [Online]. Available: https://www.ibm.com/blogs/internet-of-things/what-is-the-iot/

[31] U. Ozeer, X. Etchevers, L. Letondeur, F.-G. Ottogalli, G. Salaün, andJ.-M. Vincent, ‘‘Resilience of stateful IoT applications in a dynamic fogenvironment,’’ in Proc. ACM 15th EAI Int. Conf. Mobile Ubiquitous Syst.,Comput., Netw. Services, 2018, pp. 332–341.

[32] J. He, Q. Xiao, P. He, and M. Pathan, ‘‘An adaptive privacy protectionmethod for smart home environments using supervised learning,’’ FutureInternet, vol. 9, no. 1, p. 7, 2017.

[33] B. Ali and A. Awad, ‘‘Cyber and physical security vulnerability assessmentfor IoT-based smart homes,’’ Sensors, vol. 18, no. 3, p. 817, 2018.

[34] P. Gupta and J. Chhabra, ‘‘IoT based Smart Home design using power andsecurity management,’’ in Proc. IEEE Int. Conf. Innov. Challenges CyberSecur. (ICICCS-INBUSH), Feb. 2016, pp. 6–10.

[35] E. N. Ganesh, ‘‘Implementation of IOT architecture for SMARTHOME using GSM technology,’’ Int. J. Comput. Techn., vol. 4, no. 1,pp. 2231–2394, Feb. 2017.

[36] O. Bhat, S. Bhat, and P. Gokhale, ‘‘Implementation of IoT in smart homes,’’Int. J. Adv. Res. Comput. Commun. Eng., vol. 6, no. 12, pp. 149–154, 2017.

[37] T. Malche and P.Maheshwary, ‘‘Internet of Things (IoT) for building smarthome system,’’ in Proc. IEEE Int. Conf. I-SMAC (IoT Social, Mobile,Analytics Cloud) (I-SMAC), Feb. 2017, pp. 65–70.

[38] S. Badabaji and V. S. Nagaraju, ‘‘An IoT based smart home servicesystem,’’ Int. J. Pure Appl. Math., vol. 119, no. 16, pp. 4659–4667, 2018.

[39] S. Kaur, R. Singh, N. Khairwal, and P. Jain, ‘‘Home automation andsecurity system,’’ Adv. Comput. Intell., Int. J., vol. 3, no. 3, pp. 17–23,2016.

WAHEB A. JABBAR was born in Taiz, Yemen,in 1978. He received the B.Sc. degree in electricalengineering from the University of Basrah, Iraq,in 2001, the M.Eng. degree in communication andcomputer, and the Ph.D. degree in electrical, elec-tronics, and system engineering from UniversitiKebangsaan Malaysia (UKM), Bangi, Malaysia,in 2011 and 2015, respectively. He is currentlya Senior Lecturer with the Faculty of Electricaland Electronics Engineering Technology, Univer-

siti Malaysia Pahang (UMP), Gambang, Malaysia. He is also a Fellow ofthe IBM Centre of Excellence, UMP. His research interests include routingprotocols in ad hoc networks, mobile communications, wireless networking,and advanced electronics and automation. He also has a keen interest in theInternet of Things (IoT) applications and smart city.

TEE KOK KIAN received the Bachelor ofEngineering Technology degree in electrical engi-neering from University Malaysia Pahang, Gam-bang, Malaysia, in 2019, where he is currently aResearch Assistant with the Faculty of Engineer-ing Technology (Electrical). His research inter-ests include the Internet of Things and mobileapplications.

ROSHAHLIZA M. RAMLI received the Bach-elor of Engineering degree in informationsystem, the Master of Engineering degree in elec-trical engineering and computer science from thePolytechnic University of Japan, in 2010 and 2008,respectively, and the Ph.D. degree in electrical,electronic and system engineering (Signal Pro-cessing) from Universiti Kebangsaan Malaysia,in 2015. She is currently a Senior Lecturer withthe Faculty of Engineering Technology, University

Malaysia Pahang. Her research interests include telecommunication tech-nologies, digital/adaptive filtering, speech/audio processing, and algorithmdevelopment and their applications.

VOLUME 7, 2019 144073

Page 16: Design and Fabrication of Smart Home With Internet of Things …umpir.ump.edu.my/id/eprint/26227/1/Design and Fabrication... · 2019-10-25 · W. A. Jabbar et al.: Design and Fabrication

W. A. Jabbar et al.: Design and Fabrication of Smart Home With Internet of Things Enabled Automation System

SITI NABILA ZUBIR received the Bachelor ofEngineering Technology degree in electrical engi-neering from University Malaysia Pahang, Gam-bang, Malaysia, in 2019. Her research interestsinclude control and automation systems.

NURTHAQIFAH S. M. ZAMRIZAMAN receivedthe Bachelor of Engineering Technology degree inmanufacturing from University Malaysia Pahang,Gambang, Malaysia, in 2019. Her research inter-ests include robotics and mechatronics.

MOHAMMED BALFAQIH received the M.S.degree in communication engineering from Inter-national Islamic University Malaysia, and thePh.D. degree in electrical, electronics, and sys-tems engineering from Universiti KebangsaanMalaysia, Malaysia. He is currently a SeniorResearcher with the Automobile TransportationDepartment, South Ural State University, Russia,and also an Assistant Professor with the Computerand Networks Engineering Department, Univer-

sity of Jeddah, Saudi Arabia. His research interests include mobility manage-ment in wireless communication, the Internet of Vehicles (IoV), cooperativecommunications, and massive-MIMO.

VLADIMIR SHEPELEV received the Ph.D. degreefromChelyabinsk State Agro-EngineeringUniver-sity, Russia, in 2000. He is currently an Asso-ciate Professor with South Ural State University(SUSU). He has been a Technical Scientist withLLC South-Ural Transport and Logistic company,since 2007. He is currently working in a projectentitled Development of an Intelligent Digital Plat-form for the Management of Transportation Sys-tems of Cities based on Artificial Intelligence.

He has published several articles, books, and patents. His research interestsinclude the Internet of Things (IoT), real time traffic management, andinternet of vehicles (IoV)

SOLTAN ALHARBI received the B.S. and M.S.degrees in computer engineering from the FloridaInstitute of Technology, Melbourne, FL, USA, andthe Ph.D. degree from the Department of Electricaland Computer Engineering, University of Victoria,Victoria, BC, Canada. He was the Chairman of theElectrical and Computer Engineering Department,University of Jeddah, Saudi Arabia, where he isalso the Chairman of the Computer and NetworksEngineering Department, University of Jeddah.

He is currently on implementing a proactive system that would complementthe current practice of reactive investigation. He is a member of the fol-lowing organizations: the IEEE Computer Society and the High TechnologyCrime InvestigationAssociation (HTCIA). His research interests include, butnot limited to, digital forensics investigation (both reactive and proactive),network security, and information security. From Fall 1999 to Fall 2000,he was a recipient of the Full Tuition Waiver from the Florida Institute ofTechnology.

144074 VOLUME 7, 2019