1. Heart Rate Profile Presentation
Heart Rate Profile is a Generic Attribute Profile (GATT) based profile defined by the Bluetooth Special Interest Group (SIG).
The Heart Rate profile defines 2 roles, Sensor and Collector.
Heart Rate Sensor is the device that measures heart rate and other information, it can be defined as a GAP peripheral and GATT server.
The Collector is a GAP Central and GATT Client which receives heart rate measurement and other data.
Bluetooth® LE Heart Rate profile overview |
---|
The HRP is widely used in fitness applications to collect heart rate measurements.
2. Heart Rate Example
2.1. Requirements
2.1.1. Software and System requirements
Software required are the following:
minimum IDEs version:
- IAR Embedded Workbench for ARM (EWARM) toolchain V8.20.2
- RealView Microcontroller Development Kit (MDK-ARM) toolchain V5.31
- STM32CubeIDE toolchain V1.7.0
- STM32CubeIDE[1].
Programmer:
- STM32CubeProgrammer[2] : To flash the board with an already generated binary
2.1.2. Hardware requirements
A Nucleo board[3], a STM32WB USB dongle[3], or a STM32WB Discovery Kit[4] is necessary to install the application.
Hardware platforms illustration |
---|
|
Plus a smartphone with ST BLE Sensor application (for Android[5], or iOS[6]).
2.2. Setup
The "BLE_HeartRate" application is available by downloading STM32CubeWB MCU Package[7].
Heart Rate project directory |
---|
2.3. Project Description
Interaction between Middleware and User Application is described in the following illustration:
Heart Rate project architecture |
---|
2.4. Build and Install
Follow steps described in Bluetooth® LE Build and Install Application page, applying it for BLE_HeartRate project.
2.5. Handle
Once the BLE Heart Rate application installed on the STM32WB platform, launch the ST BLE Sensor smartphone application.
Click on Connect one Device interface:
Heart Rate application interface 1 |
---|
Your device should be visible from this interface, connect to it:
Heart Rate application interface 2 |
---|
Now bpm measurement is displayed in real time.
Heart Rate application interface 3 |
---|
With Discovery Kit Platform, the Heart Rate is also visible from the board LCD screen, and Heart pulse is illustrated:
Heart Rate on DK illustration |
---|
3. References