Polar Sampling Package
Collect heart rate, ECG, optical heart rate and motion data from Polar sensors in a CARP Mobile Sensing study.
carp_polar_package connects a CARP Mobile Sensing (CAMS) study to Polar H10, H9 and Verity Sense sensors over Bluetooth Low Energy (BLE). It collects heart rate, ECG, photoplethysmography (PPG), pulse-to-pulse intervals (PPI) and motion data while the participant wears the sensor.
The package uses the polar Flutter plugin, an unofficial wrapper of the official Polar BLE SDK.
Features
Heart rate
Heart rate in beats per minute from all three sensors, with RR intervals from the H10 and H9.
ECG
Single-lead ECG in microvolts at 130 Hz from the H10 chest strap.
PPG and PPI
Raw optical signals and pulse-to-pulse intervals from the Verity Sense optical sensor.
Motion
Acceleration from the H10 and Verity Sense, and angular velocity and magnetic field from the Verity Sense.
Measure types
The package provides seven event-based measure types:
| Measure type | Data | Android | iOS |
|---|---|---|---|
dk.cachet.carp.polar.hr | Heart rate in beats per minute, with RR intervals | Yes | Yes |
dk.cachet.carp.polar.ecg | ECG voltage in microvolts | Yes | Yes |
dk.cachet.carp.polar.accelerometer | Acceleration on three axes in milli-g | Yes | Yes |
dk.cachet.carp.polar.gyroscope | Angular velocity on three axes in degrees per second | Yes | Yes |
dk.cachet.carp.polar.magnetometer | Magnetic field on three axes in gauss | Yes | Yes |
dk.cachet.carp.polar.ppg | Raw PPG values of the optical channels | Yes | Yes |
dk.cachet.carp.polar.ppi | Pulse-to-pulse intervals in milliseconds, with error estimates | Yes | Yes |
For the fields and sample rates of each measure type, see Measure types.
Supported models
Which measures produce data depends on the sensor model. A measure that the connected sensor does not offer does not start:
| H10 | H9 | Verity Sense | |
|---|---|---|---|
| Heart rate | Yes | Yes | Yes |
| ECG | Yes | No | No |
| Acceleration | Yes | No | Yes |
| Angular velocity | No | No | Yes |
| Magnetic field | No | No | Yes |
| PPG | No | No | Yes |
| PPI | No | No | Yes |
Requirements
| Component | Requirement |
|---|---|
| Dart SDK | 3.10 or later |
| Flutter | 3.38.1 or later |
carp_mobile_sensing | 2.2.0 or later |
| Android | API level 24 (Android 7.0) or later |
| iOS | 15.0 or later |
| Sensor | A Polar H10, H9 or Verity Sense |
| Testing | A physical phone, because emulators and simulators cannot connect to the sensor |
See Installation for the platform setup.
How it works
flowchart LR
Sensor["<b>Polar sensor</b><br/>H10, H9 or Verity Sense"] -->|BLE| Phone["<b>CAMS on the phone</b><br/>PolarDeviceManager<br/>and one probe<br/>per measure"]
Phone --> Storage["<b>Data manager</b><br/>stores or uploads<br/>the measurements"]
- The study protocol names the sensor only by its role: a
PolarDeviceconnected to the phone. - On the phone, the app binds the role to a physical sensor with its Polar ID.
PolarDeviceManagerthen connects to the sensor through the Polar BLE SDK. - Once the sensor reports the data types it offers, CAMS starts the Polar measures. Each batch of samples from the sensor becomes one measurement.
- A data manager stores or uploads the measurements, as the data endpoint of the protocol specifies.
For the binding and the connection status, see Connecting a device.
Next steps
Installation
Add the package and configure Bluetooth on Android and iOS.
Quickstart
Connect to a Polar sensor and print its heart rate and ECG.
Connecting a device
Bind a Polar sensor, connect to it and follow its status.
Measure types
The seven Polar measure types, their sample rates and data fields.