Supported on Android & iOS.
This data source monitors the battery status of the device and has three unique features:
- Unlike other data sources, which can be unavailable on certain devices (e.g., smartphones without accelerometers), almost all devices are shipped with batteries.
- Unlike some data sources, such as GPS, where the user can turn off the sensor manually, the battery data source cannot be turned off.
- Avicenna guarantees that in each operation cycle, it reads exactly one battery record.
These features allow us to infer certain information from battery data. First and foremost, battery data provide information on the charging, discharging, and power consumption of the device. This allows us to measure how fast the battery drains and how often the participant has to charge their device.
Additionally, as Avicenna guarantees exactly one battery record per operation cycle, this data can clearly show for how long the app was operational and how long it was not, for reasons such as the device being turned off or the app being stopped explicitly.
Furthermore, the battery data can be combined with data from other sources to assist behavioral analysis. For example, if the phone is plugged into the wall, we can be almost certain that the person was not carrying the device, and therefore any activity readings during that period should be treated with caution.
Use Cases
- Behavioral research: Inferring behavioral patterns, such as sleep schedules and device-centric habits
- Intervention efficacy: Evaluating the real-world impact of digital health apps or interventions by analyzing changes in a user’s device usage over time
- Public health trends: Aggregating battery data across populations to study community-wide digital behavior, responses to major events (e.g., lockdowns)
Data Structure
Besides the common data fields, each battery record includes the following:
- Level: Current battery level, from 0 to Scale. On iOS, the battery percentage is recorded in increments of 5%. Internally stored as
level. - Scale: Maximum battery level. Internally stored as
scale. - Plugged: Whether the device is plugged in or not. It is internally stored as
pluggedand can contain one of the following values:0: The device is on battery.1: The current power source is AC.2: The current power source is USB.3: The current power source is wireless.
- Status: Status of the battery with respect to charging. It is internally stored as
statusand can have one of the following values:1: The battery status is unknown.2: The battery status is charging.3: The battery status is discharging.4: The battery status is not charging.5: The battery status is full.
- Temperature: Shows the current battery temperature in tenths of Celsius. Android only; iOS records will always store 0. Internally stored as
temperature. - Voltage: The current battery voltage level in millivolts. Android only; iOS records will always store 0. Internally stored as
voltage.
Adding Battery As a Data Source
See Adding Data Sources.
Data Collection Behavior
See Data Collection Behavior of Avicenna.
Monitoring and Exporting Data
You can monitor and export battery data using either the Data Export page or Kibana.
Battery Data Source in the Participant App
Participants do not need to do anything (e.g., grant permissions) for this data source, and the data collection will start immediately.