Intro: BLE Heart Rate Sensor
This instructables show how to build a BLE heart rate sensor with Arduino, nRF8001 Bluetooth LE breakout board and PulseSensor module.
Step 1: Introduction
This instructables coding come from 2 modules sample code:
- Cheong2K's BLE heart rate template: https://github.com/Cheong2K/ble-sdk-arduino/tree/R...
- Arduino Leonardo code for Pulse Sensor: https://github.com/WorldFamousElectronics/PulseSen...
Cheong2K's sample code demonstrate how to advertise heart rate value with BLE module, but only use dummy value in the sample. On the other side, pulse sensor can capture real heart rate value with the Arduino.
My code just merge both sample code to make a workable example.
Step 2: Preparation
This time I use Arduino Pro Micro
nRF8001 Bluetooth LE breakout board
Heart Rate Sensor
Sensor from pulse sensor.com
A small size bread board and some bread board wire
Step 3: Software Preparation
- Download and install Arduino (if not yet): https://www.arduino.cc/en/Main/Software
- Install BLE SDK for Arduino library
- Select menu item in Arduino: Sketch -> Include Library -> Manage Libraries
- Search "BLE SDK for Arduino"
Step 4: Connection
Here is the connection summary:
BLE SCK -> Pro Micro pin 15 BLE MISO -> Pro Micro pin 14 BLE MOSI -> Pro Micro pin 16 BLE REQ -> Pro Micro pin 10 BLE RDY -> Pro Micro pin 9 BLE RST -> Pro Micro pin 8 BLE GND -> Pro Micro GND BLE VIN -> Pro Micro RAW Pulse Sensor Signal -> Pro Micro A1 Pulse Sensor +ve -> Pro Micro RAW Pulse Sensor -ve -> Pro Micro GND
Step 5: Program Arduino
Download the code from Github:
If you are not familiar with Github, simply press "Clone or Download" button and select Download ZIP.
Open BLE-Heart-Rate-Sensor.ino in Arduino.
It is some tricky while select board, you need to select "Arduino Leonardo" in Tools Menu -> Board.
Connect the Arduino Pro Micro and press upload button to program it.
Step 6: Start Serial Monitor
After upload the program to Arduino Pro Micro, open Serial at Tools Menu -> Serial Monitor.
You can see "Advertising Start" message.
Step 7: Connect BLE HR Sensor
While advertising start, use an iOS device search the bluetooth device.
Connect to the BLE HR Sensor.
I have no Android in hand, you may find some app that can connect with bluetooth heart rate sensor.
Step 8: Check the Heart Rate
After mobile connected, you will see "Evt Connected" at Serial Monitor.
Open Health app in iOS or BLE heart rate related app in Android.
Put a finger on the pulse sensor, it will start advertising heart rate readings to the mobile.
Step 9: Happy BLE Sensing!
This instructables is just a very simple example of BLE advertising sensor value, you may find more BLE example at Arduino File menu -> Examples -> BLE SDK for Arduino.