BLE Heart Rate Service

  • Author(s): Dan Halbert for Adafruit Industries

The Heart Rate Service is specified here:

Implementation Notes


class adafruit_ble_heart_rate.HeartRateMeasurementValues(heart_rate, contact, energy_expended, rr_intervals)

Namedtuple for measurement values.

For example:

bpm = svc.measurement_values.heart_rate

Alias for field number 1


Alias for field number 2


Alias for field number 0


Alias for field number 3

class adafruit_ble_heart_rate.HeartRateService(service: HeartRateService | None = None)

Service for reading from a Heart Rate sensor.

property location: str

The location of the sensor on the human body, as a string.

Note that the specification describes a limited number of locations. But the sensor manufacturer may specify using a non-standard location. For instance, some armbands are meant to be worn just below the inner elbow, but that is not a prescribed location. So the sensor will report something else, such as “Wrist”.

Possible values are: “Other”, “Chest”, “Wrist”, “Finger”, “Hand”, “Ear Lobe”, “Foot”, and “InvalidLocation” (if value returned does not match the specification).

property measurement_values: _HeartRateMeasurement | None

All the measurement values, returned as a HeartRateMeasurementValues namedtuple.

Return None if no packet has been read yet.