PowerGraph: A Mobile Energy Measurement
Framework for Mobile Devices
Several approaches and tools to measure the power consumption of mobile devices (smartphones, tablets) exist. They range from
research solutions such as BattOr to professional lab equipment, such as the
Monsoon Power Monitor.
However, none of those are able to combine the requirements we define as essential for a reliable power consumption measurement solution.
We argue that an approach should be mobile in order to get results from real-world scenarios, limiting the applicability of approaches such as the Monsoon Power Monitor. On the other hand, a certain precision should be offered by the measurement solution which is mainly limited by the
used hardware, as in BattOr.
Therefore, our design goals for an own solution were as follows:
High precision and sampling rate
Mobile without relying on the measuring object's battery
Reproducable and affordable
PowerGraph is an extension board that can be mounted on a Raspberry Pi (B+). The major task of PowerGraph itself is sampling the current drain of the connected mobile device while simultaneously providing the operational voltage for the mobile device. Figure 1 depicts our prototypical implementation of PowerGraph.
The task of the Pi to act as a supply for PowerGraph and the storage of the obtained measurement data. The latter is transferred via the SPI bus
of the Pi. Empirical test haven showen that depending on the SPI bus frequency, measurements might get distorted. Setting the frequency to 15Mhz yields
stable results and still a high sampling rate.
At this SPI bus frequency, the ADC (LTC2314-14) that we employ is able to take samples of up to 460ksps with a precision of 14bit.
More information about the hardware design is available here.
The hardware design is licensed under Creative Commons - ShareAlike 3.0 License. More information about the license can be here.
A full text version of the license is available here.
As PowerGraph creates measurement results with a high rate, we had to implement a driver for the SPI interface for the Pi to keep up.
The standard driver does not allow uninterrupted streaming of results, which is a downside as the ADC has no internal buffer.
Available drivers use a FIFO queue which is controlled by the CPU. If the CPU fails to empty the FIFO on time, the FIFO buffers will run out and both, the SPI transfer and ADC sampling will stop. To overcome this drawback, our driver uses the DMA controller.
More information about the driver, source code and the GUI can be found here.
Figure 2 depicts an exemplary measurement run obtained with PowerGraph. The shown plot represents the current drain for a booting Nexus 5. To this end, we separated the battery connector from a LG BL-T9 battery pack. Subsequently, we connect this battery adapter to PowerGraph and to the phone.
Initially, the smartphone connects to the GSM network. At 60s, we switch to Airplane mode and subsequently lock the phone, i.e., shutting off the display. For better visibility, we apply a moving average (red line) to the data (background).
The depicted plot can be reproduced using the record file and the visualization script, which can be downloaded here.
Tested with OSX 10.10.4, Python 2.7 and pylab/matplotlib 1.4.3.