Adaptive Data Transmission Protocols for Energy Harvesting WSNs Used in Agriculture

 Energy consumption is a major concern in wireless sensor networks (WSNs) as it affects the lifespan of sensor nodes. Battery-based WSNs have a short operating period, which makes them impractical for real-time applications, for instance in agriculture. Energy harvesting and suitable medium access control (MAC) protocols have been used to extend the lifetime of nodes. Receiver-initiated protocols have been proved to be the best solution for energy harvesting WSNs. However, they suffer from a key disadvantage, i.e. an increase in collision rate. These collisions need to be reduced using a multi-layer protocol structure. In such a context, a new solar-based hybrid MAC (SHMAC) protocol relying on receiver-initiation and characterized by a multi-layer structure is proposed. It is an adaptive protocol capable of adapting to changing weather conditions. The nodes with a high energy harvesting rate have a higher level of residual energy and are active for longer time periods compared with those with low energy harvesting characteristics. The proposed work has shown improvements in two major MAC layer parameters, i.e. collision rate and energy neutrality operation ratio (ENO).


Introduction
Wireless sensor networks (WSNs) are used in numerous applications, e.g.agriculture, home automation, healthcare, wildlife monitoring etc.The major limitation encountered in outdoor applications is the limited amount of energy stored in the batteries powering the nodes.To solve this problem, solar energy harvesting technologies are considered as a potential candidate to serve as a source of continuous energy for WSN networks and to increase their lifetime.Energy harvestingbased wireless sensor networks (EHWSNs) present, however, new design challenges, since this kind of energy is unpredictable in nature [1], [2].Therefore, there is a need to store this energy for future use and to use the capacity wisely during the non-availability periods [3].The block diagram of an energy harvesting system is shown in Fig. 1.First, solar energy is harvested and stored using a Texas Instruments energy harvester (EZ430) and a power manager integrated circuit (BQ25505) [4], [5].A variety of sensors, a microcontroller, and an RF transceiver are powered.In energy harvesting applications, some sensor nodes may have more energy available than their counterparts, due to the uneven distribution that is impacted by node location, as well as shadows from buildings or trees.Such nodes may perform more energy-intensive tasks, while low energy nodes may be in the sleep state, recharging.The MAC protocol used needs to adapt to the changes in energy levels available in the environment [6], [7].Otherwise, nodes with lower residual energy levels will discharge the battery and will then go into a dead state, creating voids in the sensing area and making the entire network unreliable.The protocol's adaptivity is expected to balance the load throughout the network.Nodes with good energy levels have a better energy neutrality operation (ENO) rate than other nodes [8], [9].Hence, the protocol may entrust them with more tasks to utilize this excess energy efficiently.This helps in improving the fairness index of the network [10], [11].Keeping this in mind, a SHMAC adaptive protocol is proposed in this paper and is then optimized to maximize its performance.The paper is structured as follows.Section 2 presents the related work.Section 3 shows the process of designing the SHMAC protocol, while Section 4 describes the simulation process.Section 5 evaluates and compares the overall performance of the proposed protocol with the existing solutions.The work is concluded in Section 6.

Related Work
The amounts of energy consumed by network nodes is the most important parameter affecting the nodes' lifetime [12].Therefore, MAC helps improve a crucial network parameter [13], [14].Sender-based protocols are often utilized by battery-based WSNs.In sender-based communication, the process is initiated by the sender node whenever it wants to transmit the data, whereas in receiver-based communication, it is the sink which commences the process.Receiver-initiated schemes offer many benefits in comparison to their senderinitiated counterparts.
In receiver-based protocols, listening in idle state is insignificant, as in this case, channel utilization time of the nodes is negligible.This results in an increase in network throughput, as more nodes can interact with each other.
In [15], Ye et al. presented a sensor MAC (SMAC) protocol, introducing the concept of duty cycling in WSNs.Such an approach results in lower energy consumption as it the amount of idle listening is negligible.Dam et al. [16] proposed a time-out MAC (TMAC) adaptive protocol, while Lin et al. presented, in [17], a receiver initiated cycled receiver (RICER) as an example of a receiver-initiated scheme.It used a random delay between the reception of the beacon and the transmission of data.In [18], Tan introduced an energy harvesting-based probabilistic polling MAC (PPMAC) protocol.Its performance is analyzed for CSMA and polling-based MAC protocols for the single-hop network.
Analytical models of slotted CSMA, ID polling, and PPMAC were presented and simulated with the use of the Qualnet simulator in [19], while Fafoutis and Dragoni proposed an on-demand medium access control (ODMAC) approach in [20], [21], where the load is assigned based on the status of the harvested energy.Selahattin showed another extensive review of the MAC protocols for EHWSN [7], while Ramezani et al. [22] researched the advantages and disadvantages of each protocol along with solutions that can be possibly integrated into future work.
Tan et al. [23] presented a case study for energy harvesting and energy management, while Jha et al. [24] introduced a multi-layer MAC (MLMAC) protocol designed to have a low duty cycle and lower collisions for battery-based WSN networks.It is a contention-based MAC protocol, where the nodes discover their acquaintances based on the strength of the radio signal.Another energy-harvested receiver-initiated MAC protocol (ERIMAC) was introduced by Nguyen et al. in [25].It is based on a receiver-initiated scheme and is as a combination of ODMAC and RIMAC protocols.As far as real time adaptivity is concerned, Kosunalp et al. [26] shows a prediction algorithm for solar energy harvesting.It considers the past and the most recent weather conditions to calculate, approximately, the near future availability of harvested energy.
Most of the MAC protocols described in the literature assume that the amounts of available energy to be harvested are uncertain.It needs to be borne in mind that solar energy generally exhibits similar patterns in a given area and season.Therefore, energy predictions may be relied upon to optimize overall performance.This is currently the missing part of the majority of the research projects described.In this work, an adaptive transmission-based SHMAC protocol is introduced, being proposal aiming to optimize solar energy harvesting.Thanks to such an approach, remarkable performance improvements over other similar-related protocols may be achieved.

Design of Adaptive Hybrid MAC Protocol
Solar energy is considered to be the preferred source of energy needed to power up sensor nodes in unattended areas, for instance in forest fire monitoring applications.The quantity of energy that can be harvested depends on the season and on the area in which the solar panel is deployed.Solar energy efficiency depends on the weather, installation angle, location coordinates and time.
Shadows created by trees and buildings impact energy harvesting conditions even in the same specific area.Various sunlight incidence angles need to be taken into consideration as well.Therefore, it is difficult to predict which node should be in the power saving mode and which should exit this power limited state.In the proposed solution, this variable is monitored by the MAC layer and the protocol should be capable of adapting to changing harvesting conditions.Figure 2 shows an example of hourly solar curves for two cities.Depending on the season, the amount of solar energy available varies a lot.Hence, when implementing a WSN, the MAC protocol has to be aware of those conditions.To achieve this, two approaches (predictive and reactive) may be relied upon.The predictive approach predicts the available amount of energy and adjusts the operation of the node to the expected conditions.In the reactive approach, the node's energy level is continuously monitored and its operation is adjusted based on the harvested energy level.A hybrid approach is used in the proposed work, in which the first reactive approach is used to decrease energy consumption, with a prediction being incorporated at a later stage to make the protocol more reliable.Dedicated hardware is used to compute the amount of energy harvested from the environment.
The nodes operate in two modes, i.e. active and sleep modes.
In the active mode, there are three different layers, as shown in Fig. 3. Depending on the environmental conditions, the low energy harvesting layer (L1) is used at night or during winter, the medium energy harvesting layer (L2) is relied upon when shadows are created by trees and buildings, and the high energy harvesting mode (L3) is used at noon.The better the harvesting conditions, the higher the level active.
The most important feature for checking the reliability of any energy harvesting-based protocol is its ability to adjust the operation of sensor nodes to the prevalent energy harvesting conditions.For such a verification, the ENO ratio denoted by R should be greater than one for the nodes to prevent network outages.
where E h is the energy harvesting rate and E c is energy consumption.To keep R > 1, energy consumption E c needs to be kept as low as possible.Therefore, each node's duty cycle needs to adapt to the harvesting conditions.A common schedule for all the nodes cannot be implemented, as each node has a different initial energy level and if affected by varying harvesting conditions which depend on its position within the WSN.
To reduce energy consumption E c , the number of transmissions for each node should be decreased to keep ratio R within a safe limit.Depending on the time of the day and environmental conditions, E h varies as well.Hence, in the proposed protocol, with both factors in mind, E c is decreased by an adaptive duty cycle factor d and Eq. ( 1) takes the form of: where d is the adaptive duty cycle responsible for the changing environmental conditions.The initial deployment scenario for the SHMAC protocol is shown in Fig. 4. Total N nodes are taken into consideration, sending the collected information to the sink node positioned in the center.Depending on the conditions, those nodes are divided into three layers.Layer 1 nodes have the minimum energy, L2 nodes are in the shadow of buildings or trees, and L3 nodes operate in a goof energy harvesting environment as they are exposed to direct sunlight.Solar energy efficiency σ is given as: where S max is solar power in watts, D is solar density and s is the surface area.The efficiency of popular solar harvesters equals up to 30%, meaning that only part of the captured solar energy can be used for operating a node.Therefore, residual energy E r of any node at time t is calculated as follows: where E i is the initial energy level of the node, E h is the energy harvested by the node, and E c is the energy consumed by the node for performing its assigned tasks.

Solar Energy Harvester
The energy harvesting model used in the proposed work relies on the "accumulate and spend" scheme, meaning that energy will be accumulated until a particular threshold level, referred to as E ct , is reached.This threshold value will depend on the type of a specific application and on the deployment area.A high energy threshold is used in critical applications, where information delivery is crucial.In contrast, in such applications as hourly weather forecasts, if the level of energy harvested is a little lower that required, the node may wait with the transmission until the energy level reaches a sufficient value.This means that the data transmission will start only after this threshold value is achieved.

Results and Discussion
The most important parameter for the reliable operation of energy harvesting-based systems is to maintain the ENO ratio (i.e.energy harvested to energy consumed) above 1.
In the source code for the adaptive SHMAC protocol (Algorithm 1), the energy prediction is realized by using the EWMA scheme.It has the lowest prediction time and complexity compared with other prediction methods.Since the size of sensor nodes is limited, as is their memory capacity, complex algorithms cannot be used in such SEM type devices.Hence, EWMA is well suited for this purpose.Once energy prediction has been done and E H value has been obtained, the ENO ratio R is calculated.If R > 1, there is no need to compromise the quality of the network, hence a transceiver is used that offers the longest active time, i.e.L3.
If R = 1, then the network is in the equilibrium stage, but its performance remains satisfactory.The active time spent by the nodes L2 is shorter than in L3.If R < 1, then an adaptive measure needs to be taken to save the nodes from a power outage, i.e. the duty cycle needs to be decreased and the transceiver's on-time needs to be kept at the minimum, i.e. at L1 state as shown in Fig. 3. To maintain the ENO ratio over 1, an adaptive factor d is used to prevent the nodes from switching to a dead state -Eq.( 2).It is used to reduce energy consumption by controlling the duty cycle of the nodes, i.e. to lower the number of transmissions.Next, the ENO ratio for the ERIMAC and SHMAC protocols is compared, for a varying number of nodes (Fig. 6).One may notice that the energy neutrality ratio is greater than one for all network sizes tested, varying from 10 to 80.As the number of nodes is increased from 10 to 20, a decrease in ENO ratio is observed in SHMAC, but its value still remains greater than 1 at all times and it performs better than the ERIMAC protocol.
Throughput is another important parameter for WSN networks.It is the number of data packets received per unit of time.It can be determined by: where S is the throughput, N rx is the number of packets received and T rx is the receiving time.
Receiver initialization helps in the reduction of energy waste due to idle listening, while the multi-layer nature helps lower the number of collisions.Both features offer better throughput versus the ERIMAC protocol and the optimal polling technique.As the energy harvesting rate increases, an additional amount of energy is available for the nodes to communicate.Therefore, throughput is higher.The adaptive duty cycle also makes the particular node's operation more efficient.The prediction algorithm used improves performance even further in comparison with the other two protocols, i.e.ERIMAC and optimal polling, where such a mechanism is not used.The collision rate is another major cause of energy losses.
In such a context, a reduction in the parameter defining the probability of collisions offers another advantage in terms of energy efficiency.The collision rate is the number of collisions encountered for a given transmission attempt and is calculated for varying message inter-arrival times, as shown in Fig. 7.The higher the traffic, the shorter the message inter-arrival time and the higher the probability of a collision.As the traffic becomes lighter, collision probability decreases as well.The MAC protocol is simulated with different numbers of layers taken into consideration.SHMAC has three layers, SLMAC is a single layer solution, and the proposed protocol, as well as DLMAC, are of the dual-layer type.The collision rate is found to be lowest in the proposed SHMAC protocol.
Comparison of the collision rate for SHMAC and ERIMAC protocols is presented in Fig. 8.The collision rate remains low for dense traffic in SHMAC, as its multilayer structure helps reduce the number of collisions.However, as the packet inter-arrival time increases, i.e. traffic becomes light, both protocols are showing almost the same performance.This means that traffic profiling is important for achieving a low collision rate.
The final performance comparison between the proposed protocol and other solutions is shown in Tab. 4. As one may notice, the proposed SHMAC protocol offers a considerable performance enhancement by reducing the collision rate, thus helping reduce energy consumption.A 7.2% improvement in the ENO ratio is achieved thanks to the introduction of the adaptive factor d.

Conclusion
The primary goal of solar-based nodes used in WSNs is to maintain continuous operation as energy availability varies.This requires that an adaptive protocol be deployed to manage energy harvesting applications.Our adaptive SHMAC protocol combines a multilayer structure with adaptive timing to control various energy harvesting states in agricultural applications.Nodes with a high energy harvesting rate and significant residual energy levels are active for longer periods of time compared with their counterparts experiencing low energy harvesting conditions.The protocol ensures energy neutrality and offers higher throughput values compared with the ERIMAC protocol.The lower collision rate saves significant amounts of energy, boosting the solution's efficiency even further.

Fig. 7 .
Fig. 7. Collisions rate as a function of message inter-arrival time.
EWMA is the most popular prediction algorithm used in SEH due to its low complexity and simple hardware implementation.It calculates the current energy requirement based on energy available at similar time periods during the last Tab.1.In Tab. 2, Matlab simulation parameters used for evaluating the SHMAC protocol are presented.T ta , T standby , T proc , T sensing , T pm values are taken from Texas EZ430-RF2500-SHE datasheet for better estimation of the re-Algorithm 1 Adaptive SHMAC protocol code Energy_pred_proc 1: { 2: E p (y + 1) = aE r (y) + (1 − a)E p (y) Fig. 6.Energy neutrality ratio versus number of nodes.alworld deployment scenario.T rx , T tx , T sleep are calculated from simulations.To calculate the total consumed energy, different states of the nodes of the SHMAC protocol need to be considered.SHMAC calculates the time every node spends in each mode, such as E C is the total power consumed, and P rx , P tx , P sleep are power values consumed by nodes in receiving, transmitting and sleep states, respectively.Respective time periods spent in each state are T rx , T tx , and T sleep , while P ta and P standby are values of power consumed in turn-around and standby states.P sensing , P proc and P pm are values of power consumed in data sensing, data processing, and power management states, respectively.T standby , T proc , T sensing , and T P M are corresponding times spent by nodes in standby, data processing, and data sensing, respectively.
Impact of variable d parameter on ENO ratio (Ec = 13 mJ, N = 50 nodes).As shown in Tab. 3, as the energy harvesting values decrease and the energy consumption rate remains unchanged, the value of R is decreasing, so the nodes are going into the dead state.Contrary in R ′ parameter due to incorporated adaptive factor, this value is always maintained above 1, so the network operates continuously.This adaptive factor decreases the number of transmissions by varying the duty cycle of the nodes.As a node is in the active state for a shorter period of time, its energy consumption is reduced.