#WINDOWS10- Display live Heart Rate information in Windows Universal app using Bluetooth LE #BLE

Hola!

Series

1. Pair Heart Rate Band using Bluetooth LE to be used in a Windows Universal App

2. Create a Windows Universal App and access to Heart Rate Band information

In my previous post I wrote on how to connect the heart rate band using Bluetooth and Windows 10. In today’s post I’ll how to quicly create an app to display the heart rate values

1. Let’s create an Windows Universal App

2. Edit package manifest

Add the Bluetooth generic attribute profile [<DeviceCapability Name=bluetooth.genericAttributeProfile>]

Add [<Device Id=any>] to connect with any device

Add the heart rate service[<Function Type=name:heartRate/>]

3. Nos let’s write some source code. In the Windows Load event, we will analyze the loca Devices collection and search for the name of our device “Polar H7 498C1817”

4. Once we found the device, is time to get the device service. This BLE Service is the entry point for the characteristics of the device. This device is simple enough, and based on our settings it only publish Heart Rate information. So let-s subscribe to the ValueChanged event and enable the Notify mode.

5. Now let’s process the sensor information. We get a byte array wand the 2nd byte is the current HR value

Next one, a full app interacting with the polar device.

Saludos @ Madrid

/El Bruno

References

– Polar Heart Rate Sensor H7, http://www.polar.com/us-en/products/accessories/H7_heart_rate_sensor

8 comments

  1. Hi,Thanks for the tutorial…Can I have code for ProcessData(hrdata); ?
    I have ordered my Polar H7 to try out this code. If you sample project is available, then that will be great.

    Like

  2. Hi,
    Is Win10 required for development and deployment? Would like to use something like the Polar H series but the target deployment environment would be schools that may not have Win10.
    Cheers

    Like

  3. Hello, good morning. I’m trying to do a similar project, but anywhere I end up reading I can’t connect my BLE device (heart wrist watch) with Windows 10. Your project seems to do something like that. Would you possible give a link for the .sln solution please?

    PS: I tried to reproduce what you did, but I can’t – My VS 2017 don’t show the Package.appxmanifest as editable in code lines (I’m familiar with the old .net codes, no the universal windows app).

    That would help me a lot!

    Thanks in advance,

    Tiago

    Like

  4. Hello Bruno,
    Thank you for the explanation. I followed the instructions and I tried to extend the service two ways.
    I started to work with Polar H10 Chest strap and I have been able to successfully connect and obtain the data from it. I have since tried to make a windows console application and run this is as a background process for feeding HR data to a game. However I notice that in this case the application needs to go through multiple iterations of trying to connect and then it finally connects to the HR monitor ( usually there are 3/4 attempts before successful connection) Any idea why this might be happening ? and how to solve it ?
    Q2. I am trying to make the same program to collect data from a BLE cadence sensor. The Wahoo Cadence sensor. I noticed that by changing the service and characteristics I am able to connect to the device and also identify paired Cadence sensor. However On using a similar approach to print out the raw data I am unable to see the raw data! Not sure why… Would you be able to provide any guidance on how to connect to other BLE devices ? esp. Cadence sensor ?
    Thank you very much.

    Like

Leave a comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: