Power Reduction with Sleep/Wake on Redundant Data (SWORD) in a Wireless Sensor Network for Energy-Efficient Precision Agriculture

The use of wireless sensor networks (WSNs) in modern precision agriculture to monitor climate conditions and to provide agriculturalists with a considerable amount of useful information is currently being widely considered. However, WSNs exhibit several limitations when deployed in real-world applications. One of the challenges faced by WSNs is prolonging the life of sensor nodes. This challenge is the primary motivation for this work, in which we aim to further minimize the energy consumption of a wireless agriculture system (WAS), which includes air temperature, air humidity, and soil moisture. Two power reduction schemes are proposed to decrease the power consumption of the sensor and router nodes. First, a sleep/wake scheme based on duty cycling is presented. Second, the sleep/wake scheme is merged with redundant data about soil moisture, thereby resulting in a new algorithm called sleep/wake on redundant data (SWORD). SWORD can minimize the power consumption and data communication of the sensor node. A 12 V/5 W solar cell is embedded into the WAS to sustain its operation. Results show that the power consumption of the sensor and router nodes is minimized and power savings are improved by the sleep/wake scheme. The power consumption of the sensor and router nodes is improved by 99.48% relative to that in traditional operation when the SWORD algorithm is applied. In addition, data communication in the SWORD algorithm is minimized by 86.45% relative to that in the sleep/wake scheme. The comparison results indicate that the proposed algorithms outperform power reduction techniques proposed in other studies. The average current consumptions of the sensor nodes in the sleep/wake scheme and the SWORD algorithm are 0.731 mA and 0.1 mA, respectively.


Introduction
Precision agriculture (PA) is a supervision procedure that uses information technology to improve crop production and quality. The use of wireless sensor networks (WSNs) in agriculture to monitor climate conditions and to provide farmers with a considerable amount of information has been (i) The power consumption of the sensor and router nodes of a wireless agriculture system (WAS) is modeled. (ii) The power consumption and data communication of the adopted WAS are minimized, and battery life is prolonged using two power reduction techniques, namely, the sleep/wake scheme and the SWORD algorithm. Considerable power saving is achieved by the WAS when the proposed SWORD algorithm is used. (iii) Our results are compared with those of similar studies in terms of power consumption to verify the performance and efficiency of the proposed sleep/wake scheme and SWORD algorithm.

Related Studies
Researchers have developed several power reduction techniques in their search for an infinite power source for sensor nodes to achieve a limitless life span. This section presents several WSN power reduction methods that can be used in PA. Early studies on energy-efficient PA can be traced back to Zhu et al. [6], who developed a WSN based on an agricultural monitoring system. They discovered that the effective communication distance between nodes is more than 200 m in an open-field environment and the average packet loss rate is 7.6%. These authors adopted a sleep/wake algorithm to reduce the power consumption of the WSN. The received power became attenuated and sinusoidal when the distance between a transmitter and a receiver was increased. The sensor node woke up for 30 s every 4.5 min. The power consumption of the sensor node relative to that in traditional operation (i.e., 80 mA) was 53 mA. A power saving of 33.75% was achieved. Zou et al. [25] proposed methods to optimize data transmission and to extend network life by using a prediction algorithm for the energy harvested from a solar cell via environmental shadow detection. The mechanisms sustained network activities in an uninterrupted and efficient manner in the experimental study. However, a solar cell system is generally irregular and extensively influenced by weather changes. The power consumption of a sensor node in conventional operation is 80 mA, whereas power consumption is minimized based on the duty cycle (DC), which is set to a fixed value. The peak current consumption of the sensor node is 4.5, 18, and 20 mA, which corresponds to 10% DC in empty mode, 30% DC in lacking mode, and 100% DC in sufficient mode, respectively. Srbinovska et al. [20] collected environmental parameter data from distributed WSNs. They adopted a sleep/wake strategy to reduce the power consumption of the sensor node in a WSN. The current consumption of the sensor node is minimized to 142 µA relative to that in traditional operation, which consumes 24 mA, by switching between sleep and active modes in low DC.
Nguyen et al. [26] observed the impacts of climate change on crop fields by using WSNs. The authors adopted a sleep/wake algorithm to reduce the power consumption of WSNs. The data collection method improved the power consumption of the network. The advantages are low cost and ubiquitous monitoring. Moreover, the system can be widely applied to agriculture in developing countries. The Zigbee wireless protocol was configured to operate for 30 s every 15 min (i.e., DC equal to 3.3%). Therefore, the 129 mA power consumption of the sensor node in traditional operation is reduced to 17.25 mA when the DC strategy is adopted. Eto et al. [27] charged batteries via solar energy generation to solve the problem of covering an agricultural field with mobile sensor nodes. The results exhibited a 4% reduction in the number of nodes and a 10% extension of operation lifetime compared with the conventional method. The selection of the leader node was performed by calculating residual energy. In this case, the power consumption of the node can be extended to 90 working days (i.e., consumes 11.11 mA at a battery capacity of 1000 mAh). Fourie et al. [28] designed a fish pond management system for fish conservation by using an autonomous solar-powered system. Zigbee can enter into sleep mode to improve the power consumption of WSNs. The results indicated that the system can successfully control the pond's temperature and dissolved oxygen level. The use of a maximum power point tracking (MPPT) charging controller allows the platform to utilize energy higher than 8 W. However, the components of the system, including a solenoid valve, a stepper motor, and a sensor node hardware, consume a high amount of power, i.e., approximately 4 W. Meanwhile, the sensor node components (i.e., sensor, processor, and RF module) exhibit a low power consumption of approximately 207 mW relative to the total consumption. Therefore, the current consumption of the sensor node is 81.5 mA. When a solar cell with DC charging is adopted, the power efficiency is improved by 31%. However, power efficiency increases to 98% when MPPT is used.
Bapat et al. [29] developed a WSN application for crop protection from animal intrusion in a farming field. A sleep/wake scheme was adopted to conserve the power of the WSN. Successful results were obtained from laboratory-level trials of the systems. However, the authors discovered a few technical faults in the circuit components. The power consumption of the system was 27 W/h, but the calculations of the current consumption of the nodes in the WSN were not considered in their study. Villarrubia et al. [30] constructed practical organizations of agents that can connect with one another while observing crop irrigation. Fuzzy logic was adopted to accurately control watering quantities. The major finding of this research was that heterogeneous data from the surrounding can be merged via sensor node measurements. The proposed system based on fuzzy logic consumes 4.5 L of water per day relative to traditional operation, which consumes 7.3 L a day. Thus, 37% water saving is achieved over 30 days. The use of a solar cell also allows the continuous charging of the sensor node battery. Navarro-Hellín et al. [31] monitored soil water status and irrigation water by developing a practical application to optimize water resources in irrigated agriculture. They adopted a sleep/wake scheme to reduce the power consumption of the General Packet Radio Service (GPRS) node. The sending and sampling rates in the achieved tests were adjusted to 30 min and 15 min, respectively. The disadvantage of this system is its short life span of 13.35 days. However, the average current consumption of the entire GPRS node is 5.93 mA relative to that in traditional operation, where the GPRS modem alone consumes 400 mA during data transmission.
De la Concepción et al. [24] presented an efficient WSN platform that is appropriate for agricultural applications and can be used in remote areas. A sleep/wake algorithm was proposed to limit the energy consumption of the WSN platform. The results showed that the nodes are autonomous, scalable, and easy to locate and relocate. However, the proposed system has a limited communication range because the transceiver uses an omnidirectional antenna. Nevertheless, the sensor node captures and transmits an image for 6 min and then sleeps for 54 min, with a low power consumption of 0.8 µA. Subsequently, sensor node life is extended to 8 days. Moreover, current consumption is improved to 4.427 mA compared with that in conventional operation, where the current consumption of the camera and CC1110 is 270 mA and 31 mA, respectively, in the transmission mode. Cambra et al. [32] discovered, examined, and auto-calibrated imbalances in the pH levels of the nutrient solution used in hydroponic agriculture. The results indicated that the design of the system improved water quality in hydroponic agriculture by implementing and testing a smart system for bicarbonate control in irrigation. The advantages include low power consumption, low cost due to the use of a low-power wireless protocol (i.e., nRF24L01) while ensuring the adopted coverage area, and the provision of multimedia services because of the adoption of mobile devices or computers. However, the number of nodes in the network is limited to five. Each node wakes up for 15 s to transmit their data and then returns to sleep for 255 s (i.e., DC is equal to 15/270 = 5.555%). Accordingly, the power consumption of the sensor node is reduced from 49 mA (in traditional operation) to 2.807 mA (with the sleep/wake strategy).
Ilie-Ablachim et al. [33] monitored environmental parameters for greenhouse applications. They used the MoniSen module to introduce a new granularity level for PA monitoring applications. They adopted a distributed sensor architecture for large-scale applications by developing fully functional software and hardware. The sleep/wake algorithm was applied to reduce power consumption. Moreover, the sensor node in the system was configured to transmit data for 48 s every 24 h (i.e., DC is equal to 3.3%). Consequently, battery life is prolonged to 4408 h. The total current consumption of the system is 0.544 mA relative to that in traditional operation, where the sensor node consumes 46.145 mA with a power efficiency of more than 90%. Zaier et al. [34] tested and developed a smart irrigation system based on WSN and solenoid electrovalves. The smart irrigation system was implemented in 14 farms. The power consumption of the WSN was improved by the proposed sleep/wake strategy by using periodic sleeping cycles. The power consumption of the system is extremely low in sleep mode. The power consumption of the XBee Pro S2 module of the sensor node is 177 mA in active mode, 3.5 µA in sleep mode, and 7 mA in active mode for the soil moisture sensor. Power consumption is improved and battery life is extended through the power-down mode of XBee.
All the aforementioned studies are summarized in Table 1. The table highlights the improved power consumption and the related power reduction technique or scheme in each work. The table also provides the hardware, including wireless protocol, microcontroller or processor, climate condition sensors, battery type and capacity, and power and voltage of the solar panel, adopted in each study. The future of the agriculture industry can be revolutionized by relying on computerized systems, advanced sensors, and energy-efficient wireless networks instead of using the traditional agriculture system that is proven to be inefficient, labor intensive, and has low productivity.

WSN Topology
In this work, we aim to reduce unnecessary energy consumption and to prolong the battery life of the network, along with the sensor and router nodes that are distributed across a farm field. Figure 1 shows the proposed topology of the wireless nodes in the farm field with a layout of 200 × 200 m 2 , which represents the available tested area in this study. This area can be potentially extended to actual medium-size commercial crop farm areas. The farm field consists of 16 sensor nodes, four router nodes, the main router node, and the coordinator node. Each sensor node is responsible for collecting climate conditions, such as air temperature, air humidity, and soil moisture, from a square area of 50 × 50 m 2 . The sensor node is located at the center of the square area. Four sensor nodes communicate wirelessly to one of the router nodes. The collected data (i.e., climate conditions) from the sensor nodes are transmitted wirelessly to the central router via the router nodes. The main router node passes the climate conditions to the coordinator node, which is located at the base station (farmhouse). Our proposed topology considers only fixed router nodes for communication between sensor nodes and the coordinator node. In addition, the changing roles of the router nodes are not considered, as shown in Figure 1, because the focus of this study is the physical layer approach for achieving energy efficiency, whereas changing roles involve higher layers, such as media access control (MAC) and network. Thus, the changing roles can provide a future opportunity to continue the current study to further understand the benefits of energy savings based on cross-layer dimensions.
The distance between the farmhouse and the crop field is approximately 200 m. Therefore, an appropriate wireless communication protocol, such as Zigbee (XBee S2C), must be used to ensure data delivery. This module can theoretically guarantee 1.2 km in outdoor environments [38], low power consumption, low cost, and battery operation in WSNs. In terms of power consumption, Zigbee (XBee S2C), which consumes 36.9 mW as reported in [13], is better than LoRa, SigFox, WiFi, and GPRS, which consume 100, 122, 835, and 560 mW, respectively. Nevertheless, the current work can be extended to cater to future wireless technologies, including LoRa.

Hardware Configuration of the Proposed WAS
The range covered by the individual node and the total area of the crop field can be set based on the number of nodes to be deployed in the field. Table 2 presents the hardware for the sensor node of the proposed WAS. Figure 2 shows the hardware of the sensor, router, and coordinator nodes. It presents a simple hardware implementation of the WAS, which involves minimal interface and connection between sensors to the microcontroller and the wireless links. The digital humiditytemperature (DHT11) sensor and the soil moisture sensor require only three wires for a physical interface with the microcontrollers: (i) supply voltage, (ii) ground, and (iii) output data. The first two wires are used to power the sensors by +5 V, whereas the third wire is the analog and digital serial output signals for the soil moisture sensor and DHT11, respectively. The microcontroller of the sensor and router nodes communicates with the Zigbee wireless protocol through a single-wire data bus.
The sensor and router nodes are fixed on a surface that is 1.5 m above the ground (Figure 3), which is the recommended height in [39], to avoid the effect of the Fresnel zone or signal reflection. The sensor and router nodes in the tested area are powered by a battery. The coordinator node is connected to a laptop/PC in the base station. Therefore, this node is unaware of the energy supply. The PC is equipped with graphical user interface (GUI) software to monitor the climate conditions in the farm field. The sensor and router node structures are designed to work day and night. At daytime, the components, sensors, microcontroller, and XBee S2C are powered by solar energy. Furthermore, a solar cell provides energy to charge the batteries of the sensor and router nodes. The solar panel is positioned in front of the sensor node box at a low inclination angle (20°-30°) to orient the solar cell panel relative to the sun. In addition, two power reduction algorithms (i.e., sleep/wake and SWORD) are adopted to further reduce the power consumption of the sensor and router nodes. At nighttime, the components only use battery energy as supported by the two power reduction algorithms. For WSN simplicity and to reduce the complexity of the proposed WAS, one sensor node, one router The main router node passes the climate conditions to the coordinator node, which is located at the base station (farmhouse). Our proposed topology considers only fixed router nodes for communication between sensor nodes and the coordinator node. In addition, the changing roles of the router nodes are not considered, as shown in Figure 1, because the focus of this study is the physical layer approach for achieving energy efficiency, whereas changing roles involve higher layers, such as media access control (MAC) and network. Thus, the changing roles can provide a future opportunity to continue the current study to further understand the benefits of energy savings based on cross-layer dimensions.
The distance between the farmhouse and the crop field is approximately 200 m. Therefore, an appropriate wireless communication protocol, such as Zigbee (XBee S2C), must be used to ensure data delivery. This module can theoretically guarantee 1.2 km in outdoor environments [38], low power consumption, low cost, and battery operation in WSNs. In terms of power consumption, Zigbee (XBee S2C), which consumes 36.9 mW as reported in [13], is better than LoRa, SigFox, WiFi, and GPRS, which consume 100, 122, 835, and 560 mW, respectively. Nevertheless, the current work can be extended to cater to future wireless technologies, including LoRa.

Hardware Configuration of the Proposed WAS
The range covered by the individual node and the total area of the crop field can be set based on the number of nodes to be deployed in the field. Table 2 presents the hardware for the sensor node of the proposed WAS. Figure 2 shows the hardware of the sensor, router, and coordinator nodes. It presents a simple hardware implementation of the WAS, which involves minimal interface and connection between sensors to the microcontroller and the wireless links. The digital humidity-temperature (DHT11) sensor and the soil moisture sensor require only three wires for a physical interface with the microcontrollers: (i) supply voltage, (ii) ground, and (iii) output data. The first two wires are used to power the sensors by +5 V, whereas the third wire is the analog and digital serial output signals for the soil moisture sensor and DHT11, respectively. The microcontroller of the sensor and router nodes communicates with the Zigbee wireless protocol through a single-wire data bus.
The sensor and router nodes are fixed on a surface that is 1.5 m above the ground (Figure 3), which is the recommended height in [39], to avoid the effect of the Fresnel zone or signal reflection. The sensor and router nodes in the tested area are powered by a battery. The coordinator node is connected to a laptop/PC in the base station. Therefore, this node is unaware of the energy supply. The PC is equipped with graphical user interface (GUI) software to monitor the climate conditions in the farm field. The sensor and router node structures are designed to work day and night. At daytime, the components, sensors, microcontroller, and XBee S2C are powered by solar energy. Furthermore, a solar cell provides energy to charge the batteries of the sensor and router nodes. The solar panel is positioned in front of the sensor node box at a low inclination angle (20 • -30 • ) to orient the solar cell panel relative to the sun. In addition, two power reduction algorithms (i.e., sleep/wake and SWORD) are adopted to further reduce the power consumption of the sensor and router nodes. At nighttime, the components only use battery energy as supported by the two power reduction algorithms. For WSN simplicity and to reduce the complexity of the proposed WAS, one sensor node, one router node, the main router node, and the coordinator node are practically implemented to monitor the climate conditions in the farm field. node, the main router node, and the coordinator node are practically implemented to monitor the climate conditions in the farm field.

Zigbee Data Packet Length
The transmitted data packets for the sensor, router, and main router must be determined to node, the main router node, and the coordinator node are practically implemented to monitor the climate conditions in the farm field.

Zigbee Data Packet Length
The transmitted data packets for the sensor, router, and main router must be determined to identify the time consumption of the XBee S2C wireless module. The active transmission time (tTX) of

Zigbee Data Packet Length
The transmitted data packets for the sensor, router, and main router must be determined to identify the time consumption of the XBee S2C wireless module. The active transmission time (t TX ) of XBee S2C, which is based on the Zigbee wireless protocol, can be expressed as [42]: where t SA is the transient time of XBee S2C from sleep mode to active mode. XBee S2C consumes 10.2 ms when pin sleep is used [43]. L denotes the data packet length of XBee S2C in bits, and D indicates the XBee S2C data speed of 250 kbps for the XBee S2C module using the 2.4 GHz industrial, scientific, and medical frequency band. The data packet length consists of 31 bytes (overhead) and 35, 47, and 95 bytes (payload) for the sensor, router, and main router nodes (shown in Figure 4a-c, respectively). In the current work, the overhead bytes are constant. Moreover, the data bytes differ for the sensor, router, and main router nodes, which rely on the parameters of climate conditions. The data packet length and the active transmission time of the adopted nodes can be described as follows:

1.
Sensor node: The data packet length of each sensor node consists of 35 bytes (i.e., 280 bits). The payload includes 4 bytes, namely, (i) identification (ID) of the sensor node, (ii) air temperature data, (iii) air humidity data, and (iv) soil moisture data ( Figure 4a). Therefore, the active transmission time for each XBee S2C in the sensor node based on Equation (1) is 11.32 ms.

2.
Router node: The data packet length of each router node consists of 47 bytes (i.e., 376 bits). The payload includes 16 bytes, i.e., 4 bytes for each sensor node, where each router node collects data from four sensor nodes ( Figure 4b). Therefore, the active transmission time for each XBee S2C in the router node based on Equation (1) is 11.704 ms.

3.
Main router node: The data packet length of the main router node consists of 95 bytes (i.e., 760 bits). The payload includes 64 bytes, i.e., 16 bytes for each router node, where the main router node collects data from four router nodes ( Figure 4c). Therefore, the active transmission time for XBee S2C in the main router node based on Equation (1)  The data packet length consists of 31 bytes (overhead) and 35, 47, and 95 bytes (payload) for the sensor, router, and main router nodes (shown in Figures 4a-c, respectively). In the current work, the overhead bytes are constant. Moreover, the data bytes differ for the sensor, router, and main router nodes, which rely on the parameters of climate conditions. The data packet length and the active transmission time of the adopted nodes can be described as follows: 1. Sensor node: The data packet length of each sensor node consists of 35 bytes (i.e., 280 bits). The payload includes 4 bytes, namely, (i) identification (ID) of the sensor node, (ii) air temperature data, (iii) air humidity data, and (iv) soil moisture data ( Figure 4a). Therefore, the active transmission time for each XBee S2C in the sensor node based on Equation (1) is 11.32 ms. 2. Router node: The data packet length of each router node consists of 47 bytes (i.e., 376 bits). The payload includes 16 bytes, i.e., 4 bytes for each sensor node, where each router node collects data from four sensor nodes ( Figure 4b). Therefore, the active transmission time for each XBee S2C in the router node based on Equation (1) is 11.704 ms. 3. Main router node: The data packet length of the main router node consists of 95 bytes (i.e., 760 bits). The payload includes 64 bytes, i.e., 16 bytes for each router node, where the main router node collects data from four router nodes ( Figure 4c). Therefore, the active transmission time for XBee S2C in the main router node based on Equation (1)   The data packet length of XBee S2C includes a maximum of 127 bytes (31 bytes overhead and 96 bytes payload) [45]. Therefore, the adopted Zigbee wireless protocol using XBee S2C is adequate to achieve the proposed WSN topology in the current work, as presented in Figure 1. The maximum data packet length of 95 bytes is used to monitor the climate conditions of the agricultural field.
Delay in WSNs denotes the difference between the time when the information is produced in The data packet length of XBee S2C includes a maximum of 127 bytes (31 bytes overhead and 96 bytes payload) [45]. Therefore, the adopted Zigbee wireless protocol using XBee S2C is adequate to achieve the proposed WSN topology in the current work, as presented in Figure 1. The maximum data packet length of 95 bytes is used to monitor the climate conditions of the agricultural field.
Delay in WSNs denotes the difference between the time when the information is produced in the sensor node and the time when the information arrives at the sink node. Being delay-sensitive poses a challenge to WSNs, particularly with multihop counts [46]. Most information is delay-tolerant in the majority of agriculture applications [47,48]. In addition, a small proportion of delay-sensitive information exists. Being delay-sensitive is essential when multihops are used in WSNs and the data is required to be monitored in real time. In our application, however, climate conditions (i.e., temperature, humidity, and soil moisture) are delay-insensitive because the data are collected and transmitted from the sensor node to the coordinator node through a single router node. Evidently, delay is not a major concern in such PA case. Therefore, delay is not considered in the current study.

SWORD Algorithm
The SWORD algorithm ( Figure 5) is designed and implemented in the microcontroller Atmega 328p of the sensor node to reduce power consumption. The SWORD algorithm proceeds as follows: 1.
The microcontroller Atmega 328p initially wakes up from sleep mode.

2.
All the components of the sensor node (i.e., sensors, microcontroller, and XBee S2C) are supplied with energy from a solar cell (12 V/5 W) at daytime to charge their batteries. The batteries are used to supply power to the sensor node at nighttime.

3.
The microcontroller measures the climate conditions (i.e., air temperature, air humidity, and soil moisture).

4.
The microcontroller measures the difference between the previous and subsequent soil moisture values (soil moisture difference = |previous value − subsequent value|) to check whether redundant data exist.

5.
When the difference between the two values is zero or less than or equal to 5% (threshold level), the sensors and the XBee S2C module enter sleep mode. Furthermore, the microcontroller goes to power-saving mode to save the energy of the sensor node. In such case, the soil is wet and no data are transmitted from the sensor node to the router node. In addition, irrigating the soil is unnecessary, thereby leading to water saving. The components of the sensor node remain in sleep mode until the threshold level is exceeded. A slight difference in value of 5% is selected to obtain a precise decision. In agriculture, irrigation systems depend on soil moisture measurements, wherein soil is considered a crucial part of planning tools for conducting irrigation [49,50]. When soil is dry, the irrigation system is operating; otherwise, the irrigation system is off (i.e., wet soil). Therefore, the SWORD algorithm is determined on the basis of soil moisture measurement in the current study. By using soil moisture, irrigation is scheduled to sustain soil moisture conditions equivalent or close to the field capacity to satisfy the required crop water requirements. In addition, several sensors are being considered for future work to capture relevant parameters related to agriculture, such as soil temperature, soil conductivity, salinity, leaf wetness, and rainfall sensors. 6.
By contrast, all the components of the sensor node remain awake when the difference between the two values is greater than 5%. Therefore, the measured data in Step 3 are transmitted from the sensor node to the coordinator node via the router nodes. After the transmission process is completed, the sensors and XBee S2C module enter sleep mode. Furthermore, the microcontroller goes to power-saving mode to save the energy of the sensor node. The sensor node transmits the measured data about climate conditions every 15 min (900 s) for 2 s (i.e., extremely low DC 2/900 = 2.222 × 10 −3 ). The sensors require 1 s to measure the data on climate conditions. In addition, another second is required to transmit the data to the related router node, including the active transmission time of XBee S2C (i.e., 11.32 ms, as shown in the previous section) and the microcontroller. This situation indicates that 2 s are consumed by each sensor node to measure and transmit climate conditions to the related router node, as shown in the timing diagram in Figure 6. Consequently, each sensor node wakes up for 2 s and sleeps for 898 s. 7.
The four sensor nodes communicate using one router node ( Figure 1). Therefore, the allocated time for each router node is 16 s. From the 16 s, 8 s is for the four sensor nodes, whereas 8 s is for the guard time (2 s after data transmission of each sensor node to avoid data collision), as shown in Figure 6. The router nodes, such as RN1, RN2, RN3, and RN4, collect and transmit the data of the four sensor nodes to the main router node within 16 s and then enter sleep mode. Consequently, each router node wakes up for 16 s and sleeps for 884 s (i.e., extremely low DC 1.778 × 10 −2 ), as shown in Figure 6. 8.
The main router node gathers the collected data of the four router nodes and transmits these data to the coordinator node within 64 s. The main router node then enters sleep mode for 836 s after data transmission (i.e., DC is 7.111 × 10 −2 ), as shown in Figure 6. 8. The main router node gathers the collected data of the four router nodes and transmits these data to the coordinator node within 64 s. The main router node then enters sleep mode for 836 s after data transmission (i.e., DC is 7.111 × 10 −2 ), as shown in Figure 6.    Total time= 900 s Figure 6. Timing diagram of the sleep/wake scheme of the sensor and router nodes.

Sensor Node Power Consumption Model
The life span of sensor nodes is the time that lapsed from the first transmission until the sensor nodes lose their sensing capability. The life span of a WSN relies on the current consumed by each node in the network. The power consumption of sensor nodes depends on the number of components. In this study, the sensor nodes include air temperature and humidity sensors embedded into the DHT11 sensor, a soil moisture sensor, the Atmega 328p microcontroller as a standalone system for reducing power consumption, and the XBee S2C wireless protocol. Among the sensor nodes, XBee S2C is considered the main power consumer [51]. When the consumption values of these components are added, the total current consumption of the sensor node can be expressed as Equation (2): where ISoil is the current consumed by the soil moisture sensor, IDHT is the current consumed by the air temperature and humidity sensors, IXBee S2C is the current consumption of the XBee S2C wireless technology, and IAtmega is the current consumed by the Atmega 328p microcontroller. The measurements of each sensor node component were achieved by using a storage oscilloscope (MCP Lab Electronics/DQ7042C) and a digital multimeter (MCP Lab Electronics/MT8045) to evaluate the current consumption of the sensor node. Therefore, the current drawn by the sensor node is presented for two cases. The first case, which is a conventional operation (i.e., without a sleep/wake scheme or any power reduction technique), is formulated in Equation (2). The second case, which involves a sleep/wake scheme, can be expressed in terms of average current consumption, as presented in Equations (3)-(7): where Iavg is the average current consumption of each sensor node component. DC is the proposed duty cycle of the sensor node, which provides an effective method for achieving energy efficiency and can be computed using the ratio of the active time to the total time (tactive/Ttotal). DC is configured to 2.222 × 10 −3 to reduce the power consumption of the sensor node, where the active time is 2 s, the

Sensor Node Power Consumption Model
The life span of sensor nodes is the time that lapsed from the first transmission until the sensor nodes lose their sensing capability. The life span of a WSN relies on the current consumed by each node in the network. The power consumption of sensor nodes depends on the number of components. In this study, the sensor nodes include air temperature and humidity sensors embedded into the DHT11 sensor, a soil moisture sensor, the Atmega 328p microcontroller as a standalone system for reducing power consumption, and the XBee S2C wireless protocol. Among the sensor nodes, XBee S2C is considered the main power consumer [51]. When the consumption values of these components are added, the total current consumption of the sensor node can be expressed as Equation (2): where I Soil is the current consumed by the soil moisture sensor, I DHT is the current consumed by the air temperature and humidity sensors, I XBee S2C is the current consumption of the XBee S2C wireless technology, and I Atmega is the current consumed by the Atmega 328p microcontroller. The measurements of each sensor node component were achieved by using a storage oscilloscope (MCP Lab Electronics/DQ7042C) and a digital multimeter (MCP Lab Electronics/MT8045) to evaluate the current consumption of the sensor node. Therefore, the current drawn by the sensor node is presented for two cases. The first case, which is a conventional operation (i.e., without a sleep/wake scheme or any power reduction technique), is formulated in Equation (2). The second case, which involves a sleep/wake scheme, can be expressed in terms of average current consumption, as presented in Equations (3)-(7): where I avg is the average current consumption of each sensor node component. DC is the proposed duty cycle of the sensor node, which provides an effective method for achieving energy efficiency and can be computed using the ratio of the active time to the total time (t active /T total ). DC is configured to 2.222 × 10 −3 to reduce the power consumption of the sensor node, where the active time is 2 s, the sleep time is 898 s, and the total time is 15 min (900 s). I active and I sleep are the active and sleep current consumption of each component of the sensor node. The overall power consumption of the sensor nodes (I SN_total ) without t sleep/wake scheme can be expressed as Equation (8); where I SN n is the current consumption of each sensor node. In addition, n is the number of sensor nodes, and n = 16 in the current work. Given that DC is equal in each sensor node, the total current consumption (I SN_avg_total ) of the sensor nodes can be calculated based on Equation (9): where I SN n _avg is the average current consumption of each sensor node that is modeled in Equation (7). The average power consumption (P avg_SN ) of a sensor node can be calculated by multiplying the average current consumption with the supply voltage of the sensor node (i.e., 2 × 3.7 V = 7.4 V), as shown in Equation (10). The sensor node life span (L life ) based on the sleep/wake scheme can be expressed as Equation (11): where C Battery is the initial battery capacity of the sensor node in mAh. In the current work, two Li-ion rechargeable batteries (7.4 V/2600 mAh) are used to supply each sensor node with power.

Router Node Power Consumption Model
In this work, each router node consists of an Atmega 328p microcontroller and the XBee S2C wireless protocol. Therefore, the power consumption of the router and main router nodes depends only on these two components. The power consumption of the router and the main router nodes without and with the sleep/wake scheme can be expressed as Equations (12) and (13), respectively: The total current consumption of the router nodes without and with the sleep/wake scheme can be expressed as Equations (14) and (15), respectively: where I RN m is the current consumption of each router node, as presented in Equation (12); I RN m _average is the average current consumption of each router node, as modeled in Equation (13); and m is the number of router nodes, where m = 4 in the current work. Equations (10) and (11) can be utilized to calculate the average power consumption and life span of the router and main router nodes based on the sleep/wake scheme, respectively.

Energy Harvesting Techniques
Energy scavenging or harvesting involves a massive amount of energy from different environments, such as thermal, solar, vibration, and wind. Energy harvesting approaches are effective in improving network life span [52]. Among various forms of environmental energy, solar cell energy is selected in the current work to supply power to the sensor, router, and main router nodes. In energy harvesting, a battery is cyclically recharged to preserve the life span of nodes that continuously operate in the network rather than focusing on reducing energy depletion. However, an energy-harvesting platform must be incorporated into the network to efficiently use the harvested energy.
The current consumption of the sensor nodes from the battery depends on the type of application [53]. In our work, the solar panel is positioned in front of the sensor node box. The solar cell angle is oriented toward the sun with an incident angle of 20 • -30 • relative to the ground [8]. KINGRO-004V solar cell (KINGRO, Shaoxing, China), which is a first-generation polycrystalline solar cell (12 V/5 W) that delivers a maximum current of 416 mA, is selected (Figure 3). Table 3 provides the characteristics of the adopted solar cell.
Mathematical models should be created for the battery and solar cells of the sensor node to investigate the harvested energy from the solar cell and battery consumption. The power consumption model of the sensor, router, and main router nodes based on the battery is presented in Equations (2)-(15), as shown in Section 7.1 and 7.2. The solar cell is formulated in the current section. Solar cell efficiency (η) can be expressed as [25]: where P max is the output power of the solar cell (measured in W); S is the solar cell surface area (measured in m 2 ); and R is the radiation, which can be defined as the intensity of the incident light power on the surface of a solar cell (measured in W/m 2 ).  Figure 7 shows the connection of the soil moisture sensor to the microcontroller (connected to Pin ANo). The soil moisture sensor is connected to a 10 KΩ resistance as a voltage divider, as shown in Figure 7. The middle point (i.e., V out ) between the soil moisture sensor and the resistor is used for sensing variations in output voltage from the changes in moisture value. The output voltage (V out ) is altered between 5 and 0 depending on the moisture of soil. The moisture corresponds to the analog-to-digital converter of the Arduino microcontroller 0-1023 (10 bit resolution). The output voltage of the voltage divider can be translated into moisture in percentage through the microcontroller algorithm. The resistance of the soil moisture value decreases with increasing soil moisture. Therefore, the output voltage decreases. By contrast, the resistance of the soil moisture value increases when soil is dry, thereby increasing output voltage. The soil moisture sensor is calibrated in-field, as shown in Figure 8. The calibration of the soil moisture sensor (Figure 8) is achieved through an experimental test of three cases: (i) wet soil, (ii) field capacity soil moisture, and (iii) dry soil for soil mixture (clay and sandy soil). This calibration can be used in all seasons. The figure shows that the output voltage values of the soil moisture sensor are plotted on the left y-axis, whereas the moisture values in percentage are plotted on the right y-axis with respect to the depth of the soil moisture sensor. However, the values of the moisture percentages that are presented in Figure 8 are used in the microcontroller algorithm to determine the threshold level between dry soil and wet soil. From these values, the soil moisture sensor achieves self-calibration before each new measure based on the stored data in the algorithm of the microcontroller to reduce measurement errors.

Calibration of Sensors
The temperature and humidity sensor (i.e., DHT11) was calibrated to be extremely precise by the manufacturer in a laboratory [54]. The calibration coefficients of the sensor are stored as a program in the one-time programmable (OTP) memory. When the OTP memory is programmed, the contents cannot be changed and are retained after power is turned off. This sensor contains a negative temperature coefficient component for temperature measurement and a resistive component for humidity measurement. DHT11 is a digital sensor that can be connected to an 8 bit microcontroller using a single wire serial interface. It provides fast response, and exhibits high-quality, cost-effective, and anti-interference ability. Consequently, the DHT11 sensor does not require a calibration process and can work accurately to provide air temperature and humidity readings in any seasons. temperature coefficient component for temperature measurement and a resistive component for humidity measurement. DHT11 is a digital sensor that can be connected to an 8 bit microcontroller using a single wire serial interface. It provides fast response, and exhibits high-quality, cost-effective, and anti-interference ability. Consequently, the DHT11 sensor does not require a calibration process and can work accurately to provide air temperature and humidity readings in any seasons.

Current Consumption Measurements
The power consumption of the WAS is a combination of several hardware components, namely, air temperature and humidity (DHT11) sensor, soil moisture sensor, a standalone Atmega 328p microcontroller, and the XBee S2C module. The router and main router consist only of the standalone Atmega 328p microcontroller and the XBee S2C module. The current consumption of the sensor, router, and main router nodes is measured on the basis of three cases, namely, (i) traditional operation (without any power reduction technique), (ii) sleep/wake scheme, and (iii) the SWORD algorithm, by using a digital multimeter (MCP Lab Electronics/MT8045) and a storage oscilloscope (MCP Lab Electronics/DQ7042C). The DHT11 and soil moisture sensors consume 1.85 mA and 0.1 mA in active mode, respectively, and 0.01 mA in idle mode (i.e., no measurement value) at a supply voltage of 3.3 V.
The Atmega 328p was practically implemented under standalone condition to reduce the power consumption of the battery of the network nodes. The selection of the oscillator frequency value is crucial in the power consumption of the microcontroller, as presented in [42], where the Atmega 328p microcontroller consumed 6.25 mA at 16 MHz. A trade-off between power consumption and processing speed is necessary. Therefore, an operating frequency of 16 MHz is selected in the current experiment to minimize measurement time. In such case, the microcontroller Atmega 328p consumes temperature coefficient component for temperature measurement and a resistive component for humidity measurement. DHT11 is a digital sensor that can be connected to an 8 bit microcontroller using a single wire serial interface. It provides fast response, and exhibits high-quality, cost-effective, and anti-interference ability. Consequently, the DHT11 sensor does not require a calibration process and can work accurately to provide air temperature and humidity readings in any seasons.

Current Consumption Measurements
The power consumption of the WAS is a combination of several hardware components, namely, air temperature and humidity (DHT11) sensor, soil moisture sensor, a standalone Atmega 328p microcontroller, and the XBee S2C module. The router and main router consist only of the standalone Atmega 328p microcontroller and the XBee S2C module. The current consumption of the sensor, router, and main router nodes is measured on the basis of three cases, namely, (i) traditional operation (without any power reduction technique), (ii) sleep/wake scheme, and (iii) the SWORD algorithm, by using a digital multimeter (MCP Lab Electronics/MT8045) and a storage oscilloscope (MCP Lab Electronics/DQ7042C). The DHT11 and soil moisture sensors consume 1.85 mA and 0.1 mA in active mode, respectively, and 0.01 mA in idle mode (i.e., no measurement value) at a supply voltage of 3.3 V.
The Atmega 328p was practically implemented under standalone condition to reduce the power consumption of the battery of the network nodes. The selection of the oscillator frequency value is crucial in the power consumption of the microcontroller, as presented in [42], where the Atmega 328p microcontroller consumed 6.25 mA at 16 MHz. A trade-off between power consumption and processing speed is necessary. Therefore, an operating frequency of 16 MHz is selected in the current experiment to minimize measurement time. In such case, the microcontroller Atmega 328p consumes 6.25 mA in active mode and 0.09 mA in power-saving mode [55].
Our test bed measurements show that an active current consumption of 6 mA (Figure 9) is

Current Consumption Measurements
The power consumption of the WAS is a combination of several hardware components, namely, air temperature and humidity (DHT11) sensor, soil moisture sensor, a standalone Atmega 328p microcontroller, and the XBee S2C module. The router and main router consist only of the standalone Atmega 328p microcontroller and the XBee S2C module. The current consumption of the sensor, router, and main router nodes is measured on the basis of three cases, namely, (i) traditional operation (without any power reduction technique), (ii) sleep/wake scheme, and (iii) the SWORD algorithm, by using a digital multimeter (MCP Lab Electronics/MT8045) and a storage oscilloscope (MCP Lab Electronics/DQ7042C). The DHT11 and soil moisture sensors consume 1.85 mA and 0.1 mA in active mode, respectively, and 0.01 mA in idle mode (i.e., no measurement value) at a supply voltage of 3.3 V.
The Atmega 328p was practically implemented under standalone condition to reduce the power consumption of the battery of the network nodes. The selection of the oscillator frequency value is crucial in the power consumption of the microcontroller, as presented in [42], where the Atmega 328p microcontroller consumed 6.25 mA at 16 MHz. A trade-off between power consumption and processing speed is necessary. Therefore, an operating frequency of 16 MHz is selected in the current experiment to minimize measurement time. In such case, the microcontroller Atmega 328p consumes 6.25 mA in active mode and 0.09 mA in power-saving mode [55].
Our test bed measurements show that an active current consumption of 6 mA (Figure 9) is recorded for the microcontroller (Figure 10a). The active current drain of the Atmega 328p microcontroller is measured using an oscilloscope, whereas the power-saving mode is measured using a digital multimeter because a low current consumption value cannot be captured by an oscilloscope. In the test bed measurement, a 10 Ω shunt resistor is connected between the supply pin of the microcontroller and the voltage source (battery: 3.3 V). A small shunt resistor value is selected to reduce voltage loss in the supply line of the microcontroller. The drained current is obtained in milliamperes by dividing the measured voltage across the shunt resistor by the shunt resistor value of 10 Ω (I = V/R). Therefore, the active current consumption of Atmega 328p during the transmission process is 60 mV/10 Ω = 6 mA in active mode, as shown in Figure 10a. oscilloscope. In the test bed measurement, a 10 Ω shunt resistor is connected between the supply pin of the microcontroller and the voltage source (battery: 3.3 V). A small shunt resistor value is selected to reduce voltage loss in the supply line of the microcontroller. The drained current is obtained in milliamperes by dividing the measured voltage across the shunt resistor by the shunt resistor value of 10 Ω (I = V/R). Therefore, the active current consumption of Atmega 328p during the transmission process is 60 mV/10 Ω = 6 mA in active mode, as shown in Figure 10a.
In the WSN hardware, the main power is consumed by the RF module during data transmission and reception [56]. Therefore, the same procedure as that in the microcontroller measurements of active current consumption for XBee S2C can be applied. An active current consumption of 11.4 mA is measured during the transmission process, as shown in Figure 10b. However, the sleep current consumption of XBee S2C is measured to be 0.58 mA using the digital multimeter. The parameters in Equations (2)- (11) with and without the sleep/wake scheme for the sensor node are presented in Table 4. Furthermore, the parameters in Equations (12)- (15) for the router and main router nodes are provided in Table 4. The values in Table 4 are measured for active time, sleep time, DC, and active and sleep current consumption with and without the sleep/wake scheme.  oscilloscope. In the test bed measurement, a 10 Ω shunt resistor is connected between the supply pin of the microcontroller and the voltage source (battery: 3.3 V). A small shunt resistor value is selected to reduce voltage loss in the supply line of the microcontroller. The drained current is obtained in milliamperes by dividing the measured voltage across the shunt resistor by the shunt resistor value of 10 Ω (I = V/R). Therefore, the active current consumption of Atmega 328p during the transmission process is 60 mV/10 Ω = 6 mA in active mode, as shown in Figure 10a.
In the WSN hardware, the main power is consumed by the RF module during data transmission and reception [56]. Therefore, the same procedure as that in the microcontroller measurements of active current consumption for XBee S2C can be applied. An active current consumption of 11.4 mA is measured during the transmission process, as shown in Figure 10b. However, the sleep current consumption of XBee S2C is measured to be 0.58 mA using the digital multimeter. The parameters in Equations (2)- (11) with and without the sleep/wake scheme for the sensor node are presented in Table 4. Furthermore, the parameters in Equations (12)- (15) for the router and main router nodes are provided in Table 4. The values in Table 4 are measured for active time, sleep time, DC, and active and sleep current consumption with and without the sleep/wake scheme.  In the WSN hardware, the main power is consumed by the RF module during data transmission and reception [56]. Therefore, the same procedure as that in the microcontroller measurements of active current consumption for XBee S2C can be applied. An active current consumption of 11.4 mA is measured during the transmission process, as shown in Figure 10b. However, the sleep current consumption of XBee S2C is measured to be 0.58 mA using the digital multimeter. The parameters in Equations (2)- (11) with and without the sleep/wake scheme for the sensor node are presented in Table 4. Furthermore, the parameters in Equations (12)-(15) for the router and main router nodes are provided in Table 4. The values in Table 4 are measured for active time, sleep time, DC, and active and sleep current consumption with and without the sleep/wake scheme.  Figure 11 shows the current consumption of each component of the sensor node with and without the sleep/wake scheme. The current consumption of XBee S2C is the highest among all the components of the sensor node because RF components frequently transmit data with maximum output power to ensure data delivery.

Power Consumption Based on the Sleep/Wake Scheme
sleep/wake Llife with sleep/wake (days) 148 (3554 h) Equation (11) 112 (2687 h) Equation (11) 58 (1398 h) Equation (11) Llife without sleep/wake (days) 5.6 (134 h) Equation (11) 6 (149 h) Equation (11) 6 (149 h) Equation (11) Figure 11 shows the current consumption of each component of the sensor node with and without the sleep/wake scheme. The current consumption of XBee S2C is the highest among all the components of the sensor node because RF components frequently transmit data with maximum output power to ensure data delivery. In the current work, +5 dBm (3.1 mW) is adopted to ensure communication between WSN nodes in the farm field. Figure 12 shows the power consumption of the router and main router nodes. The current consumption of the router nodes is considerably improved by the sleep/wake scheme. The power consumed by the router nodes is higher than that consumed by the sensor node (Table 4). This result is attributed to the following conditions:

Power Consumption Based on the Sleep/Wake Scheme
(i) The router node collects climate condition data from four sensor nodes within 16 s, whereas the sensor node measures data using two sensors within 2 s. In the current work, +5 dBm (3.1 mW) is adopted to ensure communication between WSN nodes in the farm field. Figure 12 shows the power consumption of the router and main router nodes. The current consumption of the router nodes is considerably improved by the sleep/wake scheme. The power consumed by the router nodes is higher than that consumed by the sensor node (Table 4). This result is attributed to the following conditions: (i) The router node collects climate condition data from four sensor nodes within 16 s, whereas the sensor node measures data using two sensors within 2 s. (ii) The payload of the router node is higher than those of the sensor nodes, as indicated in Figure 4b,c. (iii) The DC of the router node is larger than that of the sensor node, as shown in Figure 6. (iii) The DC of the router node is larger than that of the sensor node, as shown in Figure 6.  Figure 13 illustrates that when the sleep/wake scheme is applied, the power savings of the sensor node are considerably increased to 96% relative to that in traditional operation, which consumes 19.35 mA. Power saving is computed using Equation (17) [57]:  Figure 13 illustrates that when the sleep/wake scheme is applied, the power savings of the sensor node are considerably increased to 96% relative to that in traditional operation, which consumes 19.35 mA. Power saving is computed using Equation (17) [57]: Power savings = 1 − current consumption sleep/wake scheme current consumption traditional operation × 100% (17) Figure 13 illustrates that when the sleep/wake scheme is applied, the power savings of the sensor node are considerably increased to 96% relative to that in traditional operation, which consumes 19.35 mA. Power saving is computed using Equation (17) [57]: Figure 13. Developed power savings of the WSN nodes based on the sleep/wake scheme.
In addition, power savings are improved to 90%, 99%, 98%, and 95% for soil moisture, DHT11, Atmega 328p, and XBee S2C relative to their values in traditional operation, respectively. Power savings are increased to 94% and 89% for the router and main router nodes, respectively (Figure 13), relative to traditional operation (i.e., without the sleep/wake scheme), which consumes 17.4 mA for the router and main router nodes. Power savings are computed using Equation (17). Figure 13 shows that the power savings of the sensor node are better than those of the router and main router nodes for the same reasons mentioned previously. The power saving of the router node is 96.7% and 93% for Atmega 328p and XBee S2C relative to traditional operation, respectively. The power saving of the main router is 91.5% and 88% for Atmega 328p and XBee S2C relative to traditional operation, respectively.

Battery Life Estimation Based on the Sleep/Wake Scheme
The application of the sleep/wake scheme verifies that this approach can improve the power consumption of the proposed WAS to 0.731 (sensor node), 0.967 (router node), and 1.86 mA (main router node). Consequently, battery life can be extended to 148 (sensor node), 112 (router node), and 58 (main router node) days by using two rechargeable Li-ion battery with 7.4 V/2600 mAh. The battery life of the sensor node and the router/ main router nodes is 5.6 days and 6 days in the In addition, power savings are improved to 90%, 99%, 98%, and 95% for soil moisture, DHT11, Atmega 328p, and XBee S2C relative to their values in traditional operation, respectively. Power savings are increased to 94% and 89% for the router and main router nodes, respectively ( Figure 13), relative to traditional operation (i.e., without the sleep/wake scheme), which consumes 17.4 mA for the router and main router nodes. Power savings are computed using Equation (17). Figure 13 shows that the power savings of the sensor node are better than those of the router and main router nodes for the same reasons mentioned previously. The power saving of the router node is 96.7% and 93% for Atmega 328p and XBee S2C relative to traditional operation, respectively. The power saving of the main router is 91.5% and 88% for Atmega 328p and XBee S2C relative to traditional operation, respectively.

Battery Life Estimation Based on the Sleep/Wake Scheme
The application of the sleep/wake scheme verifies that this approach can improve the power consumption of the proposed WAS to 0.731 (sensor node), 0.967 (router node), and 1.86 mA (main router node). Consequently, battery life can be extended to 148 (sensor node), 112 (router node), and 58 (main router node) days by using two rechargeable Li-ion battery with 7.4 V/2600 mAh. The battery life of the sensor node and the router/ main router nodes is 5.6 days and 6 days in the traditional operation, respectively. The battery life for a particular energy of the battery, which relies on Equation (11) at the current usage of the sensor, router, and main router nodes, is presented in the relationship in Figure 14. The figure also shows the improvement in the current drained by the nodes of the WAS when the sleep/wake scheme is considered.

Results of the SWORD Algorithm
The application of the SWORD algorithm depends on soil moisture measurements. Air temperature, air humidity, and soil moisture are measured by the sensor node of the WAS. Experiments are conducted several times on different days between June 2018 and July 2018 to measure the climate conditions in the farm. However, the measurements ( Figure 15) performed on 8 July 2018 are considered in this study to verify the performance of the proposed SWORD algorithm because the weather conditions on that day are harsh (e.g., high air temperature and low soil humidity) in the considered area. The measurements are configured to capture data every 15 min, as

Results of the SWORD Algorithm
The application of the SWORD algorithm depends on soil moisture measurements. Air temperature, air humidity, and soil moisture are measured by the sensor node of the WAS. Experiments are conducted several times on different days between June 2018 and July 2018 to measure the climate conditions in the farm. However, the measurements ( Figure 15) performed on 8 July 2018 are considered in this study to verify the performance of the proposed SWORD algorithm because the weather conditions on that day are harsh (e.g., high air temperature and low soil humidity) in the considered area. The measurements are configured to capture data every 15 min, as seen in the timing diagram of the sleep/wake scheme in Figure 6. The sensor node transmits the climate conditions to the coordinator node every 15 min via the router and main router nodes. In this case, 96 samples (from 4 samples every hour) are collected in a day ( Figure 15).

Results of the SWORD Algorithm
The application of the SWORD algorithm depends on soil moisture measurements. Air temperature, air humidity, and soil moisture are measured by the sensor node of the WAS. Experiments are conducted several times on different days between June 2018 and July 2018 to measure the climate conditions in the farm. However, the measurements ( Figure 15) performed on 8 July 2018 are considered in this study to verify the performance of the proposed SWORD algorithm because the weather conditions on that day are harsh (e.g., high air temperature and low soil humidity) in the considered area. The measurements are configured to capture data every 15 min, as seen in the timing diagram of the sleep/wake scheme in Figure 6. The sensor node transmits the climate conditions to the coordinator node every 15 min via the router and main router nodes. In this case, 96 samples (from 4 samples every hour) are collected in a day ( Figure 15). The SWORD algorithm checks whether the measured data regarding soil moisture are redundant. When the difference between the preceding and subsequent soil moisture measurements is zero or less than or equal to 5%, the data are not transmitted to the router node. Otherwise, the data are transmitted to the router node. The transmitted data are minimized through this strategy. Thus,   The SWORD algorithm checks whether the measured data regarding soil moisture are redundant. When the difference between the preceding and subsequent soil moisture measurements is zero or less than or equal to 5%, the data are not transmitted to the router node. Otherwise, the data are transmitted to the router node. The transmitted data are minimized through this strategy. Thus, the power consumption of the sensor node is considerably improved relative to the sleep/wake scheme and traditional operation. In the SWORD algorithm, the transmitted data from the sensor node to the router node are minimized to 13 samples, as shown in Figure 16. Soil moisture measurements are weighted within the range of 45-75%. The reading range of 45-49% denotes dry soil, 50-55% represents moderate moist or field capacity, and 55-75% indicates wet or saturated soil. The SWORD algorithm minimizes data transmission (data_tx) by 86.45% relative to the sleep/wake scheme, as obtained using Equation (18): samples based on SWORD algorithm samples based on sleep/wake scheme × 100% Therefore, the average current consumption of the sensor node is remarkably improved to 0.1 mA by applying Equation (19). In this case, a power consumption of 0.74 mW can be dissipated during the transmission of climate conditions in the sensor node based on the SWORD algorithm: where I SN_avg is the average current consumption of 0.731 mA of the sensor node, which is previously computed using Equation (7) based on the application of the sleep/wake scheme. mA by applying Equation (19). In this case, a power consumption of 0.74 mW can be dissipated during the transmission of climate conditions in the sensor node based on the SWORD algorithm: where _ is the average current consumption of 0.731 mA of the sensor node, which is previously computed using Equation (7) based on the application of the sleep/wake scheme. Consequently, battery life can be prolonged to 1093 days (3 years) by applying Equation (11) and using the same battery capacity of the sensor node (i.e., 7.4/2600 mAh). The battery life for a particular energy of the battery at the current usage of the sensor node is estimated in the relationship shown in Figure 17. The figure indicates that the power savings of the sensor node based on the SWORD algorithm considerably improve battery life to 86.45% and 99.48% relative to the sleep/wake scheme and traditional operation, respectively. However, these percentages may increase or decrease depending on the weather, soil conditions, and farm location. As weather temperature increases, soil condition changes rapidly from moisturized to dehydrated, thereby remarkably changing soil moisture measurements. Data transmission can occur, and power consumption increases. By contrast, data transmission and power consumption are considerably minimized when soil moisture is constant under good weather or rainfall conditions. During rainfall condition, the microcontroller measures soil moisture based on the soil humidity sensor to control the operation of the SWORD algorithm. In case of rainfall, the soil is wet, irrigation is unnecessary, and no data transmission occurs from the sensor node to the router node. Consequently, the sensors and XBee module of the sensor node enter sleep mode to conserve energy. In addition, power consumption and data transmission vary from summer to winter. However, soil moisture changes according to temperature and humidity. In our work, we set the constant value of the soil moisture (i.e., threshold) to trigger the sensor to alert the users if intervention is necessary, such as a switch on the water irrigation system  Consequently, battery life can be prolonged to 1093 days (3 years) by applying Equation (11) and using the same battery capacity of the sensor node (i.e., 7.4/2600 mAh). The battery life for a particular energy of the battery at the current usage of the sensor node is estimated in the relationship shown in Figure 17. The figure indicates that the power savings of the sensor node based on the SWORD algorithm considerably improve battery life to 86.45% and 99.48% relative to the sleep/wake scheme and traditional operation, respectively. However, these percentages may increase or decrease depending on the weather, soil conditions, and farm location. As weather temperature increases, soil condition changes rapidly from moisturized to dehydrated, thereby remarkably changing soil moisture measurements. Data transmission can occur, and power consumption increases. By contrast, data transmission and power consumption are considerably minimized when soil moisture is constant under good weather or rainfall conditions. During rainfall condition, the microcontroller measures soil moisture based on the soil humidity sensor to control the operation of the SWORD algorithm. In case of rainfall, the soil is wet, irrigation is unnecessary, and no data transmission occurs from the sensor node to the router node. Consequently, the sensors and XBee module of the sensor node enter sleep mode to conserve energy. In addition, power consumption and data transmission vary from summer to winter. However, soil moisture changes according to temperature and humidity. In our work, we set the constant value of the soil moisture (i.e., threshold) to trigger the sensor to alert the users if intervention is necessary, such as a switch on the water irrigation system or based on an automated irrigation system. The percentage values of 40-50% are considered acceptable soil moisture values in plant growing environments as proven in [58]. or based on an automated irrigation system. The percentage values of 40-50% are considered acceptable soil moisture values in plant growing environments as proven in [58]. The output power of the solar panel is adequate to supply the sensor node because the power consumption of the sensor node varies from 0.75 (SWORD algorithm) and 5.409 (sleep/wake scheme) to 143.19 mW (traditional operation). This result is based on the recommendation in [26], which indicates that the capacity of a solar cell should be at least six times the average power consumption of the load. The power consumption of the router and main router nodes is 7.155 mW and 13.764 mW for the sleep/wake scheme, whereas the value is 128.76 mW for traditional operation. The energy of the adopted solar cell can successively supply the sensor, router, and main router nodes. Consequently, when the solar cell (12 V/5 W) is used with the WAS hardware to supply power to the nodes alongside the SWORD algorithm, an infinite energy supply for the WAS node can be expected.

Power Consumption Comparison
The power consumption of the WAS using the sleep/wake scheme and the SWORD algorithm is compared with the power consumption of other schemes presented in existing studies on agriculture monitoring systems (Figure 18) to verify the proposed system. The output power of the solar panel is adequate to supply the sensor node because the power consumption of the sensor node varies from 0.75 (SWORD algorithm) and 5.409 (sleep/wake scheme) to 143.19 mW (traditional operation). This result is based on the recommendation in [26], which indicates that the capacity of a solar cell should be at least six times the average power consumption of the load. The power consumption of the router and main router nodes is 7.155 mW and 13.764 mW for the sleep/wake scheme, whereas the value is 128.76 mW for traditional operation. The energy of the adopted solar cell can successively supply the sensor, router, and main router nodes. Consequently, when the solar cell (12 V/5 W) is used with the WAS hardware to supply power to the nodes alongside the SWORD algorithm, an infinite energy supply for the WAS node can be expected.

Power Consumption Comparison
The power consumption of the WAS using the sleep/wake scheme and the SWORD algorithm is compared with the power consumption of other schemes presented in existing studies on agriculture monitoring systems ( Figure 18) to verify the proposed system. nodes alongside the SWORD algorithm, an infinite energy supply for the WAS node can be expected. Figure 17. Estimated battery life versus battery capacity in the sensor node based on the SWORD algorithm, sleep/wake scheme, and traditional operation.

Power Consumption Comparison
The power consumption of the WAS using the sleep/wake scheme and the SWORD algorithm is compared with the power consumption of other schemes presented in existing studies on agriculture monitoring systems ( Figure 18) to verify the proposed system. The performance of this work in terms of current consumption is achieved based on the methodology designed in Sections 6-8 and is validated by the actual hardware (prototype) implementation (Section 4) and on-site measurement (Section 9). The proposed algorithms are compared with those presented in related studies based on the values recorded during measurements   The performance of this work in terms of current consumption is achieved based on the methodology designed in Sections 6-8 and is validated by the actual hardware (prototype) implementation (Section 4) and on-site measurement (Section 9). The proposed algorithms are compared with those presented in related studies based on the values recorded during measurements in the previous literature. The performance in terms of average current consumption of previous methods is presented in detail in Section 2.
Although the previous works are based on energy efficient approaches, however, it is important to acknowledge that the measurement taken from this study might differ from the previous works in the literature, taken into account different factors, which include: (i) the sensors' power requirements, (ii) techniques/algorithms introduced in the previous works and (iii) variation of the agriculture conditions (such as humidity, temperature and other environmental conditions) where the previous works have been deployed.
The sensor node current consumption of the proposed WAS is reduced based on two approaches: the first is sleep/wake scheme adopting DC and the second is SWORD algorithm. The current consumption of the sensor node (0.731 mA), router node (0.967 mA), and main router node (1.86 mA) are achieved based on sleep/wake scheme using low DC. We observe that the current consumption of the proposed WAS using the SWORD algorithm is approximately similar to the performance of the approaches in [35][36][37], which have achieved a current consumption of 0.1 (based on sleep/wake), 0.118 (based on sleep/wake), and 0.227 mA (based on DC), respectively. The average current consumption of our proposed WAS is 0.1 mA and 0.731 mA for the SWORD algorithm and the sleep/wake scheme, respectively, as shown in Figure 18.

Conclusions
We propose an energy-efficient scheme known as the WAS for agricultural application. The system is designed and practically implemented to monitor the climate conditions of crops, including air temperature, air humidity, and soil moisture. System hardware is carefully selected based on energy-efficient criteria to minimize the power consumption of different nodes in the WSN, such as the low-power Zigbee wireless protocol (i.e., XBee S2C), the standalone Atmega 328p microcontroller, and low-power sensors. In addition, two power reduction techniques are proposed to further improve the power consumption of the sensor, router, and main router nodes. These two schemes are the sleep/wake scheme and the SWORD algorithm. The sleep/wake scheme is achieved based on different DCs of the nodes in the WAS (i.e., 0.222% for the sensor node, 1.778% for the router node, and 7.111% for the main router node). The SWORD algorithm combines the sleep/wake scheme and the minimization of redundant data from sensor node packets. The power consumption of the sensor, router, and main router nodes is considerably improved when the two proposed methods are used.
The power saving and data communication achieved by applying the SWORD algorithm may be increased or decreased depending on the redundant data from soil moisture measurements, which depend on the soil condition (wet or dry). The power savings in the current work are improved by 86.45% and 99.48% relative to the sleep/wake scheme and traditional operation, respectively. In addition, data communication is minimized by 86.45%. The results of current consumption are compared with those in previous studies to validate the performance of the proposed system. The proposed WAS allows data collection for decision support in farming fields and can assist users in automating irrigation systems in agricultural fields in the future. The use of an energy-efficient and advanced WSN technology can achieve highly productive and sustainable precision farming.