# GPRS Sensor Node Battery Life Span Prediction Based on Received Signal Quality: Experimental Study
## 4 Data Analysis and Discussion
### SIM 800L Based Sensor None Life Time Estimation
#### 4.3.2 Battery Life Prediction Model for SIM800L Sensor Node  
While planning for the development of an IoT network it is necessary to estimate the duration of each network node so that the time on which the battery will be replaced shall be known [6]. It has been found that the GPRS sensor node consumes more power when it is located in a location with bad signal quality and consumes low power when it is located in a location with good signal quality. In this section, we are trying to find a mathematical relationship between the current consumption for a GPRS sensor node at a particular location with the received signal quality.  
From the Figure 20, the relationship between the current and RSSI seems to exponentially decay. So, it can be written using the following equation. In this case, the current consumption is our independent variable while the signal quality RSSI is the predictive variable or independent variable and this can be expressed by the following equation:  
\[Y=Ae^{r\alpha} \tag{8}\]  
where \(Y\): The average current consumption, \(A\): an initial value and has to be greater than zero \(r\): a local rate and has to be negative \(\lambda\): the signal quality or RSSI  
The analytical solution for the Equation (8) can be written as:  
\[Y=a+\frac{b}{\alpha}+c*ln(\alpha) \tag{9}\]  
In trying to find a mathematical relationship between the current consumption of a GPRS sensor node with respect to the location where it is placed, we used Python APM (advanced Process Monitor) through its interface GEKKO which is a Python library for machine learning and optimization of mixed-integer and differential equations [41]. We found the solution for the Equation (9) as:  
\(a=0.085966482761\)  
\(b=-0.19094884551\)  
\(c=-0.020681155519\)In the end, we tried to calculate the coefficient of determination R\({}^{2}\) to see how our measured data fit our model and the value of R\({}^{2}\) was found to be 0.9231243723176469 which is tending to be unit. This shows that our model is somehow accurate. So, Equation (6) can be written as:  
\[Y=0.085966482761-\frac{0.19094884551}{\alpha}-0.020681155519*ln(\alpha) \tag{10}\]  
For our experiment, the above Equation (10), can help us to estimate other currents consumption of our radio unit for other locations in case the RSSI value is known. The RSSI for a particular location can be known using the techniques detailed in Section 3.7.4.  
By combining the Equation (10) and equation and Equation (5) and considering that y = Cr (the average current consumed by the radio unit, the Equation (5) can be written as:  
\[B_{l}=\frac{B_{c}}{C_{s}+C_{mcr}+0.085966482761-\frac{0.1904884551}{\alpha}-0. 020681155519*ln(\alpha)} \tag{11}\]  
where:  
\(B_{l}\): Battery life in Hours \(B_{c}\): battery capacity in mAh \(\alpha\): the received Signal Strength Information RSSI in dBm \(C_{s}\), \(C_{mr}\): the current consumption for sensor circuitry and microcontroller unit respectively.  
Considering that the current consumption for the sensory circuitry and the current consumed by the microcontroller are known, the Equation (11) can be considered as our mathematical model which can even help in estimating how long a GPRS sensor node with SIM800L will live at a particular location with known signal quality.