# A Framework for the Estimation and Validation of Energy Consumption in Wireless Sensor Networks

Authors: Alexandros Karagiannis; Demosthenes Vouyioukas
Journal: Journal of Sensors
 (2015)

---

## Abstract

Body sensor networks and implantable and ingestible medical devices energy efficiency is a substantial key factor in network lifetime and functionality. This work confronts the nodes’ energy problem by establishing a unified energy consumption framework comprised of theoretical model, energy simulator model, and electronic metering modules that can be attached to the nodes. A theoretical analysis, a simulation procedure, and the design and development of three prototype electronic metering modules are presented in this paper. We discuss the accuracy of the proposed techniques, towards a unified framework for the apriori estimation of the energy consumption in commercial sensor nodes, taking into account the application functionality and the energy properties of the incorporated electronics. Moreover, body network nodes are considered for the application and the measurements of the proposed framework.


---

## Body

## 1. Introduction

Wireless sensor networks (WSNs) found their way in the past years to both research fields and the commercial sector. The application of WSNs in body physiological parameters monitoring set a specific category termed as body sensor networks (BSNs) [1]. The latest development is in implantable and ingestible medical devices (IIMDs) that form in-body and on-body network.Dynamic and highly customized body sensor nodes address the clinical needs for individualized health monitoring and delivery, especially in several vulnerable groups. Chronic ill patients and episodic incidents require pervasive healthcare services utilizing BSN technology to accurately access medical related information and improve the quality of services provided. Specifically, episodic events in patients and the role of BSN in addressing them change the way of healthcare services delivered.Usual configuration of implantable and ingestible medical devices and BSN nodes follow the pattern of microsensors in close proximity or contact for monitoring of biosignals that feed a processing subsystem and a radio communication subsystem. Implantable, ingestible, and BSN nodes are equipped with energy management subsystems that incorporate batteries and optionally energy harvesting circuitry.The energy management subsystem is considered a critical component of IIMDs and BSNs with a role in the optimization of available energy reservoirs usage. Several proposals have been made concerning the powering of implantable devices and BSN nodes that include transcutaneous external sources for battery recharge, electromagnetic energy transmission, piezoelectric power generation, thermoelectric devices, ultrasonic power motors, radio frequency recharging, optical recharging methods, biofuel cells, and lithium batteries [2].The design of applications and protocols for BSNs and IIMDs requires that energy consumption optimization should be addressed in a multiparameters fashion that involves the energy-efficient operation of nodes’ subsystems.BSN’s energy consumption issue has been highlighted in research literature as a key factor for performance and network functionality. There is an increasing number of published works dealing with various aspects of energy consumption issue, mainly in simulation level, energy-efficient protocol design, and low power electronics development. However a unified approach to combine theoretical modeling of WSN and BSN applications, simulation estimation, and electronic metering module design and development for the energy consumption is the main contribution of this work.In this paper, a technical approach is discussed towards the design and development of a framework for the estimation and measurement of energy consumption in BSN and IIMD nodes. For this purpose, three electronic metering modules have been designed and developed for the validation of theoretical and software based estimations of energy consumption in BSN nodes. Furthermore, TinyOS applications have been developed for the implementation of sensor nodes health monitoring applications. Energy-efficient design of TinyOS applications is considered a primary target in energy consumption minimization with an impact on the operation of individual subsystems, the nodes’ and network’s lifetime of BSN and IIMDs battery-powered devices.The structure of this paper is as follows. Section2 introduces and analyses the related work in this area. In Section 3, basic assumptions are exhibited for the development of a framework for energy consumption study on BSN and IIMD nodes. In Section 4, the methodology is presented regarding the theoretical procedure for energy consumption estimation, a simulator-based on PowerTOSSIM is developed, and three electronic metering modules are designed and developed for energy consumption monitoring and measurement. In Section 5, results are provided for the energy consumption of BSN nodes, which monitor biosignals, and finally the conclusions are discussed in Section 6.


## 2. Related Work on Energy Consumption Issue

BSN and IIMD scientific progress is developing in two fronts, the research oriented and the commercial one. Body worn sensing devices with computing and networking capabilities are presented in MIThril project [3]. CodeBlue [4] has developed medical sensor network using various transducers of vital signs based on commercially available WSN nodes such as TelosB and MicaZ [5] designs. Healthy Aims [6] project has been focused on specific sensor applications for hearing, vision, glaucoma, and intracranial pressure. CardioMEMS [7] is one of the first attempts to develop an implantable pressure sensor into an aneurysm sac. Various healthcare applications involving body sensor networks are presented in [8].Typical BSN node consists of four main subsystems: (i) a sensing subsystem, (ii) a microcontroller (MCU), microprocessor subsystem constituting the processing component of the node, (iii) a radio communication subsystem providing the wireless communication, and (iv) an energy management subsystem. According to the specific requirements posed by the applications, additional components may be incorporated such as a secondary wireless communication module. This is the case in IIMDs that operate two radio communication subsystems, one for transcutaneous data communication and one for wake-up functionality [9].In the case of a commercial implementation of medical implantable RF transceiver, manufactured by Zarlink [9], the wake-up radio subsystem is an extremely low power operating in Industrial, Scientific, and Medical (ISM, 2.4–2.5 GHz) band to provide wake-up receiver option whilst the data communication radio subsystem operates in Medical Device Radio Communications Service (MedRadio) frequency bands 401–406 MHz [10]. The dual band operation in the MedRadio–ISM bands has an impact on the energy efficiency of the implantable medical device with the specific transceiver.Improvement in electronics design and development in terms of energy efficiency has resulted in ultralow power implementations in all four basic subsystems of BSN nodes and IIMDS. However, real life application experiences of BSN show that incorporation of energy-efficient electronics on board a BSN node partially guarantees low power performance unless energy management is taken into consideration [11].A common assumption in BSN and IIMDs considers that the main consumer of energy is the radio communication subsystem. This stands true if certain conditions are met such as the energy consumption of sensory subsystem being lower due to the incorporation of low power sensors or the implementation incorporates an energy-efficient microprocessing unit. Previous works have revealed that one bit of information transmitted through the radio communication subsystem is equivalent to the execution of a few thousand instructions in terms of energy consumption [12].Radio communication subsystem has various states of operation regarding the energy consumption point of view. In receiving mode, regardless of the protocol or standard supported, the energy consumption is almost equivalent to transmitting mode. However, in idle mode the energy consumption of the radio communication subsystem is reduced and especially in the mode of sleep it is an order of magnitude less exhibiting energy-efficient power management of BSN node’s subsystems.There are several testbeds of WSNs running applications for energy consumption and protocols performance evaluation. Motelab [13] consists of a set of permanently deployed nodes connected to a central server. Each node is monitored in terms of energy consumption by a network-connected multimeter. Trio [14] is another large-scale testbed used for outdoor purposes that is supplied by solar panels. SenseNet [15] consists of low cost sensor nodes facilitating multiple users to interact with the network.Research is mainly focused on energy-efficient protocols implemented on the network; however there are efforts for applications’ energy signature formation and optimization of subsystems operation with a direction towards minimizing energy consumption. There is an extensive variety of protocols that deal with the energy consumption issue by different perspectives and suggest interesting and highly efficient ways to conserve energy. A thorough presentation and a high level taxonomy of these protocols and techniques are presented in a recently published survey of Anastasi et al. [12].The incorporation of high-cost high accuracy infrastructure in order to measure the energy consumption on single BSN nodes or IIMDs is prohibitive and inflexible [16]. On the other hand, on purpose designed hardware modules partially deal with the energy monitoring on the node [17]. Testbed deployment approaches oriented to software based and hardware supported schemes to measure energy consumption face this issue in a holistic way [18].Energy consumption is measured by means of specially designed hardware modules attached to BSN nodes [17]. The concept for software based estimation methods is that total energy consumption is equal to the summation of individual subsystem energy consumptions and the energy state transitions. PowerTOSSIM [19] is a representative software based method which relied on TinyOS [20]. A drawback of this energy simulator is related to the intrinsic energy model, which is node’s technology dependent. AEON [21] as an energy simulator is implemented on top of AVRORA [22] emulator. Moreover, there are some simulation tools and platforms, such as OPENET, NS2, SHAWN, SensorSim, EmStar, OMNet++, and GloMoSim which are widespread in research WSN community for their capacity to investigate energy-efficient protocols performance and simulate the energy-oriented operation of WSN nodes and networks.Taking into account processing, sensing, communication, logging, network formation, and actuation events, an energy estimation model is developed in [23]. Lifetime estimation of WSNs is a critical parameter closely related to node’s and network’s energy consumption, which are investigated in [24]. In [25], an OMNET++ based simulation estimated the energy consumption based on the widely used RF transceiver CC2420 [26], found in numerous commercial WSN nodes.Specifically in the field of IIMDs, energy consumption estimation and accurate measurement are critical in defining the medical device lifetime. Merli et al. [27] suggest that energy signature of IIMDs subsystems plays key role in defining the most energy hungry subsystems. In their implementation, an implantable medical device that monitors temperature, equipped with Zarlink RF transceiver [9] and Digital Signal Processing unit, the energy consumed in radio communication subsystem is the 92% of the total energy consumed on the IIMD.In [28], the study of WSN node subsystems’ energy consumption in different energy states and state transitions, the authors present the energy models of the node core components, including processors, RF modules, and sensors. Approximate energy models are developed in [29, 30] which are proved to be sound with battery-powered devices [31]. The advantages of approximate energy models include small error compared to high accuracy energy consumption measurements on WSN and BSN nodes and low complexity in simulation level.BSN and IIMDs subsystem optimization of operation is a key stage in the minimization of energy consumption. There is a rich field of innovations towards this direction concerning the antenna component of the radio communication subsystem. The design takes into account several performance parameters for the development of novel miniature antennas for integration in IIMDs operating in the MedRadio (401–406 MHz) and ISM (433.1–434.8, 868.0–868.6, and 902.8–928.0 MHz) bands [32]. One special category of antennas for IIMDs is patch antennas which are receiving significant scientific interest for integration into the implantable medical devices and radio frequency- (RF-) enabled biotelemetry [33].In a previous authors’ work, a theoretical tool for energy consumption prediction is presented. A metric of energy consumed on the BSN node is proposed in [34, 35] that consists of a hybrid method based on current consumption subsystem specifications and real or simulated timing information for each BSN subsystem. The battery voltage levels are sampled by ADC of MCU in the commercial WSN node used. Battery voltage, current consumption, and timing information provide the energy consumption in node and subsystem level.The contribution of the current work with respect to previous authors’ work [34, 35] lies in the unification of the theoretical modeling, the design and development of an energy consumption simulator for specific TinyOS applications, and the presentation of a theoretical and simulation process for energy consumption metering modules which are designed and developed. Specifically, in the last part of this work, we present the parameters involved in the design and development process, a set of measurements conducted for a variety of TinyOS applications, the optimization process for the minimization of measurement error in electronic metering modules and a rich set of new data concerning TinyOS applications, the simulation results, measurement data, and comparison of each part of the framework with respect to one of the electronic metering modules. The current work supports the idea that the energy consumption of WSNs-BSNs should be studied under the consideration of the whole system of “WSN-BSN node and the running application.” This concept reveals two fronts of energy consumption optimization, the low power electronics for node implementation and the applications’ energy-efficient operational optimization.


## 3. Assumptions Adopted for the Energy Consumption Framework

Body sensor network is deployed in standard laboratory conditions and monitors temperature as a typical case of a biosignal for on-body and in-body medical applications. Temperature sensors are attached to the commercially available sensor node Tmote Sky, a variant of TelosB, which is used for network deployment. Multiple sampling frequencies are used to investigate the effect of sampling on the total energy consumption of the node. Processing of the acquired time series is performed in the microcontroller subsystem of BSN node.A single hop body sensor network is taken into consideration with three nodes communicating with a central point BSN node that collects data from the network. Communication is accomplished in a single hop fashion by broadcast RF messages produced at the radio communication subsystem of each node that implements IEEE 802.15.4 standard. The RF environment is considered to include only path loss.Focus is given on the total energy consumption of each node that executes TinyOS applications specially developed for BSN temperature monitoring and processing. The energy model of the node incorporated in the energy simulator takes into account current consumption provided by subsystems’ manufacturers and verified by averaged current consumption measurement at each possible energy state. The energy model considered is an approximate model as described in the literature review section that neglects energy transition states due to the small time window and the low energy dissipated in each transition.Transitions between different energy states that occurred during the operation of node’s subsystems are considered as an additive factor in total energy consumption. The fraction of energy consumed during a transition over total energy consumption due to subsystem operation is low. However, theoretical tool does not take into consideration the energy consumed during transitions. This assumption is necessary to avoid complexity in estimating energy consumption by the theoretical approach although it is a reason for deviation of actual energy consumption from the estimated one. This assumption is reasonable as it is suggested in numerous references and literature review for approximate energy models.The three prototype electronic metering modules are designed and developed in order to be used in a modular fashion over any commercial WSN and BSN node. Basic requirements to calculate energy are the a priori knowledge of the time function of voltage induced across the BSN node, the time function of current drawn, and timing information for the operation of the node.In this work, the voltage is provided by the Analog-to-Digital (ADC) component of the microcontroller subsystem. According to specifications of MSP430 microcontroller (MCU) used in the implementation of Tmote Sky, the ADC internal part of the MCU may be used to read and monitor the battery voltage over time. Time samples of battery voltage constitute a series of voltage readings over time that provide a time function of the battery voltage induced across the BSN node.The main role of the three electronic metering modules is to provide the function of the current drawn by the BSN node and subsystems over time. Timing information is provided and used by various sources such as the prototype modules’ output oscilloscope measurements, the energy simulator virtual timing machine, and the internal ADC of the microcontroller subsystem.A metric for total and subsystems’ energy consumption is adopted formulated inE/V which is expressed in mA∗sec. The nominator represents the energy consumption and the denominator is the time invariant voltage, which is the reference point in this case. If the time window of the observation, concerning the battery voltage, is reasonably small, the voltage is considered constant over time and thus can be used as reference point in order to incorporate information from current drawn and timing. However, the methodology in the development of the proposed framework enables the incorporation of battery voltage time function, current consumption, and timing information for the extraction of energy consumption estimation and measurement validation.


## 4. Proposed Methodology

### 4.1. Developed TinyOS Applications

TinyOS is an open source operating system which supports nesC and is widely used in WSN commercial and research oriented applications. NesC is based on wiring components together that provide interfaces for communication purposes with other components.Since the radio communication subsystem of BSN and IIMDs is considered the most energy expensive one, an assumption which in most cases stands correct, TinyOS provides a feature called Low Power Listening (LPL) in order to reduce energy consumption during the radio communication operation. According to LPL technique, the radio communication subsystem is turned on specific time periods and checks the presence of a carrier. In case of a radio message the subsystem remains active to receive the RF message.A family of TinyOS applications are developed in order to be used as reference software applications in the theoretical calculation of the energy consumption, the software based estimation, and the validation of energy consumption measurements via the three electronic metering modules. The basic part of the TinyOS applications called Oscilloscope resembles the functionality of the oscilloscope device, which is to sample the biosignal selected, temperature, and compare the values of the acquired data against a predefined threshold. When a number of temperature readings (NREADINGS, as a parameter in the application) are acquired, the radio communication subsystem is enabled to listen for carrier, transmit the acquired data, and then turn off the radio in a LPL mode.Furthermore, data fusion is implemented as a secondary way apart from LPL to minimize radio transmissions and apply on board data processing by activating the microcontroller subsystem (OscilloscopeFusion). The combination of LPL and data fusion targets the further minimization of energy consumption. Every NREADINGS of temperature, an averaging takes place in data fusion section and the acquired value is stored until 10 averaged values are available which correspond to10∗ NREADINGS temperature samples. Radio communication subsystem is turning on and transmits the RF message with the 10 averaged values in one RF message (OscilloscopeWMR, With Management Radio).The selection of the processing algorithm is related to the nature of the sampled biosignal, the sampling frequency, and the complexity of the implementation in the microcontroller subsystem. Oscilloscope based family TinyOS applications have a strong flexibility in the implementation of on board processing algorithms taking into account the processing power as a resource oriented constraint.Another branch of TinyOS applications used in this work, based on the Oscilloscope family, is the CountToLeds-CountToRadio applications. A major difference of CountTo family applications with Oscilloscope family applications is the use of microcontroller subsystem counter to count between intervals instead of acquiring data from the sensory subsystem. The communication and processing stages are common in the two TinyOS application families.


### 4.2. Theoretical Tool for Energy Consumption Calculation

Theoretical calculation of energy consumption for TinyOS family applications executed in BSN nodes is based on a hybrid approach. Theoretical model combines a mathematical formula ofE/V for summing individual subsystem energy consumption with timing information derived either from simulation stage or from measurement procedures. Current consumption information for each subsystem and energy state is derived from manufacturer’s specification. However, it is verified in measurement stage by the three prototype electronic modules, which are used for current monitoring of each subsystem.Timing information is a critical element of the proposed theoretical procedure that provides the time period for the operation of each subsystem in specific energy states. The time variable is dependent on the running application on board the BSN node. If timing information from energy simulator output is incorporated, a deviation from actual timing is expected due to the assumptions imposed in the development of simulator approximate energy model and the indirect way that timing information is extracted for microcontroller subsystem.Battery voltage information is provided by the ADC of the microcontroller subsystem; however in a short time period, voltage level is expected to be constant and time invariant.The equation of the theoretical energy model for BSN node energy consumption is expressed as(1)EV=IMCUTMCU+ILxTLx+IRxTRx+ITxTTx+∑iIiTi,where IMCU is the current drawn by the microcontroller subsystem for time period TMCU,ILx is the current drawn by the radio communication subsystem at the state of listening to the channel for time period TLx,IRx is the current drawn by the radio communication subsystem at the state of receiving data for time period TRx, and ITx is the current drawn by the radio communication subsystem at the state of transmitting data for time period TTx. The sum term is a cumulative model of all the other subsystems’ energy consumptions, which mainly refer to the energy consumption of the sensory subsystem and the flash memory operation. For short time period observation, energy states transition of microcontroller and radio communication subsystems are considered negligible in the approximate energy model.The terms of (1) are analyzed in detail as a sum of energy consumptions, which correspond to various energy states of each subsystem. The theoretical model can be adapted according to the specific operation of each TinyOS application implemented on BSN nodes. The first step for the theoretical calculation of BSN nodes’ energy consumption is the analysis of the operation in the subsystem level and the formulation of the appropriate mathematical expression.We provide hereinafter an example of this procedure for a TinyOS application. Initially the radio subsystem is in sleep energy state and the microcontroller is in energy state mode LPM3 (the microcontroller of the BSN node based on Tmote Sky has 5 different energy states for the microcontroller operation denoted as LPM0–LPM4). Current consumption during LPM3 is 10 uA according to manufacturer specifications. Microcontroller ADC starts the sampling of temperature sensor. Every time a new sampling takes place the content of data register is forwarded to radio communication subsystem for transmission via broadcast RF message. In between the readings the microcontroller and radio communication subsystem get into the sleep state. When new data reading is received, the radio subsystem wakes up and the energy state changes.The operation of the Oscilloscope based TinyOS application leads to the formulation of the mathematical equation for the theoretical estimation of energy consumption on BSN node depicted in(2)EV=TMCU-IdleIMCU-Idle+TRadio-Active∑iIRadio+TMCU-Active∑jIMCU+TSensorISensor+TRF-TransitionIRF-Transition+TMCU-TransitionIMCU-Transition,where IMCU-Idle is the current consumption of the microcontroller at sleep state time period TMCU-Idle, ∑iIRadio is the total current consumption of the radio communication subsystem to listening, transmitting, or receiving mode for the time period of TRadio-Active, ∑jIMCU is the total current consumption of the microcontroller subsystem that transits from sleep state to LPM3 for time period TMCU-Active,ISensor is the current consumption of the sensory subsystem for time period TSensor,IMCU-Transition is the current consumption of the energy states transition for the time period TMCU-Transition, and IMCU-Transition is the current consumption of the MCU subsystem, for the energy states transition from sleep mode to LPM3.A formulation of the specific TinyOS theoretical analysis may reasonably ignore theIsensor,IRF-Transition, and IMCU-Trasnsition terms as long as these values are small enough compared to the other current consumption terms (an order of magnitude would be an appropriate criterion) and does not contribute significantly to the E/V result.


### 4.3. Simulator-Based Estimation of BSN Energy Consumption

A variant of PowerTOSSIM, called PowerTOSSIM-z, is used for software-based estimation of energy consumption in TinyOS applications running on BSN nodes. The adaptation of the energy simulator is critical for the energy consumption estimation in order to fit the needs of the available BSN node architecture, which is based on Tmote sky.Recalibration of the simulator is taking place in two fronts. First an approximate energy model is required that includes the necessary virtual subsystems, which are the exact corresponding of the actual BSN node’s ones. In the next step, a calibration of the new approximate energy model takes place. The microcontroller subsystem imposes a challenge for the development of a sufficient energy model and a suitable virtual event machine. This challenge is addressed by mapping the basic blocks of TinyOS application code into cycles of operation for each application. In this way, an indirect estimation of microcontroller energy consumption is extracted for the software-based total energy consumption caused by the execution of the application on BSN node.Energy simulator monitors the energy state for each virtual subsystem, by outputting appropriate messages of energy state transitions as the code runs on the virtual machine of the simulator. At the end of the simulation, a log file is produced with virtual subsystems messages of the energy state transitions along with virtual timing information. Energy consumption information is acquired by processing the log file for the various energy states of the BSN subsystems as well as the virtual timing information.Recalibration of the approximate energy model is accomplished by a measurement campaign using electronic metering modules developed for energy consumption monitoring on BSN nodes. The outcome of this process is depicted in Table1, which includes current consumption measurement results of BSN node for the parameterization of simulator energy model.Table 1
Calibration of energy simulator model.
Subsystem
Current consumption  (mA)
LED 0 (red)
3.30
LED 1 (yellow)
5.60
LED 2 (blue)
3.53
Radio receiving +microcontroller (MCU)
19.95
Radio transmission +microcontroller (MCU)
18.10
Radio listening +microcontroller (MCU)
18.86Next step, the adaptation of the architecture and the development of a modified energy model for the simulator, proceeds with the verification by uploading the TinyOS Oscilloscope based applications. The essential characteristic of these applications is related to the a priori identification of specific operations and energy states that take place during the execution of each application. An indicative example is depicted in Figure1, where the application OscilloscopeWMR samples the temperature and transmits it to the BSN. At the time periods between successive samplings, radio subsystems energy state transits to sleep mode; thus the energy consumption is reduced.Figure 1
Verification of energy simulator operation for specially designed TinyOS application (OscilloscopeWMR) used for temperature monitoring in BSN node. Iny-axis the current consumption is expressed in mA and in x-axis the time is in seconds.Oscilloscope family TinyOS applications developed in the context of current research work have also been presented in a previous work [34, 35] along with energy consumption optimization techniques. Results depicted in Figure 1 for the verification of simulator energy model are cross-checked with theoretical model results. The approximate energy model theoretical expression of OscilloscopeWMR operation for time period 100 m sec and number of samples transmitted (1 sample) is(3)EV=TMCU-IdleIMCU-Idle+TActive∑IRadio+∑IMCU=0.160mAsec.The energy consumption estimation of OscilloscopeWMR from energy simulator is 0.146 mA sec per time period. There is an underestimation of 9%, which is due to the assumptions posed in energy simulator approximate energy model concerning the production of virtual machine energy states and timing of MCU subsystem and radio communication subsystem.


### 4.4. Electronic Metering Modules for the Measurement of BSN Energy Consumption

Methodologies for hardware usage in energy consumption measurement in BSN and IIMDs have attracted small interest in research community. Most of the implementations propose high-cost solutions unsuitable for large-scale networks.In this work, three prototype electronic metering modules are proposed for energy consumption monitoring. Principal goal of the design is the low cost solution with high accuracy and modularity. Suitable dynamic range in current consumption monitoring is considered as a key requirement since current consumption in BSN nodes may vary up to three orders of magnitude according to the operations imposed by the TinyOS applications (from a few uA to several thousands of uA). The electronic metering modules are small size with low power consumption.


#### 4.4.1. Shunt Resistor Based Electronic Metering Module

The main approach behind the first BSN energy consumption electronic module is based on a shunt resistor that intervenes between the BSN battery-powered node and the energy reservoir, in this case the batteries. It monitors voltage time function across the shunt resistor. High accuracy shunt resistor is employed in order to acquire current consumption time function. In this case, shunt resistor should meet two contradictory conditions. The first one imposes that shunt resistor value should be high enough in order to detect the voltage across it and the second one sets the shunt resistor at an ultralow value in order not to disturb the powering of the BSN node.At a constant battery voltage for short time periods, the current information provided by the metering module enables the calculation of total energy consumption of the BSN node as a product of measured by the ADC battery-voltage, current consumption, and timing information.Simulation of the electronic module by means of a typical electronic circuit simulator provides information about the simulated performance of the module. The values for the elements used in the design of the electronic module in the simulation stage areRshunt=1Ω, RGain=300Ω, RLoad=10KΩ. Figure 2 depicts the actual design of the first electronic metering module.Figure 2
Electronic metering module of the energy consumption in BSN nodes with shunt resistor and instrumentation amplifier. Model IMOTE is used for the modeling of BSN node.Deviation of the simulated output from the theoretically calculated output is computed by(4)100Vout-GainVRshuntGainVRshunt,where Vout is the theoretically expected value,Gain is dependent on the selection of RGain resistor and is related to the specifications of instrumentation amplifier AD620, and VRshunt is the voltage output by the simulation process.The main source of deviation in small current range (uA) is due to the offset voltage of the instrumentation amplifier. Figures3 and 4 depict the deviation in the range of hundreds of uA (typical current consumption range in BSNs) before and after the compensation of offset voltage in electronic metering module based on shunt resistor. Limiting offset voltage results in a deviation of less than 0.6% for small current range (uA) and less than 0.05% in the range of mA.Figure 3
Deviation of theoretically expected output value against the simulated one in the range of hundreds of uA for the estimation of BSN energy consumption before the compensation of the instrumentation amplifier offset voltage. The error reaches 17% in 100 uA range. Iny-axis the error or deviation as it is calculated in (4) and in x-axis the current is drawn by the BSN node as a parametric value.Figure 4
Deviation of theoretically expected output value against the simulated one in the range of hundreds of uA for the estimation of BSN energy consumption after the compensation of the instrumentation amplifier offset voltage. The error reaches 0.6% in 100 uA range. Iny-axis the error or deviation as it is calculated in (4) and in x-axis the current is drawn by the BSN node as a parametric value.In the development stage, validation of the correct operation according to the design specifications for accuracy is accomplished by replacing the BSN node with a set of high precision resistors in the range of 100 Ω–500 KΩ. Results of the validation process are depicted in Figure5. Deviation, according to (4), in the order of 20% at current range of less than or equal to 10 uA has a negligible impact on total energy consumption since the excess energy consumption is minimal in that small current range. For typical case current consumptions in BSN nodes, in the range of hundreds of uA the deviation is less that 5%, reaching 0.4% at 100 uA.Figure 5
Deviation of simulated from theoretically expected output as a function of BSN node’s compensated current consumption in log scale.


#### 4.4.2. Capacitor-Based Electronic Metering Module

Regarding the second electronic metering module, a capacitor initially charges with a current drawn submultiple of the current drawn by the BSN node. When the capacitor voltage is equal to an upper voltage threshold, discharge process is initiated until capacitor voltage drops to the lower voltage threshold. In every cycle of charge/discharge a pulse of constant energy is produced. Pulse duration is proportional to the current drawn by BSN node.Expressing the operation of the electronic metering module based on successive cycles of capacitor charge and discharge in a mathematical formula yields (5) for the schematic of Figure 6:(5)INode=RscaleRsenseCΔVΔT⟹VsupplyINode=VsupplyRscaleRsenseCΔVΔT⟹VsupplyINodeΔT=VsupplyRscaleRsenseCΔV⟹VsupplyINodeΔT=Eramp,where Rscale and Rsense are resistances of the current mirror which also includes an operational amplifier and a MOSFET in order to achieve equal voltages across the Rscale and Rsense. In that case, the current charging the capacitor is proportional to the current drawn by the BSN node.Figure 6
Electronic metering module of the energy consumption in BSN nodes with a capacitor. Model IMOTE is used for the modeling of BSN node.The constant energy transferEramp per cycle of charge/discharge is dependent on the capacitance, the upper and lower voltage thresholds, and the resistors Rsense and Rscale used in the implementation of the electronic metering module. Hence, the total energy consumption measurement is reduced to a number of pulses counting.Averaging in time domain provides an intuitive mathematical equation (6) to calculate BSN node’s current consumption by measuring frequency of pulses produced at each cycle of capacitor charge/discharge (Figure 7):(6)I-Node=αf,where I-NodeΔT is the averaged BSN node’s current consumption, f is the mean frequency of pulse train, and α is a constant coefficient equal to (Rscale/Rsense)CΔV.Figure 7
Averaged current consumption of BSN in relation to the pulse frequency measured.y-axis and x-axis are in log scale.The values of the elements used in the simulation of the electronic module areR1 = 50 KΩ, R2 = 3.5 KΩ, R3 = 1 KΩ, Rsense=1 Ω, Rscale=100 Ω, and C=100 nF.The deviation between the simulated and the theoretically expected output, after the procedure of offset voltage compensation, is in the range of 10% for current consumption values less than 20 uA. In the range of current consumptions of hundreds of uA to a few mA, the deviation is less than 2%.The development of the proposed electronic metering module after the refinement in simulation stage proceeds with the verification of correct operation, which is similar to the procedure described in the first electronic module.


#### 4.4.3. iCount-Based Electronic Metering Module

The iCount technique relies on the capacity of Pulse Frequency Modulated counting cycles of a node switching regulator [36]. The amount of energy transferred in each cycle of switching is constant for constant input voltage. Thus, a linear relationship between BSN current and frequency is shown. The range of linearity spread from 5 uA to 35 mA for current consumption and constant input voltages in the range of 2-3 V. The schematic of the implemented iCount technique is depicted in Figure 8.Figure 8
Electronic metering module based on iCount technique. The model IMOTE is used for the modeling of BSN node.For inductanceL = 45 uH and capacitances Cin=Cout = 10 uF the dynamic range of switching frequencies is maximized for the aforementioned current range. Lower values of inductance or capacitances result in the preservation of linearity for smaller range of switching frequencies.Simulation results of the electronic metering module implementing the iCount technique are depicted in Figure9 for a wide range of input voltage from 1.6 V to 3.09 V.Figure 9
BSN current consumption against frequency switching curve for a wide range of input voltages.There is a disturbance of linearity for BSN current consumption in the range of 25 mA for input voltage below 1.9 V. Particularly, in BSN battery-powered nodes, the levels of battery voltage affect the linearity of the electronic metering module even in the range of 20 mA for input voltages of 1.6 V.Measurement of the switching frequency enables the direct calculation of BSN current consumption, according to modeling of iCount technique, as it is depicted in Figure10.Figure 10
Modeling the linear relationship of BSN current drawn against the switching frequency for iCount technique. They-axis and x-axis are in log scale.


## 4.1. Developed TinyOS Applications

TinyOS is an open source operating system which supports nesC and is widely used in WSN commercial and research oriented applications. NesC is based on wiring components together that provide interfaces for communication purposes with other components.Since the radio communication subsystem of BSN and IIMDs is considered the most energy expensive one, an assumption which in most cases stands correct, TinyOS provides a feature called Low Power Listening (LPL) in order to reduce energy consumption during the radio communication operation. According to LPL technique, the radio communication subsystem is turned on specific time periods and checks the presence of a carrier. In case of a radio message the subsystem remains active to receive the RF message.A family of TinyOS applications are developed in order to be used as reference software applications in the theoretical calculation of the energy consumption, the software based estimation, and the validation of energy consumption measurements via the three electronic metering modules. The basic part of the TinyOS applications called Oscilloscope resembles the functionality of the oscilloscope device, which is to sample the biosignal selected, temperature, and compare the values of the acquired data against a predefined threshold. When a number of temperature readings (NREADINGS, as a parameter in the application) are acquired, the radio communication subsystem is enabled to listen for carrier, transmit the acquired data, and then turn off the radio in a LPL mode.Furthermore, data fusion is implemented as a secondary way apart from LPL to minimize radio transmissions and apply on board data processing by activating the microcontroller subsystem (OscilloscopeFusion). The combination of LPL and data fusion targets the further minimization of energy consumption. Every NREADINGS of temperature, an averaging takes place in data fusion section and the acquired value is stored until 10 averaged values are available which correspond to10∗ NREADINGS temperature samples. Radio communication subsystem is turning on and transmits the RF message with the 10 averaged values in one RF message (OscilloscopeWMR, With Management Radio).The selection of the processing algorithm is related to the nature of the sampled biosignal, the sampling frequency, and the complexity of the implementation in the microcontroller subsystem. Oscilloscope based family TinyOS applications have a strong flexibility in the implementation of on board processing algorithms taking into account the processing power as a resource oriented constraint.Another branch of TinyOS applications used in this work, based on the Oscilloscope family, is the CountToLeds-CountToRadio applications. A major difference of CountTo family applications with Oscilloscope family applications is the use of microcontroller subsystem counter to count between intervals instead of acquiring data from the sensory subsystem. The communication and processing stages are common in the two TinyOS application families.


## 4.2. Theoretical Tool for Energy Consumption Calculation

Theoretical calculation of energy consumption for TinyOS family applications executed in BSN nodes is based on a hybrid approach. Theoretical model combines a mathematical formula ofE/V for summing individual subsystem energy consumption with timing information derived either from simulation stage or from measurement procedures. Current consumption information for each subsystem and energy state is derived from manufacturer’s specification. However, it is verified in measurement stage by the three prototype electronic modules, which are used for current monitoring of each subsystem.Timing information is a critical element of the proposed theoretical procedure that provides the time period for the operation of each subsystem in specific energy states. The time variable is dependent on the running application on board the BSN node. If timing information from energy simulator output is incorporated, a deviation from actual timing is expected due to the assumptions imposed in the development of simulator approximate energy model and the indirect way that timing information is extracted for microcontroller subsystem.Battery voltage information is provided by the ADC of the microcontroller subsystem; however in a short time period, voltage level is expected to be constant and time invariant.The equation of the theoretical energy model for BSN node energy consumption is expressed as(1)EV=IMCUTMCU+ILxTLx+IRxTRx+ITxTTx+∑iIiTi,where IMCU is the current drawn by the microcontroller subsystem for time period TMCU,ILx is the current drawn by the radio communication subsystem at the state of listening to the channel for time period TLx,IRx is the current drawn by the radio communication subsystem at the state of receiving data for time period TRx, and ITx is the current drawn by the radio communication subsystem at the state of transmitting data for time period TTx. The sum term is a cumulative model of all the other subsystems’ energy consumptions, which mainly refer to the energy consumption of the sensory subsystem and the flash memory operation. For short time period observation, energy states transition of microcontroller and radio communication subsystems are considered negligible in the approximate energy model.The terms of (1) are analyzed in detail as a sum of energy consumptions, which correspond to various energy states of each subsystem. The theoretical model can be adapted according to the specific operation of each TinyOS application implemented on BSN nodes. The first step for the theoretical calculation of BSN nodes’ energy consumption is the analysis of the operation in the subsystem level and the formulation of the appropriate mathematical expression.We provide hereinafter an example of this procedure for a TinyOS application. Initially the radio subsystem is in sleep energy state and the microcontroller is in energy state mode LPM3 (the microcontroller of the BSN node based on Tmote Sky has 5 different energy states for the microcontroller operation denoted as LPM0–LPM4). Current consumption during LPM3 is 10 uA according to manufacturer specifications. Microcontroller ADC starts the sampling of temperature sensor. Every time a new sampling takes place the content of data register is forwarded to radio communication subsystem for transmission via broadcast RF message. In between the readings the microcontroller and radio communication subsystem get into the sleep state. When new data reading is received, the radio subsystem wakes up and the energy state changes.The operation of the Oscilloscope based TinyOS application leads to the formulation of the mathematical equation for the theoretical estimation of energy consumption on BSN node depicted in(2)EV=TMCU-IdleIMCU-Idle+TRadio-Active∑iIRadio+TMCU-Active∑jIMCU+TSensorISensor+TRF-TransitionIRF-Transition+TMCU-TransitionIMCU-Transition,where IMCU-Idle is the current consumption of the microcontroller at sleep state time period TMCU-Idle, ∑iIRadio is the total current consumption of the radio communication subsystem to listening, transmitting, or receiving mode for the time period of TRadio-Active, ∑jIMCU is the total current consumption of the microcontroller subsystem that transits from sleep state to LPM3 for time period TMCU-Active,ISensor is the current consumption of the sensory subsystem for time period TSensor,IMCU-Transition is the current consumption of the energy states transition for the time period TMCU-Transition, and IMCU-Transition is the current consumption of the MCU subsystem, for the energy states transition from sleep mode to LPM3.A formulation of the specific TinyOS theoretical analysis may reasonably ignore theIsensor,IRF-Transition, and IMCU-Trasnsition terms as long as these values are small enough compared to the other current consumption terms (an order of magnitude would be an appropriate criterion) and does not contribute significantly to the E/V result.


## 4.3. Simulator-Based Estimation of BSN Energy Consumption

A variant of PowerTOSSIM, called PowerTOSSIM-z, is used for software-based estimation of energy consumption in TinyOS applications running on BSN nodes. The adaptation of the energy simulator is critical for the energy consumption estimation in order to fit the needs of the available BSN node architecture, which is based on Tmote sky.Recalibration of the simulator is taking place in two fronts. First an approximate energy model is required that includes the necessary virtual subsystems, which are the exact corresponding of the actual BSN node’s ones. In the next step, a calibration of the new approximate energy model takes place. The microcontroller subsystem imposes a challenge for the development of a sufficient energy model and a suitable virtual event machine. This challenge is addressed by mapping the basic blocks of TinyOS application code into cycles of operation for each application. In this way, an indirect estimation of microcontroller energy consumption is extracted for the software-based total energy consumption caused by the execution of the application on BSN node.Energy simulator monitors the energy state for each virtual subsystem, by outputting appropriate messages of energy state transitions as the code runs on the virtual machine of the simulator. At the end of the simulation, a log file is produced with virtual subsystems messages of the energy state transitions along with virtual timing information. Energy consumption information is acquired by processing the log file for the various energy states of the BSN subsystems as well as the virtual timing information.Recalibration of the approximate energy model is accomplished by a measurement campaign using electronic metering modules developed for energy consumption monitoring on BSN nodes. The outcome of this process is depicted in Table1, which includes current consumption measurement results of BSN node for the parameterization of simulator energy model.Table 1
Calibration of energy simulator model.
Subsystem
Current consumption  (mA)
LED 0 (red)
3.30
LED 1 (yellow)
5.60
LED 2 (blue)
3.53
Radio receiving +microcontroller (MCU)
19.95
Radio transmission +microcontroller (MCU)
18.10
Radio listening +microcontroller (MCU)
18.86Next step, the adaptation of the architecture and the development of a modified energy model for the simulator, proceeds with the verification by uploading the TinyOS Oscilloscope based applications. The essential characteristic of these applications is related to the a priori identification of specific operations and energy states that take place during the execution of each application. An indicative example is depicted in Figure1, where the application OscilloscopeWMR samples the temperature and transmits it to the BSN. At the time periods between successive samplings, radio subsystems energy state transits to sleep mode; thus the energy consumption is reduced.Figure 1
Verification of energy simulator operation for specially designed TinyOS application (OscilloscopeWMR) used for temperature monitoring in BSN node. Iny-axis the current consumption is expressed in mA and in x-axis the time is in seconds.Oscilloscope family TinyOS applications developed in the context of current research work have also been presented in a previous work [34, 35] along with energy consumption optimization techniques. Results depicted in Figure 1 for the verification of simulator energy model are cross-checked with theoretical model results. The approximate energy model theoretical expression of OscilloscopeWMR operation for time period 100 m sec and number of samples transmitted (1 sample) is(3)EV=TMCU-IdleIMCU-Idle+TActive∑IRadio+∑IMCU=0.160mAsec.The energy consumption estimation of OscilloscopeWMR from energy simulator is 0.146 mA sec per time period. There is an underestimation of 9%, which is due to the assumptions posed in energy simulator approximate energy model concerning the production of virtual machine energy states and timing of MCU subsystem and radio communication subsystem.


## 4.4. Electronic Metering Modules for the Measurement of BSN Energy Consumption

Methodologies for hardware usage in energy consumption measurement in BSN and IIMDs have attracted small interest in research community. Most of the implementations propose high-cost solutions unsuitable for large-scale networks.In this work, three prototype electronic metering modules are proposed for energy consumption monitoring. Principal goal of the design is the low cost solution with high accuracy and modularity. Suitable dynamic range in current consumption monitoring is considered as a key requirement since current consumption in BSN nodes may vary up to three orders of magnitude according to the operations imposed by the TinyOS applications (from a few uA to several thousands of uA). The electronic metering modules are small size with low power consumption.


### 4.4.1. Shunt Resistor Based Electronic Metering Module

The main approach behind the first BSN energy consumption electronic module is based on a shunt resistor that intervenes between the BSN battery-powered node and the energy reservoir, in this case the batteries. It monitors voltage time function across the shunt resistor. High accuracy shunt resistor is employed in order to acquire current consumption time function. In this case, shunt resistor should meet two contradictory conditions. The first one imposes that shunt resistor value should be high enough in order to detect the voltage across it and the second one sets the shunt resistor at an ultralow value in order not to disturb the powering of the BSN node.At a constant battery voltage for short time periods, the current information provided by the metering module enables the calculation of total energy consumption of the BSN node as a product of measured by the ADC battery-voltage, current consumption, and timing information.Simulation of the electronic module by means of a typical electronic circuit simulator provides information about the simulated performance of the module. The values for the elements used in the design of the electronic module in the simulation stage areRshunt=1Ω, RGain=300Ω, RLoad=10KΩ. Figure 2 depicts the actual design of the first electronic metering module.Figure 2
Electronic metering module of the energy consumption in BSN nodes with shunt resistor and instrumentation amplifier. Model IMOTE is used for the modeling of BSN node.Deviation of the simulated output from the theoretically calculated output is computed by(4)100Vout-GainVRshuntGainVRshunt,where Vout is the theoretically expected value,Gain is dependent on the selection of RGain resistor and is related to the specifications of instrumentation amplifier AD620, and VRshunt is the voltage output by the simulation process.The main source of deviation in small current range (uA) is due to the offset voltage of the instrumentation amplifier. Figures3 and 4 depict the deviation in the range of hundreds of uA (typical current consumption range in BSNs) before and after the compensation of offset voltage in electronic metering module based on shunt resistor. Limiting offset voltage results in a deviation of less than 0.6% for small current range (uA) and less than 0.05% in the range of mA.Figure 3
Deviation of theoretically expected output value against the simulated one in the range of hundreds of uA for the estimation of BSN energy consumption before the compensation of the instrumentation amplifier offset voltage. The error reaches 17% in 100 uA range. Iny-axis the error or deviation as it is calculated in (4) and in x-axis the current is drawn by the BSN node as a parametric value.Figure 4
Deviation of theoretically expected output value against the simulated one in the range of hundreds of uA for the estimation of BSN energy consumption after the compensation of the instrumentation amplifier offset voltage. The error reaches 0.6% in 100 uA range. Iny-axis the error or deviation as it is calculated in (4) and in x-axis the current is drawn by the BSN node as a parametric value.In the development stage, validation of the correct operation according to the design specifications for accuracy is accomplished by replacing the BSN node with a set of high precision resistors in the range of 100 Ω–500 KΩ. Results of the validation process are depicted in Figure5. Deviation, according to (4), in the order of 20% at current range of less than or equal to 10 uA has a negligible impact on total energy consumption since the excess energy consumption is minimal in that small current range. For typical case current consumptions in BSN nodes, in the range of hundreds of uA the deviation is less that 5%, reaching 0.4% at 100 uA.Figure 5
Deviation of simulated from theoretically expected output as a function of BSN node’s compensated current consumption in log scale.


### 4.4.2. Capacitor-Based Electronic Metering Module

Regarding the second electronic metering module, a capacitor initially charges with a current drawn submultiple of the current drawn by the BSN node. When the capacitor voltage is equal to an upper voltage threshold, discharge process is initiated until capacitor voltage drops to the lower voltage threshold. In every cycle of charge/discharge a pulse of constant energy is produced. Pulse duration is proportional to the current drawn by BSN node.Expressing the operation of the electronic metering module based on successive cycles of capacitor charge and discharge in a mathematical formula yields (5) for the schematic of Figure 6:(5)INode=RscaleRsenseCΔVΔT⟹VsupplyINode=VsupplyRscaleRsenseCΔVΔT⟹VsupplyINodeΔT=VsupplyRscaleRsenseCΔV⟹VsupplyINodeΔT=Eramp,where Rscale and Rsense are resistances of the current mirror which also includes an operational amplifier and a MOSFET in order to achieve equal voltages across the Rscale and Rsense. In that case, the current charging the capacitor is proportional to the current drawn by the BSN node.Figure 6
Electronic metering module of the energy consumption in BSN nodes with a capacitor. Model IMOTE is used for the modeling of BSN node.The constant energy transferEramp per cycle of charge/discharge is dependent on the capacitance, the upper and lower voltage thresholds, and the resistors Rsense and Rscale used in the implementation of the electronic metering module. Hence, the total energy consumption measurement is reduced to a number of pulses counting.Averaging in time domain provides an intuitive mathematical equation (6) to calculate BSN node’s current consumption by measuring frequency of pulses produced at each cycle of capacitor charge/discharge (Figure 7):(6)I-Node=αf,where I-NodeΔT is the averaged BSN node’s current consumption, f is the mean frequency of pulse train, and α is a constant coefficient equal to (Rscale/Rsense)CΔV.Figure 7
Averaged current consumption of BSN in relation to the pulse frequency measured.y-axis and x-axis are in log scale.The values of the elements used in the simulation of the electronic module areR1 = 50 KΩ, R2 = 3.5 KΩ, R3 = 1 KΩ, Rsense=1 Ω, Rscale=100 Ω, and C=100 nF.The deviation between the simulated and the theoretically expected output, after the procedure of offset voltage compensation, is in the range of 10% for current consumption values less than 20 uA. In the range of current consumptions of hundreds of uA to a few mA, the deviation is less than 2%.The development of the proposed electronic metering module after the refinement in simulation stage proceeds with the verification of correct operation, which is similar to the procedure described in the first electronic module.


### 4.4.3. iCount-Based Electronic Metering Module

The iCount technique relies on the capacity of Pulse Frequency Modulated counting cycles of a node switching regulator [36]. The amount of energy transferred in each cycle of switching is constant for constant input voltage. Thus, a linear relationship between BSN current and frequency is shown. The range of linearity spread from 5 uA to 35 mA for current consumption and constant input voltages in the range of 2-3 V. The schematic of the implemented iCount technique is depicted in Figure 8.Figure 8
Electronic metering module based on iCount technique. The model IMOTE is used for the modeling of BSN node.For inductanceL = 45 uH and capacitances Cin=Cout = 10 uF the dynamic range of switching frequencies is maximized for the aforementioned current range. Lower values of inductance or capacitances result in the preservation of linearity for smaller range of switching frequencies.Simulation results of the electronic metering module implementing the iCount technique are depicted in Figure9 for a wide range of input voltage from 1.6 V to 3.09 V.Figure 9
BSN current consumption against frequency switching curve for a wide range of input voltages.There is a disturbance of linearity for BSN current consumption in the range of 25 mA for input voltage below 1.9 V. Particularly, in BSN battery-powered nodes, the levels of battery voltage affect the linearity of the electronic metering module even in the range of 20 mA for input voltages of 1.6 V.Measurement of the switching frequency enables the direct calculation of BSN current consumption, according to modeling of iCount technique, as it is depicted in Figure10.Figure 10
Modeling the linear relationship of BSN current drawn against the switching frequency for iCount technique. They-axis and x-axis are in log scale.


## 4.4.1. Shunt Resistor Based Electronic Metering Module

The main approach behind the first BSN energy consumption electronic module is based on a shunt resistor that intervenes between the BSN battery-powered node and the energy reservoir, in this case the batteries. It monitors voltage time function across the shunt resistor. High accuracy shunt resistor is employed in order to acquire current consumption time function. In this case, shunt resistor should meet two contradictory conditions. The first one imposes that shunt resistor value should be high enough in order to detect the voltage across it and the second one sets the shunt resistor at an ultralow value in order not to disturb the powering of the BSN node.At a constant battery voltage for short time periods, the current information provided by the metering module enables the calculation of total energy consumption of the BSN node as a product of measured by the ADC battery-voltage, current consumption, and timing information.Simulation of the electronic module by means of a typical electronic circuit simulator provides information about the simulated performance of the module. The values for the elements used in the design of the electronic module in the simulation stage areRshunt=1Ω, RGain=300Ω, RLoad=10KΩ. Figure 2 depicts the actual design of the first electronic metering module.Figure 2
Electronic metering module of the energy consumption in BSN nodes with shunt resistor and instrumentation amplifier. Model IMOTE is used for the modeling of BSN node.Deviation of the simulated output from the theoretically calculated output is computed by(4)100Vout-GainVRshuntGainVRshunt,where Vout is the theoretically expected value,Gain is dependent on the selection of RGain resistor and is related to the specifications of instrumentation amplifier AD620, and VRshunt is the voltage output by the simulation process.The main source of deviation in small current range (uA) is due to the offset voltage of the instrumentation amplifier. Figures3 and 4 depict the deviation in the range of hundreds of uA (typical current consumption range in BSNs) before and after the compensation of offset voltage in electronic metering module based on shunt resistor. Limiting offset voltage results in a deviation of less than 0.6% for small current range (uA) and less than 0.05% in the range of mA.Figure 3
Deviation of theoretically expected output value against the simulated one in the range of hundreds of uA for the estimation of BSN energy consumption before the compensation of the instrumentation amplifier offset voltage. The error reaches 17% in 100 uA range. Iny-axis the error or deviation as it is calculated in (4) and in x-axis the current is drawn by the BSN node as a parametric value.Figure 4
Deviation of theoretically expected output value against the simulated one in the range of hundreds of uA for the estimation of BSN energy consumption after the compensation of the instrumentation amplifier offset voltage. The error reaches 0.6% in 100 uA range. Iny-axis the error or deviation as it is calculated in (4) and in x-axis the current is drawn by the BSN node as a parametric value.In the development stage, validation of the correct operation according to the design specifications for accuracy is accomplished by replacing the BSN node with a set of high precision resistors in the range of 100 Ω–500 KΩ. Results of the validation process are depicted in Figure5. Deviation, according to (4), in the order of 20% at current range of less than or equal to 10 uA has a negligible impact on total energy consumption since the excess energy consumption is minimal in that small current range. For typical case current consumptions in BSN nodes, in the range of hundreds of uA the deviation is less that 5%, reaching 0.4% at 100 uA.Figure 5
Deviation of simulated from theoretically expected output as a function of BSN node’s compensated current consumption in log scale.


## 4.4.2. Capacitor-Based Electronic Metering Module

Regarding the second electronic metering module, a capacitor initially charges with a current drawn submultiple of the current drawn by the BSN node. When the capacitor voltage is equal to an upper voltage threshold, discharge process is initiated until capacitor voltage drops to the lower voltage threshold. In every cycle of charge/discharge a pulse of constant energy is produced. Pulse duration is proportional to the current drawn by BSN node.Expressing the operation of the electronic metering module based on successive cycles of capacitor charge and discharge in a mathematical formula yields (5) for the schematic of Figure 6:(5)INode=RscaleRsenseCΔVΔT⟹VsupplyINode=VsupplyRscaleRsenseCΔVΔT⟹VsupplyINodeΔT=VsupplyRscaleRsenseCΔV⟹VsupplyINodeΔT=Eramp,where Rscale and Rsense are resistances of the current mirror which also includes an operational amplifier and a MOSFET in order to achieve equal voltages across the Rscale and Rsense. In that case, the current charging the capacitor is proportional to the current drawn by the BSN node.Figure 6
Electronic metering module of the energy consumption in BSN nodes with a capacitor. Model IMOTE is used for the modeling of BSN node.The constant energy transferEramp per cycle of charge/discharge is dependent on the capacitance, the upper and lower voltage thresholds, and the resistors Rsense and Rscale used in the implementation of the electronic metering module. Hence, the total energy consumption measurement is reduced to a number of pulses counting.Averaging in time domain provides an intuitive mathematical equation (6) to calculate BSN node’s current consumption by measuring frequency of pulses produced at each cycle of capacitor charge/discharge (Figure 7):(6)I-Node=αf,where I-NodeΔT is the averaged BSN node’s current consumption, f is the mean frequency of pulse train, and α is a constant coefficient equal to (Rscale/Rsense)CΔV.Figure 7
Averaged current consumption of BSN in relation to the pulse frequency measured.y-axis and x-axis are in log scale.The values of the elements used in the simulation of the electronic module areR1 = 50 KΩ, R2 = 3.5 KΩ, R3 = 1 KΩ, Rsense=1 Ω, Rscale=100 Ω, and C=100 nF.The deviation between the simulated and the theoretically expected output, after the procedure of offset voltage compensation, is in the range of 10% for current consumption values less than 20 uA. In the range of current consumptions of hundreds of uA to a few mA, the deviation is less than 2%.The development of the proposed electronic metering module after the refinement in simulation stage proceeds with the verification of correct operation, which is similar to the procedure described in the first electronic module.


## 4.4.3. iCount-Based Electronic Metering Module

The iCount technique relies on the capacity of Pulse Frequency Modulated counting cycles of a node switching regulator [36]. The amount of energy transferred in each cycle of switching is constant for constant input voltage. Thus, a linear relationship between BSN current and frequency is shown. The range of linearity spread from 5 uA to 35 mA for current consumption and constant input voltages in the range of 2-3 V. The schematic of the implemented iCount technique is depicted in Figure 8.Figure 8
Electronic metering module based on iCount technique. The model IMOTE is used for the modeling of BSN node.For inductanceL = 45 uH and capacitances Cin=Cout = 10 uF the dynamic range of switching frequencies is maximized for the aforementioned current range. Lower values of inductance or capacitances result in the preservation of linearity for smaller range of switching frequencies.Simulation results of the electronic metering module implementing the iCount technique are depicted in Figure9 for a wide range of input voltage from 1.6 V to 3.09 V.Figure 9
BSN current consumption against frequency switching curve for a wide range of input voltages.There is a disturbance of linearity for BSN current consumption in the range of 25 mA for input voltage below 1.9 V. Particularly, in BSN battery-powered nodes, the levels of battery voltage affect the linearity of the electronic metering module even in the range of 20 mA for input voltages of 1.6 V.Measurement of the switching frequency enables the direct calculation of BSN current consumption, according to modeling of iCount technique, as it is depicted in Figure10.Figure 10
Modeling the linear relationship of BSN current drawn against the switching frequency for iCount technique. They-axis and x-axis are in log scale.


## 5. Results

TinyOS applications developed for the purpose of biosignal monitoring in BSN nodes are employed for validation of the energy consumption estimation and measurement results. A family of TinyOS applications, Oscilloscope, is used for temperature sensing.In Table2, current consumption is presented for a series of Oscilloscope based TinyOS-2.x applications measured via the electronic metering module which is based on shunt resistor. A common basis is considered concerning the time period in order to provide comparative results.Table 2
TinyOS-2.x applications current consumption measurement results.
TinyOS-2.x applications
Current consumption (mA∗sec) per time-period 9.767 sec
Oscilloscope(NREADINGS = 1)
186.653
OscilloscopeWMR(NREADINGS = 1)
19.304
Oscilloscope with LPL(NREADINGS = 10) (Wake-up period = 20 msec)
74.444
Oscilloscope with LPL(NREADINGS = 10) (Wake-up period = 100 msec)
42.223
OscilloscopeWMR(NREADINGS = 10)
4.474
OscilloscopeFusion with LPL(Wake-up period = 20 msec)
68.617
OscilloscopeFusion with LPL(Wake-up period = 100 msec)
22.244
OscilloscopeFusionWMR
0.635The performance of TinyOS-2.x applications in terms of overall current consumption is dependent on the design directions and the implementation of the applications. The incorporation of optimization techniques in order to minimize energy consumption targets the reduction of energy expensive subsystems usage, such as the radio communication subsystem. The combination of this technique with low power listening modes in TinyOS applications has a direct impact on the energy efficiency of BSN nodes. A typical case is depicted in Figure11 for two TinyOS applications based on Oscilloscope, which samples a biosignal (temperature) periodically and enables the radio communication subsystem only when a specific number of temperature readings are collected and processed.Figure 11
Current consumption of TinyOS-2.x applications OscilloscopeWMR and OscilloscopeFusionWMR based on the output of the electronic metering module for energy consumption measurement.Implementation of low power techniques and time series processing methods verifies that energy-efficient approaches applied on BSN nodes have positive impact in terms of energy consumption. Furthermore, the effect of sampling frequency is explored on total energy consumption. As the sampling frequency increases, sensory subsystem energy consumption tends to increase. Moreover, frequent sampling produces more data on the node, which raises energy burden of radio communication subsystem. The processing methods applied on collected data time series reduce the amount of data to be transmitted, thus the total energy consumption.Figure12 refers to the energy consumption comparative results between the theoretical model, the energy simulator, and the electronic metering modules. The biosignal tested is temperature with a small sampling rate. Table 3 includes comparative results of energy consumption on various TinyOS applications executed on BSN nodes. The measurement results of the shunt resistor electronic metering circuit are used as a reference point for comparison purposes.Table 3
Comparative results of BSN node energy consumption.
Applications
Techniques
Current consumption per period (mA∗sec)
Shunt resistor
Capacitor based
iCount based
Energy simulator
Theoretical estimation
CountToLeds
4.821
4.811
4.760
4.863
4.866
—
−0.2%
1.3%
0.9%
0.9%
CountToRadio
1.843
1.872
1.881
1.842
1.844
—
1.6%
2.1%
−0.1%
0.1%
CountToRadio with LPL
1.371
1.403
1.399
1.247
1.321
—
2.3%
2%
−9%
−3.7%
CountToRadioWMR
0.154
0.165
0.160
0.119
0.147
—
7.1%
3.9%
−22.7%
−4.5%Figure 12
BSN node’s comparative energy consumption results for temperature monitoring using theoretical model, energy simulator output, and electronic metering module measurement (shunt resistor).The comparison between the theoretical model, the energy simulator output, and the electronic metering modules measurements shows matching results in terms of energy consumption, as depicted in Figure12. The overall picture shows similar results of the measurement, the simulation, and the theoretical methods, however in software-based current consumption estimation; it tends to be underestimated due to the approximate energy model and the timing information which is produced from the virtual machine behind the energy simulator.The relative deviation between the capacitor based module, the shunt resistor module, the iCount based module, the energy simulator, and the theoretical model is in the range of less than 10% in reference to the shunt resistor electronic metering module. Only in one case, the relative deviation is in the range of 22.7%, underestimating the total energy consumption from the energy simulator. Indirect microcontroller energy consumption estimation and energy state transitions, which are not taken into consideration, explain the difference of the energy simulator result from the shunt resistor electronic metering measurement.One interesting point from the comparison results of Table3 is the reduction of differences in all techniques when the application implements fewer energy consumption optimization procedures. Focusing on the approximate energy simulator and the theoretical estimation tool, fewer energy consumption optimization procedures have a positive effect on more accurate timing information extracted from the virtual machine of the simulator. On the other hand, when energy consumption optimization procedures are applied, such as low power listening with or without management of radio communication subsystem, the timing information extracted seems to underestimate the energy state transitions with an impact on the accuracy of the energy consumption result.The accuracy of the electronic metering modules is considered fairly acceptable. Even in low energy consumption TinyOS applications with optimization techniques, despite the fact that simulation results from the electronic metering modules design stage revealed increased deviation of the measured output from the theoretically expected value of current consumption, the three modules operate with credibility in the region of their low sensitivity which corresponds to current consumptions in the order of uA. In higher current consumptions, the accuracy in monitoring is increased due to the high sensitivity in the region of current consumption in the order of 10 uA to thousands of uA.The concept in the use of electronic metering modules in the current work is the a priori validation of theoretical modeling and energy simulation results with energy consumption measurements. The energy reservoir for the electronic metering modules differs from the energy reservoir of the BSN-WSN node. A coarse current consumption comparison between the three components of the corresponding electronic metering module reveals that AD620 quiescent current is 0.9 mA in typical cases whilst for LTC3525 is only 7 uA and for the second electronic metering module is expected to be higher than 1 mA. In terms of individual current consumption of the three electronic metering modules, the second one which is based on the iCount technique seems to be less energy consumable whilst maintaining sensitivity and measurement accuracy for a wide range of BSN-WSN input voltages.


## 6. Discussion

Energy resources management subsystem is a critical component in BSN nodes and IIMDs since reduced lifetime and lack of adequate power may compromise network functionality and reliability. Simulation and theoretical tools are essential in designing energy-efficient applications for body sensor networks. Measurement results verify the available tool providing a valuable insight into the actual energy consumption on BSN nodes.The network topology is simple for the presented evaluation methodology, as we are interested at the energy consumption framework of health monitoring body networks.Electronic metering modules provide accurate time function of current drawn by the BSN or IIMD node. This information is combined with the sampling of the battery voltage levels and timing information to produce an accurate energy consumption signature of the BSN node system or the IIMD system. The energy consumption issue in BSN and IIMDs introduces a holistic approach in determining the energy profiling which is composed of ultralow power electronics, energy-efficient applications, and means to determine the energy consumed in BSN and IIMD nodes.A unified framework with components of energy consumption theoretical model, simulation of approximate energy models, and electronic metering modules facilitate the study of the energy consumption issue on body sensor networks. In this work, an energy consumption estimation framework is presented which is composed of theoretical tool calculation, simulation of applications energy signature, and three prototype electronic metering modules for accurate energy consumption measurement.Conclusions drawn out of this framework allow the design of energy efficient hardware and software solutions for BSN nodes and the performance testing of the proposed solution in terms of total energy consumption. Furthermore, experimental measurements of BSN node’s energy consumption by means of electronic metering modules attached to the nodes verify in real time the efficiency of energy conservation techniques in order to extend node and network lifetime. In the case of BSN and IIMDs applied to clinical practice, network and node lifetime extension is related to patient comfort and minimization of invasive procedures for depleted energy reservoir replacement.



---

*Source: 124987-2015-07-08.xml*