# Routing with Renewable Energy Management in Wireless Sensor Networks
## 3 REBORN-Renewable Energy-Based Routing Algorithm
The main idea was that if the node had a lower residual battery, fewer packets would be sent. In this sense, the same principle was adopted for the solar intensity, that is, lower solar intensities would reduce the number of packets to be sent. #### 3.3.1 Battery Management

Based on the control mechanism discussed previously, we considered that the data packet interval would increase as the amount of battery power decreases. Thus, when the energy was close to zero, the number of packets would be as small as possible. In this way, energy-aware is characterized, since the amount of packets sent is related to the amount of energy available in the battery. Thus, we need a way to compute the time to send the next data packet for each sensor node. As mentioned, this time needs to be related to the battery level of the node. Equation (4) is responsible for this behavior:

\[\omega=(\alpha-\varphi)\left(\frac{\beta-\delta}{\sigma-\delta}\right)+\varphi \tag{4}\]

whose variables and default values are described in Table 2. This equation was derived from the classic line equation passing throw the points (\(\sigma\), \(\alpha\)) and (\(\delta\), \(\varphi\)), which are the worst and the best cases, respectively. As depicted in Figure 5, the time for sending data packets decreases (i.e., more packets are sent) as the energy level of the node increases. #### 3.3.2 Solar Intensity Control

Similar to the battery management control, when solar intensity is low or nonexistent, the interval between packet sending should be as large as possible since the battery is \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Variable** & **Default Value** & **Function** & **Unit** \\ \hline \(\alpha\) & 7200 & Maximum interval between sending out packets & s \\ \hline \(\varphi\) & 120 & Minimum interval between sending out packets & s \\ \hline \(\delta\) & 1000 & Maximum battery-resident energy & J \\ \hline \(\sigma\) & 0 & Energy threshold to arrive at \(\alpha\) & J \\ \hline \(\beta\) & – & Current battery charge level & J \\ \hline \(\omega\) & – & Time to send the next packet & s \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Battery management equation variables. Figure 5: Battery power level vs. time. not being recharged. Thus, the node has enough information about the energy collection, characterizing the awareness of energy harvesting. Equation (5) is responsible for this behavior and Table 3 describes the variables and values used in the simulation, as depicted in Figure 6. The Equation (5) was derived by line equation form based at these two points (\(\rho,\alpha\)) and (\(\lambda\), \(\varphi\)), which are the worst case and best case, respectively. \[\Omega=(\alpha-\varphi)\bigg{(}\frac{\varphi-\lambda}{\rho-\lambda}\bigg{)}+\varphi \tag{5}\]

It is important to note that Equations (4) and (5), considers a linear relationship between the number of packets to send and both the battery level and the solar intensity. Other curves (e.g., parabola or a third-degree curve) could result in different and interesting relationships. For instance, a logarithmic curve could result in more drastic behavior such as almost stopping sending packets even when the node still has some energy available. This kind of behavior could be useful in some applications. We intend to propose and evaluate the performance of different curves in future work. #### 3.3.3 Battery + Solar Intensity

In order for the two control mechanisms to work together, an average was provided between Equations (4) and (5), allowing the creation of a single model that effectively expressed both battery energy and solar intensity. This model is shown in Equation (6). Therefore, when using the standard values of the simulations, we have the corresponding packet intervals depicted in Figure 7a.