Download as pdf or txt
Download as pdf or txt
You are on page 1of 13

Journal of Systems Architecture 58 (2012) 7385

Contents lists available at SciVerse ScienceDirect

Journal of Systems Architecture


journal homepage: www.elsevier.com/locate/sysarc

Hardware-assisted energy monitoring architecture for micro sensor nodes


Sukwon Choi a, Hayun Hwang a, Byunghun Song b, Hojung Cha a,
a
Department of Computer Science, Yonsei University, Seodaemun-gu, Shinchon-dong 134, Seoul 120-749, Republic of Korea
b
RFID/USN Convergence Research Center, Korea Electronics and Technology Institute, #68 Yatap-dong, Bundang-gu, Seongnam, Gyeonggi Province 463-816, Republic of Korea

a r t i c l e i n f o a b s t r a c t

Article history: In this paper, we present a hardware-assisted energy monitoring architecture, HEMA, which provides
Received 1 September 2010 power information for individual system components in micro sensor nodes. HEMA gives information
Received in revised form 5 December 2011 on how the system components of sensor nodes spend energy while applications are running. To develop
Accepted 12 December 2011
a practical runtime monitoring system we used a power monitoring technique based on a battery mon-
Available online 28 December 2011
itor IC (Integrated Circuit) which is typically used in embedded systems. HEMA uses a software technique
to monitor device usage patterns, and combines it with hardware-assisted power information in runtime.
Keywords:
However, the battery monitor IC has problems in monitoring individual devices. In this paper, we devel-
Wireless Sensor Network
Energy management
oped a software technique to supplement its drawbacks. To evaluate the proposed system, we built a
Battery monitor IC micro sensor node with battery monitor IC. We operated real applications on the sensor node and con-
ducted a comparative analysis with a dedicated power monitor. Our experiment results show that HEMA
indeed provides a suitable architecture for runtime power analysis with low overhead.
2011 Elsevier B.V. All rights reserved.

1. Introduction proposed off-line techniques. These approaches may perform


incorrect power proling due to unstable power models and
Power management is an important issue in Wireless Sensor inaccurate pre-measured power data for individual devices. To
Networks (WSNs) [1] since micro sensor nodes are typically pow- overcome the limitations of software-based monitoring, hard-
ered by energy-limited batteries. Although sensor network tech- ware-assisted power monitoring techniques were proposed. Trath-
nology has recently been applied to various applications, battery nigg [9] and Jiang [10] suggested power measuring hardware that
lifetime is still a major limiting factor for the widespread use of should be connected to sensor node to collect data. An on-board
sensor applications. Alternatively, researchers have studied energy hardware-based power monitoring technique was also proposed.
harvesting schemes such as solar panels [2], but the amount of har- Stathopoulos [11] suggested EndScope using the current monitor
vested energy is limited and the system has similar problems to IC [12]. EndScope provides real-time energy usage information for
those found in batteries. Power management to extend battery life- individual devices but the system is not suitable for resource-con-
time, therefore, becomes more important and active research has strained sensor nodes. Fonseca [13] proposed Quanto, which traces
been done in recent years. the energy consumption of a device using iCount [14] that is
An appropriate power management technique for sensor nodes combined with a software technique. iCount uses a PFM (Pulse
is to detect an idle device operation and change it to reduce unnec- Frequency Modulation)-type DCDC switching regulator and timer
essary energy consumption [3]. The energy consumption of a on a microcontroller, which counts the switch cycle of the regula-
sensor node is affected by node type, deployed environment, and tor. For continuous energy monitoring, however, iCount uses a
application [4]. In addition, batteries have chemical characteristics system timer on the microcontroller, which would affect the appli-
that affect battery lifetime of sensor nodes [5]. Runtime energy cation performance.
monitoring is, therefore, an important issue for the efcient power Recent advances in CMOS technology have enabled the devel-
management of sensor nodes, and an essential functionality opment of a micro-sized battery monitor IC [15]. The hardware
required for any practical system [6]. has a small form factor and consumes little power; hence, it can
Various approaches are found for runtime and off-line energy readily be integrated into a sensor node. Using a battery-monitor-
monitoring of sensor nodes. Dunkels [7] proposed a runtime ing IC is a common technique to manage batteries in typical
software-based energy estimation technique and Landsiedel [8] embedded devices. In Wireless Sensor Networks, the conventional
belief is that using a hardware IC would involve additional cost,
power, and access time overhead. However, the recent widespread
Corresponding author. Tel.: +82 2 2123 5711; fax: +82 2 365 2579. use of batteries in micro sensor nodes will accelerate the use of a
E-mail address: hjcha@cs.yonsei.ac.kr (H. Cha). battery monitor IC [16].

1383-7621/$ - see front matter 2011 Elsevier B.V. All rights reserved.
doi:10.1016/j.sysarc.2011.12.001
74 S. Choi et al. / Journal of Systems Architecture 58 (2012) 7385

In this paper, we describe HEMA, a hardware-assisted energy mechanisms, a continuous and accurate mechanism is necessary
monitoring architecture for micro sensor nodes. Our primary to monitor battery power and measure overhead of device power
objective is to provide an energy monitoring architecture that mode change. Therefore, DPM mechanism requires runtime power
monitors power consumption of resource-constrained sensor monitoring of individual devices.
nodes in real-time. In particular, HEMA is designed to provide a Software-based power monitoring is a common technique
method for monitoring individual devices in sensor nodes. Our sys- adopted by many practitioners in the eld [7,8]. The method uses
tem provides a software technique to handle hardware-assisted the ADC (Analog to Digital Converter) reference voltage from micro-
power monitoring information. For a practical use of the system, controller for runtime monitoring, which indicates the battery sup-
we use a battery-monitoring IC, which is commonly used in mobile ply voltage. A software-based power monitoring technique changes
embedded systems. The software technique provides a power trace this data to power-related information. The information is then
of individual hardware components in a sensor node by using combined with pre-proled data and used for prediction of battery
incomplete power information from the battery monitoring IC. residual, current power consumption, and remaining lifetime. Fig. 1
The remainder of the paper is organized as follows: In Section 2, shows the comparison of the software-based power voltage moni-
we describe why we chose a battery monitor IC as a hardware toring and hardware-assisted monitoring. Y-Mote (refer Fig. 13)
assistant and discuss its limitations. We present the system design powered by 2AA alkaline battery was used for the experiments.
of HEMA in Section 3. In Section 4, we show how we implement Two types of workloads were used: high-workload (Fig. 1(a)) and
HEMA in a real sensor network environment. The evaluation re- 50% duty cycle (Fig. 1(b)). High-workload uses all the sensors device
sults are shows in Section 5. We conclude the paper in Section 6. and radio devices actively. The 50% duty cycle turns on the radio
device for one second and turns it off for one second repeat. For
2. Backgrounds high-workload, the hardware-assisted monitoring shows a steady
decrease in remaining voltage whereas the software method shows
Runtime power monitoring of non-trivial sensor applications is uctuations due to the ADC noise. The 50% duty cycle workload
not easy because of the implementation overhead. Any practical exhibits the similar results, but the uctuations are becoming
energy management of sensor networks requires an accurate yet noticeable both in hardware and software-based monitoring.
efcient power monitoring method in order to acquire detailed Software-based power monitoring uses a battery voltage level as
power data. We have considered the use of a battery monitor IC base information to calculate battery residual or to detect the tran-
for this purpose. sition time of devices power status by comparing with the power
prole. The lack of accurate information makes it hard to develop
2.1. Motivation an efcient power management algorithm.
Power management in most of the previous research was
Power management for sensor devices typically includes dy- conducted in a limited environment or simulation situation.
namic power management (DPM) [3,17]. The key idea of DPM is Real-world sensor applications should require practical lifetime
to understand the underlying devices on/off/sleep usage patterns. reservation techniques based upon accurate run-time estimation
A DPM algorithm should understand power consumption pattern of battery residual as well as the power consumption.
of devices according to this pattern, and analyze correct timing
of power mode transition. A typical DPM mechanism uses pre-de- 2.2. Why use battery monitor ICs?
ned power consumption information that has been derived from
pre-proling of the underlying system. The pre-proling informa- Power monitors in sensor nodes should operate the microcon-
tion, however, cannot reect issues such as data bus delay, connec- trollers independently. However, previous research has typically
tion overhead, or the relationship between other devices [18]. If focused on precise current monitoring and rarely considered
the DPM mechanism uses prole information, sensor device char- microcontroller overhead. One case of an accurate and powerful
acteristics cannot be detected, and consequently an efcient DPM energy monitoring system is EndScope [11]. The system allowed
algorithm is hard to be developed. To construct practical DPM for a new sensor node design where major devices are connected

Fig. 1. Comparison of the software-based power monitoring and the hardware-based monitoring.
S. Choi et al. / Journal of Systems Architecture 58 (2012) 7385 75

Table 1 showed continuous power consumption, and high-workload deliv-


DS2730 specication [15]. ered a comparatively linear change of power consumption. In the
Parameter Specication case of 50% and 8% duty cycles, uctuations of current occurred.
Overhead Supply voltage 2.5 V The results validated the idea that power monitoring based on a
ACTIVE current 65 lA battery IC can monitor the on/off usage pattern of a device as well
SLEEP mode current 1 lA as its power consumption. In addition, the mechanism generated
Accuracy Voltage resolution 50 mV accurate current information, which can be used as a useful input
Voltage error 1.56 lV for practical power management.
Current resolution 1.56 lV Most battery monitor ICs have on-chip EEPROM (Electrically
Current gain error 1%
Erasable Programmable Read-Only Memory) and accumulators to
save long-term energy information. These structural features of
the battery monitor IC provide the microcontroller an independent
to a current monitor IC for energy monitoring. The current monitor power monitoring function by reducing sampling rate. Fig. 3 shows
IC provides accurate but momentary energy information about the the performance comparison of battery monitor IC-based energy
device. Hence, understanding the power usage pattern of the de- monitoring and the microcontroller-based methods which include
vice is necessary with continuous access to the current monitor iCount, current monitor IC-based, and the pure software-based ap-
IC. The current monitor IC uses the microcontrollers resources proach. The monitoring period was approximately 50 ms, which is
such as ADC (Analog to Digital Converter), I2C bus, and serial the minimum period for using software lter (We used the Least
bus. Because of this problem, EndScope is designed to use a dual Mean Square Method). This is to minimize uctuations due to
processor: one is the ARM-based application processor, and the the ADC noise shown in Fig. 1. Fig. 3 shows that the microcontrol-
other is a microcontroller for energy monitoring. This approach ler-based monitoring causes about 10 times more overhead than
should not be suitable for use with micro sensor nodes. the battery monitor IC. This is because the battery monitor IC has
The primary goal of using a battery monitor IC is to provide pre- twofold bus overhead due to structural features, whereas the
cise supply voltage and battery residual information to end-users current monitor IC uses ADC during the monitoring period. This
when a mobile device is supplied system power from a lithium- overhead would disrupt sensor operations or cause jitters in
ion or lithium-polymer battery. Most battery monitor ICs offer sensor-intensive applications. Table 2 also shows a comparison
current measurement and accumulation functions in real-time, between the battery monitor IC-based power monitoring and other
which potentially provide runtime power-consumption informa- methods. Using a battery monitor IC is shown to be a good choice
tion for embedded devices. We conducted experiments to under- for an energy monitor for micro sensor nodes.
stand how well a battery monitor IC provides power related
information. We used the DS2782 [15] battery monitor IC in a micro
sensor node. The hardware specication of the chip is shown in 2.3. Problem
Table 1. We examined how the battery monitor IC monitored elec-
tronic current. Four types of workloads were used for the experi- In spite of the various advantages mentioned previously, a
ments. Low-workload meant all sensor devices and radio devices battery monitor IC has limited adaptability to our target system.
were turned off except for the microcontroller. High-workload used To understand the potential and limitations of a battery monitor
all of the device and radio devices actively. The other two workloads IC-based energy monitoring technique we conducted preliminary
used radio duty cycles of 8% and 50%. The 8% duty cycle workload experiments. We obtained the measurement results using a battery
turned on the radio device for 250260 ms, and turned it off for three monitor IC, a custom-built high-performance measuring instru-
seconds, repeatedly. The 50% duty cycle workload turned on the ment, and a software-based energy monitoring technique. We built
radio device for one second and turned it off for one second repeat- a high frequency power measurement device, shown in Fig. 4, to
edly. The results are shown in Fig. 2. The battery monitor IC used in handle the dynamic current level of micro sensor nodes. The instru-
our experiment colleted 150 samples every 3.3 s. Low-workload ment used an 18-bit ADS8381 ADC [19] and a TMS320f28335 DSP

Fig. 2. Current monitoring data by battery monitor IC.


76 S. Choi et al. / Journal of Systems Architecture 58 (2012) 7385

Fig. 3. Comparison of microcontroller occupation: microcontroller-based approach


and battery monitor IC-based approach.

Fig. 4. Experiment Setup.

Table 2
Power monitoring techniques. measures the system current accurately. In the case of Sensor-
On&Off the battery monitor IC data is represented as a line (BM
Method Accuracy Range Microcontroller Energy
Trace). This is because the sampling rate of the battery monitor
overhead overhead
IC is too low to detect the transition timing of the device. Fig. 5 also
Software Low Low High Low
shows the software-based monitoring results (S/W Trace) for the
technique [7,8]
iCount [14] High High High Low exact transition timing of the device. However, monitored data
Current monitor IC High High High High by software-based monitoring does not contain the transition
[11] overhead shown in Fig. 6. The overhead is shown as an irregular
Battery monitor IC High Low Low Low peak power that inuences the total power consumption in the mi-
cro sensor node.
Fig. 6 shows that the battery monitor IC detects the devices
(Digital Signal Processor) [20]. The same method was used for the transition overhead rather than the transition timing. This is be-
battery monitor IC-based technique we used in Section 2. We also cause the battery monitor IC has a circuit to provide accurate cur-
implemented a simple software technique that traces a devices rent measurement. This circuit continuously monitors the power
activity and matches it with pre-measured power information. consumption of the system and periodically provides the micro-
Three types of workloads were used for the experiments: (1) the controller with the collected data. For example, DS2782 samples
sensor is constantly turned on (Sensor-On), (2) the sensor is con- signals with 18.6 kHz rate and updates the current measurement
stantly turned off (Sensor-Off), (3) the sensor is alternately on and register every 3.515 s. If we use this accurate run-time data for a
off (Sensor-On&Off). We used a gyro sensor in the sensor node to software-based monitoring technique, we can monitor the
detect workloads. The results are shown in Figs. 5 and 6. power-consumption pattern of micro sensor nodes. In this paper,
In the case of Sensor-On and Sensor-Off, the results for the bat- we will present a concrete software technique for a practical
tery monitor IC-based measurements and the measuring instru- run-time energy monitoring system, based on the accurate power
ment were the same. This is because the battery monitor IC information of battery monitor IC.

Sensor-On-Off (S/W Trace) Sensor-On-Off (BM Trace) Sensor-On


Current (mA)

Transition Overhead

Sensor-Off
Constant Power

Time (ms)

Fig. 5. Drawback of battery monitor IC.


S. Choi et al. / Journal of Systems Architecture 58 (2012) 7385 77

40
Transition Overhead
35

30
Sensor-On

25

Current (mA) Sensor-On-Off (H/W Trace)


20

15

10
Sensor-Off
5 Constant Power

0
0 1000 2000 3000 4000 5000 6000 7000 8000 9000
Time (ms)

Fig. 6. Ideal measurement results using accurate measuring instrument.

3. Hardware-assisted energy monitoring architecture


Software-based Power Monitor
The key concept of HEMA is to provide a technique for combin-
ing hardware-based power monitoring with a software-based de- HEMA
vice utilization tracking technique. To monitor hardware, we
chose a battery monitor IC, which has various practical advantages. Device Utilization Monitor Device Classifier
In the previous section, we showed that the main limitation of a
battery monitor IC is caused by its low sampling performance, Runtime Power Energy Energy
which is due to long register update time. The software technique Coupler Calculator Estimator
to track device utilization in HEMA should, therefore, accommo-
date this limitation.
Runtime Power Monitor Power Table
Fundamentally, HEMA uses a software-based power monitoring
technique. The estimated power consumption based on a software-
based technique is corrected with hardware-assisted power moni-
Hardware -assisted Power Monitor
toring data. Fig. 7 shows an overview of HEMA. HEMA consists of
both software and hardware components. The software-based part
Fig. 7. Overview of HEMA.
is organized with the device utilization monitor, device classier,
energy estimator, and power table.
the power consumption varies with different battery voltage. The
3.1. Power table result indicates that for accurate estimation of power consumption
the power table should be dynamically updated as time passes. In
Energy consumption of devices is stored as a table. Based on the this paper, we therefore use a dynamic technique to update the
information in the power table, HEMA dynamically infers the con- power table according to sensor node and its battery status.
sumed power of devices. The power table contains pre-measured To use a dynamic technique in HEMA, a sequence of operations
data, which is either electronic current or power stored according should be performed to create a power table at the initial start-up
to device operation. Software-based power measurement tech- phase of sensor nodes. Fig. 9 shows the pseudo-code of these oper-
niques usually use a static table and comprise the following prob- ation sequences. When the sensor node is booted all devices are
lems. First, sensor nodes normally use a battery as a power source, rst turned off and power consumption of each device is measured
and the output voltage becomes low as the battery is discharged. by turning them on one by one. The result is stored in the power
Second, nodes are equipped with various sensors and devices, table, and updated using the following method.
hence often require a voltage regulator to supply constant-voltage. Given the BMIC (battery monitoring IC)s update interval TBM
The effect of voltage regulator varies according to the input voltage and monitoring power at this interval, the device power consump-
and the current. In sensor nodes, an input voltage and a current tion is measured at every k  TBM. k is a constant set by user. Then,
load change as the battery depletes, which causes non-linear the energy consumption EBM of sensor node is estimated as
behavior in power consumption. This problem is illustrated in follows:
Fig. 8. Z
In this experiment, power consumption of a gyroscope X
k
EBM Ptdt V i  Ii  T BM ;
equipped in sensor node is estimated with step-up switching reg- i1
ulator and step-down linear regulator. In the gure, the REG output
is the estimation of consumed power in output side of the regula- where Vi, Ii are the voltage and current at step i respectively. At the
tor, and the REG input is estimated at power input from the battery same time, the energy consumption ESW of sensor node with a soft-
to the regulator. No change is observed in consumed power with ware-based method is estimated using devices power consumption
the REG output of both regulators, whereas with the REG input PD, which is stored in power table, and operation time tD, as follows:
78 S. Choi et al. / Journal of Systems Architecture 58 (2012) 7385

70 the problem of regulator and the voltage transition overhead of bat-


tery. Thus, by compensating the difference of EBM and ESW, the
60 power consumption of each device ED is estimated accurately,
which is expressed as
50
ED PD  t D EBM  ESW  P D  tD =ESW
Power(mW)

40
With the dynamic table update technique of HEMA, ED is esti-
mated periodically and the table is updated accordingly, and accu-
30
REG input rate power consumption can be estimated over the software-based
REG output techniques.
20

10 3.2. Energy calculation

0 The runtime power monitor and runtime power coupler are


3.2 3.1 3.0 2.9 2.8 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0 1.9 parts of the hardware-assisted component. The data processed by
Volt(V) the components are fed to the energy calculator and converted to
(a) Switching regulator real energy information.
The monitored information is then sent to a device utilization
70
monitor and device classier. The device utilization monitor mea-
sures the device operation time (Fig. 10(a)). The device classier
60
rearranges the device operation time to an appropriate status for
energy calculation (Fig. 10(b)). Based on the rearranged data and
50
power table, the energy estimator expects the energy consumption.
Power(mW)

40
The hardware-assisted power monitoring data is collected by a
runtime power monitor, which converts the monitored data into
30 electronic current and voltage. Using a runtime power coupler,
REG input HEMA arranges the power information to each device. The runtime
REG output
20 power coupler calculates individual devices energy ei in Fig. 10. At
this time, the device utilization information from the device utili-
10 zation monitor is used together. The coupled data is passed to
the energy calculator. After energy calculator collects the expected
0 data and coupled data from other components, the energy infor-
4.3 4.2 4.1 4.0 3.9 3.8 3.7 3.6 3.5 3.4 3.3
mation of the individual device is derived, based on the formula-
Volt(V)
tion set out below.
(b) Linear regulator The monitoring period is the update time of the battery monitor
IC. To calculate an individual devices energy ei, the formula given
Fig. 8. Basic concept of our approach.
below is used. The total energy used during the monitoring period
EP, is calculated as follows:
X
n
ESW PD  tD P a  ta Pb  t b . . . Pn  t n EP IP  V P  T P 1
Da
where IP is the electrical current, VP the supply voltage, and TP the
where a, b, c, . . ., n represent the devices in sensor node. In an ideal monitoring period. IP and VP are measured with a hardware power
case, EBM and ESW should be equal. Yet, they are different due to monitor, and TP is tracked by software. Therefore, EP is calculated

// PW_TABLE[MAX_DEV_NUM] : Power Table Variable


// Get_Energy(); : Energy Monitoring Function using Battery Monitoring IC
Init_Power_Table() {
SET MAX_DEV_NUM to Total number of devices in sensor node
FOR I=0 TO MAX_DEV_NUM {
All_DEVICE_OFF(); // turn off every devices in sensor node
// turn on current device while monitoring period
WHILE one monitoring period {
DEVICE_ON(I);
}
SET PW_TABLE[I] to Get_Energy(); // update power table variable
}

Fig. 9. Pseudo-code for runtime construction of power table.


S. Choi et al. / Journal of Systems Architecture 58 (2012) 7385 79

Current (mA)

Current (mA)
Monitoring Period (TP) t1 t1
t0 t1 t2 t0 t2

Time (ms) Time (ms)


(a) Software-based Device Utilization Tracking (a) Software-based Multiple Device Utilization Tracking

Total Total
Working Time Idle Time Real Current
Current (mA)

Current (mA)
Expected Current
e0 e1 e2 e0 e1 e2 e4
(Ep - EC)

Constant Power (EC) EC

Time (ms) Time (ms)


(b) Energy Calculation based on Hardware-assisted Monitoring (b) Energy Recalculation based on Hardware-assisted Monitoring

Fig. 10. Basic concept of our approach. Fig. 11. Technique for multiple devices.

within the rst step. In Fig. 10, the energy consumed while the de- current-matching technique. Fig. 11 illustrates the scheme. The de-
P
vice is working is expressed as ni1 ei : vice-grouping technique collects the total operational time of the
X
n X
n individual devices during the monitoring period. Because the bat-
ei EP  EC I i  V i  t i 2 tery monitor IC is operated independently, the device-grouping
i0 i1
technique can be performed at runtime. Fig. 11(b) shows the re-
where EC is the constant energy consumption. Ii, Vi, and ti stand for sults after the device-grouping technique has been conducted.
the electronic current, supply voltage, and working time of the ith The light gray and dark gray colors indicate the relevant device
device, respectively. In single device usage, the following is groups. After determining the device groups, HEMA employs an
assumed: electronic current-matching technique. The technique assigns the
total energy to each devices energy according to the estimated en-
Ii I 0 I 1 . . . In IW 3
ergy consumption ratio.
The supply voltage in a single monitoring period is the same, The estimated energy consumption ratio is calculated according
hence it is also assumed that: to the premeasured energy. Let Pi denote the anticipated current of
the ith device; Thus, Eq. (8) will be changed as follows:
Vi V0 V1 . . . Vn VP 4
Pn
i0 ei and ei are calculated by the following formulae: Pi
ei ti   VP 9
X
n X
n IP  IC
ei IW  V P  ti 5
i0 i0
The energy information monitored by battery monitor ICs re-
ects energy losses caused by transition overhead. IP PIi C in Eq. (9)
 
ei IW  V p  ti 6 calculates this energy loss. Based on Eqs. (8) and (9), HEMA accu-
rately monitors the energy consumption of each individual device.
According to Eq. (3), IW is denoted as:
IW Ip  I C 7
3.3. Case study
where IC is the constant electronic current, and estimated from the
initial measurement. Therefore, ei becomes: To clarify that HEMA estimates power consumption correctly,
we performed experiment with a gyroscope periodically turning
ei t i  IP  IC  V P 8
on and off. Three types of measurements were compared: the mea-
This is considered to be a single devices operational workload. suring instrument, software-based energy estimation and HEMA.
However, in real sensor network environments, devices are oper- The results are shown in Fig. 12. HEMA-based energy monitoring
ated concurrently. Therefore, a practical energy monitoring tech- contains transition overheads of the gyro sensor, whereas the soft-
nique for multiple devices should be considered. The major ware-based energy estimation indicates the maximum power. The
problem for the energy monitoring of multiple devices is that the transition overheads, IP PIi C , are reected in the subsequent moni-
hardware monitor observes the total system power, and it is hard toring period since HEMA handles the information after monitor-
to tell which devices use energy during the monitoring period. To ing. The result shows that power consumption for each device is
solve this problem, HEMA uses a device-grouping and electronic correctly estimated with Eq. (9).
80 S. Choi et al. / Journal of Systems Architecture 58 (2012) 7385

30

25
Pi
Instrument S/W Only (Ip Ic) HEMA
20
Current (mA)

15

10

0
0 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000
Time (ms)

Fig. 12. Single device monitoring.

4. Implementation

To validate HEMA, we built a battery monitor IC-equipped sen-


sor node and modied the RETOS [21] sensor network operating
system appropriately.

4.1. Hardware prototype

We developed a prototype sensor node with hardware-assisted


power monitoring functionality. Fig. 13 shows the hardware, named
Y-Mote, which is equipped with inertial sensors such as an acceler-
ometer and a gyroscope. The inertial sensors used in our board nor-
mally require additional power, due to the high-frequency sampling
of the devices for the inertial navigation applications. The Ymote
uses the newly standardized IEEE 802.15.4a-compatible radio chip
[22]. This radio device uses more power than the IEEE802.15.4 radio
interface. We used the DS2782 [16] battery monitor IC in the Ymote
to implement hardware-based power monitoring. The hardware
specications of the chip are shown in Table 1. The Y-Mote runs Fig. 13. Ymote prototype.
the RETOS operating system [21].

the micro time stamp. The device monitor collects the power stats
4.2. RETOS modication
of a device; power_on and power_off power-control interface in the
device manager was modied. The HEMA core is the key compo-
The RETOS operating system has been designed to satisfy three
nent of our system and collects all the information from the other
goals: to support a multi-threading programming environment, to
components, and transforms it into energy information.
offer a robust system by protecting the kernel from application er-
rors, and to give functional extensibility to the sensor operating
system. The RETOS device driver model is exible enough to meet 5. Evaluation
the various requirements of the sensor hardware, and to support
the diverse characteristics of the devices [23]. To support exibil- Using a hardware IC would involve additional overheads includ-
ity, three different methods are supported, namely: the user-mode ing cost, power, and access time. In this section, we rst evaluated
driver, the 2-layer kernel-mode driver, and the single-layer kernel- the overheads of the system. Then, we evaluated how well HEMA
mode driver. All device drivers are managed by the device man- traces the energy consumed by individual devices. The custom-
ager. The system is designed to support simultaneous requests built measuring instrument and the software-based energy estima-
from devices and provides shared access and power management. tion technique were used for the purpose of comparison. Finally,
The device manager was modied to implement HEMA on RETOS. the functionality of HEMA was examined using real applications.
Fig. 14 illustrates the modication.
Four components are added to the device manager; that is the 5.1. Overhead
battery monitor driver, the micro timer, the device monitor, and
the HEMA Core. The battery monitor driver is a device driver for Hardware-assisted monitoring certainly incurs overheads in
battery monitor IC and provides hardware-assisted power infor- terms of cost and additional power. Hence, the potential overheads
mation. The micro timer is a modied system timer to support of the proposed system should be evaluated with appropriate
S. Choi et al. / Journal of Systems Architecture 58 (2012) 7385 81

150 ms of microcontroller operation, which occurs every 3.3 s.


User Application The results show that HEMA has 1% ROM and 10% RAM overheads
over the kernel. The ROM overheads are acceptable. Although
User Mode Device Single Layer 2- Layer HEMA requires a large amount of RAM for runtime monitoring,
Driver System Calls Device Driver Device Driver the total RAM size of MSP430 is 10 KBytes, 332 Bytes for HEMA
is acceptable considering that MSP430 has 10 KBytes of RAM.
Device Manager

HEMA Core 5.2. Articial workload

To evaluate the per device power estimation accuracy of HEMA,


Battery Monitor Device Driver
Micro Timer we have carried out experiment with articial workloads, in which
Driver Monitor
devices are randomly operated. The power consumption is
estimated with HEMA and measured with special instrument in
Hardware parallel. Fig. 15(a) shows the total power consumed, Fig. 15(b)
(d) shows the power consumption of each device such as radio,
Fig. 14. RETOS modication. GPS, and digital compass. The consumed power is estimated using
power-measuring instrument and HEMA. The gures indicate that
although HEMA cannot provide power consumption of each device
experiments. In the following experiment, we measured delay, as detail as the measuring instrument due to the low sampling fre-
power and code overheads of HEMA. The delay component of quency, the exact amount of consumed power and power
HEMA includes data collection and processing overheads. To mea- consumption pattern can be learned using HEMA. Especially, the
sure power consumption and delay overhead of HEMA, we made per device power estimation is close to that of measuring devices
experimental setup using high frequency power measurement when the multiple devices operate simultaneously. The results
device and Agilent DSO6034A oscilloscope. We measured the exe- show that the per device power consumption and pattern monitor-
cution time and the current drawn via the resistor connected to a ing is possible using HEMA.
battery of sensor node. We excite articial workload with and
without HEMA to compare overhead. Table 3 shows the results. 5.3. Real application
The DS2730 battery monitor IC uses an I2C bus interface to read
the battery data and transfers them to the microcontroller. I2C uses To evaluate HEMA, a real sensor network application was
two wires: SCL and SDA. SCL is the clock line used to synchronize implemented, as illustrated in Fig. 16. This is an anchor-free mobile
all data transfers over the I2C bus, whereas the SDA data line is node localization system [24] using the Ymote, which is equipped
used to transfer data to microcontroller. This two-wired I2C com- with the IEEE 802.15.4a RF module. The operation consists of three
munication has a time delay. Our measurements reveal that phases: advertisement, ranging and self-positioning. In the adver-
168 ls is required to the read data. Upon receiving the I2C data, tisement phase, a node periodically broadcasts a beacon message
microcontroller converts them into useful data and stores them to the neighboring node. A node then periodically measures dis-
in the memory. This causes an additional delay. In the case of soft- tance to its neighbors, and estimates its location using the received
ware-based energy estimation, the processing delay is higher than information. This application requires sensor nodes to use the
the collection delay. The collection delay is due to the ADC access radio device frequently and randomly, and to collect motion infor-
of the microcontroller. The processing delay occurs when the mation using the gyro sensor. The system also uses Bluetooth to
microcontroller generates various power related data. The voltage send information to a cell phone. Fig. 17 shows the applications
monitoring and current monitoring overheads shown in Table 3 power trace using hardware-assisted monitoring data. 300 s of
are caused by the I2C and microcontroller. The energy calculation operation were logged, and then the data was analyzed. The results
is an overhead for the software technique (HEMA Core), whereas are shown in Fig. 18 and Table 4.
HEMA calculates the energy required for each individual device. Fig. 18 shows the short-term monitoring results. We analyzed
The overhead is incurred by the utilization monitor, device classi- the short-term monitoring area at Section A in Fig. 17. The appli-
er, and energy estimator. The code overheads means the addi- cation is operated by using three devices simultaneously. The re-
tional memory size required for HEMA, and consists of a device sults show the operational effectiveness of the multiple devices
driver for the battery monitor IC and a software code for making monitoring technique. The measuring instrument results are com-
the calculations. pared with the software-based energy estimation technique and
In Table 3 the total delay overheads are 441us, approximately the results from HEMA. The dotted line in Fig. 18 indicates the data
equivalent to 176 cycles of the MSP430 microcontroller. The over- estimated by the software-based energy estimation technique, and
heads occurred every 3.3 s, and hence generated insignicant sys- line in bold indicates the data monitored by HEMA. The software-
tem overheads. The total power overheads are equivalent to based energy estimation approach cannot exhibit accurate energy

Table 3
Total system overhead.

Method Delay overhead (ls) Power overhead (lA) Code overhead


Battery monitor driver Current monitoring 168 101 324 bytes ROM (12 bytes RAM)
Voltage monitoring 188 103
HEMA core Utilization monitor 13 11 120 bytes ROM (110 bytes RAM)
Device classier 27 18 200 bytes ROM (135 bytes RAM)
Energy estimator 45 75 220 bytes ROM (87 bytes RAM)
Total overhead 441 308 864 bytes ROM (332 bytes RAM)
82 S. Choi et al. / Journal of Systems Architecture 58 (2012) 7385

Fig. 15. Power consumption estimation of individual device using HEMA.

75

74

73

72
A B C D E
Current (mA)

71

70

69
Short Term
68 Monitoring
Area
67

66

65
0 50 100 150 200 250 300
Time (s)

Fig. 16. Evaluation setup for HEMA in real application. Fig. 17. Evaluation setup for HEMA in real application.

information, and the total energy for localized operation is de- HEMA monitoring data shows that the power characteristics of
tected as being higher than the actual value. This is because the individual devices are presented accurately.
transition overheads of device are not considered in the soft- We traced the applications operation in Fig. 16 and divided the
ware-based energy estimation approach. On the other hand, the monitoring areas into Section A to E in order to evaluate the med-
HEMA monitoring data shows accurate power information that is ium-term monitoring performance (Fig. 17). We then measured
close to the measuring instrument monitoring data. Especially, de- the total energy consumption of each area. Table 4 shows the
vice operation trends are very well reected in the monitored data. results. We used the error ratio over the measuring instruments
S. Choi et al. / Journal of Systems Architecture 58 (2012) 7385 83

200

180

160
S/W Only
140
HEMA

Current (mA)
120
Instrument
100

80

60

40
Radio On Bluetooth On
20
Radio Send Gyro On
0

Time (ms)

Fig. 18. Short term monitoring in real application.

Table 4 Table 5
Middle-term monitoring error. Long-term monitoring error.

Method Gyro Radio Bluetooth Method Gyro Radio Bluetooth


S/W (%) HEMA (%) S/W (%) HEMA (%) S/W (%) HEMA (%) S/W (%) HEMA (%) S/W (%) HEMA (%) S/W (%) HEMA (%)
A area 4.3 2.1 7.1 3.3 2 1.8 1h 10 2.2 15 3.9 7 2.3
B area 7.1 2.3 15 3.1 2.3 1.7 3h 17 2.9 23 4.3 13 3.1
C area 4.3 2.0 8.3 3.2 2.1 1.5 6h 22 4.2 34 4.9 18 3.7
D area 5.9 2.1 9 3.1 2.2 1.6 9h 25 5.1 48 5.5 21 4.1
E area 7.3 2.0 12.1 3.0 2.3 1.7 12 h 56 5.9 62 6.3 30 4.9

results. The monitoring data from the measuring instrument and 5.4. Power management
software-based energy estimation was too large to handle in the
sensor nodes; hence we logged them on-line and made the rele- To evaluate HEMA, we implemented a power management
vant calculations off-line. The energy data for HEMA was logged mechanism. We reprogrammed the automated sensor-specic
and calculated while on-line due to the characteristics of the bat- power management system (ASPM) [17] for DSL [18] application
tery monitor IC. using HEMA. ASPM monitors the energy consumption pattern of
The results show that the monitored data of the three devices applications and powers on/off the devices automatically. The
has different levels of accuracy according to the monitoring meth- DSL application includes periodic patterns of event-responded
od. For the Bluetooth case, the monitoring error for both the soft- and continuous tracking of sound signal. A node that hears the
ware-based energy estimation technique and HEMA was not sound rst is elected as the leader node. The leader node then se-
large, since Bluetooth is rarely operated and energy monitoring lects the position of the acoustic source among the voting grids.
does not have much chance to render inaccurate energy estimates. The detailed mechanism of ASPM and DSL is found in [17,18]. Here,
However, the radio device is frequently used, and the state transi- we evaluate the power consumption of the DSL application using
tion overheads are large (Fig. 18) for the software-based energy HEMA-based ASPM.
estimation approach. HEMA performed energy monitoring with To perform ASPM for DSL application, ASPM should have knowl-
an error rate of less than 3%. In the gyro case, similar results were edge on wakeup latency and break-even cycle. HEMA provides this
obtained. information using the Power Table described in Section 3. In the
The previous experiments were conducted to evaluate momen- original ASPM we used pre-dene power table; we now automat-
tary monitoring performance. Momentary monitoring can be a ically generate the power table for HEMA-adapted ASPM as shown
useful tool for understanding the energy consumption behavior in Table 6. This is one advantage of using the HEMA scheme for
of a device. The key advantage of HEMA is the ability to monitor power management.
energy consumption after deployment. Therefore, long-term mon- In the original DSL, the MIC sensor is turned off whenever it
itoring is possible. The results of long-term monitoring with HEMA is not used (called UserPM, hereafter). UserPM does not consider
are shown in Table 5. Energy monitoring was conducted for 112 h the energy consumption of transition overhead. The DPM policy
to evaluate the long-term monitoring performance. To save mem- of the original DSL was reprogrammed using ASPM as follow.
ory overheads, the monitoring data was stored in terms of average Whenever the MCU is not used, its power mode becomes C3 be-
energy consumption while the application was running. Table 5 cause the break even time of the MCU is close to 0 ms. In the
shows that the software-based energy low error ratio of 6.3% due MIC case, we established more complicated PM policies than
to the run time power monitoring estimation approach has a large the original DSL. Because the MIC sensor is frequently used,
error ratio, since errors are information. the break even is too short. We compare the original DSL
84 S. Choi et al. / Journal of Systems Architecture 58 (2012) 7385

Table 6 Acknowledgements
Power table of DSL application with HEMA.

Device State Power Estimated Description This work was supported by the National Research Foundation
latency of Korea (NRF) Grant funded by the Korea government (MEST) (No.
MCU C0 240 lA 6 ls Power on 2011-0000156, No. 2011-0015332), and also by the IT R&D pro-
C1 51 lA 2 ls Lower power mode gram of MKE/KEIT (No. 2010-10035310).
1
C2 7 lA 2 ls Lower power mode
2 References
C3 2 lA 1 ls Lower power mode
3
[1] D. Estrin, A. Sayeed, M. Srivastava, Wireless Sensor Networks, in: Proceedings
C4 0.1 lA 0 Power off of Eighth International Conference on Mobile Computing and Networking
MIC sensor D0 40 lA 85 ms Power on (MobiCom02 Tutorial), USA, September 2002.
D2 0 mA 0 Power off [2] A. Kansal, J. Hsu, S. Zahedi, M.B. Srivastava, Power management in energy
harvesting sensor networks, ACM Transactions on Embedded Computing
Network D0 17.4 mA 100 ls Send Systems 6 (4) (2007).
device D1 19.7 mA 2 ls Receive [3] A. Sinha, A. Chandrakasan, Dynamic power management in wireless sensor
D2 426 lA 2 ls Idle networks, IEEE Design & Test of Computers 18 (2) (2001) 6274.
D3 20 lA 2 ls Sleep [4] P. Dutta, J. Hui, J. Jeong, S. Kim, C. Sharp, J. Taneja, G. Tolle, K. Whitehouse, D.
D4 1 lA 0 Power off Culler, Trio: Enabling Sustainable and Scalable Outdoor Wireless Sensor
Network Deployments, in: The fth International Conference on Information
Processing in Sensor Networks (IPSN 2006), Nashville, Tennessee, USA, April
2007.
[5] S. Choi, H. Cha, R. Ha, A Selective DVS Technique based on Battery Residual,
Microprocessors and Microsystems, Elsevier Science 30 (1) (2006) 3342.
Table 7 [6] S. Choi, B. Song, H. Cha, R. Ha, Energy-Aware Pipeline Monitoring System Using
Power consumption of the modied DSLs. Piezoelectric Sensor, IEEE Sensors (in press).
[7] A. Dunkels, F. sterlind, N. Tsiftes, Z. He., Software-based on-line energy
Power consumption (mA) Sound detection error (%) estimation for sensor nodes, in: Proceedings of the Fourth Workshop on
Always On 0.0156 0.03 Embedded Networked Sensors (Emnets IV), Cork, Ireland, June 2007.
UserPM 0.0158 3.57 [8] O. Landsiedel, K. Wehrle, S. Gotz, Accurate Prediction of Power Consumption in
Sensor Networks, in: The Second IEEE Workshop on Embedded Networked
HEMA-based 0.0142 0.05
Sensors, Sydney, Australia, May 2005.
S/W-based 0.0139 2.72
[9] T. Trathnigg, R. Weiss, A Runtime Energy Monitoring System for Wireless
Sensor Networks, in: Proceedings of the 3rd IEEE International Symposium on
Wireless Pervasive Computing, Santorin, Greece, May 2008.
[10] X. Jiang, P. Dutta, D. Culler, I. Stoica, Micro Power Meter for Energy Monitoring
of Wireless Sensor Networks at Scale, in: Proceedings of the Sixth International
(Always-ON) with three kinds of PM policies: User-PM, HEMA- Conference on Information Processing in Sensor Networks(IPSN), Cambridge,
Massachusetts, April 2007.
based ASPM and S/W-based ASPM. Table 7 shows the average [11] T. Stathopoulos, D. McIntire, W. Kaiser, The Energy Endoscope: Real-time
power consumption after running the DSL for 5 min of each Detailed Energy Accounting for Wireless Sensor Nodes, in: Proceedings of the
policy. Seventh International Conference on Information Processing in Sensor
Networks(IPSN), St. Louis, Missouri, USA, April 2008.
As shown in Table 7, HEMA-based and S/W-based PM policies [12] Ti INA219 current monitoring IC, <http://focus.ti.com/docs/prod/folders/print/
are more energy-efcient than User-PM. Moreover, when HEMA- ina219.html>.
based ASPM is applied, the error rate decreased because HEMA [13] R. Fonseca, P. Dutta, P. Levis, I. Stoica, Quanto: Tracking Energy in Networked
Embedded Systems, in: Proceedings of the Eighth USENIX Symposium on
prevents the data delay based on runtime power consumption
Operating System Design and Implementation (OSDI08), San Diego, CA, USA,
information. However, S/W-based ASPM increase error rate be- 2008.
cause it uses pre-dened power information. HEMA provides [14] P. Dutta, M. Feldmeier, J. Paradiso, D. Culler, Energy Metering for Free:
Augmenting Switching Regulators for Real-Time Monitoring, in: Proceedings
appropriate information for WSN applications as well as energy
of the Seventh International Conference on Information Processing in Sensor
efciency. The result shows that HEMA provides essential informa- Networks(IPSN), St. Louis, Missouri, USA, April 2008.
tion to perform run-time power management. [15] DS2782 battery monitor IC, <http://www.maximic.com/quick_view2.cfm/
qv_pk/4779/t/al>.
[16] J. Rahm, K. Agha, A state-based battery model for nodes lifetime estimation
in wireless sensor networks, in: Proceedings of the tenth ACM international
6. Conclusion symposium on Mobile ad hoc networking and computing, New Orleans, USA,
2009.
[17] N. Kim, S. Choi, H. Cha, Automated Sensor-specic Power Management for
In this paper, we proposed HEMA, the hardware-assisted Wireless Sensor Networks, in: The Fifth IEEE International Conference on
energy monitoring architecture, for a practical runtime Mobile Ad-hoc and Sensor Systems (MASS 2008), Atlanta, USA, September
energy monitoring system. HEMA uses a hardware-software 2008.
[18] Y. You, J. Yoo, H. Cha, Event Region for Effective Distributed Acoustic Source
combined monitoring technique to provide an analysis of Localization in Wireless Sensor Networks, in: The 5th IEEE Wireless
consumed energy for individual devices using micro sensor Communications & Networking Conference (WCNC 2007), Hong Kong, China,
nodes. We presented the design and core mechanism of HEMA March 2007.
[19] IADS8381, <http://focus.ti.com/docs/prod/folders/print/ads8381.html>.
based on a real implementation. The experimental results [20] TI TMS320F28335, <http://focus.ti.com/docs/prod/folders/print/tms320f28335.
showed that HEMA accurately traced the energy consumption html>.
of individual devices with low overheads. The accuracy was [21] H. Cha, S. Choi, I. Jung, H. Kim, H. Shin, J. Yoo, C. Yoon, RETOS: Resilient,
Expandable, and Threaded Operating System for Wireless Sensor Networks, in:
within 6% when compared with the custom-built measuring The Sixth International Conference on Information Processing in Sensor
instrument. Networks (IPSN 2007), Cambridge, Massachusetts, USA, April 2007.
In conclusion, we validated that battery monitor IC-assisted [22] Nanotron NA5TR1, <www.nanotron.com/EN/pdf/Factsh eet_nanoLOC-
NA5TR1.pdf>.
power monitoring is an efcient method for developing practical
[23] H. Choi, C. Yoon, H. Cha, Device Driver Abstraction for Multithreaded Sensor
power management methods in wireless sensor nodes. The cost Network Operating Systems, in: European conference on Wireless Sensor
of a battery monitor IC is reasonably cheap, and the overheads Networks(EWSN), Bologna, Italy, JanuaryFebruary 2008.
are sufciently low to use it for sensor nodes. This, when combined [24] C. Yoon, H. Choi, S. Lee, H. Cha, B. Song, H. Lee, IEEE 802.15.4a-Based Anchor-
free Mobile Node Localization System, in: The 8th International Conference on
with appropriate software techniques, means that effective energy Information Processing in Sensor Networks (IPSN 2009, DEMO), San Francisco,
monitoring is now both possible and practical. USA, April 2009.
S. Choi et al. / Journal of Systems Architecture 58 (2012) 7385 85

Byunghun Song is a senior researcher in the RFID/USN


Sukwon Choi received his B.Sc. and M.Sc. degrees in
Convergence Research Center of Korea Electronics
computer science from Kwangwoon University and
Technology Institute. His research interests are in the
Yonsei University in 1999 and 2005, respectively. He
broad area of wireless sensor networks, including reli-
received his Ph.D. in computer science from Yonsei
able protocol design, system support, and applications
University in 2011. His research interests include
of systems. He received his B.S., M.S. and Ph.D. in elec-
embedded operating systems, low-power system, and
tronic communication engineering from Kwangwoon
wireless sensor networks.
University, Korea, in 1998, 2000, and 2004, respectively.

Hojung Cha is currently a professor in computer science


Hayun Hwang is currently working for LG electronics,
at Yonsei University, Korea. His research interests
Korea, as a research engineer. He received his B.Sc. and
include wireless and mobile systems, embedded oper-
M.Sc. degrees in computer science from Dankook Uni-
ating systems, and sensor network systems. He received
versity and Yonsei University, respectively. His research
his B.S. and M.S. degrees in computer engineering from
interests include embedded system and wireless sensor
Seoul National University, Korea, in 1985 and 1987,
networks.
respectively. He received his Ph.D. in computer science
from the University of Manchester, England, in 1991.

You might also like