Smart Home IoT System by Using RF Energy Harvesting

IoT system becomes a hot topic nowadays for smart home. IoT helps devices to communicate together without human intervention inside home, so it is o ﬀ ering many challenges. A new smart home IoT platform powered using electromagnetic energy harvesting is proposed in this paper. It contains a high gain transmitted antenna array and e ﬃ cient circularly polarized array rectenna system to harvest enough power from any direction to increase lifetime of the batteries used in the IoT system. Optimized energy consumption, the software with adopting the Zigbee protocol of the sensor node, and a low-power microcontroller are used to operate in lower power modes. The proposed system has an 84.6-day lifetime which is approximately 10 times the lifetime for a similar system. On the other hand, the proposed power management circuit is operated at 0.3V DC to boost the voltage to ~ 3.7V from radio frequency energy harvesting and manage battery level to increase the battery lifetime. A predictive indoor environment monitoring system is designed based on a novel hybrid system to provide a nonstatic plan, approve energy consumption, and avoid failure of sensor nodes in a smart home.


Introduction
Smart home services become the key feature of an environment of this era where data is collected from different sensors and control them. Smart home support services such as security and access control across multiple devices are related to the home [1]. These applications may be service timing oriented; thus, they need to save and manage the energy consumption [2]. Internet of Things (IoT) should be able to integrate several and diverse terminal systems to develop oversize of digital services from smart homes. IoT is a good solution to connect everything by wireless rather than physically connected. Many different features are required to complete and integrate the system [3]. The choice of the antenna system is more important since it is a crucial compo-nent in these smart devices that end in the node. To create an effective antenna performance in IoT system, many factors should be examined as size of the antenna, radiation pattern, and gain [4]. Electromagnetic wave is used nowadays in empowering implantable biomedical devices, wireless charges, WSN nodes, etc. Radio frequency harvesting is necessary for biomedical devices especially when it is planted inside the body, as increase lifetime of the replacement of the batteries in their structure. Radio frequency becomes a popular type of energy harvesting; this is due to the fact that the environment around us is full of RF waves extended from 300 MHz to 3000 MHz in different wireless applications such as broadcasting, mobile, satellite, and Wi-Fi communications [5]. This abundant energy can be reused as harvested and stored in batteries for the IoT applications.
The spectrum of smart home applications is vast, and many have contributed in different areas of this spectrum. Many researchers have developed smart home applications based on wireless sensor networks and Internet of Things [6][7][8][9]. For example, in [6], a smart home control system based on Zigbee wireless network is proposed. The proposed system uses an embedded network gateway to bridge the local Zigbee network with the Internet. Instead of just controlling the environment, the proposed smart home monitoring system in [7] concentrates on finding patterns in the recorded data and analyzing resident's behavior based on it. In addition to the work developed in [8], many have taken the concept of smart home step further to develop smart building systems [9][10][11][12]. Others have developed systems for indoor ambient monitoring in general, as in [13,14].
Generally, the rectenna is the key element in RF energy harvesting. Rectenna is an antenna integrated with rectifier. Antenna arrays are capable of capturing more RF power than single elements due to the larger aperture area [4,5,[15][16][17]. In [4,5], antenna arrays are used as receiving units in different rectenna structures to harvest RF energy. There are different techniques to increase the harvested RF energy. Smart antenna [18][19][20] is one of these techniques that uses beam steering to suitable directions of radiation. However, this technique is very complicated structure as well as expensive. Second used technique is the efficient CP dielectric resonator antenna array fed by cavity-backed substrate integrated waveguide (SIW) which has been proposed in [5]. In [4], a wideband left-handed metamaterial (WBLHM) substrate has been used to improve the array gain and provide wideband CP operation. Wider half power beamwidth (HPBW) and better coverage can be achieved by using 1 × 4 beamwidth-enhanced antenna array [4]. Nonuniform amplitude and phase distributions are applied, and two auxiliary antennas are added besides the 1 × 4 antenna array in order to maximize the power harvested efficiency [5]. In [5], the antenna wireless sensor consists of two layers in wireless sensors node but it is difficult to be integrated with the rectifier. Furthermore in [18], the antenna is designed on one layer; the maximum gain is small (3 dBi) as well as it is not applied to IoT system. In addition in [19], the antenna consists of a multilayer system which makes it expensive, complex, and not easy to be integrated with the rectifier. Concerning the lifetime of the system using energy harvesting in IoT system, it is found to be 84.6 days which is approximately 10 times the lifetime for similar system. However, Table 1 in [21] shows that the lifetime of the system using a dual linearly polarized antenna array is to be 50.08 days.
Different designs have been presented for CP arrays [5,15,16]. A wideband left-handed metamaterial (WBLHM) substrate has been used in [5] to improve the array gain and provide wideband CP operation. However, two layers are needed with a separation of about 27 mm. In [15], a simple and highly efficient rectenna was presented which has been constructed on a loonly about 100 MHz for dual-band CP radiation which is realized in w-cost commercial FR4 substrate. The achieved axial ratio bandwidth is only about 100 MHz for dual-band CP radiation which is realized in [16] by stacking the slotted-circular-patch (SCP) on the tapered-slit-octagon patch (TSOP) and the microstrip feedline with metallic via to SCP. A complicated structure with multilayers was proposed which increased the rectenna size. In this scenario, a simple and wideband CP rectenna is proposed. As stated before, novelty of the design lies on the simplicity to implement a high-efficient energy harvesting rectenna using a single layer structure with high gain and wideband CP performance. There are many research works considering the problem of time series prediction, but few of them tackling the problem of optimization deep learning models using bioinspired algorithms [22][23][24][25]. In [22], three different traditional machine learning techniques were used for forecasting the next 24-hour indoor environment quality parameters. In [23], feature selection methods and genetic algorithm (GA) were utilized to improve the performance of long short-term memory (LSTM) deep learning model for prediction of electric load. Also, in [24], a hybrid approach for forecasting stock market is proposed; this approach integrates GA and LSTM network to determine the optimal time window size and topology for the LSTM network. Another optimization technique was used to finetune the parameters of the echo state network for time series prediction in [25], where particle swarm optimization (PSO) algorithm is utilized to pretrain some fixed weights values of the network.
In this paper, an integrated cloud-based IoT system is presented for smart homes. The proposed system is powered using the RF energy harvested from surrounding ambience. The overall system that integrates all of its IoT components in home is shown in Figure 1. The experimental results that demonstrate the performance of the different components of the proposed smart home IoT powering harvesting radio frequency at Bluetooth and 4th mobile generation are done. The smart home control action plan combines both instantaneous sensor readings and foreseen environmental conditions to overcome faults in the sensors' readings. The prototypes not only extended lifetime of the system but also its ability to effectively control smart home.
The organization of the paper is as follows. We discuss the related literature in Section 1. Section 2 explains the proposed smart home system architecture. In Section 3, we detailed the implementation of components and the system prototype, while Section 4 evaluates the system performance. Finally, Section 5 concludes the paper work.

Proposed Smart Home System Architecture
The design of complete RF energy harvesting system is introduced. The energy harvesting system consists of a high gain 2 × 2 linearly polarized antenna array (LPAA) as a dedicated transmitted source and 2 × 2 circularly polarized antenna array (CPAA) as a receiving component in the rectenna structure. The receiving array is integrated with highefficiency rectifier circuit in order to complete the rectenna array structure. The main advantage of the proposed 2 × 2 CPAA is to obtain a constant output DC voltage regardless of the polarization of the harvested waves. Usually, the harvested electromagnetic field is linearly polarized at all available mobile frequency bands and at the Wi-Fi 2.45 GHz 2 Journal of Sensors band. However, in the environment of the indoor and outdoor, the multipath effects are taking place which make a depolarization. This leads to decrease the efficiency of the energy harvesting system because the received EM waves have unknown angle of incidence. This problem can be solved by using CP antennas. The novelty of the design lies in the simplicity to manufacture of a high-efficiency energy harvesting rectenna using a single layer structure with high gain and wideband CP performance. The use of layered approach to design and implement an energy efficient IoT system with reduced overall energy consumption such that it can be powered using the harvested RF energy is shown in Figure 2. As the sensor node is the only element in the system that is RF energy powered, we optimize its energy consumption by the following: (i) Utilizing a low-power microcontroller and configuring it to operate in lower power modes as much as possible, thereby minimizing the sensor node's wake up duration (ii) Optimizing the sensor node's software to exploit the tasks and semaphores of the used Texas Instruments real-time operating system (TI-RTOS). This improves the energy efficiency of the node (iii) Adopting the Zigbee protocol as the internode communication protocol since Zigbee has low power consumption compared to other widely used wireless protocols (e.g., Wi-Fi). We assemble a prototype of the developed system. Excessive experiments show that the smart home system as shown in Figure 1 effectively controls lighting and cooling devices, thereby reducing the home's power consumption. Furthermore, the system has an 84.6-day lifetime which is approximately 10 times the lifetime reported in existing literature The design and implementation of the power management and voltage regulation circuit accepting as low as 0.3 V DC from the energy harvesting rectifier circuit are to not only boost the voltage to proper voltage level needed by the batteries (~3.7 V) but also manage its level to be between the undervoltage and overvoltage ratings of the battery to ensure long lifetime of the batteries. Additional regulation stage is added to support a different needed battery voltage level (~3.2 V).
A predictive indoor environment monitoring system is developed which is based on a novel hybrid system based on gated recurrent unit (GRU), grey wolf optimization (GWO) algorithm GRU-GWO, and fuzzy logic system. The developed system uses GWO to find optimal time lags, number of predicted steps, and number of layers for GRU predictive model with optimized performance. The GWO optimization algorithm has the ability to achieve very competitive results in terms of improved local optima avoidance.

Journal of Sensors
Moreover, the proposed system depends on the fuzzy control optimization for energy conservation in heating, ventilation, and air conditioning (HVAC) systems.

Design Methodology
In this section, the system design and the implementation details of the proposed system are presented. We start with the proposed RF energy harvesting system, the designed rectennas, and power management unit. Then, the design of the various used IoT nodes is given. Finally, we discuss the proposed cloud-based artificial intelligence system developed to control the home ambience.

RF Energy Harvesting System
Design. An RF energy harvester is generally composed of receiving antenna, band pass filter, matching network, rectifier, and terminal load [21]. The full system presented includes a transmitter of 2 × 2 linearly polarized antenna array (LPAA) and a 2 × 2 circularly polarized antenna array (CPAA) receiving rectenna of RF energy harvester.
3.1.1. Transmitting Antenna Design. A 2 × 2 linearly polarized antenna array (LPAA) with high gain is designed and fabricated to be used as electromagnetic waves transmitting source. The proposed array consists of four identical elements of circular patch with V-shaped slot integrated over rectangular slot ground plane. The elements arranged in a planar array structure and excited with same phase. The configuration of the antenna element has many advantages as wide impedance bandwidth with high radiation intensity in both directions. The array is designed on the Roger RO4003C substrate with dielectric constant of 3.38, dielectric loss tangent of 0.0027, substrate height of 0.813 mm, and the copper thickness of 0.035 mm. The photos of the top and bottom view for the fabricated transmitting antenna array are shown in Figure 3. The proposed 2 × 2 LPAA has total area of 118:8 × 156:8 mm 2 . The details of the physical parameters of the proposed transmitting antenna array system are optimized and published in [26].

Receiving Rectenna
Design. The proposed rectenna consists of a 2 × 2 CP antenna array (CPAA), a matching circuit, and a rectifier circuit. The basic antenna element, in the array structure, is a coplanar waveguide (CPW) slot antenna that consists of a main slot radiator, a grounded-L strip, a stepped impedance matching stub, two chamfered corners for CP behavior, and asymmetric U-shaped strip acting as a perturbed element; more details of the designed antenna are in [21]. Furthermore, the single element was optimized and published in [27]. Optimization was carried on the separation between elements for obtaining wide axial bandwidth and higher gain. The 2 × 2 array as shown in Figure 4 has an equal phase feeding network in order to obtain high gain besides the CP operation as well as high radiation efficiency. The designed array is built on RO4003C substrate with a dielectric constant of 3.38, thickness of 0.813 mm, and loss tangent of 0.0027. The feeding network of the 2 × 2 array is corporate microstrip lines that perform impedance matching and delivering equal phases to the elements. The four elements are in the same orientation and are fed by a microstrip line from the right side of the array. The spacing between the elements is 0.768 λ0 at a central resonance frequency of 2.45 GHz. In order to equate the phases between the elements, the lengths of transmission lines have been turned around in a meander shape to deliver equal phase to all elements. Three-equal division microstrip Wilkinson power dividers are used to provide the equal amplitude distribution for the 4 elements. A ground plane is placed below substrate for the Wilkinson divider. In addition, the output phases for the feeding network ports are almost equal with a maximum phase difference of 2.8°. In order to connect the feeding system to the elements, a microstrip-line-to-CPW transition using via holes [28] is applied. An extra substrate section for normal ground plane layer is added at the top of the array for providing ground symmetry and more uniform radiation pattern. The total size of the 2 × 2 array is 178 × 148 mm 2 .
A rectifier circuit is designed and implemented for providing the conversion process. The topology of the conversion circuit used in this paper is a half wave rectifier circuit that has been investigated in [29,30]. The circuit is designed using the Schottky diode SMS-7630 [31] which has a very high sensitivity to the low values of the received power. The rectifier circuit is matched with the 2 × 2 CPAA at 2.45 GHz, in order to achieve maximum power transfer between the 2 × 2 CPAA and the half wave rectifier circuit. The process of designing the rectifier circuit has been done using the Advanced Design System (ADS) simulator. Figure 4 depicts the fabricated 2 × 2 rectenna array.
The schematic diagram of the proposed rectifier circuit is studied in [30]. The circuit is designed on the same Roger RO4003C substrate. Figure 5 shows the fabricated rectifier circuit. A short-ended stub, 1 pF capacitor, and 10 nH inductor are used to match antenna input impedance of 50 Ω with rectifier circuit input impedance. The rectifier circuit consists of a single Schottky SMS7630 diode, smoothing capacitor, and load resistance of 10 kΩ. The output voltage and rectenna efficiency variations versus the frequency are shown in Figure 6. The rectenna system has maximum efficiency of 60% at 2.45 GHz.   Journal of Sensors the RF harvester followed by the rectifier has low voltage (in the orders of 0.6 V~1 V) which boosted to a stable voltage level 3.7 V that is needed to be supplied to the smart home node battery.
Voltage regulation also is added to support the facility of using a battery of a different level 3.2 V when needed; this voltage regulation stage is enabled through a switch to support working with the two types of the batteries; the boosting  The BQ25504 also covers suitable range of output voltage that starts from 2.2 V to 5.5 V; it also provides safe operation for both the battery and the load by controlling the design of the undervoltage and overvoltage of the output voltage from the BQ25504 through the proper design of the resistances R uv1 , R uv2 , R ov1 , and R ov2 , respectively, shown in the schematic of the power management circuit in Figure 7, where the undervoltage and overvoltage thresholds are determined from the following equations.
where V BIAS is of typical value 1.25 V. Figure 8 shows the voltage regulation part, while the final compacted manufactured part for the power management and voltage regulation unit (PMVRU) is shown in Figure 9.

IoT System
Design. The IoT system design is based on five layers of IoT architecture driven from [12]. As shown in Figure 2, the layers of the architecture are end devices layer, network connectivity layer, edge computing layer, cloud computing layer, and security and privacy layer.
3.3.1. End Devices Layer. The end devices layer has two main functionalities. The first one is to sense the home's environment (temperature, light, CO 2 , etc.) using the sensors attached to it. The second functionality is to control devices like heat, ventilation, and air conditioning (HVAC) and lighting systems based on the actions issued by upper layers in the system to control the home's environment. Two types of end devices are designed to implement these functionalities: sensor nodes and actuator nodes.
The sensor node is the device that measures the home's environment and wirelessly sends these measurements to the network gateway through the network connectivity layer. Our sensor node design differs from all previous related works [6][7][8][9][10][11][12][13][14] by being self-powered using the RF harvested energy. Thus, it is entirely designed to consume the minimum possible amount of power.
The main component of the sensor node is the microcontroller unit (MCU). The one used is CC2650 Simple Link multistandard 2.4 GHz ultralow power wireless MCU from Texas Instruments (TI). The energy harvesting is one of the typical applications of TI's Simple Link MCUs [32]. There are many features in these MCUs making it suitable for energy harvesting applications specifically and ultralow power applications in general. The most important feature is the flexible power modes available with the most interesting one which is the shutdown mode. In this mode, the CC2650 only consumes 100 nA by turning off all hardware components waiting for external interrupt event to happen to wake it up and enters the active mode [33].
The sensors used in the sensor node are temperature and humidity, ambient light, carbon dioxide, and passive infrared (PIR) motion detection. In addition to these sensors, external nanotimer is used to wake up the MCU periodically to collect sensor readings and send them to the network gateway. The specific part numbers of the components used are shown in Table 2. The mentioned shutdown mode is used with the external timer and the PIR sensor to keep the MCU and the sensors in the lowest possible power mode. The MCU wakes up only periodically and if motion is detected in front of the PIR sensor.
When the MCU wakes up, it sends commands to the attached sensors to do the measurements and send them back to it. Then, the MCU sends the received measurements to the gateway using the network module. An important part of the node is the firmware. The firmware is developed in a way that minimizes the processor active time. TI offers a    Figure 7: The power management circuit schematic. 6 Journal of Sensors real-time operating system (TI-RTOS) to be used with all of its MCUs [32]. Although TI-RTOS is a compact powerful solution that includes all devices' drivers and software components required in development [33], it is very lightweight and simple making it suitable for both fast prototyping and product development. The actuator node is the device that implements the desired changes in the home environment by controlling the operation of HVAC system and lighting system based on the decisions issued by upper layers in the system. Specifically, the node is connected to air cooler, dehumidifier, and LED lamp. The air cooler and dehumidifier are turned on and off. On the other hand, the LED lamp is controlled by pulse width modulated (PWM) signal. Although the actuator node is connected to devices that are powered by mains electricity, the MCU is the same one used in the sensor node. This eliminates any possible compatibility issues that could happen in the network connectivity layer.

Network Connectivity
Layer. The network connectivity layer is responsible for delivering messages between the nodes and the edge of the network which is implemented on the network gateway. The implementation of the layer includes choosing a network protocol and transceiver that implements it. Thus, this layer is implemented on the sensor nodes, the actuator nodes, and the gateway. The protocol used is Zigbee protocol. Zigbee protocol is a high-level communication protocol that targets low-power applications like the one in hand. A distinctive feature of the protocol is the mesh network topology [34]. Zigbee routers could be used to connect end devices together and with the gateway by rerouting messages received from a router to another router closest to the final destination of the message [35]. In our system, the actuator nodes have no restrictions on power consumption; thus, they could be used as Zigbee routers.

Edge Computing
Layer. The edge computing layer's main role is to collect measurements from sensor nodes and send proper commands to the actuator nodes. Although this role could be done directly by the cloud computing layer, the existence of a local device at the edge of the local network eliminates any drops and latencies that may be caused by the Internet connection to the cloud servers. The layer's functionalities are implemented on Raspberry Pi 3 Model B. On the top of Raspbian OS installed on the Raspberry Pi, Node-RED (rapid events developer) framework is used to build the actual software application that implements the required functionalities. To connect the Raspberry Pi to Zigbee network, XBee Zigbee S2C network module is used and configured as Zigbee network coordinator. This makes it possible to remotely configure all Zigbee devices in the network from the gateway itself.

Cloud Computing
Layer. The measurements gathered by the gateway in edge computing layer are sent in real time to a cloud server where it is stored in a database for historical archiving and further analysis. The database is accessible through the Internet making it possible to see historical measurements of the home environment or the real-time measurements being received by the cloud server. Data analysis methods, to be discussed in the next section, are used to analyze the data and find patterns in it. The results of the data analysis methods are sent back to the gateway in the edge computing layer to optimize the control of home environment.

Security and Privacy
Layer. This layer is concerned in secure and private connection between devices in different layers. Any communication between devices in the architecture uses security features available in the protocol used. The actual implementation of these features is out of our work scope. In the network connectivity layer, Zigbee standard offers many security features like data encryption and central trust center [14]. The connection between the gateway in the edge computing layer and the cloud servers is protected using hybrid text transfer protocol secure (HTTPS) protocol.

Deep Learning-Based Time Series Prediction.
Although the IoT system can perform actions immediately especially time-critical actions based on the collected data, all the data is uploaded to the cloud for further analysis such as indoor air quality parameters prediction. This can be used to provide a nonstatic plan for monitoring HVAC system with the aim of optimizing energy consumption, avoiding sensors node failure via using the predicted data as an input to the forecasting models, and providing a comfortable environment for occupants. Selecting optimal parameters for GRU model enabled us to prevent overfitting and resulted in more accurate and stable forecasting models. Therefore, we developed a hybrid approach based on GRU and GWO techniques to forecast the next 24-hour indoor air quality parameters. Figure 10 describes the general block diagram of the proposed monitoring system for indoor air quality parameters. The proposed system consists of three main phases, namely, data preprocessing, hybrid GRU-GWO time series forecasting, and fuzzy logic-based alarming and controlling phases.

Data Preprocessing Phase.
A pivotal step to achieve better performance and accuracies of deep learning-based model is data preprocessing [36]. It is about handling inconsistent, missing, and noisy data. Our dataset comes from our sensor's node, which is the indoor air quality parameter of a smart home. It has measurements of indoor temperature, humidity, and CO 2 with an hour sampling rate. Further data preprocessing comprised the following.
(1) Data cleansing: eliminate duplicated data entry      [36,37]. Therefore, we propose a hybrid approach of GRU network integrating GWO technique to improve the time series forecasting accuracy via finding the optimal time window size and number of GRU. GWO is a bioinspired technique which mimics the hunting mechanism and leadership hierarchy of the grey wolves. It can be used for solving optimization problems [38,39]. Moreover, particle swarm optimization (PSO) will be used also for optimization to be compared against GWO. PSO is a widely used evolutionary technique for solving a wide range of optimization problems. It mimics the social behavior of birds [40]. In this phase, a multistep time series forecasting approach based on LSTM network encoder-decoder schema is proposed [36,39].

Fuzzy Logic-Based Control
Phase. This phase is aimed at maintaining the comfort atmosphere of the user, as uncontrolled indoor air quality has a negative effect on human health and activity. So, we use fuzzy logic to control temperature, humidity, and CO 2 . For temperature control, current temperature and temperature error which are the difference between current temperature and user preferred temperature are used as inputs to the fuzzy control, while we have both heat fan speed and cool fan speed as outputs. The temperature ranges from 7 to 45 degrees and is divided into 7 categories, namely, cold, cool, warm, normal, hot, very hot, and extra hot. The temperature error ranges from -26 to 18 and is divided into 7 categories, namely, negative extra-large, negative very large, negative large, negative small, zero, positive small, and positive large. Table 3 shows samples of temperature control rules. Similarly, for humidity, current temperature and current humidity are used as inputs to the fuzzy control, while we have both humidifier and exhaust fan as outputs. The humidity ranges from 0 to 100% and is divided into 6 categories, namely, dry, not too dry, suitable-1, suitable-2, not too wet, and wet. The current temperature ranges from 16 to 28 degrees and is divided into 2 categories, namely, range-1 and range-2. Table 4 shows samples of humidity control rules. For CO 2 , a simple rule is used. If the value of CO 2 is larger than predefined threshold then, turn on ventilation system else nothing is needed.

Prototype Performance Evaluation
The prototype was assembled which integrates the different system components detailed in Section 3. In this section, we present an extensive set of experiments that demonstrate the various performance aspect of the proposed RF energy harvesting IoT smart home system.

RF Energy Harvesting Performance.
To verify the simulated results, the proposed antenna for transmitter and receiver rectenna are fabricated.

Transmitting Antenna.
A comparison between the simulation and measurement results for the 2 × 2 LPAA is shown in Figure 11. It can be seen that the array has a multi bandwidth behavior at 1.8, 2.1, 2.45, and 2.6 GHz. Also, there is a very good agreement between the simulated and measured results. The gain and the radiation efficiency variations with the frequency are shown in Figure 12. It can be seen that the 2 × 2 LPAA has 8.3 dBi gain value at 2.45 GHz. The array has 90% radiation efficiency at 2.45 GHz. The 3-D radiation pattern for the array is illustrated in Figure 13 which indicates that the array radiates in both sides (forward and backward directions).  Figure 14. A return loss of 24.508 dB has been achieved at 2.45 GHz. In addition, the 3-D radiation pattern for the CPAA is shown in Figure 15(a). The radiation intensity is greatly enhanced at the normal direction to the array since all elements are arranged to radiate at the same direction. Front and back radiation can be noticed, and two main lobes at 0°and 180°are depicted. In order to check the CP operation, the axial ratio has been calculated. The achieved axial ratio as a function of frequency is illustrated in Figure 15(b). The array achieved 3 dB axial ratio bandwidth of 1.24 GHz (from 1.73 GHz to 2.97 GHz). In addition, the array gain is greatly enhanced. Figure 16 illustrates the achieved gain as a function of frequency of 2 × 2 CPAA with equal phases. The gain, directivity, and radiation efficiency of the array are 9.902 dBi, 10.31 dBi, and 91.13%, respectively, at 2.45 GHz. This array is suitable for dedicated RF energy harvesting applications where the positions of the source and receiving antennas are known, and consequently, this array can collect power from specific direction when it is used as the receiving antenna in a rectenna structure. In addition, circularly polarized rectennas are used due to their ability to obtain constant DC power at random polarization angles.
The proposed rectenna is tested at different measurement distances from the 2 × 2 transmitting antenna. Table 5 lists the values of the obtained DC voltages at different frequencies. Table 5 shows that our proposed RF energy harvesting system has a larger number of covered frequency bands, higher gain, higher rectenna efficiency, simple one-layer structure, and superior operation, as compared to different types of polarization techniques. Table 1 gives a comparison between the RF energy harvesting system proposed in this paper and the literature [5,18,19].

Power Management Unit Performance.
Simulation is conducted at first using TINA-TI for the power management part based on the power management voltage regulation unit (PMVRU) unit on the TI BQ25504, and then the Proteus 8.0 is used to verify the voltage regulation output level against different input voltage levels for the voltage regulation part of the PMVRU unit; output voltage at battery reaches 3.7 V after some transients at first few milliseconds which is shown in Figure 17. Simulation results follow a fixed nature after saturation with different input voltage levels as shown in Figure 18, while the practical results show slight variations but converge to the same value of 3.7 V; the practical results are tested on a AA-3.7 V-lithium ion 4200 mAh battery, and using a DC source of different input voltage levels and maximum current limit of 1 mA is shown in Figure 18   Journal of Sensors discussed. Then, we demonstrate the overall performance of the system through set of experiments. The sensor node is the only self-powered component in the system. Thus, the lifetime of the overall system is bounded by the lifetime of the sensor node. As mentioned in IoT system design section, the sensor node operates in two power modes: sleep mode and active mode. Most of the time, the sensor node is in sleep mode and it wakes up in two cases: when the external timer sends an interrupt signal (periodic measurements) and when someone moves in front of the motion detector as it sends an interruption to the MCU. The lifetime of the sensor node is estimated by measuring power consumption in both power modes; then use these values with the power budget available to calculate the time until the batteries of the node need to be charged. Based on average current consumption, the active mode could be divided into three phases with current consumption in each one, respectively: 49.16 mA, 30.96 mA, and 11.16 mA. In the sleep mode, the node consumes only 1.46 mA on average. For the sensor node, it takes only 500 ms to wake up, collect the measurements, and send them to the gateway. The node is powered by three 1200 mAh LiFePO 4 batteries with 3.2 V output. Using these conditions, the calculated lifetime is 84.6 days. It is worth mentioning that the harvested RF energy will dramatically increase the lifetime of the node.
Next, experiments were presented to validate the ability of the system to control home's environment. The first experiment shows the different motion detection profiles in the system. As a proof of concept, we defined three motion detection profiles: automatic light control, manual light control, and security alarm. In the first profile, the light is controlled automatically by the system based on the existence of inhabitants in the room. The second profile gives the user the ability to change light intensity manually from system's dashboard without depending on the motion detection signal received from the sensor node. In security alarm profile, lights are controlled manually from the dashboard, but when motion is detected in the room, an alarm siren is initiated. Figure 19 shows light intensity in the room and motion detection signal when different profiles are selected. First, the profile activated was automatic light control at which lights are turned on as long as motion is detected in the room. At 5:43 PM, the profile is changed to manual light control; the light intensity is changed manually without depending on the motion detection signal.
The next experiment illustrates the system's ability to control relative humidity in the home. The value of relative humidity is kept in a predefined range set by the user using system's dashboard. Figure 20 shows the relative humidity value with signal sent to the dehumidifier and how the system keeps relative humidity inside the predefined range. At time 5:29 PM, the value of relative humidity passed down the lower threshold then the dehumidifier is turned off. Then when the relative humidity value reached the upper threshold at 5:33 PM, the system turned on the dehumidifier again to lower the relative humidity.

Time Series Prediction
Performance. The proposed hybrid GRU-GWO time series prediction approach depends on the collected data of our sensor nodes (temperature, humidity, and CO 2 readings at hourly rate) over a period of 120 days. Root mean square error is calculated to validate the performance of the proposed hybrid GRU-GWO approach for time series prediction using the following equation.
where a is the actual value, p is the predicted value using hybrid GRU-GWO approach, and N is the total number of values. Table 6 shows configuration parameters for both GWO and PSO optimization algorithms. Table 7 represents the average RMSE of the predicted indoor temperature, humidity, and CO 2 on testing dataset using both GRU-PSO and GRU-GWO for optimizing time window size and GRU parameters, while Table 8 shows the RMSE of each parameter individually. Although the results of GRU-PSO and GRU-GWO are close, the shortcoming of the PSO algorithm is that it has the problem of ease of falling into the local optimum. But unlike PSO, in GWO algorithm, the position of the best solution is assessed by three solutions not a single solution. So, GWO can significantly reduce the probability of falling into the local optimum. From our experiment, it is noticed that the GRU-PSO convergence curve has no improvement starting from iteration number 5, unlike the convergence curve of GRU-GWO which keeps improving.

Conclusion
In this paper, a complete IoT system application is designed and fabricated using EM energy harvesting. The proposed system is consisting of complete RF energy harvesting system starting from dedicated transmitted high gain 2 × 2 linearly polarized array antenna and 2 × 2 circularly polarized rectenna array as a receiving component in a rectenna structure. The receiving antenna array is integrated with efficient rectifier circuit in order to improve the rectification efficiency. An energy efficient IoT system is designed to reduce the overall energy consumption. As the sensor node is optimized, its energy consumption is reduced by using a low-power microcontroller and operating in lower power modes. In addition, optimizing the sensor node is achieved by the sensor node's software and using operating system (TI-RTOS) with adopting the Zigbee protocol. The system has an 84.6-day lifetime which is approximately 10 times the lifetime reported in existing literature. On the other hand, a power management unit was designed with voltage regulation circuit operated at 0.3 V DC from the energy harvesting rectifier circuit to boost the voltage to~3.7 V and manage battery level to ensure long lifetime of the batteries. Then, a predictive indoor environment monitoring system was developed based on a novel hybrid system with gated recurrent unit, grey wolf optimization algorithm GRU-GWO, and fuzzy logic system to provide a nonstatic plan for IoT sensor system to reduce energy consumption and avoid the problem of sensor nodes' failure.

Conflicts of Interest
The authors declare that they have no conflicts of interest.

Acknowledgments
This work is funded by the National Telecommunications Regulatory Authority (NTRA) and the Ministry of Communications and Information Technology (MCIT), Egypt,  Figure 20: Relative humidity measured in the home and system's ability to keep its value in the predefined range.