The main target for the use of the temperature-dependent battery models presented in the previous section is for the prediction of the lifetime and voltage behavior of typical WSN batteries. Basically, these are analytical models that can be included in simulation models, to perform the simulation assessment of WSN deployments. On the other hand, one of the main targets of this paper is to show that these models can be also implemented upon low-power small-memory MCUs, providing accurate results for the prediction of both the lifetime and the voltage behavior of typical WSN batteries. Therefore, the purpose of this section is to present a set of T-KiBaM functions, which may be deployed upon WSN-compatible MCUs. These software functions will be experimentally validated by comparing their analytical and experimental results.
4.1. T-KiBaM Functions
The purpose of T-KiBaM is to provide an estimate of the State of Charge (SoC) of the battery over time at different temperatures, including information about its voltage level. Therefore, it becomes possible to obtain the estimated battery lifetime according to the discharge profile and the used temperature. The implementation presented in this work is divided into two stages: (i) the call to the T-KiBaM function and (ii) the T-KiBaM function itself. Such stages are described below.
The first stage implements the call to the T-KiBaM function, that has as input the discharge profile. Such discharge profile (DP) is defined by a set of pairs
, where
represents the discharge current and
represents its operating time (or time step), with
. For example,
. Therefore, this stage returns the updated values regarding the T-KiBaM and TVM functions. Algorithm 1 shows the implementation of the function call that uses Equations (
1) and (
7) to update the battery data.
Algorithm 1: tkibam_call. |
![Jsan 06 00008 i001]() |
The input parameters at this stage are related to the Arrhenius equation (
,
A,
R,
T), to T-KiBaM (
,
c,
k,
,
) and TVM (
,
,
,
,
B,
). In T-KiBaM parameters, note that
represents the initial battery capacity. In this case, this parameter receives the nominal capacity of the battery used as reference. The parameter values of
c and
k are dependent on the battery technology. In this work, these three values were obtained from a Panasonic battery, model HHR-4MRT/2BB (2xAAA, 2.4 V, 750 mAh). For more information on how to obtain these parameters, please refer to [
16]. Next, parameter
represents the total battery lifetime. In addition, parameter
may contain one or more pairs
to indicate the use of a set of tasks (i.e., a discharge profile as depicted in
Figure 1). This feature is useful as a WSN node usually has different discharge currents for different operating states, e.g., Tx, Rx and Sleep. Using the
definition, duty cycles can also be used in the T-KiBaM implementation. In the TVM parameters,
represents the initial value of the exponential voltage,
, which is used for the calculation of
in each iteration.
In Algorithm 1, the correction factor (CF) function is applied in Line 1, as described in
Section 3.2. In addition, the definition of
k (Line 4) considers the Arrhenius equation values (
,
A,
R and
T), which can be obtained through experiments (please refer to [
16] for details). Through the for loop (Line 6), it becomes possible to call the T-KiBaM function according to the used discharge profile. As presented in Line 8, the user of T-KiBaM should check the content of the available charge tank, which needs to be greater than zero. This is a necessary condition for the battery operation, even if there is charge at the bound charge tank. Finally, note that the battery voltage level is obtained in Line 11, which performs the calculations corresponding to Equation (
7). Finally, the algorithm returns some additional information about the battery, such as remaining battery charge in both tanks (
and
), battery run time (
), and voltage level (
) when executing the discharge profile
.
The T-KiBaM function implements the concepts presented in
Section 3.1, where Equation (
1) is used to calculate the charge of the battery over time. This stage returns the updated values in relation to the battery charge and its time of use. Algorithm 2 shows how to implement the T-KiBaM function.
Algorithm 2: T-KiBaM_function. |
Input: c, k, , , , I, |
Output: , , t |
1 ; |
2 ; |
3 = compute-i (); |
4 = compute-j (); |
5 return (); |
The input parameters of the T-KiBaM function are as follows:
c,
k,
,
,
,
I and
. The values of
I and
represent a task in the
. Note that Lines 3 and 4 perform the calculations corresponding to Equation (
1). The output values of
and
represent the actual state of charge in the available and bound charge tanks, respectively. Finally,
t represents a time accumulator that is used to compute the total time of battery usage.
The knowledge about the SoC of the battery is very important for the development of energy-aware strategies. In this approach, during the node duty cycle, for example, it is possible to perform an iteration of T-KiBaM for each performed task (e.g., Tx, Rx, Sleep) in order to update the battery status (SoC and voltage level). With this, the node can take different decisions according to the current capacity of the battery. Although the proposed approach is flexible in several aspects, the following assumptions should be considered when running the T-KiBaM model:
The node initializes its operating cycle with a fully charged battery, i.e., SoC = 100%. In addition, the T-KiBaM model is adjusted for the used battery technology. Therefore, it is not necessary to measure any battery information over time (e.g., voltage level);
The node knows the discharge profile for all tasks that need to be performed during its operation. Knowing the discharge current in the transition between states, as well as the time it takes to perform such action, makes the T-KiBaM even more accurate. Thus, it is possible to parametrize T-KiBaM with the measured values and the time spent in each state/transition. In this case, the better the discharge profile definition, the greater the accuracy of the estimated battery behavior. Note that the discharge profile can be obtained from an analysis of the hardware power consumption (e.g., MCU, transceiver, sensors, etc.);
The duty cycle of the node does not have to be constant since T-KiBaM supports different operating times () for each task (), allowing the configuration of any combination of tasks;
The node can obtain the environment temperature, which is provided to the T-KiBaM model to increase the accuracy of the estimate on the battery behavior.
An application example is presented in
Section 6 to demonstrate the use of the T-KiBaM model.
4.2. Analytical vs. Experimental Comparison
The objective of this section is to validate the analytical evaluations comparing analytical results obtained from the T-KiBaM model with some experimental results, comparing the error between the two approaches regarding the battery lifetime estimation and its voltage behavior over time. Note that the values of all the constants of the T-KiBaM model were previously obtained by Rodrigues et al. [
16]. In addition, all the analytical evaluations use the same experimental characteristics, such as discharge profile and temperature.
First, tests with continuous discharge currents were performed at different temperatures to evaluate the accuracy of the T-KiBaM model. The evaluated temperatures were as follows:
, 10, 25, 32.5, and 40
C. The used discharge currents were 20 and 30 mA. With this, it became possible to analyze the relative Error (ERR) between analytical and experimental results.
Table 2 presents the results of these evaluations. The experimental results (EXP), T-KiBaM and ERR columns represent, respectively, the experimental average lifetime of three battery measurements (note that the cutoff value of 2.0 V is considered for the calculation of the battery lifetime), the lifetime using T-KiBaM (in this case, the lifetime is reached when SoC
%) and the relative error between EXP and T-KiBaM. The average ERR (AVG) values are presented at the of the table.
Next, some experiments using a Duty Cycle (DC) scheme were also carried out to evaluate the ability of the T-KiBaM model to handle typical WSN scenarios. The discharge current was set at 30 mA to decrease the time of the experiments. The following duty cycle schemes were evaluated:
Note that the duty cycle period is 4 s for
and
, and 2 s for
. In addition, only the temperature at 25
C was used in the experiments.
Table 3 presents the results of this evaluation, including the relative Error for each situation.
These results demonstrate that T-KiBaM is able to accurately estimate the battery lifetime of WSN nodes, presenting average ERR values smaller than 0.35% for continuous discharge currents and an average ERR value of 1.73% for duty cycle schemes. However, although the presented results are quite accurate, battery lifetime is not the only interesting information that can be extracted from the T-KiBaM model.
The voltage level is another relevant factor when evaluating the behavior of batteries. In the case of T-KiBaM, the battery voltage model provides voltage values that are dependent on the operating temperature, which allows monitoring the state of the battery more accurately, particularly, in WSN scenarios with high temperature variations.
Figure 3 depicts an example comparing the experimental results using a continuous discharge current (30 mA) at different temperatures with those analytically obtained using the T-KiBaM and KiBaM models. The experimental data are fitted according to the average behavior of three experiments.
Note that the original KiBaM voltage model represents a linear battery discharge curve,
. This type of approximation induces significant errors with respect to the lifetime analysis of any device connected to the battery. On the other hand, the T-KiBaM + TVM model offers a higher precision when estimating the behavior of the battery voltage curve over time. For instance, at
T = −5
C (
Figure 3a), analyzing the voltage level at 2.4 V, the relative error to the experiment of KiBaM is 37.53%, while in T-KiBaM is 0.73%.