A Temperature-Dependent Battery Model for Wireless Sensor Networks

Energy consumption is a major issue in Wireless Sensor Networks (WSNs), as nodes are powered by chemical batteries with an upper bounded lifetime. Estimating the lifetime of batteries is a difficult task, as it depends on several factors, such as operating temperatures and discharge rates. Analytical battery models can be used for estimating both the battery lifetime and the voltage behavior over time. Still, available models usually do not consider the impact of operating temperatures on the battery behavior. The target of this work is to extend the widely-used Kinetic Battery Model (KiBaM) to include the effect of temperature on the battery behavior. The proposed Temperature-Dependent KiBaM (T-KiBaM) is able to handle operating temperatures, providing better estimates for the battery lifetime and voltage behavior. The performed experimental validation shows that T-KiBaM achieves an average accuracy error smaller than 0.33%, when estimating the lifetime of Ni-MH batteries for different temperature conditions. In addition, T-KiBaM significantly improves the original KiBaM voltage model. The proposed model can be easily adapted to handle other battery technologies, enabling the consideration of different WSN deployments.


Introduction
Wireless Sensor Networks (WSNs) are being increasingly used in industrial, commercial and residential facilities to support monitoring applications. The utilization of WSNs has significant restrictions, as nodes are battery-powered, and battery replacements usually have high cost operations. Therefore, it is desirable that WSN nodes use both low-power hardware components and energy-aware protocols and algorithms to save energy.
As WSN nodes can be deployed in outdoor environments or at locations subject to high temperature variations [1], the thermal effect on both the battery lifetime and its voltage behavior must be considered. The thermal effect may accelerate the rate of chemical reactions inside the battery, according to the operating temperature, implying that the battery will be able to provide higher effective capacity at higher temperatures [2]. However, using batteries at higher temperatures may present safety risks or even reduce its life cycle, i.e., its number of charge/discharge cycles [3,4]. Therefore, it is a difficult task to estimate the battery behavior at different temperatures, increasing the complexity of estimating its lifetime for typical operating scenarios. This paper is organized as follows. Section 2 presents some of the most relevant related works that can be found in the literature. Section 3 addresses some fundamental concepts about battery modeling and chemical kinetics that are required for understanding the reasoning behind the proposed model. Section 4 introduces the analytical T-KiBaM and its main characteristics. Section 5 presents the performed experimental assessment that was the basis for the validation of the proposed T-KiBaM. Finally, Section 6 concludes the paper and indicates some guidelines for future work.

Related Work
Despite the widespread knowledge that thermal effects can influence the battery lifetime, analytical battery models often ignore this fact. Nevertheless, some works strive to integrate thermal effects on battery models. Rong and Pedram [4] designed a high-level analytical model to predict the remaining capacity of a Li-ion battery. The model considers the output voltage, the discharge rate and the battery temperature and aging (number of recharge cycles). The Dualfoil simulator [23] was used as the reference for the assessment of this model. Although presenting a maximum accuracy error of 5%, the on-line prediction model requires the use of a System Management Bus (SMBus) module, which is an integrated circuit inside the battery. Besides, this model also requires multiple parameters to be tuned in (up to 42 parameters).
Szente-Varga et al. [24] proposed a set of different models for Ni-MH batteries, based on mathematical approximating functions, which consider arbitrary temperatures and discharge currents. The most appropriate model uses the sum of two hyperbolas and a linear component. It has a total of six parameters. It is possible to retrieve the values for all parameters by curve fitting, according to data retrieved from experiments. However, this model is only able to predict the behavior from a known battery discharge curve (V × t) with constant temperature and load.
Erdinc et al. [14] proposed a dynamic model for Li-ion batteries encompassing both temperature and capacity fading effects. The output voltage considers the open-circuit voltage, the voltage drop from the battery equivalent internal impedance and the temperature correction for the battery potential. The authors validated their model by comparison with other studies, assuming high battery capacities, as well as high discharge currents (>100 mA). Unfortunately, the performed experimental validation does not reflect the behavior of low-power WSN nodes.
Ye et al. [25] proposed a mathematical model for Li-ion batteries considering electronic conduction, mass transfer, energy balance and electrochemical mechanisms. In addition, the proposed model also considers the effect of temperature on battery performance. The achieved results highlight a good approximation with respect to the experimental assessment. However, the performed work was done in the context of electrical vehicles and hybrid electrical vehicles. As a result, it assesses large battery capacities (11.5 Ah) and high discharge currents (e.g., 20 A). Besides, the model has several parameters that need to be tuned in, and some of them are battery specific.
Hausmann and Depcik [26] expanded Peukert's equation to predict the remaining battery capacity, so that it becomes possible to consider the effects of variable currents and temperatures. When comparing the obtained results with results obtained through experiments, simulation results presented a maximum error of 5% in the accuracy of remaining battery capacity prediction. Again, as the scope of the performed work was to assess the use of Li-ion batteries in vehicles, it considers high capacity batteries (60, 90 and 100 Ah) and high discharge currents (6 to 330 A).
The aforementioned research works have the following limitations when dealing with the typical usage of batteries in WSN nodes: (a) they address high battery capacities that are usually found in electrical vehicle applications; for this type of application, the focus is on the charge/discharge cycle behavior of the batteries, and not on their single-cycle charging mode and long duration operating behavior; (b) they consider that accuracy errors in the range of 5%-10% are adequate to characterize the typical usage of batteries in electrical vehicle applications; however, that is not the case for the lifetime estimation of batteries operating on single-cycle charging mode and long-term operation [7]. Other relevant works address energy issues that may be useful within the WSN context. Girban and Popa [27] discuss relevant factors that may influence the energy consumption of nodes. The authors also propose a set of analytical relationships to estimate the network lifetime. Forty et al. [28] use a node prototype to evaluate the battery lifetime in multiple experimental assessments. The achieved results indicate that the battery lifetime has a strong dependence on the time in the Rx state of the radio.

Background
This section presents some of the most relevant concepts required for the understanding of T-KiBaM analytical modeling. First, we discuss some characteristics of Ni-MH batteries, which were used to experimentally assess the proposed model. Afterwards, we present the original KiBaM, its most relevant features and operation mode. Then, we present the basics of the Arrhenius equation, used to integrate temperature dependencies in the analytical KiBaM.

Ni-MH Batteries
Ni-MH batteries are widely used in portable electronic devices, due to their lightweight characteristics and their high energy density. Furthermore, Ni-MH battery technology supports operation in a wide range of temperatures, usually between −10 and 45 • C.
A Ni-MH battery uses nickel hydroxide in the positive electrode. An alloy absorbs hydrogen at the negative electrode. The electrolyte composition is predominantly an aqueous solution of potassium hydroxide. Figure 1 depicts the structure of a common Ni-MH battery. The charge and discharge chemical reactions in a regular Ni-MH battery occur as follows [29]: In this case, M is the hydrogen-absorbing alloy and H ab is the absorbed hydrogen. The overall reaction principle concerns the hydrogen movement from the positive to the negative electrode during the charging process, without the electrolyte taking part in the reaction. The opposite reaction occurs during the discharge process.
A Ni-MH battery presents five important characteristics [29]: (i) The charge procedure is influenced by current, time and temperature, which modifies the battery voltage behavior; the charge procedure can be sped up by higher currents or lower temperatures. Temperatures between 0 • C and 40 • C are suitable for the charging procedure, with a current of 1C (the value of 1C expresses a multiple of the battery nominal capacity) or less; (ii) The discharge procedure is influenced by the same factors. The discharge curve is flat at 1.2 V (assuming only one battery cell), presenting an efficiency reduction if the current increases or if the temperature decreases; (iii) The storage for long periods of time often causes capacity loss due to an effect known as self-discharge. This effect is influenced by the temperature at which the battery is stored. Thus, self-discharge increases with higher temperatures or long storage periods; (iv) The battery life cycle depends on several factors, such as temperature, discharge current, storage conditions, etc. Generally, a Ni-MH battery has a lifetime cycle longer than 500 recharge cycles, if used appropriately over time; (v) The safety of a battery cell must be protected against overload, short circuit and reverse charge. In the case of any of these events, the self-sealing vent must be opened to prevent battery damage.

KiBaM
KiBaM is an analytical battery model, that was proposed by Manwell and McGowan [18,22,30] to model the behavior of high-capacity lead-acid batteries. It uses an intuitive approach, based on a two-tank analogy, to describe the charge/discharge processes. Figure 2 illustrates the abstraction used by the KiBaM, including the related variables. The available charge tank holds an electrical charge that can be immediately used for a device draining current I. The bound charge tank holds a bounded charge that can flow towards the available charge tank, regulated by a valve with a fixed conductance k . Such a constant corresponds to the rate of a chemical diffusion/reaction processes. Constant c corresponds to the total charge ratio stored in the available charge tank. A battery is exhausted when its available charge tank becomes empty, whatever the state of the bound charge tank. The transfer of charge, as well as the amount of unavailable charge are proportional to the difference of the heights between both tanks, δ = (h 2 − h 1 ). Thus, a smaller difference between these two height values provides a longer lifetime for the battery [31].
The following system of differential equations describes KiBaM.
where i is the available charge and j the bound charge. The height values are calculated as h 1 = i/c and h 2 = j/(1 − c), respectively. A new rate constant k for the chemical diffusion/reaction process is defined as: Substituting h 1 , h 2 and k in the system of differential Equations (1), the following is obtained: Laplace transforms can be used to solve this system of differential equations [18]. Thus: where i 0 and j 0 are the amount of charge in the available charge and bound charge tanks, respectively, at the beginning of the calculations (t = 0). In addition, y 0 = i 0 + j 0 , where y 0 is the amount of charge in the battery at t = 0, i.e., the initial battery capacity.
In KiBaM, the unavailable charge (u) is given by Equation 5, where δ is the difference between heights [31]. Equation (6) describes how to compute this difference [21].
The reasoning behind the use of δ is to capture the non-linear capacity variation of the battery [32]. Thereby, KiBaM can model two important battery effects: • Rate capacity refers to the applied discharge current intensity, i.e., a larger discharge current implies faster battery discharges and, therefore, reduces its lifetime. This is due to the battery voltage level, which decays slowly during the battery discharge, reducing its effective capacity for higher discharge currents [7]. • Charge recovery refers to the ability of a battery to partially recover its charge during an idle period, after a discharge period. This phenomenon is related to the electrochemical stabilization inside the battery pack.
The non-linear battery behavior is highly visible, particularly when these two effects act together. This is the case of batteries powering-up WSN nodes that operate in duty cycle schemes, i.e., shorter periods during which the radio is in normal operation (high discharge currents) and longer periods during which it is in low power or sleep mode (low discharge currents). Figure 3 depicts an example of a WSN battery modeled by KiBaM regarding the behavior of both tanks: available charge and bound charge. In the fast discharge curve, the following tasks are performed: 250 mA (900 s), 100 µA (900 s) and 50 mA (2700 s). In the slow discharge curve, the following tasks are performed: 50 mA (900 s), 100 µA (900 s) and 5 mA (2700 s). In this example, KiBaM parameters (y 0 , c and k) were adjusted to model the behavior of a Ni-MH battery.

Estimating KiBaM Parameters
As mentioned in [18], one of the major advantages of the KiBaM analytical model is the ability to retrieve its main parameters through a series of experimental measurements with constant discharge currents. These parameters are: the total charge ratio stored in the available tank (c); the charge flow rate between both tanks (k); and the maximum capacity of the battery (y max ). For the sake of convenience, the guidelines for obtaining these parameters are reproduced in the following paragraphs.
First, it is necessary to normalize the capacities according to a slow discharge rate, which corresponds to a discharge time t 2 . This value is required to express data in terms of the ratio between capacities as follows: where y t is the discharge capacity at discharge time t. Considering that the battery is fully charged at the beginning of the experiments, i = y 0 · c and j = y 0 · (1 − c), then: i/j = c/(1 − c). In this condition, Equation (4) representing the available charge (i) is modified to: Note that y max is the maximum capacity of the battery. It is possible to find the discharge current responsible for emptying the battery in time t, I t , in terms of c and k, by considering i = 0 in Equation (8). Thus: The total charge supplied by the battery at a given rate is the rate multiplied by its time of operation. Therefore: By replacing Equation (9) in Equation (10), after simplifying the result, it is possible to obtain the following: Thus, the c and k parameters can be found given any two F t 1 ,t 2 . By rewriting Equation (11), it is possible to obtain c as a function of k (here, F t = F t 1 ,t 2 for easy understanding): With Equation (12), the c and k values' definition occurs when the same value of k, at two different discharge rates, produces a unique value of c. The method of least squares can be used to solve Equation (11), whenever multiple values of F t 1 ,t 2 are known.
Any slow discharge rate can be used to find y max . Thus, the maximum battery capacity may be obtained from Equation (9):

Voltage KiBaM
As stated in [18], KiBaM is also able to track the battery voltage (V) over time. In this case, it becomes necessary to consider the internal resistance of the battery, R 0 : where E is the internal voltage of the battery. For the battery discharge case, the following equation must be used: where E min is the minimum allowed internal discharge voltage ("empty"), E 0,d is the maximum internal discharge voltage ("full") and i max is the maximum capacity of the available charge tank. The internal resistance, R 0 , can be experimentally determined using constant discharge currents. Its value is represented by the slope dV/dI, when the battery is fully charged, i.e., plotting V × I and finding the slope gives R 0 [18].

Arrhenius Equation
As noted by Manwell and McGowan [18], most chemical processes are sped up at higher temperatures, which corresponds to a higher k value in KiBaM. This behavior is consistent with the higher battery capacities observed at higher temperatures, suggesting that it may be appropriate to use a chemical kinetics analysis based on the Arrhenius equation to model the influence of temperature on batteries.
Svante August Arrhenius (1859-1927) has contributed to the development of classical chemical kinetics. His contribution refers to the influence of temperature on the rate of a chemical reaction, which follows an empirical law known as the Arrhenius equation: where k is the constant rate of a reaction, A is the pre-exponential factor or pre-factor (in s −1 ), E a is the activation energy (in KJ/mol), R is the universal gas constant (8.314 × 10 −3 KJ/mol·K) and T is the temperature (in Kelvin). Equation (16) indicates that the increase of the reaction rate occurs either by increasing the temperature or by decreasing the activation energy (i.e., using a catalyst). In an extreme situation, i.e., an infinite temperature or the activation energy equal to zero, e − Ea R·T = 1. The result leads to k = A, which means that the value is an A upper-bound for the reaction rate.
Equation (16) can be written in a more convenient form by applying a natural logarithm: Typically, the activation energy (E a ) definition refers to the minimum energy required to start a chemical reaction. Experiments at two different temperatures allow one to obtain the value of the activation energy. Equation (17) can be used for both experiments. In this case, consider the following: It is possible to re-write the above equations as follows: By solving both equations with respect to E a , it is possible to obtain that: Furthermore, by determining the value of k at different temperatures, it becomes possible to find the upper-bound value for the reaction rate (A) through the Arrhenius plot (Equation (16)).

T-KiBaM
The target of this section is to detail the integration of the Arrhenius equation with KiBaM. The resulting analytical model, Temperature-Dependent KiBaM (T-KiBaM), is able to integrate the effect of temperature on the battery operating behavior, particularly upon both its voltage behavior and its lifetime. Consider the proposition below. Proposition 1. Both k parameters from KiBaM and the Arrhenius equations refer to a constant reaction rate, which models the rate of a chemical diffusion/reaction process (in KiBaM, this rate is represented by the charge rate between both tanks). Thus, considering that k KiBaM = k Arrhenius : Therefore, the constant rate parameters of KiBaM (Equation (2)) are now re-defined to consider the activation energy (E a ) and the temperature (T), as defined in Equation (16).
A set of experimental assessments was performed to validate this procedure and to illustrate how to use the proposed T-KiBaM. Briefly, a set of experiments with Ni-MH batteries were performed to obtain the T-KiBaM parameters, c and k. Then, the described methodology was applied to obtain the Arrhenius constants, E a and A. Finally, the proposed approach was validated by comparing the experimental results against the results obtained with the analytical T-KiBaM. This methodology is presented below. Note that, except when explicitly stated, all presented graphs contain interpolated voltage curves upon the experimental data, in order to clearly present the obtained results.

Finding Activation Energy (E a ) and the Upper-Bound of the Reaction Rate (A)
The experimental assessment was done using a set of twelve Panasonic batteries, Model HHR-4MRT/2BB (2xAAA, Ni-MH, 2.4 V, 750 mAh). The batteries were fully charged at the beginning of the experiments, being discharged until reaching the cut-off value of 2.0 V. The time required for reaching this voltage level defines the battery lifetime in each experimental assessment. Note that this cut-off value is commonly used in experimental tests with Ni-MH batteries, in order to prevent the internal damage that could occur if the voltage level went below 2.0 V [29]. The recharging time was around eight hours, by using a common Ni-MH battery charger (output: 1.2 V DC , 250 mA). The batteries stayed at rest during, at least, 60 min before the start of each experiment.
A test-bed has been specifically developed for this experimental assessment, which includes a discharge-controlled circuit and an Arduino UNO [33]. This test-bed allows setting up controlled discharge currents to the batteries and collecting the experimental data for further analysis. Figure 4 presents a photo of the test-bed circuit, and Figure 5 illustrates the interconnection of its main blocks. The discharge-controlled circuit is able to consume currents in the range of 30 µA-30 mA, commonly found in COTS low-power WSN nodes, e.g., MICAz from Crossbow [34]. It is possible to select among 256 consumed current values, by using a digital potentiometer (AD5206, Analog Devices, Inc., Norwood, MA, USA) [35]. The discharge-controlled circuit guarantees a constant discharge current from the batteries, by using a controlled current source. The batteries' board also includes a temperature sensor (Maxim 18B20) [36] for temperature measurements.  An Arduino UNO controls all circuit components and collects the experimental data from the batteries' board: battery voltage and temperature. The UNO board has analog inputs with 10-bit resolution, the data log interval being adjustable. For the performed assessments, data were recorded every 10 s. A computer receives the collected data from the UNO board through a USB connection using CoolTerm [37], which stores all data in a TXT file for further analysis.
The experiments were performed at a set of different temperatures, with a 15 • C step, −5, 10, 25 and 40 • C, using thermally-insulated equipment with temperature control. A complementary full experiment was performed for 32.5 • C, as this temperature was found to be the most relevant outlier between the assessed temperature values. For all of the experiments, only the batteries (including the temperature sensor) remained inside the thermally-insulated equipment, at a controlled temperature.
Three experimental assessments were performed for each of the above-mentioned temperature values and for each of the following discharge current values: 10, 20 and 30 mA (actually, due to the available 256 resistance values obtained from the digital potentiometer, the considered current values were: 10.424, 20.303 and 30.242 mA). A total of 45 experiments were performed, three for each current/temperature pair. Thus, average lifetime/voltage values from three experiments were considered for each measurement presented in this paper.
For the estimation of the T-KiBaM parameters, only two temperature values are required. Therefore, just the measurements for −5 and 25 • C were considered for this purpose. It is possible to obtain the capacity provided by the battery using Idt. As the discharge current is constant, the capacity is obtained by just multiplying the current value by the experimental lifetime, i.e., I · t I . Table 1 shows the obtained results for both temperature ranges. Figure 6 depicts the discharge curves for each temperature.  The obtained set of experimental measurements (numerical values are represented with up to five significant figures, whenever available) allows the evaluation of the T-KiBaM parameters, as previously explained in Section 3.3: Note that being that k 1 < k 2 , this indicates that the reaction rate is slower at lower temperatures. By using Equation (18), it is possible to obtain the activation energy value, E a , which is equal to 1.1949 KJ/mol. Through the activation energy (E a ), k 2 and temperature (T 2 ) values, it is possible to obtain an upper-bound for the reaction rate (A): The new values for k are then obtained by combining Equation (19) with the obtained values of A, E a , R and T. Thus, k values vary with temperature, defining the T-KiBaM dependence on temperature as shown by Proposition 1. Finally, A and E a values are constant values for a given battery type and do not depend on the temperature value. Table 2 depicts the relationship between k and temperature. Note that it is possible to extrapolate the values of k beyond the temperature range at which the parameters were obtained, due to the chemical kinetics concepts modeled by the Arrhenius equation. Table 2 shows the behavior of the reaction rate (k) between −12.5 and 47.5 • C. However, it is also worth mentioning that the operating limits of the battery must be taken into account for these extrapolations. The indicated temperature range for the discharge of Ni-MH batteries varies from −10 to 45 • C [29].

Calibrating T-KiBaM for Battery-Specific Characteristics
Temperature also affects the battery capacity. Typically, batteries provide higher effective capacities at higher temperatures [2] and lower effective capacities when used at lower temperatures [38]. Within this context, it is crucial to adjust T-KiBaM to the technology of the battery being modeled (e.g., Ni-MH or Li-ion).
Therefore, in this section, we present a method for adjusting the T-KiBaM parameters accordingly. Briefly, through a set of experimental assessments, it is possible to evaluate the losses and gains of the battery capacity according to the temperature variation. Such knowledge is incorporated in T-KiBaM to model the initial battery capacity under different temperature conditions. First, fifteen experiments were performed with the same discharge current, 30 mA, under five different temperatures: −5, 10, 25, 32.5 and 40 • C (three experiments for each temperature). Each of the following average lifetimes was obtained from three battery pairs: 24.749, 25.087, 25.385, 25.560 and 25.022 h, respectively. Figure 7a illustrates the related discharge curves, V × t (for the sake of clarity, the results at 40 • C were not included). Note the non-linearity of these voltage curves throughout the experiments with different curves for different temperatures, even using the same discharge current. As previously mentioned, the capacity provided by the battery can be evaluated by integrating its discharge current over time. From the obtained results, it becomes possible to evaluate the losses and gains of the battery capacity at different temperatures, in order to establish the Correction Factor (CF) of the initial battery capacity (y 0 ) for each situation. The losses and gains of the battery capacity are evaluated with respect to the battery nominal capacity, which was 750 mAh for this case. Table 3 presents the obtained results. After establishing the correction factor, which indicates the gain or loss of the initial battery capacity (y 0 ) at different temperatures, it is possible to find a function that properly fits the data. Figure 7 (b) depicts the CF data points and the fitted curve. A smoothing spline (piecewise polynomial function of degree three) [39] with p = 0.6 and w = [1, 1, 1, 1, 1] fits the obtained data points: Table 4 presents the coefficients for each segment. Note that this function enables the adjustment of the initial battery capacity according to the selected temperature and is valid only within the aforementioned temperature range, i.e., from −5 to 40 • C, which represents the case for most part of the applications within the WSN context (e.g., from snow [40] to industrial [41] monitoring applications).

Modeling the Voltage Behavior for Ni-MH Batteries
Voltage is important output information from the battery modeling, as it provides a perspective on how the battery behaves over time. In this sense, it is valuable to model variable V × t during the discharge process, in order to understand the ability of the battery to maintain its nominal voltage. The original KiBaM offers this possibility (Equation (14)), though inaccurately since it does not model the exponential voltage decrease at the beginning of the discharge curve, nor the "knee" at the end of the discharge curve (as will be illustrated later, in this section), which can be observed in real experiments with Ni-MH batteries (cf. Figure 7). Thus, it becomes necessary to improve the voltage model that has been used in KiBaM.
Tremblay and Dessaint [42,43] developed a voltage model for different battery technologies, e.g., lead-acid, Ni-MH, Ni-Cd and Li-ion. Although being able to handle both charge and discharge curves for each battery type, only the Ni-MH battery discharge model is presented in this paper.
The Tremblay-Dessaint voltage model can accurately represent the voltage dynamics with varying current values. Besides, it considers the Open Circuit Voltage (OCV) as a function of the State of Charge (SoC). Thus, the battery voltage may be obtained as follows: where V b is the battery voltage (V), E 0 is the battery constant reference voltage (V), K b is the polarization resistance (Ω), Q is the battery capacity (Ah), it = idt is the actual battery charge (Ah), A b is the exponential zone amplitude (V), B is the exponential zone time constant inverse (Ah) −1 , R b is the internal resistance (Ω), i is the discharge current (A) and i * is the filtered current (A). For further details, please refer to [42,43]. Equation (21) is valid only for Li-ion batteries, as it presents an exponential term that is not observed in other battery types, such as lead-acid, Ni-MH and Ni-Cd. These batteries exhibit a hysteresis phenomenon between the charge and discharge processes, which occurs only at the beginning of the discharge curve, regardless of their SoC. This phenomenon can be represented by a non-linear dynamic system:Ė where Exp(t) is the exponential zone voltage (V), i(t) is the discharge current (A) and u(t) is the charge/discharge mode. The exponential voltage relies on its initial value Exp(t 0 ) and the charge (u(t) = 1) or discharge (u(t) = 0) mode. Briefly, the final form for the discharge equation of the voltage model for Ni-MH and Ni-Cd batteries is as follows: However, this voltage model presents an inconsistency at the end of the analytical evaluation (cf. Figure 4  In this section, we propose the Temperature-Dependent Voltage Model (TVM) model, an extension of the Tremblay-Dessaint model, which is able to attenuate the above described problems (P1 and P2) and appropriately represent the influence of the temperature on the V × t curve during the battery discharge.
In order to increase the accuracy of the Tremblay-Dessaint voltage model, i.e., attenuating P1 and P2, a smoothing constant, τ b , has been added. This τ b value multiplies the terms that relate current and time, i.e., it andĖ xp(t). Therefore, Equations (22) and (23) should be rewritten as follows: All parameters (A b , B, E 0 , Exp(t 0 ), K b , Q, R b and τ b ) can be obtained using the battery data-sheet or by performing experimental measurements [43]. Considering an experiment at −5 • C, for example, the following values can be obtained:  (14)). The raw experimental data are then used to make a point-to-point comparison with just the T-KiBaM analytical curve, as the original KiBaM linear results are clearly inaccurate along the time scale. Note that a reduced steady-state relative error is obtained for most of the T-KiBaM analytical results. The following absolute errors were obtained for T-KiBaM values: 3.1% (max) and 0.6% (mean).
Experiments performed for different temperature values enabled the extraction of the voltage model parameters. Table 5 illustrates the Arrhenius constants obtained for each parameter, as well as the values of all parameters at each temperature.
Finally, it becomes possible to represent the values obtained from the T-KiBaM analytical voltage model adapted to different temperatures, using the set of parameters represented in Table 5, along with their respective constants A and E a , using the Arrhenius equation. Figure 9 depicts the voltage results for the different temperatures using Arrhenius constants. The absolute errors are: (a) T = −5 • C: 3.1% (max) and 0.6% (mean); (b) T = 10 • C: 2.9% (max) and 0.7% (mean); (c) T = 25 • C: 2.0% (max) and 0.9% (mean); (d) T = 32.5 • C: 6.7% (max) and 1.2% (mean). Figure 10

T-KiBaM Summary
This section summarizes the parameters of the T-KiBaM analytical model regarding the used Ni-MH batteries. Table 6 illustrates the experimentally-obtained values, as described in the previous sections (in Table 6; T c and T k are the temperatures in degrees Celsius and Kelvin, respectively). Table 6. Temperature-Dependent KiBaM (T-KiBaM) parameters for a Ni-MH battery.

Model
Parameter Value E a 1.1949 Table 4 T-KiBaM Table 5

Analytical and Experimental Results
Finally, this section aims to present the performed T-KiBaM validation. Briefly, we use MATLAB to implement the T-KiBaM analytical model (Equations (4) and (19)). Then, both analytical and experimental results were compared regarding the battery lifetime. Below, details about the implementation of the analytical set-up are shown.

Implementing T-KiBaM
First, the following steps must be performed to find the function that allows calculating the Correction Factor (CF) with respect to the initial capacity of the battery, according to the temperature (TEMP): 1. Perform at least four experiments at distinct temperatures using the same constant discharge current, whose value should be within the interest range of the supported WSN application. 2. From the obtained results in Step 1., extract the charge losses/gains according to the battery nominal capacity. 3. From TEMP vs. CF data, it is possible to determine a function that properly fits the data behavior. 4. Add such a function to the T-KiBaM implementation.
Next, there is the need to implement Equation (4) as a function to compute the battery lifetime. Its purpose is to update the content of both tanks: available charge and bound charge. Algorithm 1 depicts the function structure, as well as its definitions.

Algorithm 1: T-KiBaM_function
Input: c, k, i 0 , j 0 , t 0 , I, t I Output: i 0 , j 0 , t 0 1 y 0 = i 0 + j 0 ; 2 t 0 = t 0 + t I ; 3 i 0 = compute-i (c, k, y 0 , i 0 , j 0 , I, t I ); 4 j 0 = compute-j (c, k, y 0 , i 0 , j 0 , I, t I ); 5 return (i 0 , j 0 , t 0 ); The T-KiBaM function input parameters are: c, k, i 0 , j 0 , t 0 (total lifetime), I (discharge current) and t I (operating time of I). Note that Lines 3 and 4 perform the calculations corresponding to Equation (4). In addition, by making the appropriate changes, one-dimensional arrays can replace I and t variables to evaluate a set of tasks. Algorithm 2 depicts the call for the previously-described function.

Algorithm 2: T-KiBaM_call
Input: E a , A, R, T, c, y 0 , k, t 0 , I, t I Output: i 0 , j 0 , t 0 (Computed Lifetime) 1 y 0 = y 0 · CF(T); 2 i 0 = (c) · y 0 ; 3 j 0 = (1 − c) · y 0 ; 4 k = A · e −Ea/(R·T) ; 5 while i 0 > 0 do 6 [i 0 , j 0 , t 0 ] = T-KiBaM_function (c, k, i 0 , j 0 , t 0 , I, t I ); 7 end 8 return (i 0 , j 0 , t 0 ); In this case, note that the correction factor is applied in Line 1, as described in Section 4.2. In addition, the definition of k (Line 4) considers the Arrhenius equation values (E a , A, R and T), obtained through experiments in Section 4.1. Through the while loop (Line 5), it is possible to verify the content of the available charge tank, which needs to be greater than zero, even if there is charge in the bound charge tank. Thus, regardless of the available charge in the available charge tank, the algorithm performs the discharge according to the load value (I).

Validating T-KiBaM
The T-KiBaM analytical evaluation involves the use of Algorithms 1 and 2. The following discharge currents were used for the evaluations: 20 and 30 mA, which represent the same current values used for the experimental assessments. The input parameters were the same as those mentioned in Algorithm 2. However, note that the battery initial capacity (y 0 ) is defined according to the values of each experiment. Besides, the value c = 0.56418 was used, which represents the average of c 1 and c 2 values (mentioned in Section 4.1). Table 7 illustrates the results of the analytical evaluations using T-KiBaM. The EXP, T-KiBaM and ERR columns represent, respectively, the experimental average lifetime of three battery measurements, the lifetime using T-KiBaM and the relative error between EXP and T-KiBaM. Note that the adapted model performs the battery lifetime estimation with an average relative error of 0.21% for low temperatures (−5 • C) and 0.23% for 25 • C. These results demonstrate that T-KiBaM is able to accurately estimate the battery lifetime of WSN nodes, presenting average accuracy errors smaller than 0.25% when using the battery nominal capacity. Our rationale is that, if all 45 tests (with one pair of batteries each) were started with exactly the same battery capacity, even better results would have been achieved using T-KiBaM. However, this is an assumption that is difficult to hold as, due to electrochemical reactions inside the batteries, it is not possible to guarantee the exact same value with respect to the initial battery capacity for each test.

Model Comparison: KiBaM vs. T-KiBaM
This section compares the original KiBaM and T-KiBaM as concerns the expected battery lifetimes for five different temperatures. The target is to perform an experimental validation of T-KiBaM. The analytical evaluations consider the following details.
The constants used for setting up KiBaM are the ones that were obtained at 25 • C, i.e., c 2 = 0.56486 and k 2 = 0.59526. For T-KiBaM, c = 0.56418, and the value of k varies according to the evaluated temperatures (cf. Table 2). The initial battery capacity is the same for both models, y 0 = 2700 As (750 mAh). Nevertheless, T-KiBaM adjusts this value after the start of the analytical evaluation, in accordance with the related Correction Factor (CF). The evaluated temperatures (TEMP) were the following: −5, 10, 25, 32.5 and 40 • C. The battery is drained until the end of the available charge in all of the analytical evaluations. Table 8 presents the results obtained using both models. As expected, KiBaM presents the same battery lifetimes for all situations, regardless of the evaluated temperature. In the KiBaM analytical evaluation, the average relative error is 1.50%, with a standard deviation of 1.12%. The largest error occurs at 32.5 • C, where a difference of 2.98% (45 min) is achieved between the experimental assessment and the analytical evaluation. Considering a period of 365 days (one year), this error would generate a difference in the battery lifetime of 10.8 days.
On the other hand, T-KiBaM presents different battery lifetimes according to the assessed temperatures. For this case, the average relative error is 0.01%, with a standard deviation of 0.01%. The largest error occurs also at 32.5 • C, where a difference of 0.03% (29 s) is observed. In one year, this error would represent a difference of 0.1095 days [1,44].
It is possible that thermal effects will have an even greater impact when applying intermittent discharge currents to the battery, e.g., WSN nodes operating in a duty cycle scheme. Our rationale is that, by taking advantage of the radio sleep periods at different temperatures, the transfer rate from the bound charge tank to the available charge tank (recovery effect) will also be variable, i.e., parameter k will have different values according to the temperature (cf. Table 2). In other words, a smaller value of k implies a slower rate for the charge recovery. This behavior may have a substantial impact on the battery lifetime for different temperatures, particularly when long periods of time are evaluated, e.g., weeks or months. Therefore, this is an issue that must be addressed in future work.

Conclusions
Estimating battery lifetimes is a complex task, as there are multiple factors influencing their behavior. The most studied factors are both the rate capacity and the charge recovery. However, the thermal effect also plays an important role as concerns the evaluation of their lifetime. Thermal effects can modify the electrochemical reaction rate and/or impair the battery operation. In the case of WSNs, battery-powered nodes are especially prone to the influences of temperature variations, especially in outdoor environments.
Within this context, the availability of adequate battery models able to encompass thermal effects would be of utmost importance. This paper proposes an extension to the widely-used analytical KiBaM to encompass thermal effects. As a consequence, it provides a valuable tool for the battery lifetime estimation at different temperatures. The proposed model extension was validated through an extensive experimental assessment, using Ni-MH batteries operating at different temperatures. The achieved results show that the proposed T-KiBaM extension presents an average accuracy error smaller than 0.33%, when estimating the lifetime of batteries for different temperature conditions. This result significantly improves the accuracy of KiBaM for the same operating conditions, which is slightly smaller than 2.7%. The full experimental and analytical assessments can be examined in Appendix A.
As future work, it would be necessary to evaluate the behavior of T-KiBaM with other battery types, e.g., Li-ion. The rationale beyond the proposed set of equations suggests that the same set of formulae can be used to obtain the parameters for different battery types. Furthermore, the proposed extension of KiBaM should also be tested for duty cycle battery loads, similar to those that can be found in typical WSN applications. Finally, it would be interesting to evaluate the performance of the proposed model in a microcontroller typically used in WSNs. Table A1 illustrates a comparison between experimental and analytical results for each of the assessed temperatures. The EXP column represents the average discharge time of three discharge experiments using different batteries of the same model, i.e., Panasonic HHR-4MRT/2BB.
The results obtained when using using Peukert's Law [7,[45][46][47] were also included for comparative purposes. This is a simpler analytical battery model, which can capture part of the non-linear properties of the batteries, where the battery lifetime (L) can be evaluated using: I being the discharge current and a and b experimentally-obtained constants. Ideally, a corresponds to the battery capacity, and b is equal to one. In this comparison, the value of a was set at 0.75 Ah, which corresponds to the nominal battery capacity, and b was adjusted according to the experimental results at 25 • C using the discharge current I = 30 mA. Thus, b = 1.0067. Table A1 also contains the results of T-KiBaM when the discharge current of 20 mA was used to calculate the function that returns the correction factor for each temperature. In this case, the same methodology mentioned in Section 4.2 was followed to generate the function parameters.
The behavior of the battery voltage over time was also assessed in this work. In this case, the experimental results were compared with the analytical results using both KiBaM and T-KiBaM. Figure A1 depicts some examples of voltage tracking at different temperatures.

°C
Experimental Data T-KiBaM + TVM KiBaM Voltage Model Note that KiBaM presents the same results in all analytical assessments, since this model is not able to handle different temperatures. In addition, KiBaM represents linearly the voltage behavior, which causes a significant error in relation to the experimental data when analyzing different cut-off points, as in the range between 2.0 and 2.5 V. On the other hand, T-KiBaM is able to deal more accurately with voltage tracking at different temperatures. For instance, at T = −5 • C ( Figure A1 top-left), analyzing the voltage level equal to 2.4 V, the relative error to the experiment of KiBaM is 37.53%, while in T-KiBaM is 0.73%.