Design and Fabrication of Smart Home With Internet of Things Enabled Automation System

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.


I. INTRODUCTION
Home automation systems have attracted considerable attention with the advancement of communications technology [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. Many automation systems have been developed, and some of them are used as commercial products in the market [7]- [16]. Some of these products are adopted to control home appliances either locally or remotely. With the invention of microcontrollers, the costs of electronic control have rapidly decreased at the end of the last century, and home automation has emerged. Home automation systems have not been widely spread and such systems still considered the domain of hobbyists or the rich. Various automation technologies, such as remote control for TVs, fans, air conditioners, and music players, have been used to equip home appliances with the required systems for easy monitoring and control [17], [18]. With the widespread introduction of electricity into homes and the rapid advancement of information technology, a new era of controlling home appliances has started by using mobile devices with short-range communication interfaces, such as Bluetooth and ZigBee [19], and by Wi-Fi networks and GSM modules [7]. All these systems and technologies are useful for indoor control of home appliances and does not allow residents to monitor and control their homes from the outside. Although such systems allow interaction with inhibitors to provide convenience, comfort, safety, and energy efficiency at all times, they have many limitations in functionality and communication range [20]. Most of these systems do not utilize the powerful features of the emerging IoT technology, which aims to connect billions of smart devices (phones, laptops, sensors, and actuators) to the Internet.
At present, majority of homes have some of the ''smartness'' because various devices have built-in sensors or electronic appliance controllers [21]. Devices within an SH system can be linked with one another and reached through an access point (AP) to monitor home conditions and control home appliances [22]. For instance, lights, thermostats, TVs, door locks, cameras, washing machines, and refrigerators can be monitored and controlled via an all-in-one SH automation system. Such a system becomes an IoT-based automation system when it is provided with access to the Internet [23]. Home automation systems have many benefits, such as reduction of electric consumption and energy costs. In addition, home automation systems increase home security and safety [24]. For example, some systems can notify homeowners when any motion is detected at home while they are not around, and some of the appliances can report to fire stations in case of fire. IoT can be utilized to improve the existing home automation systems by introducing a main control over the Internet.
The main part of the home automation system based on IoT is the microcontroller. A node microcontroller unit (NodeMCU) Wi-Fi-based controller board [25] is an open-source platform for IoT applications and is used as the main microcontroller in this project. NodeMCU is basically used to gather data obtained by sensors and uploads the data to the IoT server. In addition, this microcontroller receives commands given by users via smartphones/laptops to perform specific tasks [26].
NodeMCU consists of a physical programmable circuit board similar to any other development board such as Arduino or Raspberry Pi. NodeMCU can be programmed on Arduino software, which is an integrated development environment (IDE) to write the instruction codes and uploads them to the microcontroller. An advanced form of SH automation system is the use of gadgets to access and control all home appliances and sensors. The commonly used gadgets are developed as mobile apps on top of operating systems of smartphones, such as Android/iOS or as web-based dashboards integrated to open-source IoT platforms [27]. With the aid of IoT cloud computing servers, all data obtained from sensors are aggregated and analyzed to become valuable information for addressing specific requirements when they are uploaded to the server. All data can be used to display the reading patterns in terms of graphs and detect possible occurring problems and provide recommendations or alert the user. IoT can create new innovation concepts that can be used for the development of SHs to provide intelligence, comfort, safety, and better quality of life.
This study presents the design, fabrication, and validation of an IoT-based portable automation system called IoT@HoMe for SHs. It enables IoT automation and monitoring of SHs by using NodeMCU as microcontroller and Internet gateway. IoT@HoMe utilizes several sensors to monitor various home-related parameters, such as temperature, humidity, gas leakage, motion, radio-frequency identification (RFID), and water level. Several actuators are used to perform control activities of home appliances, such as switching of lights and fans, control of doors and windows, and operation of motors and pumps. Furthermore, a user-friendly graphical user interface (GUI) is developed to facilitate the interaction between users and the SH. An SH prototype is constructed to implement and validate the effectiveness of the proposed IoT@HoMe system. The developed system aims to automate home appliances, increase safety and security, and enhance life quality and convenience.
The remaining part of this paper is structured as follows: Section II introduces the background and related work. Section III presents the prototype and fabrication of SH. Section IV describes the design, architecture, implementation, and functionalities of the developed IoT@HoMe system. Section V discusses the experimental results. Section VI provides the conclusion.

II. BACKGROUND AND RELATED WORKS A. MOTIVATIONS AND PROBLEM STATEMENT
The advantages of SH automation systems include ease and accessibility, energy reduction, convenience, comfort, peace of mind, entertainment, safety, and security. A study has been conducted to identify the problems in existing home automation systems. Most existing systems are unsuitable for many users because of their high costs and difficulty in maintenance. In addition, existing home automation systems lack IoT technologies and have unfriendly user interfaces. Some existing SH automation systems do not consider safety and security. Safety and security are important elements in any SH to avoid incidents. Some existing SHs have insufficient features and functionalities because the original installer may not have adequate knowledge of the installation and commission of the system. Existing systems have limited wireless transmission range connectivity because they utilize short-range wireless interfaces, such as ZigBee, Bluetooth, and Wi-Fi.
Considerable home automation systems are available in the market. These systems can be classified into two main categories, 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 stationary or wireless communication technology to connect to the central hub or gateway, and users can only control home appliances locally. Remote/global control systems allow users to control home appliances from anywhere over the Internet using their smartphones/laptops. Home automation systems should provide a user-friendly interface to efficiently monitor and control home appliances. To address these issues and minimize the limitations of home automation systems, the present study introduces a cost-effective and hybrid (local and remote) IoT@HoMe automation system to extend the range of connectivity and allow users to control their homes easily and efficiently via a user-friendly interface using smartphones and/or laptops regardless of time and location. The proposed system considers safety and security. The system cost is considered by using NodeMCU and free mobile apps to manage, monitor, and control home appliances and conditions over the Internet.

B. RESEARCH CONTRIBUTIONS
The main contribution of this study is the development of an efficient, low cost, and portable IoT@HoMe system to continuously monitor home conditions and comfortably control home appliances over the Internet regardless of time and location. To fulfill these requirements, this study adopts the following objectives and contributions: (i) Design and fabrication of an SH prototype that facilitates the monitoring and control of home appliances using an IoT platform and supports home safety by utilizing NodeMCU as a gateway to connect the system to the Internet. (ii) An algorithm for smart home monitoring and automation base on IoT. (iii) Implementation of an innovative portable IoT add-on automation controller (IoT@HoMe) as a box that can be attached for monitoring and controlling a real house. (iv) Validation of IoT@HoMe system functionalities in terms of automation, security, and safety and evaluation of the performance of the developed system. The design and fabrication of an SH prototype are based on IoT. The proposed system integrates Wi-Fi for local control and IoT for enabling remote control and monitoring via an IoT platform and ubiquitous evaluation of activities. This condition allows the independence of mobile provider and user location. NodeMCU is used as a microcontroller and Wi-Fi as a communication protocol. The messages sent from the Wi-Fi-connected microcontroller managed system can be received by the users on their smartphone or computer from any distance by ensuring that the electronic devices are connected to the Internet. NodeMCU is programmed on Arduino software (IDE). This software helps to writes the codes and upload the program onto the chip of the microcontroller. The system can be merged to the switches and sensors of home appliances to allow efficient control. Several sensors are attached to the controlled household appliances and placed throughout the home to track activities and events, and the sensed data are wirelessly sent to a gateway. The system is integrated with alarm devices to detect any security threat. The proposed system provides safety and comfort, especially for elderly and disabled people.

C. RELATED WORKS
SHs represent a concept rather than actual structures. Science fiction has provided the concept of home automation for decades, and has been demonstrated by the American Association of House Builders in 1984, thereby defining SHs. An SH is the integration of technology that enables users to achieve a better quality of living. SH is a voice assistant for the remote control of all home appliances. SH can help to improve security, comfort, convenience, and energy management. SH aids elderly and disabled people by providing them a safe and secure environment. Basically, SHs can be categorized into two types, namely, wired and wireless systems. Wired systems use optical fibers, bus lines, and power lines. Wireless systems are a combination of a sender and a receiver. At present, many new applications use wireless technology, such as radio waves or infrared, to communicate with other devices. SHs can simultaneously work on wireless and wired systems. SH automation systems have gradually become all-purpose portable controllers that provide convenience to people in their daily routines.
An SH is an environment where heterogeneous and electronic devices are connected together to deliver smart services to individuals. IoT-based SHs are an important part of the proposed and developed smart cities worldwide. An SH is designed 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 monitoring, safety from hackers, remote control, and fire and gas alarms. As sensitive and personal data are managed between SHs, security and privacy solutions must be developed to protect users and corporate data from infringement while ensuring reliable services [28]. Generally, IoT is a relatively new development, which enables existing homes to have strong computing and communication capabilities with the rapid development of the Internet and communication technologies.
In an SH environment, smart appliances can be directly connected to the home network, and the commands are given by users to individually control each appliance. Smart devices can automatically react when commands are given either through voice, smartphone, or computer. Majority of control applications are interrelated to lighting, motion, security, entertainment, and temperature. The use of smartphones and computers are crucial because they are technological benchmarks in the modern era. Users can bring these gadgets anywhere and directly configure them through the Internet to link with online devices. IoT is a catchword in which the objects are interrelated and connected through network devices [29]. IoT is an enormous network of linked objects and humans, which collects and shows the required data and surroundings by using a large number of devices of all sizes. Devices, such as smartphones and computers, are linked to sensors and connected to IoT networks. The data are integrated from various devices and imply analytic Internet waves to show the most valuable data with the devices built to meet specific needs. IoT can precisely specify the useful and useless data. These data can be applied to detect patterns, form recommendations, and detect possible problems that may occur [30]. However, IoT is expected to be an unusual trend in the future. In this section, previous IoT-related studies on SHs are reviewed. A large number of studies have focused on SHs. Accordingly, studies on SHs are reviewed with the proliferation of home appliances in the IoT. The findings and recommendations of this study contribute to a broad understanding of advanced user attitudes toward privacy in SHs. Thus, some of the related work in home automation are provided.
In [7], an SH automation control using Bluetooth and GSM module was proposed. The objective of this study is to help handicapped and elderly people to control home appliances from remote places. People used Bluetooth and GSM wireless communications to control the home. Bluetooth was also used to control the appliances indoor and GSM to control the appliances outdoor. Bluetooth can reduce system costs because most cellphones and laptops have this built-in application. Users can monitor and control the appliances from remote places by sending SMS through GSM. However, such a system has limitations in the two cases. Bluetooth has a limited range and data rate, and GSM is expensive because of SMS costs. Reference [8] proposed SH automation based on sensor technology that can automatically control home appliances using Android-based smartphones as a remote controller. The authors utilized Raspberry Pi as the microcontroller and Bluetooth as the communication protocol. Wi-Fi was used to connect the smartphone to the Raspberry Pi controller, which was connected with smart appliances to the same network AP. All sensors updated their data to a local server via Raspberry Pi. However, the user cannot access the server and cannot directly use the smartphone to send the commands to the Raspberry Pi controller when he is outside the range of Wi-Fi AP.
In [9], a home automation and environmental monitoring system was developed using Arduino Mega 2560 microcontroller with Bluetooth module. Several sensors and switches were used to control home appliances through websites or Android applications. The website controls Arduino by passing information to it as codes. Arduino Mega is more expensive than NodeMCU, and the use of Bluetooth is unsuitable for SH applications due to its limited features. A Message Queuing Telemetry Transport (MQQT)-based home automation system using ESP8266 was presented by [10]. Actuators and sensors were connected to ESP8266, and MQTT was used for control and monitoring. Wi-Fi was used as the communication for the prototype, and devices were controlled by MQQT using ESP8266. Arduino IDE was used to program the ESP8266 module as MQTT. MQTT resulted in low bandwidth and low power consumption. ESP8266 board was cheaper than other microcontrollers, such as Raspberry PI and Arduino UNO. However, only limited functionalities were used for switching. Safety and security issues were ignored, and the developed system was not validated.
A Wi-Fi-based home automation system was designed and implemented by [3]. The developed prototype allowed users to control and monitor the home through Wi-Fi by using Arduino Mega integrated with Android-based application known as Virtuino. However, the prototype had limited connectivity, can only perform local control, and the remote control of the developed system should be enabled based on IoT to allow users to control it using a webserver even when they are not around their house. The prototype also lacked automation of windows and doors and did not consider the safety and security of SH. A similar system using Arduino Mega with IoT was presented by [12]. The interconnected system consisting of an Arduino microcontroller was used to connect to an Ethernet shield, which was connected to a modem with Internet connection. A relay was connected to the devices and through an HTML page with an assigned IP address. However, the system did not consider home surroundings and was not implemented.
Reference [13] reported the design and implementation of flexible approaches to realistic testing in an SH environment Fog-IoT, where this framework was executed and tested with consideration of the specificities of the environment. This study summarized the flexibilities of the framework that allowed IoT application developers to provide flexible services in a cyber-physical, dynamic, and heterogeneous Fog-IoT environment. This framework avoided re-launching of the entire application when failure occurred, limited the spread of failures, and retrieved the application and the infrastructure entities through reshaping and restoration of a consistent state of the application, which included the consistency with respect to the PW. The framework was evaluated on a testbed inspired by [14], resulting in an actual SH application reproduction. Practical experiments showed the recovery and feasibility of the approach with acceptable delay from the user's point of view [31].
Reference [15] used RFID tags to successfully identify various elements within a smart refrigerator. This technique was used to improve home security but required many elements within the home. These elements included home population with RFID tags, which were difficult to implement considering the memory lapses of humans. Although many SHs have utilized IoT, they are vulnerable to various attacks [32]. Thus, home appliances can be connected to a wired or wireless network through a home gateway, where an attack on the home gateway can immediately lead to an attack on the entire home network, which is where an external connection can be made [33]. However, an individual can attack an interconnected device, such as a gateway or field device, by using its network or local communication interface to attack the device and can impersonate a device by using a wrong certificate.
Reference [34] designed and implemented an SH intelligent system based on Ethernet to monitor power consumption in real time through tracking devices in the home using an Intel Galileo Gen 2 board, which can be used in homes and communities. The proposed system worked through voice control with real-time monitoring, which allowed the remote control and monitoring of electrical devices and keys with or without an Android-based application. In other words, this study presented a smart and intelligent system for energy management and security based on IoT with an independent and portable power control, where users can oversee the power management and security of their homes even when they are not around. The power consumption was reduced, and resource utilization was maximized through real-time tracking and monitoring of electrical appliances and home security. Different sensors were used to monitor the devices in real time and maintain home security. The proposed system was remotely controlled and monitored using an Android app through an Internet or intranet connection. The results of this study provided multiple benefits, such as keeping the users in constant touch with their homes with the option to control switching devices through their voices or simple touches on their smartphones, delivering electricity bills at home, and monitoring resource usage to reduce electrical power consumption. The experimental results explained that the proposed system is suitable for energy management and security.
Reference [35] introduced a web-based IoT architecture using GSM to implement SH applications and presented a GSM-based design control system of SH. This work suggested a structure to enable users to monitor and control smart devices through the Internet, where the users give commands through the web, and the user input is converted to GSM-SMS commands. The proposed structure creates an interface between the SH and users through the Internet and GSM and provides a GSM-based wireless connection from the web server to the SH. These commands are sent to the integrated system module, which is placed anywhere in the world and can be directly connected to the devices the through GSM network. In addition, the module is controlled through an IoT agent by the GSM network. The user commands are executed and analyzed using a microcontroller to control any electronic objects, such as lights and home appliances, and sends an acknowledgment. The prototype collects and transmits data through GSM-SMS. The initial test proves that the prototype is capable of monitoring and controlling devices in the published environment and has many advantages, such as zero data loss, rapid delivery, ease of use, flexibility, low cost, and energy efficiency.
Reference [36] introduced an IoT-based system for efficient energy management of devices and security. The main concept of this work is to control home appliances using smartphones through Wi-Fi as the connection protocol, which provides the information on the required software and hardware components. The IoT structure used in smart houses is described as follows: First, all the devices are connected to a device called smart central control, which is linked to the switch for each connected device and thus enables access to each individual device. Subsequently, the device is connected to the Internet through a router, which enables the user to connect as needed.
Reference [37] described a Frugal Labs IoT (FLIP) platform for building SHs that enabled IoT. This work discussed the SH functions and applications and provided the FLIP architecture with SH services through FLIP using the proposed system. The proposed system controls the SH environment based on FLIP, which is flexible and extendable to user needs with security concerns and can be implemented as per user requirements.
Reference [38] presented a system that managed home appliances through IoT, where the temperatures, fire, and gas were controlled by using different sensors, and their values were displayed on an LCD. This type of system is useful when the user is away because it monitors temperature, detects liquid petroleum gas leakage and fire, and provides brief information on household safety when fire and gas leakage are detected. In other words, the gas sensor detects the leakage and immediately alerts the user through an SMS to the mobile phone and the people at home by turning on the siren and displaying the message on an LCD screen. Similarly, an SMS is automatically sent, and the spray engine is turned on when fire is detected. The proposed system determines a range of temperatures, fire, and gases because it uses different sensors. Thus, a message via GSM is received when the range of given values increases, where these values are stored on a server for future reference and displayed on an LCD screen. In addition, the data uploaded to the web server are updated and can be retrieved from anywhere in the world. In summary, IoT is used to enhance the safety standards, where the communication between sensors and transducers is wirelessly resolved by using one chip through Wi-Fi.
Reference [39] provided information on home automation and security systems using different techniques, such as Arduino and GSM and Android applications to control home appliances. The number of people inside the house increases each time an individual enters the house; thus, home automation mode applications are turned on and security lights are also switched on with alarm. Moreover, the number of people that enters the house is displayed on an LCD screen. However, in ''home automation'' mode, the number of people becomes zero, and applications are turned off when the room is empty, making the system power efficient. In addition, anyone can control their home devices through an Android mobile app, which reduces human labor. At the same time, a text message is sent to the homeowner's mobile phone when someone enters under security mode, indicating that a person is inside the home. Thus, the alarm can be turned on through SMS or Android app.
For the sake of brevity, SH systems-related studies have been reviewed, summarized and compared in Table 1. The proposed IoT@HoMe system is also included the comparison to emphasis on its main features with respect to the existing systems. As it is presented in the table, the proposed system aims at overcoming the limitations of the existing system and supported with a real implementation scenario for validation purposes. To the best of our knowledge, only few studies were supported with a real implementation of their proposed systems either in prototype or real house.

III. DEVELOPMENT OF SH PROTOTYPE A. METHODES
This section describes the methodology adopted in this study, which includes systematic organization of different research phases in conjunction with the detailed design and implementation of the IoT@HoMe system and SH prototype. In addition, the selection of components and their integration are explained to fulfill the design objectives. The flowchart in Figure 2 illustrates the conceptual framework of this study. The research starts by identifying the problems encountered in existing SH systems. Most considerable problems of the available systems in the market are their high initial implementation costs and unfriendly user interfaces. The modeling phase focuses on the selection of materials and components for building the SH prototype and developing the IoT@HoMe system. The SH is designed on NX10 software, and the prototype is fabricated using plywood. The design and implementation 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 attached IoT@HoMe system (NodeMCU, relay board, DC source, and others) are installed and tested. After the connection of the microcontroller and components, coding is performed to realize the required tasks. Then, the design is rechecked to identify whether any problem exists with the system functionalities. Testing is conducted to validate the system effectiveness. The system returns to the previous phase, which is enhancement and optimization, when any problem is found. The system is finalized when it exhibits good performance.

B. SH DESIGN
The SH is designed on NX10 software based on the requirements. The prototype design includes master bedroom, bedroom 1, bedroom 2, toilet 1, toilet 2, kitchen, living room, and a porch. Its outside measurement is 100 cm × 100 cm. The windows are closed and opened through a sliding motion. The upper part of the windows uses a steel rod as the base. The doors have a motor installed at the upper side for opening and closing. A motion sensor is connected to the door to detect motions and automatic closing and opening. An RFID sensor is placed outside the house, where the owner scans the access card to enter the house. A tank is installed at a high position to enable smooth water flow. An ultrasonic sensor is placed in the tank to detect the water level. Three metal rods are installed in the center of the tank. The tank is connected outside the house prototype. Overall, the SH prototype is implemented with the IoT@HoMe system. Figure 3 shows the overall design and layout of the SH prototype.

C. SH FABRICATION
The plant layout is designed on NX10, as previously shown. The SH prototype is fabricated using plywood, as shown in Figure 4. The plywood is cut into specific measurements and dimensions using a table saw. The spotted area is drilled to attach the wood using screws. The plywood is attached at the base of the house prototype by using hammer, screws, and wood glue to strengthen the attachment. The SH prototype consists of three bedrooms, namely, bedroom 1, bedroom 2, and master bedroom. Two toilets, kitchen, and living room are included. The plywood is cut based on the design on NX10 software. Plywood is used because it is affordable, widely available, sturdy, and can be cut easily. The prototype is painted to improve its appearance. A primer is applied on the surface before painting with the selected color. A smooth surface is an important feature of the prototype.
Doors and windows are installed with the required mechanisms for door automation. Metal rods are used to ensure that the doors and windows move in a sliding direction. A portable ceiling made of glass is created for transparency purposes. All sensors and actuators are installed in predefined places to sense the considered stimuli. The wiring of lights, sensors, and appliances are installed and arranged on the ceiling and walls, as shown in Figure 5. Plugs are used as terminals for the wiring to facilitate the connection with the portable IoT@HoMe system. A fabricated casing for the developed IoT@HoMe system is attached to the prototype for the monitoring and control of the SH prototype. A water tank is installed and fixed. The prototype is furnished and decorated. Decorations are important in this phase to make the SH look  beautiful and show the identity of the specific places. Decorations, such as beds, cupboards, dining table, and kitchen cabinet, are created and placed in their specific areas.

IV. DEVELOPMENT OF IOT@HOME AUTOMATION SYSTEM A. SELECTION OF COMPONENTS
Hardware and software components are crucial and essential in the design of the IoT@HoMe system for successful and smooth SH automation. The components used to fabricate the IoT@HoMe automation system are listed as follows: NodeMCU ESP8266 Wi-Fi controller board, 12 V DC Power source, 8-channel 5 V DC relay module, HCR04 ultrasonic module, PIR motion sensor, DHT11 temperature and humidity sensor, MQ2 gas sensor, Light-emitting diode (LED) bulbs, Mini fan, 1.5 V DC motor, RFID, 12 V DC brushless submersible water pump, and Plywood for SH prototype. The software components are listed as follows: Nx Siemens software, Adafruit.IO, Arduino IDE software, MQTT protocol server, and If This Then That (IFTTT).
After the selection of components, we design and fabricate the IoT@HoMe automation system. The system hardware components are discussed. NodeMCU (Figure 6), which is a low-cost thumb-sized microcontroller, is used as the central controlling unit in this system. NodeMCU is an open-source software and development board that is embedded with a system-on-chip called ESP8266, which helps users to prototype IoT products using Lua script lines similar to Python and Ruby.
NodeMCU has a 32-bit Tensilica Xtensa LX106 core clocked at 8 MHz. It is a self-contained Wi-Fi networking solution that acts as a bridge between existing microcontrollers to Wi-Fi and is capable of running self-contained applications. NodeMCU can easily connect to components, such as sensors and actuators, through its integrated builtin 20 kb of RAM, 10 GPIOs, 4 megabytes of on-board storage, and TCP/IP. A built-in USB connector links to the computer using a USB cable to upload the codes, which is similar to other development boards available in the market, such as Arduino and Raspberry Pi. Compared with Arduino UNO, NodeMCU has many other good features, such as low cost, simplicity, smartness, a built-in power regulator, and a powerful processor.
An 8-channel 5 V DC relay module is used in this study to perform the switching of various actuators, such as fans, lights, and pumps. The relay is energized or reenergized based on the received signals from the NodeMCU, which receives the commands from the user or the sensors. The relay board overcomes the limitation of the control voltage generated by the controller, and 3.3-5 V DC voltage is used to control 240 V ac appliances.
Several sensors are utilized in this study for different purposes. An HCR04 ultrasonic sensor is used to measure the water level in the water tank. The ultrasonic sensor sends a feed to the NodeMCU to trigger the relay to switch ON the brushless submersible water pump and feed water to the tank when the water level is low. The sensor sends data to the NodeMCU to stop the pump when the water level is full.
A DHT11 temperature sensor is used because of its advantages, such as low cost, long-term stability, excellent quality, fast response, strong anti-interference ability, long-distance signal transmission, digital signal output, relative humidity and temperature measurement, and precise calibration. This temperature sensor is used to detect the temperature and humidity of the room. It triggers the buzzer when the temperature is higher than the room temperature. It also sends data to the NodeMCU, which sends a command to switch ON the mini fan in the prototype or air conditioning (AC) system in the real implementation of the system.
A PIR motion sensor is utilized to detect the presence of 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/close the doors or to switch ON/OFF the lights. In addition, PIR sensor output can trigger the buzzer and send notifications to the server when a person is detected for security purposes when the homeowner is away. Similarly, MQ2 gas sensor is utilized in this system to detect gas leakage at home. This gas sensor is sensitive to a range of gases and is used indoors at room temperature. An analog signal is sent to the NodeMCU and IoT server and notifies the user when smoke is detected. This sensor is used to increase the safety of SH against any gas leakage or fire. Another sensor for security purposes is RFID, which is used to identify the user access card ID and trigger the relay to open the door. This sensor only allows people who have predefined access cards to open the doors and updates their information to the server via NodeMCU, thereby increasing the security level of SH.
Our system uses several actuators as examples for real home appliances. These actuators can be extended or replaced with any home appliance, such as TV, ovens, refrigerators, washing machines, and AC systems. The consideration for such replacement is the rated current of the utilized relay board based on the connected loads. LED bulbs are used as the main lighting source in the developed SH prototype because these bulbs are energy efficient and compatible with our system and modern houses. Low-power bulbs are used in the SH prototype, which require only 30-60 milliwatts to operate. These LED bulbs use more durable and shockproof materials compared with other glass bulbs. The lights are distributed in different parts of the home and connected to the relay board to be controlled by the IoT system.
In our study, a mini axial fan is used in the kitchen for ventilation purposes. Additional fans can be utilized in the rooms for cooling. An AC system can be connected in actual situation with a similar principle of operation. Users can turn ON/OFF the fan through Adafruit IO server or MQTT Dash by energizing/deenergizing the related relay. Similar actuators for cooling can be directly controlled by the temperature sensor as another option for automation. In addition, a 1.5 V DC motor is used to automatically control the sliding doors. The motor is controlled by the relay and microcontroller. Users can open the door by tapping their access card with RFID.
At the beginning of the experiment, the motor speed is controlled with a potentiometer at 5 V. However, the battery voltage rapidly drops. A MOSFET is used to control the motor speed by connecting the MOSFET between the motor and switching power supply. The MOSFET temperature increases, and the potentiometer is burned. This condition occurs because of high voltage supply, causing the damage of the MOSFET and potentiometer. An MD10-POT motor driver is used that enables the users to easily control the DC motor direction and speed. Users can instantly control the DC motor when the battery and DC motor are connected to MD10-POT. The motor speed is successfully controlled with the implementation of the MD10-POT motor driver. Similar motors can be used in real houses with different ratings to control the sliding doors and windows. In our project, we use one motor as an example. Another actuator, a 12 V DC brushless submersible water pump (Figure 7) is used to pump the water to the tank when the water level is lower than the minimum threshold value and stops the water pump when the water level reaches the maximum threshold value. This water pump is controlled by the signal obtained from the ultrasonic sensor, which updates the data to the NodeMCU and controls the relay connected to the pump.
System software components are selected and developed. Adafruit.IO (Figure 8) is an open-source and free IoT server that utilizes the data. Adafruit.io is easy to use and allows simple data connection with minimal programming. In this study, Adafruit.io is used as the IoT server for our system to monitor home conditions and control home appliances through the Internet with MQTT protocol. The sensing data, which include sensor measurements and relay status (ON or OFF), are uploaded to the server through the  NodeMCU microcontroller. The command is sent to the NodeMCU through the MQTT server when users remotely control the system using their laptops or smartphones. The NodeMCU sends a signal to switch ON/OFF to the relay switches based on what the users pressed on Adafruit.io web GUI using their fingertips.
MQTT is a TCP-based publish messaging protocol designed for lightweight machine-to-machine communications. At present, these IoT devices and sensors communicate with each other on the back end without human knowledge. MQTT is originally developed by IBM based on a hub-andspoke model. Basically, an MQ broker is required to enable MQTT. The MQ broker is a full-featured, message-oriented middleware broker that allows clients to send short one-hop messages to the broker and receives messages when they subscribe to a certain topic. Furthermore, IFTTT is utilized in the software development of our project. This free web-based service is used to create chains of simple conditional statements called applets. An applet is triggered by the changes that occur within other web services. In this project, IFTTT operates on Adafruit IO web that uses a platform to send notifications to the user's smartphone when an abnormal situation is detected by Adafruit IO. In addition, it is used to connect Adafruit with Google Assistant. For example, a notification is triggered through IFTTT when the temperature sensor exceeds the normal value. Users can obtain up-to-date information on their house through IFTTT. Users can use Google Assistant to control their home appliances.
Arduino IDE is an application that is used to write codes and uploads them to the NodeMCU board. In this project, Arduino IDE is used for coding, debugging, and testing the functionalities of the IoT@HoMe system and its components. Arduino IDE has other features, such as a debugging area in case of abnormal conditions to support various Arduino boards, additional libraries, and a serial monitor for communicating with the board. Arduino libraries are usually expressed as dot CPP files based on software abstraction called wiring. Wiring allows the easy control of hardware ports through simple functions without consulting data sheets and being delayed in pin mapping. Thus, Arduino uses the bits of C and C++, but the general flow and structure of the code are heavily based around C.

B. DESIGN ENHANCEMENT AND OPTIMIZATION
The implemented hardware system in the SH prototype is evaluated, and the design is enhanced and optimized when any error exists until the system can perform well. This phase is important to improve the system performance and detect errors. Thus, the problems encountered during the previous phases are identified and fixed. This step is repeated until a successful implementation is achieved. For example, before starting the real implementation of our system, LED bulbs are used as replacements for actuators to read the output. After compiling all the programming codes into NodeMCU, the actuators, such as fan, motors, buzzer, bulbs, and relay module are used for the real testing of the breadboard, as shown in Figure 9. All the installed wiring connections are checked with a multimeter. The wires are marked and named to help the user to clearly verify every part of the system connection. Furthermore, the wires are isolated and covered with black tape 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@HOME
The main contribution of this work is the development of an innovative market-ready portable controller (IoT@HoMe) that can be implemented in real houses to continuously monitor home conditions and comfortably manage home appliances through the Internet regardless of time and place. In addition to the proposed algorithm (Algorithm 1) for home automation and control that implemented in NodeMCU microcontroller.
In this study, NodeMCU is selected for the SH prototype because of its capabilities and cost effectiveness. Several sensors, such as temperature and humidity, gas, RFID, ultrasonic, and motion sensors, are used to ensure that the system is smart and safe. Several experiments for individual sensors and actuators are conducted on the breadboard before starting the final implementation and fabrication of the developed system. Thus, the proper materials and components for the system are selected.
The IoT@HoMe is designed to be portable; thus, it can be implemented (plug and play) in the fabricated prototype and suitable to be attached to a real house. Connectors are used on the wire terminals for easy plug and play, as shown in Figure 10. The IoT@HoMe system is installed in the SH prototype and retested after the testing of hardware implementation. The system is enhanced and optimized when any error exists until the system can fully function as proposed. Figure 10 shows the two microcontrollers working smoothly with the sensor and relay in the developed IoT@HoMe portable automation system.
As part of software implementation, two GUIs are developed for monitoring and controlling the SH prototype. The first GUI is a web-based dashboard integrated to the Adafruit.IO web server. This GUI includes several indicators to display the obtained readings from the implemented sensors in addition to several switches to control various actuators. The second GUI is a smartphone-based interface using MQTT mobile apps that are available on Google Play. The two GUIs are synchronized, and users have two options for monitoring and controlling the SH. Additional details on the developed GUIs and their usage in our IoT@HoMe automation system are presented in Section V.

D. OVERALL SYSTEM ARCHITECTURE
The overall system architecture of the developed IoT@HoMe automation system is illustrated in Figure 11. In this study, the NodeMCU sends the data collected by the sensor to the MQTT server (Adafruit.IO) and responds to the commands given by the user from the server to the system, such as ON/OFF switching of actuators similar to LEDs. The NodeMCU uses the embedded Wi-Fi module to connect to the Internet. Users can monitor the data on the server by logging in using any electronic device that can access the Internet and control lights, fans, and motors. RFID is used to control the door relay by tapping the access card. Users receive notifications through IFTTT on their smartphones based on the sensor readings. For example, an output signal is transmitted to NodeMCU when the temperature is higher than 30 • C, which triggers IFTTT to send a notification to the user. The PIR motion sensor triggers the buzzer and sends a notification when a stranger enters the house. The gas and temperature sensors update the data to NodeMCU and trigger the ventilation and cooling fans. The ultrasonic sensor collects the data through the sensor and controls the water pump relay. All sensors are connected to the input GPIOs of NodeMCU, and actuators are their output. The system operates based on the developed coding in the microcontroller. Samples of sensors and actuators are used in the developed prototype. However, this system can be expanded by including many sensors and actuators in actual implementation. The flowchart of the system operation mechanism is shown in Figure 12.

V. EXPERIMENTAL RESULTS AND VALIDATION
This section presents the results to verify the functionalities of the implemented IoT@HoMe system in the fabricated SH prototype. Thus, IoT@HoMe successfully controls home appliances (lights, doors, pumps, fans, and others) and monitors various stimuli, such as temperature, humidity, gas,  water level, and motion using mobile phones/laptops through Adafruit IO, MQTT Dash, and Google Assistant. Users can monitor and control the SH prototype anytime and anywhere by connecting to the Internet. One of the achievements of this study is the utilization of artificial intelligence in controlling home appliances by enabling Google Assistant voice commands to help people with disabilities. Users have multiple options by developing multi-dashboards and can utilize any device by connecting to the Internet regardless of time and location to monitor and control the home.
NodeMCU is connected to the predefined Wi-Fi network to continuously connect the IoT@HoMe system to the Internet. Users can use any mobile device, laptop or personal computer to log in to Adafruit IO, MQTT Dash, and Google Assistant applications to access the developed control system, which uplinks the sensor data from NodeMCU and downlinks the used commands to NodeMCU. Thus, users can control all electrical appliances and monitor the motion, temperature, gas, water level, and humidity of the house. Figure 13 shows the GUI for the monitoring of SH through Adafruit IO and MQTT Dash. Users can obtain up-to-date information from the sensors through the Adafruit IO platform or MQTT Dash. In addition, users can switch ON/OFF the light bulbs using the buttons on the GUI. Electrical appliances, such as bulbs, fans, and water pumps, can also be controlled and monitored using Adafruit IO and MQTT Dash.
Google Assistant is an add-on functionality that enables the control of home appliances using voice commands, as demonstrated in Figure 14 (a). Furthermore, all utilized sensors can be used in the next step to fully automate the light and home appliances to reduce energy consumption. The data obtained from the sensors are utilized for subsequent processing to increase the safety and security of SHs. IFTTT is utilized with Adafruit IO to define the limits for abnormal sensing data and sends notifications to users' smartphones when these values exceed the predefined limits. For example, the bar color changes from yellow to blue when the gas sensor exceeds the value of 650, the data are sent through IFTT, and a notification is sent to the user's smartphone, as shown in Figure 14 (b). A DHT22 sensor can detect abnormal temperature that may be due to a fire at home, and Adafruit sends feeds to IFTTT to notify users on their smartphones when the temperature exceeds the threshold. The motion sensor can detect any motion at the main entrance and notifies the residents. Such functionality can increase the safety and security of SHs.
An RFID card to access the home is the automation and security consideration in this study. The main gate of the home is automatically opened using a DC motor when a user tags the RFID card. This developed circuit performs effectively and RFID detects the right access card, which turns on the relay circuit that powers the motor to open the door. The RFID circuit is connected to NodeMCU with the motion sensor to control home security through IoT.
The effectiveness of the developed system is validated by evaluating its functionalities on the fabricated SH prototype. All electrical appliances and sensors can be controlled and monitored using Adafruit IO, MQTT Dash, and Google Assistant. Figure 15 shows the top view of the SH prototype and the attached IoT@HoMe controller that enables home automation through the IoT platform. Maintaining rapid and accurate reading of the sensors is one of the issues encountered during the testing phase in this study. In the beginning, a 16-channel analog multiplexer was utilized to increase the number of analog ports due to the limited number of NodeMCU pins. The sensors connected to the multiplexer did not provide accurate readings during testing, and switching ON/OFF appliances was delayed. We could not solve this issue after several experiments, and we added another NodeMCU controller to replace the multiplexer and overcome the problem. Subsequently, the system without analog multiplexer was tested, and all sensors were functioning well and provided accurate readings to the server. The switching delay of home appliances was reduced, and the response was fast. Another issue encountered during system implementation was related to the RFID system. For example, relay circuit was shorted when it was connected to battery wires. This issue was solved by placing an insulator on top of two circuits to prevent any possibility of short circuit. Using NodeMCU as the controller in our project was an advantage and a challenge at the same time. In existing home automation systems, several microcontrollers, such as Arduino Mega, Arduino UNO, Raspberry Pi, and NodeMCU, have been utilized.
In our previous study, Arduino UNO with ESP8266 Wi-Fi was used. However, after several experiments, the system still failed to perform remote control over the Internet and was not utilized in this study. We performed an experiment on NodeMCU, which worked perfectly and fulfilled the requirements of this project. The NodeMCU can be easily controlled by the computer and smartphone through the Internet. In addition, the NodeMCU facilitated editing and uploading the codes using Arduino IDE whenever necessary with the micro USB port still in place. However, low power supply and limited number of ports occurred due to the large number of relays and sensors used in this project. Thus, we used two NodeMCUs. The first NodeMCU was used to control the relay and monitor the sensor, whereas the second NodeMCU was utilized for security system implementation, which included RFID and motion sensor.
An Adafruit account was created to enable control and monitoring of the SH. This account can be logged in through the webserver where the application for the smartphone is not provided. The Adafruit account did not fulfill this requirement due to the objective of the project, which was remote control of SH. To address this situation, an MQTT DASH smartphone application was created to connect and link with the Adafruit account. This application has a simple GUI design, where its color, title, and size can be selected by the user. Users can easily control and monitor their SHs within a few seconds through this application.
This project was implemented using Google Assistant to control the switch ON/OFF button. This implementation used IFTTT to trigger the Adafruit system. Users can easily control their homes by speaking to Google Assistant on their smartphones. Google Assistant triggers Adafruit with specific feeds and turns ON/OFF the light. This function helps elderly people to use mobile applications and improve their mobility. Google Assistant was implemented because of its user-friendly features, which are updated with each new generation and are applicable for use by elderly people.

VI. CONCLUSION AND FUTURE WORK
This study presented the design, fabrication, and implementation of a portable, user-friendly, and low-cost automation system for SHs based on IoT. The developed IoT@HoMe system can be easily implemented in a real house to allow real-time monitoring of home conditions and control of home appliances. Several sensors and actuators were connected to the NodeMCU controller, which updated the data to the IoT server. The obtained data from the sensors (temperature, humidity, motion, gas, and RFID) can be monitored via MQTT Dash mobile application and Adafruit IO Web via laptops/PC. For security and safety purposes, the user receives notifications on their mobile phones about any abnormal condition at home via the IFTTT server. Control of home appliances can be easily and efficiently conducted by using MQTT/Adafruit IO GUI or through voice commands using Google Assistant. The results of this study are promising, and the developed system can increase the safety, security, intelligence, and comfort of users. The proposed system can be expanded with additional sensors and actuators. The developed system can also be improved to make it suitable for future commercialization. Our next study will use solar panels to power the control box rather than using batteries to make the proposed system energy efficient and environment friendly. We will optimize all circuits using printed circuit boards to save space and minimize the risk of connection losses or short circuits.  He is currently on implementing a proactive system that would complement the current practice of reactive investigation. He is a member of the following organizations: the IEEE Computer Society and the High Technology Crime Investigation Association (HTCIA). His research interests include, but not 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 of Technology.