Bluetooth Heart Rate Monitor using Maxim MAX32630FTHR & MAXREFDES117

Fork of mbed-os-example-ble-HeartRate by mbed-os-examples

Committer:
Vincent Coubard
Date:
Tue Jul 26 14:45:32 2016 +0100
Revision:
0:fb66cae3e9a1
Child:
1:72c60abef7e7
Update example at tag mbed-os-5.0.1-rc1

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Vincent Coubard 0:fb66cae3e9a1 1 # BLE Heart Rate Monitor
Vincent Coubard 0:fb66cae3e9a1 2
Vincent Coubard 0:fb66cae3e9a1 3 This application transmits a heart rate value using the [Bluetooth SIG Heart Rate Profile](https://developer.bluetooth.org/TechnologyOverview/Pages/HRP.aspx). The heart rate value is provided by the application itself, not by a sensor, so that you don't have to get a sensor just to run the example.
Vincent Coubard 0:fb66cae3e9a1 4
Vincent Coubard 0:fb66cae3e9a1 5 Technical details are better presented [in the mbed Classic equivalent of this example](https://developer.mbed.org/teams/Bluetooth-Low-Energy/code/BLE_HeartRate/).
Vincent Coubard 0:fb66cae3e9a1 6
Vincent Coubard 0:fb66cae3e9a1 7 # Running the application
Vincent Coubard 0:fb66cae3e9a1 8
Vincent Coubard 0:fb66cae3e9a1 9 ## Requirements
Vincent Coubard 0:fb66cae3e9a1 10
Vincent Coubard 0:fb66cae3e9a1 11 To see the heart rate information on your phone, download Panobike for [iOS](https://itunes.apple.com/gb/app/panobike/id567403997?mt=8) or [Android](https://play.google.com/store/apps/details?id=com.topeak.panobike&hl=en).
Vincent Coubard 0:fb66cae3e9a1 12
Vincent Coubard 0:fb66cae3e9a1 13 You could also use a generic BLE scanners:
Vincent Coubard 0:fb66cae3e9a1 14
Vincent Coubard 0:fb66cae3e9a1 15 - [nRF Master Control Panel](https://play.google.com/store/apps/details?id=no.nordicsemi.android.mcp) for Android.
Vincent Coubard 0:fb66cae3e9a1 16
Vincent Coubard 0:fb66cae3e9a1 17 - [LightBlue](https://itunes.apple.com/gb/app/lightblue-bluetooth-low-energy/id557428110?mt=8) for iPhone.
Vincent Coubard 0:fb66cae3e9a1 18
Vincent Coubard 0:fb66cae3e9a1 19 Hardware requirements are in the [main readme](https://github.com/ARMmbed/mbed-os-example-ble/blob/master/README.md).
Vincent Coubard 0:fb66cae3e9a1 20
Vincent Coubard 0:fb66cae3e9a1 21 ## Building instructions
Vincent Coubard 0:fb66cae3e9a1 22
Vincent Coubard 0:fb66cae3e9a1 23 Building instructions for all samples are in the [main readme](https://github.com/ARMmbed/mbed-os-example-ble/blob/master/README.md).
Vincent Coubard 0:fb66cae3e9a1 24
Vincent Coubard 0:fb66cae3e9a1 25 ## Checking for success
Vincent Coubard 0:fb66cae3e9a1 26
Vincent Coubard 0:fb66cae3e9a1 27 **Note:** Screens captures depicted below show what is expected from this example if the scanner used is *nRF Master Control Panel* version 4.0.5. If you encounter any difficulties consider trying another scanner or another version of nRF Master Control Panel. Alternative scanners may require reference to their manuals.
Vincent Coubard 0:fb66cae3e9a1 28
Vincent Coubard 0:fb66cae3e9a1 29 1. Build the application and install it on your board as explained in the building instructions.
Vincent Coubard 0:fb66cae3e9a1 30 1. Open the BLE scanner on your phone.
Vincent Coubard 0:fb66cae3e9a1 31 1. Start a scan.
Vincent Coubard 0:fb66cae3e9a1 32
Vincent Coubard 0:fb66cae3e9a1 33 ![](img/start_scan.png)
Vincent Coubard 0:fb66cae3e9a1 34
Vincent Coubard 0:fb66cae3e9a1 35 **figure 1** How to start scan using nRF Master Control Panel 4.0.5
Vincent Coubard 0:fb66cae3e9a1 36
Vincent Coubard 0:fb66cae3e9a1 37 1. Find your device; it should be named `HRM`.
Vincent Coubard 0:fb66cae3e9a1 38
Vincent Coubard 0:fb66cae3e9a1 39 ![](img/scan_result.png)
Vincent Coubard 0:fb66cae3e9a1 40
Vincent Coubard 0:fb66cae3e9a1 41 **figure 2** Scan results using nRF Master Control Panel 4.0.5
Vincent Coubard 0:fb66cae3e9a1 42
Vincent Coubard 0:fb66cae3e9a1 43 1. Establish a connection with your device.
Vincent Coubard 0:fb66cae3e9a1 44
Vincent Coubard 0:fb66cae3e9a1 45 ![](img/connection.png)
Vincent Coubard 0:fb66cae3e9a1 46
Vincent Coubard 0:fb66cae3e9a1 47 **figure 3** How to establish a connection using Master Control Panel 4.0.5
Vincent Coubard 0:fb66cae3e9a1 48
Vincent Coubard 0:fb66cae3e9a1 49 1. Discover the services and the characteristics on the device. The *Heart Rate* service has the UUID `0x180D` and includes the *Heart Rate Measurement* characteristic which has the UUID `0x2A37`.
Vincent Coubard 0:fb66cae3e9a1 50
Vincent Coubard 0:fb66cae3e9a1 51 ![](img/discovery.png)
Vincent Coubard 0:fb66cae3e9a1 52
Vincent Coubard 0:fb66cae3e9a1 53 **figure 4** Representation of the Heart Rate service using Master Control Panel 4.0.5
Vincent Coubard 0:fb66cae3e9a1 54
Vincent Coubard 0:fb66cae3e9a1 55 1. Register for the notifications sent by the *Heart Rate Measurement* characteristic.
Vincent Coubard 0:fb66cae3e9a1 56
Vincent Coubard 0:fb66cae3e9a1 57 ![](img/register_to_notifications.png)
Vincent Coubard 0:fb66cae3e9a1 58
Vincent Coubard 0:fb66cae3e9a1 59 **figure 5** How to register to notifications using Master Control Panel 4.0.5
Vincent Coubard 0:fb66cae3e9a1 60
Vincent Coubard 0:fb66cae3e9a1 61
Vincent Coubard 0:fb66cae3e9a1 62 1. You should see the heart rate value change every half second. It begins at 100, goes up to 175 (in steps of 1), resets to 100 and so on.
Vincent Coubard 0:fb66cae3e9a1 63
Vincent Coubard 0:fb66cae3e9a1 64 ![](img/notifications.png)
Vincent Coubard 0:fb66cae3e9a1 65
Vincent Coubard 0:fb66cae3e9a1 66 **figure 6** Notifications view using Master Control Panel 4.0.5