Skip to content
CARP Docs
Ask AISystemLightDark
On this page

Polar Sampling Package

Collect heart rate, ECG, optical heart rate and motion data from Polar sensors in a CARP Mobile Sensing study.

Copy MarkdownOpen inOpen in GitHubView as MarkdownOpen in Scira AIOpen in ChatGPTOpen in ClaudeOpen in Cursor

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.

pub.devAPI referenceGitHub

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 typeDataAndroidiOS
dk.cachet.carp.polar.hrHeart rate in beats per minute, with RR intervalsYesYes
dk.cachet.carp.polar.ecgECG voltage in microvoltsYesYes
dk.cachet.carp.polar.accelerometerAcceleration on three axes in milli-gYesYes
dk.cachet.carp.polar.gyroscopeAngular velocity on three axes in degrees per secondYesYes
dk.cachet.carp.polar.magnetometerMagnetic field on three axes in gaussYesYes
dk.cachet.carp.polar.ppgRaw PPG values of the optical channelsYesYes
dk.cachet.carp.polar.ppiPulse-to-pulse intervals in milliseconds, with error estimatesYesYes

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:

H10H9Verity Sense
Heart rateYesYesYes
ECGYesNoNo
AccelerationYesNoYes
Angular velocityNoNoYes
Magnetic fieldNoNoYes
PPGNoNoYes
PPINoNoYes

Requirements

ComponentRequirement
Dart SDK3.10 or later
Flutter3.38.1 or later
carp_mobile_sensing2.2.0 or later
AndroidAPI level 24 (Android 7.0) or later
iOS15.0 or later
SensorA Polar H10, H9 or Verity Sense
TestingA 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"]
  1. The study protocol names the sensor only by its role: a PolarDevice connected to the phone.
  2. On the phone, the app binds the role to a physical sensor with its Polar ID. PolarDeviceManager then connects to the sensor through the Polar BLE SDK.
  3. Once the sensor reports the data types it offers, CAMS starts the Polar measures. Each batch of samples from the sensor becomes one measurement.
  4. 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.

Quick links

Page · DocumentationCARP DocumentationPage · DocumentationIntroductionPage · DocumentationQuickstartPage · DocumentationTerminologyPage · DocumentationArchitecture