About

Niels Brouwers

Embedded Software Group
HB 09.280
Mekelweg 4
2628 CD Delft
The Netherlands

Research

Smartphone Power Analysis

Analyzing the power consumption of modern smartphones is a difficult problem because of the complex interplay between soft- and hardware. Power analysis depends on measuring both power consumption and state simultaneously and correlating the two. Unfortunately there is a distinct lack of proper tooling, which limits our understanding of the energy footprint of algorithms, and makes it hard to track down energy-related bugs.

External power measurement tools such as Monsoon's Power Monitor offer precision, but constrain the mobility of the device. Internal voltage/current sensors on the other hand suffer from limited range and frequency. Attempts at building accurate models to augment the internal sensor's lack of detail have met with limited success because of unobservable state (e.g. the modem's power state), and non-linear power consumption (e.g. OLED displays).

In order to address these challenges we have built a power metering toolkit called Neat. Neat comprises a voltage- and current measurement board that fits inside a typical Android smartphone, and analysis software that automatically fuses event logs taken from the phone with the obtained power trace. The power meter samples voltage, current, and a separate trigger channel at 2kHz, and writes out traces to a micro-SD card. The trigger channel is used for time-synchronization with an event logger tool, and is connected to a free GPIO pin on the device or more commonly the buzzer motor output.

Neat power meter installed inside a Galaxy Nexus smartphone. The meter has its own battery, which is charged through USB.
      
Trace analysis tool. Events, shown at the bottom, are placed on the same time-line as the power trace.

We use commercially available back-covers designed for double-sized replacement batteries, and use the extra space to fit the power meter and its own battery inside, yielding a fully usable phone. In this way Neat makes it possible to obtain day-long traces from free-roaming smartphones. We have used Neat to investigate the correlation between signal strength and 3G power consumption, analyze an Android kernel energy bug, and model the energy consumption of Samsung OLED panels.

Modeling OLED panels is particularly difficult because unlike with TFT, power consumption depends on the contents of the image. Brighter pixels emit more light, and hence consume more energy than dark ones. The relationship between a color in (r,g,b) space and its power draw is not power-law as is often assumed, because of proprietary color-tuning chips that sit between the screen buffer and display. We use Neat's ability to correlate event- and power data to easily produce a color look-up table that holds calibration data for a 16x16x16 discretization of the color space. We found this model to be very accurate, to within a few percent mean error on our test set.

Drop files here. Drop an image here to compute OLED power draw.

  • (Paper Under Submission)
  • Incremental Scanning

    Smartphone localization through Wi-Fi has several advantages over GPS, most notably in-door availability and energy cost. Wi-Fi localization is especially attractive for tracking user location over time, since the cost of converting scan results into geographical coordinates can be batched or performed off-line.

    In the interest of decreasing energy consumption, we analyzed the energy consumption of Wi-Fi scanning on eight different Android devices, and propose a new method of scanning that reduces energy cost by more than half on modern smartphones. Our techniques are based on three observations: i) modern smartphones have 32 channels available to them in the 2.4 and 5GHz spectrums, and scanning all these channels takes a lot of time and energy, ii) the majority of access points resides on a small number of channels (roughly three-quarters of all APs in our data set), and iii) users are static (not moving) 89% of the time on average, which means that only 11% of the scans performed yield any new information.

    Our incremental scanning algorithm scans channels in turn and terminates early when enough information has been collected to determine user location. We exploit the property of multilateration that once 15 APs have been discovered, adding more typically does not increase precision, which we verified on our dataset using Google's localization service.

    Our scanning algorithm also terminates early when the partial results indicate that the user is in the same location as during the last scan. We use the Tanimoto coefficient to determine scan similarity, and employ a simple hysteresis approach to filter out noise. Our thresholds are trained using traces of AP scans labeled with user activity (moving/not moving).

    We collected month-long AP scan traces from five volunteers and simulated incremental scanning post-facto to compute the energy savings. We verified that overall power consumption of a scan operation is linear in the number of channels scanned, and constructed linear models for each of the devices. The cost of bringing the device out of suspend, and going back into suspend are non-trivial and included in the total cost.

    Power savings using incremental scanning for five different users on our test set of eight Android devices.

  • N. Brouwers, M. Zuniga, and K. Langendoen. Incremental Wi-Fi Scanning for Energy-Efficient Localization (PerCom 2014)link
  • Mobile Phone Sensing Middleware

    The smartphone revolution has brought ubiquitous, powerful, and connected sensing hardware to the masses. This holds great promise for a wide range of research fields. However, deployment of experiments onto a large set of mobile devices places technological, organizational, and sometimes financial burdens on researchers, making realworld experimental research cumbersome and difficult.

    Pogo is an application for Android devices that turns a modern smartphone into a mobile sensor as part of a large scale test bed. Pogo is designed to unlock experimental research using mobile phones to non-domain specialists such as behavioral scientists, offering a comprehensive and complete tool set.

    A Pogo test bed may contain many participating devices, and can be utilized by multiple scientists at once, who each have access to a subset of the total device pool. In this way, the cost of recruitement is shared by all participating scientists. Experiments are deployed to target phones using a push mechanism that requires no interaction from the end user, facilitating frequent (re-)deployment of code which is crucial to experimental research.

    Pogo protects the privacy of end users by hiding their identity from researchers. Moreover, end users retain control over their data and are able to turn individual data sources (i.e. location, Wi-Fi, motion) on or off. Pogo also takes energy consumption into consideration, and schedules its data transmissions to coincide with other background applications to avoid triggering the 2g/3g/4g modem into a high power state.

    Experiments that run on Pogo are written in JavaScript, and make use of a simple, yet powerful publish/subscribe framework that abstracts away the intricacies of sensor access and communication. The platform is simple enough to be usable by entry-level programmers, but also flexible enough to run custom, on-line algorithms written by experts such as clustering, hysteresis, fitting, and so on.

    Pogo Android Application.

  • N. Brouwers and K. Langendoen. Pogo, a Middleware for Mobile Phone Sensing (Middleware 2012)link
  • Darjeeling JVM

    Wireless sensor networks (WSN) are ad-hoc networks composed of tiny, battery powered, resource constrained devices. They are meant to be deployed in inaccessible areas such as forests, deserts, lakes, and so on for environmental monitoring purposes. The grand vision of WSN is so-called smart dust, where large quantities of inexpensive devices can be dropped from a plane onto an area of interest, and form a connected data collection network automatically. Because sensor nodes are designed to be battery powered, minimizing energy consumption is of primary concern.

    Programming sensor nodes poses a number of unique difficulties. First of all, memory is tight, since typical sensor node platforms have 48-128kB of program flash and only 2-10kB of RAM. Second, reliability is extremely important because of the physical inaccessability of the hardware once deployed. A watchdog timer is not enough protection against software crashes because of the energy overhead of rebuilding network routing tables after a node reset.

    Darjeeling is a tiny Java Virtual Machine (JVM) designed from the ground up for extremely limited devices. Where other JVMs often require at least several hundreds kB of RAM, Darjeeling can run meaningful programs in as little as 2kB. The VM supports multithreading with locking and on-demand stack frame allocation. To keep stack frames small, Darjeeling uses a 16-bit architecture, and special 16-bit arithmetic instructions are automatically generated by a JVM bytecode post processing tool.

    Precise compacting garbage collection is implemented using a dual-ended stack, which keeps references on one, and numeric values on the other end of the stack. This eliminates memory overhead due to heap fragmentation.

    Darjeeling is not fully Java compliant, and drops some features from the language, such as mult-dimensional arrays, floating point arithmetic, and reflection. Because code is linked statically rather than dynamically before loaded into the VM, class initialisers are not run in a lazy order.

    Darjeeling is open source, and may be downloaded here. The VirtualSense project maintains a more up-to-date Contiki port.

    A sensor node in CSIRO's springbrook network. Inside is an Amtega128 microcontroller with 128kB of flash, and 4kB of RAM.
  • N. Brouwers, K. Langendoen, and P. Corke. Darjeeling, a feature-rich vm for the resource poor (SenSys 2009)link
  • N. Brouwers, P. Corke, and K. Langendoen. A Java compatible virtual machine for wireless sensor nodes (SenSys 2008, demo)link
  • N. Brouwers, P. Corke, and K. Langendoen. Darjeeling, a java compatible virtual machine for microcontrollers (Middleware 2008)link
  • Resume

    Education

    PhD Candidate, Embedded Software
    Delft University of Technology, Delft, NetherlandsMay 2014
    Master of Science, Computer Science (with honors)
    Delft University of Technology, Delft, NetherlandsJune 2009
    Bachelor of Science, Computer Science
    Delft University of Technology, Delft, Netherlands September 2006

    Professional Experience

    ConsultantMarch 2013
    Wincor NixdorfDelft, the Netherlands
    InternshipJune - September 2012
    Microsoft Research Asia Beijing, China
    DeveloperJune 2009 - March 2010
    Zarafa Delft, the Netherlands
    InternshipFebruary 2008 - September 2008
    CSIRO Brisbane, Australia
    InternshipFebruary 2008 - September 2008
    Osaka University Osaka, Japan
    Web DeveloperJanuary 2003 - July 2003
    Tentacle InteractiveArnhem, the Netherlands
    Game DeveloperJune 2001 - October 2002
    Karma Studios Arnhem, the Netherlands

    Skills

    Publications