Download pdf, 2 MiB - Infoscience

Transcript
6.2. Measurement Setup
remote procedure call (ONC RPC) protocols originally developed by Sun Microsystems. We
used the free ONC RPC implementation provided by the Remote Tea project to implement the
VXI-11 protocol in Java. With this, the computer can adjust any setting of the oscilloscope and
read the full acquired waveform. A waveform can consist of up to 107 measurements, each
with a 16-bit resolution, whereby the time window and the value range depend on the settings.
This setup allows us to remotely control and change the application that should run on the
sensor node and to repeat measurements as often as necessary. A typical measurement
cycle consists of the following steps: connect the sensor node to the programming hardware,
program the flash memory of the microcontroller, disconnect the sensor node from the
programming hardware, connect the sensor board to the battery power (with the power
measurement circuit), configure the oscilloscope (including triggering conditions), prepare
the oscilloscope for the acquisition of a single waveform, trigger the interrupt on the sensor
node, wait for the acquisition to finish, copy waveform data from the oscilloscope and save it
to a file.
Some networking protocols use random delays, e.g., to avoid colliding transmissions. To get
meaningful results, measurements need to be repeated multiple times. As the randomness in
TinyOS (and other software for embedded systems) is implemented using a pseudorandom
number generator (PRNG), reseting a node and starting anew would also reset the PRNG
and the sequence of random numbers would simply be repeated. To avoid this, the test
programs were written such that after the first run the experimental condition can be repeated
by triggering further interrupts without having to reset the sensor node.
6.2.1 Sending Data
To understand the power consumption and the potential for power savings in communication,
we decided to study the basic element of communication, namely, the sending of a single
packet. We implemented a simple application, in which a sensor node wakes up from sleep
mode, sends a single message, and then immediately returns to sleep mode. Such an application might be used in a simple network where every sensor node is only one hop away from the
base station, and the data is sent on a best-effort basis. To measure the power consumption of
this first application, our test program waits in sleep mode for an external interrupt. When the
interrupt occurs, the microcontroller wakes up, sets a timer, and returns to sleep mode. When
the timer expires, the microcontroller wakes up again and turns on the radio. Once the radio
is ready, our program starts sending a message with a predefined length. When the network
stack signals that the message has been sent, the program turns the radio off. Once the radio
has entered the power saving mode, the microcontroller will enter the sleep mode as well.
Instead of sending the message directly when the interrupt occurs, we opted for a timer to
avoid any overhead by the interrupt circuit and to make the test program behave more like a
real sensor application, in which most likely a timer will be used as well. We assume that the
length of the random back-off time is determined with a pseudo-random-number generator
81