# Piezoelectric Energy Harvesting Prediction and Efficient Management for Industrial Wireless Sensor
## 4 Efficient Management of Harvested Energy
### IWS Energy Consumption Model
In this work, the LoRa SX1280 of Semtech [60] transceiver is considered, and for variable packet size, the number of symbols is defined by:  
\[N_{\text{sym}}\ \ =\left\{ \begin{array}{c}N_{\text{prra}}\ +\ 6.25\ +\ 8\ +\ \text{ceil}\left(\frac{max(b+16-4 \text{SF}+N_{\text{out}},0)}{4\text{SF}}\right)si\ \text{SF}\ <\ \text{SF}7\\ N_{\text{prra}}\ +\ 4.25\ +\ 8\ +\ \text{ceil}\left(\frac{max(b+16-4\text{SF}+8+N_{ \text{out}},0)}{4\text{SF}}\right)si\ \text{SF}7\ \leq\text{SF}\leq\text{SF}10\\ N_{\text{prra}}\ +\ 4.25\ +\ 8\ +\ \text{ceil}\left(\frac{max(b+16-4\text{SF}+8+N_{ \text{out}},0)}{4\text{(SF}-2)}\right)si\ \text{SF}>\text{SF}10\end{array} \right. \tag{6}\]  
where \(b\) represents the number of bits in the payload, SF is the spreading factor, and \(N_{prna}\) and \(N_{ent}\), respectively, represent the number of symbols in the preamble and the number of symbols in the header. Considering the transmission power \(P_{\text{tx}}\) and the transmission duration \(T_{oA}\), the energy dissipated for the data transmission \(E_{\text{tx}}(b)\) in \(mJ\), is evaluated as follows:  
\[E_{\text{tx}}(b)\ =P_{\text{tx}}\cdot T_{oA} \tag{7}\]  
By substituting Equation (5) in Equation (7), the expression of \(E_{\text{tx}}(b)\) becomes:  
\[E_{\text{tx}}(b)=\ \frac{P_{\text{tx}}\cdot 2^{SF}\cdot N_{\text{sym}}}{BW} \tag{8}\]  
with \(N_{\text{sym}}\), which is the number of symbols in the packet and evaluated by one of the equations defined in the system of Equations (6). \(BW\) is the bandwidth in kHz and \(SF\) is the spreading factor. The transmission power \(P_{\text{tx}}\) is related to the maximum range of the LoRa transmitter. To assess the maximum range of the LoRa transmitter, one must consider the sensitivity \(S_{R}\) of the receiver, which represents the minimum power necessary to detect the transmitted signal. The sensitivity value is provided in the datasheet, and in the case of the LoRa SX1280 transceiver, it is \(-99\) dBm [60]. The sensitivity corresponds to the power received in a link budget between the LoRa transmitter and the LoRa receiver. Considering the path-loss propagation model and assuming the unit gains antenna, the attenuation factor \(L_{\text{path}}\) is defined as follows:  
\[L_{\text{path}}\ =\ \left(\frac{4\pi f_{\text{LoRa}}}{c}\right)^{2}\cdot d^{n} \tag{9}\]  
where \(f_{\text{LoRa}},\ c,\ n,\) and \(d,\) represent the used frequency, the speed of light, the path loss exponent, and the distance between the LoRa transmitter and the LoRa receiver, respectively. Depending on the attenuation factor \(L_{\text{path}}\) and the transmission power \(P_{\text{tx}}\), the sensitivity \(S_{R}\) will be expressed as follows:  
\[S_{R}\ =\ \frac{P_{\text{tx}}}{\left(\frac{4\pi f_{\text{LoRa}}}{c}\right)^{2} \cdot d^{n}} \tag{10}\]  
Thus, the transmission power in LoRa is linked to the transmission range \(d\) as follows:  
\[P_{\text{tx}}\ =\ S_{R}\left(\frac{4\pi f_{\text{LoRa}}}{c}\right)^{2}\cdot d^{n} \tag{11}\]Finally, the substitution of Equation (11) in Equation (8) makes it possible to express the energy cost associated with data transmission as follows:  
\[E_{\text{tx}}(b,d) = \left(\frac{4\pi f_{\text{LoRa}}}{c}\right)^{2}\frac{S_{R}\cdot d^{ \text{nt}}\cdot 2^{SF}\cdot N_{\text{sym}}}{BW} \tag{12}\]  
The parameters for evaluating the energy cost of the IWS are reported in Table 5 below; the values considered are those of a LoRa SX1280 transmitter from Semtech [60]. Using the parameters in Table 5, it was obtained as a function of the loss exponent (3 or 4), the energy levels shown in Figure 14. The results showed for transmission ranges up to 10 km, the maximum energy demand was 1.02 mJ in an environment with a loss exponent of 3 (which was the case of obstructed factories [61]), while the energy demand is above 10 J for n = 4 which would be the case with obstructed buildings [61]. In the rest of this paper, an exponent path loss of 3 was considered.