Keywords

1 Introduction

Wireless Sensor Networks (WSNs) are commonly composed of a large number of nodes, deployed in an area of interest, with self-management capacity [1]. Their nodes are characterized to be devices with processing, communication, and sensing capacities. Due to the reduction in manufacturing cost of the electronic components such as microcontrollers, transceivers, and sensors, WSNs are increasingly being adopted in many important application domains, including residential, commercial and industrial ones.

However, the nodes are usually powered by batteries and it is not feasible to replace the batteries of a large number of nodes for two reasons: cost and accessibility, mainly assuming that the deployments may occur in places with difficult access or which impose health risk. Thus, one of the great challenges of WSNs lies in the power management of the nodes in order to save the energy consumption of the network as a whole.

Another factor that hinders the power management in WSN is related to the complexity of the batteries. In these components, electrochemical reactions are responsible for ensuring the power supply to the node. However, several factors (e.g., the discharge current intensity, operating temperature and chemical composition) may affect the battery operation. In this sense, it is common to observe a non-linear behaviour in these components over time.

In general, battery models aim to estimate the battery behaviour over time, which may include the knowledge about its lifetime, voltage level or State of Charge (SoC), for instance. Specifically, the analytical battery models are based on mathematical equations that consider the application load profile for estimating the battery lifetime. It is important that such models adequately represent the main effects that affect the batteries, such as the rate capacity and charge recovery, since the battery lifetime can be different if these effects are not considered during its use. Particularly, the recovery effect allows the battery to recompose part of its charge after reaching its internal electrochemical stability. In this context, it is important to insert periods of low-power consumption during the battery operation.

Sleep scheduling policies aim to switch nodes during the WSN activities to maximize their lifetime [2, 3]. The sleep scheduling is an approach that takes advantage of the recovery effect by putting the nodes in low-power mode (or sleep mode) to save the network power as a whole. However, many studies perform simulations using sleep scheduling policies without considering both rate capacity and charge recovery effects, i.e., it is assumed that the batteries have a linear behaviour over time. This kind of assumption can affect the results of the simulations since batteries have much more complex behaviours, which are difficult to model.

This paper aims to conduct a study on the recovery effect in WSN nodes with low power characteristics. The assessments involve the use of an analytical battery model known as Kinetic Battery Model (KiBaM), which considers both rate capacity and charge recovery effects. These characteristics are important to minimize the error regarding the non-linear behaviour of the battery over time, mainly in WSN simulators. The main contributions of this work are as follows:

  • Use of an analytical battery model within WSN context to assess the recovery effect in low-power consumption nodes.

  • An analysis of several relevant scenarios to the WSN context, including assessments regarding recovery speed and the execution order of the tasks using the aforementioned KiBaM model.

  • Results indicating the importance of the addition of low-power consumption periods during node activities to maximize its lifetime.

This paper is organized as follows. Section 2 presents the related work. Section 3 presents the concepts used in this work, including the battery basics and analytical battery models. Section 4 shows the set-up used in the simulations. Section 5 presents the results for different scenarios considering the recovery effect on batteries. Section 6 concludes the paper and presents future work.

2 Related Work

There are many studies evaluating the use of battery models for application in mobile devices. Some of them focus in the context of WSN. This section presents an overview of the main analytical battery models in the literature, including some papers that compare the performance of such models and their application.

Manwell and McGowan [4, 5] developed a battery model, based on the approach of chemical kinetics of Lead-Acid batteries, for use in time series performance models of hybrid energy systems. Such model requires the determination of three constants, unlike other existing models that typically require several constants to properly model the battery behaviour. Besides, the Kinetic Battery Model considers the rate capacity and charge recovery effects. The simulation results were compared with the BEST model (Battery Energy Storage Test).

Rakhmatov and Vrudhula [6, 7] proposed a high-level battery model to help system designers to make battery-aware decisions. This model offers the ability to estimate the battery lifetime under a specific discharge current. Furthermore, it allows the trade-off between the estimation accuracy and the number of operations performed. Authors evaluate the results of the simulations based on a low-level simulator, known as DUALFOIL, which was set for Lithium-ion batteries. The results showed an average error of 3% in the predictions.

Rong and Pedram [8] presented a high-level analytical battery model to predict the remaining capacity of a Lithium-ion battery. However, this model needs to measure the battery output voltage and its temperature in an on-line way, which, according to the authors, can be obtained through the “smart battery” technology. The temperature and battery cycle aging effects are also considered in the model. Thus, it is possible to estimate the remaining capacity of the battery under different load conditions. Authors compare the results of predictions with simulations using DUALFOIL, reaching a maximum error of 5%.

Jongerden and Haverkort [9] indicate analytical battery models as the best type of model in the setting of performance modelling. In this context, authors performed a study on two well-known battery models: KiBaM and diffusion model. Some theoretical and practical comparisons were assessed in addition to demonstrating that the KiBaM is a first order approximation of the diffusion model. Finally, authors indicate the best battery model to use.

Chau et al. [10] examined the gain in the lifetime of Ni-MH batteries due to recovery effect. For this, the authors conducted several experiments with commercially available nodes (TelosB and Imote2). The paper shows that there is a substantial gain to utilize the benefits of the recovery effect, and indicate a threshold in which the charge recovery becomes insignificant. Based on that, it is proposed an energy-efficient duty cycle scheme which adjusts the duration of the transceiver sleep period according to the recovery saturation in the battery.

Rohner et al. [11] investigated the use of battery models within WSN context, which means assess such models with respect to low duty cycles and short duration loads. The investigation includes the following models: Electrochemical (using BatteryDesignStudio), KiBaM and a Hybrid Model combining KiBaM with an electric circuit abstraction. The parameters used in all models were based on Lithium batteries (CR2032). The results using the electrochemical model presented high computational complexity, which increases the simulation runtime to impractical values (\(\approx \)50 days). Although KiBaM deals with the rate capacity and recovery effects, it showed little difference regarding the battery lifetime for the used load profiles. The hybrid model requires a series of experiments to determine its constants, in addition to the simulation time close to 1 h for the used load profiles. Finally, authors indicate a depth study of battery models with regard to their sensitivity and temporal aspects within WSN context.

Daniil et al. [12] compared the performance of three battery models for Lithium polymer batteries: Circuit-Based Model, Diffusion Model, and KiBaM. The authors’ goal was to find the appropriate model for real-time applications. In addition to the precision, the study assesses the execution time on a specific hardware platform. The results showed greater accuracy when using the circuit-based model, however, it requires the use of constant RC elements to avoid increasing the execution times of the simulations. The diffusion model and KiBaM showed less accurate results. Nevertheless, the study indicates the use of KiBaM since it presents lower execution times in the simulations.

Rodrigues et al. [13] proposed the analytical Temperature-Dependent Kinetic Battery Model (T-KiBaM), which allows modelling the behaviour of batteries under different operating temperatures. Such a model is capable of handling both the charge and the voltage level for different battery technologies. The authors performed several experiments with Ni-MH batteries at different operating temperatures. Although performing evaluations only with constant discharge currents, the results show that the T-KiBaM model is more accurate than both the original KiBaM model and Peukert’s Law, when considering different operating temperatures of the battery.

Analytical battery models are preferred for two main reasons: (i) flexibility in allowing the parameter adjustment for different battery technologies; and (ii) computational efficiency allowing simulations with execution times on the order of seconds or minutes. Other works apply the KiBaM to model the battery behaviour in mobile devices, such as smartphones [14, 15] or Internet-of-Things systems [16].

This article proposes the use of the KiBaM to model the battery behaviour of low-power nodes within WSN context. The major focus is on the recovery effect assessment in situations commonly encountered in WSN applications, such as with nodes with long sleep periods (sleep scheduling schemes) or nodes operating with duty cycles, alternating periods of activity and inactivity.

3 Background

This section presents the key concepts involved in this paper. A brief explanation of the mode of operation and characteristics of the batteries is addressed. Then, some analytical battery models are presented.

3.1 Battery Basics

Batteries are essential to make the concept of mobility a reality. Basically, batteries are devices that contain one or more electrochemical cells capable of transforming chemical energy into electrical energy. The cells are formed by two terminals (electrodes): the positive (or cathode); and the negative (or anode). An electrolyte allows the flow of ions between the battery terminals [17].

Fig. 1.
figure 1

Schematic of an electrochemical cell.

Generally, when discharging a battery, oxidation occurs at the anode, producing electrons (which flow through the external circuit) and positively charged ions (which, by diffusion, move through the electrolyte towards the cathode). Reduction reactions occur at the cathode, generating negatively charged ions. Figure 1 depicts the operation of a single cell battery.

There are primary and secondary batteries. Primary batteries can not be recharged, i.e., they do not support the reverse process of transforming electrical energy into chemical energy. Generally, this type of battery has a high specific energy, low cost, and long storage periods. Secondary batteries can be recharged by applying an electric current. Despite having higher initial cost, secondary batteries have a long life cycle and can be used several times before being discarded. Besides, they can withstand higher discharge currents.

There are three characteristics that define any secondary battery:

  • Technology: relates the components interacting in the battery chemical reactions, the most common are Lead, Nickel, and Lithium. Batteries have different characteristics depending on the technology, being chosen according to the application requirements.

  • Voltage: the open circuit voltage (\(V_{OC}\)) indicates the potential difference between the terminals of an electrochemical cell. The cut-off voltage (\(V_{cut}\)) indicates when a battery is no longer capable of withstanding the applied discharge current. This value is often used to indicate an “empty” battery.

  • Capacity: normally in ampere-hours (Ah), it is the amount of available charge when the battery is discharged at a certain discharge current. The total capacity of a battery can be calculated by multiplying the discharge current applied by the time to reach \(V_{cut}\).

Modelling the behaviour of batteries is a complex task since their characteristics depend on many factors such as the used technology, the operating temperature, the “age” of the cell etc. Thus, batteries have a non-linear behaviour. In this context, some battery models stand out for providing realistic estimates regarding the behaviour of the batteries over time. Some of these models are discussed in the following section.

3.2 Battery Models

This section presents the most common analytical battery models. These models describe the battery in an abstract way by modelling its properties through some equations [18]. The analytical battery models are computationally flexible since they involve the evaluation of analytical expressions [19].

Battery models help understand the battery behaviour over time according to the application requirements, without the need to conduct experiments with real WSN nodes. In this sense, adjustments in the node load profile can be performed to avoid the inefficient use of the available charge, which leads to the node failure and impairs the WSN coverage. Thus, each node maximizes its lifetime, being able to contribute to the network for the longest period possible.

There are several types of battery models: electrochemical, circuit-based, analytical, stochastic and hybrid. This work focuses on analytical battery models since they perform the prediction of the behaviour of batteries using equations that require few constants. This allows modelling different battery technologies with reduced effort. Some analytical battery models are shown below.

Peukert’s Law is one of the simplest models for estimating the battery lifetime. This model considers only a part of the non-linear effects, relating the battery lifetime and the discharge rate. According to the Peukert’s Law, the battery lifetime (L) can be approximated according to the following expression:

$$\begin{aligned} L = \frac{a}{I^b}, \end{aligned}$$
(1)

where: I is the discharge current; a and b are constants dependent on the battery type, being obtained through experiments. However, the recovery effect is not part of this model. Thus, the results obtained with the Peukert’s Law are considered good only for constant continuous loads, being inadequate when variable or intermittent loads are used [18].

Diffusion Model was introduced by Rakhmatov and Vrudhula [7]. This model describes the diffusion process of the active material in a battery. For example, it allows to estimate the battery lifetime (L), with a good approximation, for a given constant discharge current using the first ten terms of an infinite sum according to the following expression:

$$\begin{aligned} \alpha = 2I\sqrt{L} \left[ 1 + 2 \displaystyle \sum _{m=1}^{10} \left( e^{- \frac{\beta ^{2}m^{2}}{L}} - \frac{\pi e^{- \frac{\beta ^{2}m^{2}}{L}}}{\pi - 1 + \sqrt{1 + \pi \frac{L}{\beta ^{2}m^{2}}}} \right) \right] , \end{aligned}$$
(2)

where: \(\alpha \) is the battery capacity; \(\beta \) captures the non-linear behaviour of the battery. Both parameters can be estimated through experimental data. However, as pointed out by Jongerden and Haverkort [18], the second-order differential equation makes it difficult to combine the model with a performance model.

Kinetic Battery Model (KiBaM) is an analytical battery model developed by Manwell and McGowan [4, 5, 20] that originally aims to model the behaviour 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 depicts the abstraction used in the model, including its constants.

Fig. 2.
figure 2

Kinetic Battery Model (KiBaM) [4].

The Available Charge tank holds an electrical charge that can be immediately used for a device draining a 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 constant corresponds to the rate of a chemical diffusion/reaction process. Constant c corresponds to the total charge fraction stored in the Available Charge tank. A battery is exhausted when its Available Charge tank becomes empty, even if there is still charge in the Bound Charge tank. The transfer of charge, as well as the amount of unavailable charge, is proportional to the height difference between the two tanks, \(\delta = (h_2 - h_1)\). Thus, a smaller difference between these two heights provides a longer lifetime for the battery [17]. The following system of differential equations describes the model.

$$\begin{aligned} { {\left\{ \begin{array}{ll} \frac{di}{dt} = - I + k'(h_2 - h_1) \\ \frac{dj}{dt} = - k'(h_2 - h_1), \end{array}\right. }} \end{aligned}$$
(3)

where: i is the available charge and j is the bounded charge. The height values are calculated as \(h_1 = i/c\) and \(h_2 = j/(1-c)\), respectively. A new rate constant k is defined as:

$$\begin{aligned} k = \frac{k'}{c(1-c)}. \end{aligned}$$
(4)

Replacing \(h_1\), \(h_2\) e \(k'\) in the system of differential Eq. (3), it results on:

$$\begin{aligned} {\left\{ \begin{array}{ll} \frac{di}{dt} = - I - k(1 - c)i + kcj \\ \frac{dj}{dt} = + k(1 - c)i - kcj. \end{array}\right. } \end{aligned}$$
(5)

Laplace transforms are able to solve the system of differential equations [4], which results on:

$$\begin{aligned} {\left\{ \begin{array}{ll} i = i_0e^{-kt} + \frac{(y_0kc-I)(1-e^{-kt})}{k} - \frac{Ic(kt-1+e^{-kt})}{k} \\ j = j_0e^{-kt} + y_0(1-c)(1-e^{-kt}) - \frac{I(1-c)(kt-1+e^{-kt})}{k}, \end{array}\right. } \end{aligned}$$
(6)

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 calculation (\(t = 0\)). In addition, \(y_0 = i_0 + j_0\), where \(y_0\) is the amount of charge in the battery at \(t = 0\).

In the KiBaM model, the unavailable charge (u) is the height difference times \((1-c)\) [17]. Equation (7) describes the difference between heights, denoted by \(\delta \), which is used to compute the unavailable charge (u) [21].

$$\begin{aligned} \delta&= (h_2 - h_1) = \frac{j}{(1-c)} - \frac{i}{c}\end{aligned}$$
(7)
$$\begin{aligned} u&= (1-c) \cdot \delta \end{aligned}$$
(8)

The reasoning behind \(\delta \) value is important in order to obtain the battery nonlinear capacity variation [22]. Thus, KiBaM can model two important effects:

  • Rate Capacity refers to the applied discharge current. The larger the load I, the faster the battery discharge and, thus, the lower its lifetime. This is due to the battery voltage level, which decays slowly during the battery discharge, reducing the effective capacity for high discharge currents [18];

  • Charge Recovery refers to the ability of a battery to partially recover its charge during an idle period, after performing a discharge current I. This is due to the electrochemical stabilization inside the battery pack.

Fig. 3.
figure 3

An example of KiBaM behaviour over time.

The non-linear battery behaviour arises, particularly, when these two effects act together. That is the case of WSN nodes operating in duty cycle schemes, i.e., periods during which the radio is in normal operation (high discharge currents), and periods during which it is in low power mode or sleep mode (low discharge currents). Figure 3 depicts an example with the behaviour over time in both tanks. In the fast discharge curve, the computing tasks consume: 250 mA (900 s), 100 \(\upmu \)A (900 s) and 50 mA (2700 s). In the slow discharge curve, the computing tasks consume: 50 mA (900 s), 100 \(\upmu \)A (900 s) and 5 mA (2700 s). Here, the parameters are adjusted to model a commercially available Ni-MH battery, as described by Manwell and McGowan [4], leading to c = 0.828164, k = 0.021139 s\(^{-1}\) and \(y_0\) = 2700 As (\(\approx \)750 mAh).

4 Assessment Set-Up

This section describes the set-up used in the analysed scenarios. The simulations are performed in the MatlabFootnote 1, a scientific software for numerical computations. This choice is justified mainly by the following reasons: (i) easy implementation of mathematical models, (ii) ability to conduct simulations quickly using a multi-core computer, and (iii) ability to represent the results through custom graphics. Thus, we present the KiBaM function, implemented to perform the simulations, as well as the set of tasks used in the simulations. A study on the impact of different values for the KiBaM constants is also presented.

4.1 KiBaM Implementation

This section presents the KiBaM implementation in the function format, which is used in the assessments regarding the battery lifetime estimation on Matlab.

The KiBaM implementation can be summarized as a loop that performs function calls that drain the battery capacity, accounting for the time required to exhaust all its charge. Thus, it becomes possible to obtain the battery estimated lifetime in accordance with the applied discharge current and its respective execution time. Algorithm 1 shows how to implement the KiBaM function.

figure a

Lines 3 and 4 are responsible for updating the amount of charge in the Available Charge and Bound Charge tanks, respectively, according to Eq. (6). An example of the KiBaM function call is presented in Algorithm 2.

figure b

The parameters that need an initial value are c, k and \(y_0\) (the initial battery capacity), I (the discharge current) and \(t_I\) (the execution time of I). Throughout the execution, it becomes necessary to observe the amount of charge in the Available Charge tank, which can not be less than or equal to zero. Line 4 of the Algorithm 2 performs this verification.

4.2 Task Set

This section presents the tasks used in the assessment. In this case, a task consists of a node state and its respective execution time. Here, the tasks have the same power consumption of the Mica2 node, as described by Mikhaylov and Tervonen [23]. Table 1 shows the power consumption in each of the node states as well as its execution times, according to the simulated application.

Table 1. Discharge currents in a Mica2 node [23].

For easy understanding, the tasks are named as follows: Tx (MCU+Tx), Rx (MCU+Rx), Ac (MCU-Active), and NS (Node-Standby). The first task, Tx, consumes 25.4 mA with an execution time of 4 min, representing the microcontroller (MCU) activity and the use of the transceiver to transmit data (Tx). The Rx task consumes 15.1 mA with an execution time equal to 10 min, representing the MCU activity and the use of the transceiver to receive data (Rx). The Ac task consumes 8 mA and has 6 min of execution time, representing only the MCU activity (transceiver off). Lastly, the NS task consumes 19 \(\upmu \)A with execution times ranging between 0–20 min, according to the simulated scenario. This task represents the period in low-power mode (or sleep mode). Such task set is equivalent to an environmental monitoring application.

4.3 Comparison Between Different Values of k

This section presents a study regarding the use of different battery technologies (e.g., Lead-Acid, Ni-MH, Li-ion), which implies in different values for the KiBaM constants since the electrochemical characteristics of these technologies are distinct. This may change the recovery effect behaviour, so that the battery technology can be chosen according to the application requirements (e.g., discharge current, duty cycle and battery capacity).

The constant k is a time-dependent value. Thus, its value becomes critical to determine the time needed to transpose the charge from the Bound Charge tank to Available Charge tank, until the equilibrium in both tanks is reached. From the equilibrium point, it becomes unnecessary to maintain a low-power state, since there is no significant charge recovery. In this case, the time to reach the equilibrium point (stability) is called threshold.

In the simulations performed in this study, the values of c and \(y_0\) are set in 0.625 and 2700 As [21], respectively. The values for the constant k are as follows: 0.05, 0.01, 0.005, 0.001, 0.0005 and 0.0001 s\(^{-1}\). Besides, the following task sequence is performed: an MCU+TX state followed by a Node-standby state (with an 8-min execution time). This means a 33.33% duty cycle, i.e., the period in sleep mode is twice the period in active mode. Figure 4 depicts the simulation results with different values for the k constant.

Note that the behaviour of the discharge curves are different depending on the value of the k constant. In this case, the larger the value of k, the faster the charge transposition between the tanks and, thus, the shorter the time to reach the threshold. On the other hand, the lower the k value, the slower the charge transposition between the tanks. Consequently, the greater the time required to reach the threshold. Besides the difference in the recovery effect, there is a noticeable difference in battery lifetime. Table 2 shows the battery lifetime according to the value of k.

Fig. 4.
figure 4

Simulation with different k values.

Table 2. Difference in battery lifetime according to the k value.

For this application, the most appropriate k value is 0.01 s\(^{-1}\) since it represents the best fit for a full charge recovery, i.e., without wasting time. This example highlights the importance of choosing the battery parameters that has characteristics similar to those used in the batteries in the real application.

5 Assessment Results

This section aims to present the assessment results from different scenarios, focusing on the analysis of the charge recovery effect on batteries. Briefly, the recovery effect speed is analysed for the simulated application, as well as the influence of changing the sleep period order among the performed tasks. The execution order between tasks is also analysed. Finally, a case study regarding the frequency of switching between tasks is presented. The settings shown in Sect. 4 are used in these simulations, including the values of the KiBaM constants (\(y_0\), c and k).

5.1 Recovery Effect: Speed Evaluation

This section shows how to properly choose the sleep period according to the application characteristics. In this sense, a comparison between different recovery times is performed. The goal is to choose an optimized sleep period for the set of tasks used so that recovery effect occurs without wasting time after reaching the threshold. Other details are presented below.

In this experiment, the task execution order is as follows: Tx, Rx, Ac, and NS. The execution times of the tasks are the same as shown in Table 1. In this case, the adopted periods for the Node-Standby task are 5, 10, 15 and 20 min. Such periods represent duty cycles of 20%, 33.33%, 42.85% and 50%, respectively. All simulated experiments are performed cyclically until the content in the Available Charge tank reach the minimum level. Figure 5(a) depicts the behaviour of the simulations when these tasks are used.

Fig. 5.
figure 5

Comparison between simulations using different sleep periods.

The battery lifetimes in each situation are: 62.2375 h (NS = 5 min), 74.6383 h (NS = 10 min), 87.0389 h (NS = 15 min), and 99.4389 h (NS = 20 min). Figure 5(b) depicts the behaviour of the simulations with zoom. Note the behaviour of the recovery effect in each situation. In this case, it is possible to note that a sleep period equal to 5 min is not enough since the threshold is not reached. The situations with greater sleep times (15 and 20 min) offer a longer battery lifetime, however, the charge recovery is insignificant as from 10 min. Thus, if the interest lies only in the recovery effect without wasting time, the most suitable task combination is the one that provides a sleep time of 10 min.

5.2 Recovery Effect: Changing the Sleep Period Order

This section performs a variation of the previous simulation. In this case, the sleep period is placed at different moments to evaluate the impact on battery lifetime. The tasks are ordered as follows: NS-Tx-Rx-Ac, Tx-NS-Rx-Ac, Tx-Rx-NS-Ac, and Tx-Rx-Ac-NS. The experiments are performed cyclically until the content in the Available Charge tank reaches the minimum level. Table 3 shows the results, including the charge recovered after a sleep period, at t \(\approx \) 36 h.

Table 3. Results when the sleep period is placed at different moments.

Note that there is a little difference between the times obtained in the simulations. Simulation 2, which has a sleep period after a Tx task, achieved longer battery lifetime and higher percentage of charge recovered. This can be explained by the simple fact that there is a greater benefit with the recovery effect after performing a higher consumption task, as depicted in Fig. 6, which presents a zoom of the simulation final period (74 h \(\le t \le \) 74.9 h). Simulations 3 and 4 reached the same time, although they presented different values of charge recovered. It may indicate a model inconsistency regarding this situation. The relative difference between the Simulations 2 and 3 is 0.22%, which represents 606 seconds (10.1 min) in the battery lifetime.

Fig. 6.
figure 6

Simulated experiments with different sleep period order.

5.3 Assessing Changes in Task Execution Order

This section presents a comparison between simulations with different task execution order. The objective is to evaluate the difference in battery lifetime in each situation. In this scenario, the sleep period is not included in the task set. Although there is not a period in sleep mode itself, note that the recovery effect also has its share in this scenario since the tasks present different discharge currents. The tasks are divided as shown in Table 4.

Table 4. Results with different task order.

Note that all simulations have different battery lifetimes, even if the tasks are the same, but in a different execution order. In this case, Simulation 4 showed longer battery lifetime, 179765 s (49.9347 h). The task with the highest discharge current (Tx) is performed lastly in this simulation. On the other hand, Simulation 1 had the shortest battery lifetime, 179412 s (49.8367 h). In this case, the task with the highest discharge current (Tx) is performed first. The relative difference in these two cases (Simulations 1 and 4) is 0.19%, which represents 353 s (5.88 min) in the battery lifetime. Figure 7 depicts a zoom with the last moments of the performed simulations.

Fig. 7.
figure 7

Simulations with different task order.

5.4 Evaluating Task Switching Frequency

This section evaluates the KiBaM behaviour with regard to the influence of the task switching frequency in battery lifetime. The goal is to establish a frequency range in which the simulation execution time is feasible.

In this scenario, only two tasks are used: Tx and NS. The execution times are defined according to the duty cycle, which in this case is 50%. For example, if the duty cycle period is 16 s, each task runs for 8 s. The simulated frequencies are as follows: 0.015625, 0.03125, 0.0625, 0.125, 0.25, 0.5, 1, 2, 4, 8, 16, 32, and 64 Hz. Table 5 shows the results in each situation.

Table 5. Results with different frequencies.

Note that the battery lifetime is virtually the same within the simulated frequencies range. The differences in battery lifetimes arise due to the simulation step, which is different in each simulated frequency. However, the simulation execution time increases considerably as increases the rate of task switching. We found a linear growth in our simulations. This is due to the increase in the number of iterations required to run the model. That is, the higher the frequency, the lower the amount of charge drained from the battery at each iteration of the algorithm, and therefore the greater the number of iterations required. This makes the simulation execution time impractical from a certain frequency value since the period of the tasks is too small.

6 Conclusions

The energy constraint is a major challenge within WSN context since it forces network designers to use energy-aware algorithms/protocols to avoid extra costs by replacing batteries. In addition, batteries have intrinsic effects due to electrochemical reactions, which provide energy to the connected device. Two widely studied effects are the rate capacity and charge recovery.

Since batteries are complex devices, the use of battery models assists WSN designers to predict the network behaviour since such models are capable of providing an estimate of the battery lifetime according to the used load profile.

In this paper, we evaluated an analytical battery model, known as KiBaM, to assess the impact of the recovery effect on the battery of low-power WSN nodes. It was possible to verify that the way the recovery effect is used can influence the battery lifetime. Our results presented a difference up to 10.1 min in battery lifetime just by changing the sleep period order. In addition, a minimum standby time (sleep period) is required to achieve a satisfactory charge recovery, i.e., a threshold. For the parameters used in this simulation (discharge currents, execution times, KiBaM constants), a time between 5 and 10 min is enough to recover the battery charge. Finally, we evaluated the frequency of task switching and its impact on the KiBaM execution time. The results showed that higher switching frequencies increase the simulation execution time.

As future work, it is interesting to evaluate the KiBaM through experiments with low-power WSN nodes. In this sense, it is important to consider the battery technology used to adjust the model parameters properly.