This example implements the Heart Rate service and Pulse Oximeter service. It enables a peer device to connect and receive Heart Rate and Pulse Oximeter values via Bluetooth. The HRM/SpO2 values are measured by using a bio-sensor located on the Heart Rate 2 Click board and displayed on the OLED screen located on the SparkFun Micro OLED Breakout (Qwiic) board.
This code example has related code examples, which may be worth reading before. Find them here:
- SDK version
- Software Required
- Hardware Required
- Connections Required
- Setup
- How It Works
- Report Bugs & Get Support
- 1x Bluetooth Low Energy Explorer Kit. For example, BGM220-EK4314A
- 1x Mikroe Heart Rate 2 Click board
- 1x SparkFun Micro OLED Breakout (Qwiic) board
- 1x smartphone running the 'Simplicity Connect' mobile app
The Heart Rate 2 Click board can just be "clicked" into its place. Be sure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line.
The SparkFun Micro OLED Breakout (Qwiic) board can be easily connected by using a Qwiic cable.
To test this application, you can either create a project based on an example project or start with a "Bluetooth - SoC Empty" project based on your hardware.
Note
-
Make sure that the Third Party Hardware Drivers extension is installed as part of the SiSDK and the bluetooth_applications repository is added to Preferences > Simplicity Studio > External Repos.
-
SDK Extension must be enabled for the project to install the required components.
-
From the Launcher Home, add your hardware to My Products, click on it, and click on the EXAMPLE PROJECTS & DEMOS tab. Find the example project filtering byfilter "hrm".
-
Click Create button on the Bluetooth - HRM/Sp02 Measurement example. Example project creation dialog pops up -> click Create and Finish and Project should be generated.

-
Build and flash this example to the board.
-
Create a Bluetooth - SoC Empty project for your hardware using Simplicity Studio 5.
-
Copy the app.c file and the hrm folder into the project's root folder (app.c will replace the existing file). Add the include directories into the project
-
Import the GATT configuration:
-
Open the .slcp file in the project.
-
Select the CONFIGURATION TOOLS tab and open the Bluetooth GATT Configurator.
-
Find the Import button and import the configuration
bluetooth_explorer_kit_bio_sensor_oled/config/btconfig/gatt_configuration.btconffile. -
Save the GATT configuration (ctrl-s).
-
-
Open the .slcp file. Select the SOFTWARE COMPONENTS tab and install the software components:
-
[Services] → [IO Stream] → [IO Stream: USART] → default instance name: vcom.
-
[Application] → [Utility] → [Log]
-
[Platform] → [Driver] → [GPIOINT]
-
[Platform] → [Driver] → [I2C]→ [I2CSPM] → create new instances: mikroe and qwiic.
-
[Platform] → [Driver] → [Button] [Simple Button] → create an instance: btn0.
-
[Third Party Hardware Drivers] → [Display & LED] → [SSD1306 - Micro OLED Breakout (SparkFun) - I2C].
-
[Third Party Hardware Drivers] → [Services] → [GLIB - OLED Graphic Library].
-
-
Build and flash the project to your device.
Note
A bootloader needs to be flashed to your board if the project starts from the "Bluetooth - SoC Empty" project, see Bootloader for more information.
GATT Database
-
Device name: Silabs HR Example
-
[Service] Generic Access
-
[Service] Device Information
-
[Service] Heart Rate
- [Char] Heart Rate Measurement
- [Char] Body Sensor Location
- [Char] Heart Rate Control Point
-
[Service] Pulse Oximeter Service
- [Char] PLX Spot-Check Measurement
- [Char] PLX Continuous Measurement
- [Char] PLX Features
- [Char] Record Access Control Point
Upon reset, the application will display the Silicon Labs' logo on the OLED screen for three seconds. Then the OLED display will be off to save energy.
Follow the below steps to test the example with the Simplicity Connect application:
-
Open the Simplicity Connect app on your smartphone and allow the permission requested the first time it is opened.
-
Find your device in the Bluetooth Browser, advertising as Silabs HR Example, and tap Connect.
You can use the BTN0 button to start or stop the measurement at any time. When starting the HRM/SpO2 measurement, you should put your finger on the sensor with appropriate pressure (solid contact between the finger and the sensor without optical leakage and don’t press with a too large force) and stay idle for at least 10 seconds. Then check the measured Heart Rate and Pulse Oximeter values on the OLED screen and the Simplicity Connect application on your smartphone.
Heart Rate Service:
You have to enable Notify for the Heart Rate Measurement characteristic. You can see the change of value, it represents your heart rate. After that, the notification will be sent every 500 milliseconds from the device. The normal heart rate of a healthy person is frequently in the range of 60-100 beats/minute at rest. The average person's SpO2 should be between 95 and 100%.
OLED display:
On the OLED screen, you can see the measured heart rate and Sp02 value. That value is allocated according to the icon and description on the left. Values also will be updated every 500 milliseconds.
You can launch the Console that is integrated into Simplicity Studio or can use a third-party terminal tool like Tera Term to receive the logs from the virtual COM port. The raw data in each column represents "green LED, IR LED, red LED”. Heart rate and SpO2 values are updated once a second. The user can easily log the raw samples and debug messages to a *.csv file for post-analysis.
To report bugs in the Application Examples projects, please create a new "Issue" in the "Issues" section of bluetooth_applications repo. Please reference the board, project, and source files associated with the bug, and reference line numbers. If you are proposing a fix, also include information on the proposed fix. Since these examples are provided as-is, there is no guarantee that these examples will be updated to fix these issues.
Questions and comments related to these examples should be made by creating a new "Issue" in the "Issues" section of bluetooth_applications repo.