# Routing with Renewable Energy Management in Wireless Sensor Networks
## 3 REBORN-Renewable Energy-Based Routing Algorithm
As shown in [37], the light intensity begins approximately at 06:00, grows up to noon, and decreases until 18:00. To model this behavior, we used a quadratic function fit with three hour/solar-intensity points: (6, 0), (12, 1000), and (18, 0). These points were used to find the coefficients of the function, shown in Equation (1). The value 1000 at noon was used because of the Watt-pico (Wp), a common measure used in solar panels, to represent the maximum solar intensity input. \[\phi=-27.778\chi^{2}+666.667\chi-3000.024 \tag{1}\]

where \(\chi\) is the time measured in hours. As we can see in Figure 3, the model has a maximum intensity of 1000 W/m\({}^{2}\) around noon and no intensity during the night. Figure 3: Theoretical model of solar intensity. Figure 2: REBORN flowchart of states and decisions executed by each node. To determine how much energy is generated by Equation (1), a model for the solar panel is also created. Considering no loss by the conversion of energy, the output power of the solar panel is described by Equation (2). \[\Psi=\frac{\gamma\phi}{\Lambda} \tag{2}\]

where \(\Psi\) is the power output, \(\gamma\) is the maximum output of the solar panel, \(\phi\) is the current solar intensity, and \(\Lambda\) is the maximum solar intensity, as detailed in Table 1.

From Equations (1) and (2), we can compute the energy generated considering periods of 1 second between 06:00 and 18:00. For each second, we can compute the solar intensity using Equation (1) and use the result in Equation (2). At 18:00, the accumulated energy generated was 4319.5 J. However, this energy generated is based on a very optimistic behavior from experiments made in laboratories. As shown by some studies [38], we can see that in a real-world scenario, a small, sensor-based solar panel of 0.15 W can only generate a total energy of 3240 J. However, even this case is an optimistic one, since nodes in WSNs will be located, in most cases, in places with lower solar intensity (e.g., forests) or in places where the lightness does not reach directly or at a good angle. Thus, we reduce the accumulated energy even more to about 1727.8 J by changing Equation (1) to reduce the solar intensity by a constant value of 0.4. Finally, Equation (3) shows the final model used by our simulations while Figure 4 shows its respective curve. \[\phi=(-27.778\chi^{2}+666.667\chi-3000.024)*0.4 \tag{3}\]

### Gaf-Eh

Our proposed solution is based on the GAF algorithm, introduced in [23]. An improvement was implemented so that the approach would also be able to collect renewable energy. Considering the energy expenditure observed when a node is in listening mode, mechanisms to reduce energy consumption from the nodes were implemented. In order to provide a fair comparison among the approaches proposed in this work, we adapted the GAF algorithm so that it was possible to collect energy. Based on this adaptation, it was considered that if the node's battery was completely depleted, the node would be able \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Variable** & **Standard Value** & **Function** & **Unit** \\ \hline \(\Psi\) & - & Current output power of solar panel & W \\ \hline \(\gamma\) & 0.150 & Maximum output power of solar panel & W \\ \hline \(\Lambda\) & 1000 & Maximum solar intensity possible on the solar panel & W\({}_{\rm P}\) \\ \hline \(\phi\) & – & Current solar intensity in the solar panel & W/m\({}^{2}\) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Solar panel model variables. Figure 4: Adjusted model of solar intensity. to recharge the attached battery and, at the same time, be able to operate in power-saving mode. ### Control Mechanisms

In order to better manage the energy model proposed in this work, we implemented a packet sending control mechanism that is based on both the solar intensity received and also on the amount of energy available in the battery so that the interval between the data packets had a direct relationship with these variables.