nRF51 SDK
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
ANT and BLE Heart Rate Monitor Relay Application
Sports-and-Fitness.jpg

Heart Rate Relay Example

The Heart Rate Application is a firmware example that implements the Heart Rate profile using the hardware delivered in the nRF51922 Development Kit. It also implements the ANT Heart Rate Profile receiver. The aggregated data received from ANT will relayed and sent as BLE notifications.

The source code and project file can be found in the <InstallFolder>\Nordic\nrf51922\Board\nrf6310\s310\ble_ant_app_hrm folder.

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

When notification of Heart Rate Measurement characteristic is enabled, the Heart Rate Measurement, containing the current value for all the components of the Heart Rate Measurement characteristic, is notified each time there is new data received from the ANT connection.

The ANT Heart Rate Monitor TX profile SDK application located at Board (development kit) or Board (evaluation kit) can be used as a peer ANT device. By changing ANT_HRMRX_NETWORK_KEY to the ANT+ Network Key, the application will instead be able to connect to an ANT heart rate belt.

Note
The ANT+ Network Key is available for ANT+ Adopters. Please refer to http://thisisant.com to become an ANT+ Adopter and access the key.
This application is based on the BLE Heart Rate Service Sample Application (Board). Please refer to this application for additional documentation.
This application is not power optimised!
The application will stop advertising after 3 minutes and go to system-off mode. Push the button 0 restart advertising.

Setup

Instructions on how to set up the nRFgo Motherboard: nRFgo Motherboard Setup (nRF6310).

LED assignments:

  • LED 0: Advertising
  • LED 1: Connected
  • LED 7: Asserted (i.e. an assert check in the application has failed)

Buttons assignments:

  • Button 0: Wake-up from system-off and restart advertising.
  • Button 1: Wake-up erase all bonds and restart advertising.

Testing

The Heart Rate Relay Application can be tested using the nRF Utility app for iOS and Android. The app will be listed as "nRFready Utility" on Apple Store and as "nRF Utility" on Google Play.

It can also be tested using the Master Control Panel as follows:

  1. Compile and program the application. Observe that the Advertising LED is lit.
  2. Connect to the device from Master Control Panel (the device will be advertising as 'Nordic_HRM'), then perform service discovery. Observe that the Connected LED is lit, and the Advertising LED is off.
  3. Click the 'Enable services' button on the Master Control Panel. Observe that Heart Rate notifications are received every second.
  4. Compile and program the ANT Heart Rate Monitor TX profile SDK application on the second board.
  5. Press the buttons on the motherboard or ev-kit to increase or decrease the transmitted heart rate.
  6. Observe that the value recieved in the Heart Rate notifications change according to the button presses.