nRF5 SDK v15.2.0
BLE Heart Rate Collector Example
This example requires one of the following SoftDevices: S132, S140, S332

Important: Before you run this example, make sure to program the SoftDevice.

The BLE Heart Rate Collector application implements the Heart Rate Collector Role.

GAP role implemented is the Central role. GATT role implemented is the Client role.

The Heart Rate Collector application implements the Collector role for the Heart Rate Profile. It scans peripheral devices, connects to the device advertising with Heart Rate Service UUID in its advertisement report, and discovers and configures the Heart Rate Service to start sending Notifications of Heart Rate Measurement. The Heart Rate Measurement received is logged on UART interface. This application will also discover and configure Battery Service at the peer.

The application includes the two services in the Heart Rate profile:

This example demonstrates the use of Low Energy Secure Connections (LESC). The default cryptographic backend used for LESC is CC310 (when run on nRF52840) or Oberon (for other SoCs). To use micro-ecc instead, follow the steps in Enabling micro-ecc support in selected examples.

The application currently does not support connecting to multiple peripherals. Handling Connection Parameters Update and Pairing/Bonding are not implemented. Once connected, the application does not initiate disconnection but is capable of handling disconnection event initiated by peer or triggered unexpectedly.
RTT is also available as a logger backend in case UART can't be used. You can configure the nrf_log backend in the sdk_config.h.


You can find the source code and the project file of the example in the following folder: <InstallFolder>\examples\ble_central\ble_app_hrs_c

Button assignments: BSP BLE Button Assignments

The application uses the following UART settings:


Two boards are needed to perform this test:

The application running on the Sensor board is intended to serve as a peer (i.e. Heart Rate Sensor role) to this Heart Rate Collector application.

Test the BLE Heart Rate Collector Example application by performing the following steps:

  1. Compile the BLE Heart Rate Collector Example application and program both SoftDevice and application on the Collector board.
  2. On the Collector board, observe that the BSP_INDICATE_SCANNING state is indicated. This shows that the application is scanning for Heart Rate Sensors.
  3. Compile the Heart Rate Sensor application and program both SoftDevice and application on the Sensor board.
  4. Observe that the Heart Rate Sensor is advertising.
  5. Once the connection is established, the BSP_INDICATE_CONNECTED state is indicated on the Collector board.
  6. After a few seconds, observe Heart Rate measurements displayed on the UART.
  7. Disconnect the devices, for example by pressing the Reset Button on the Collector board. Observe that the boards automatically reconnect and that Heart Rate measurements are diplayed on the UART.

Documentation feedback | Developer Zone | Subscribe | Updated