BLE Heart Rate Sensor

by 陳亮 in Circuits > Arduino

10366 Views, 63 Favorites, 0 Comments

BLE Heart Rate Sensor

IMG_4932.jpg

This instructables show how to build a BLE heart rate sensor with Arduino, nRF8001 Bluetooth LE breakout board and PulseSensor module.

Introduction

螢幕快照 2017-04-04 下午11.53.58.png
螢幕快照 2017-04-04 下午11.56.36.png

This instructables coding come from 2 modules sample code:

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.

Module reference:

Preparation

IMG_4925.jpg
IMG_4926.jpg
IMG_4884.jpg
IMG_4885.jpg
IMG_4924.jpg

Arduino Board

This time I use Arduino Pro Micro

BLE Module

nRF8001 Bluetooth LE breakout board

Heart Rate Sensor

Sensor from pulse sensor.com

Others

A small size bread board and some bread board wire

Software Preparation

螢幕快照 2017-04-05 上午12.03.46.png
螢幕快照 2017-04-04 下午1.03.46.png
  1. Download and install Arduino (if not yet): https://www.arduino.cc/en/Main/Software
  2. Install BLE SDK for Arduino library
    • Select menu item in Arduino: Sketch -> Include Library -> Manage Libraries
    • Search "BLE SDK for Arduino"
    • Install

Connection

IMG_4927.jpg
IMG_4928.jpg
IMG_4929.jpg
IMG_4930.jpg

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 

Program Arduino

螢幕快照 2017-04-05 上午12.03.56.png

Download the code from Github:

https://github.com/moononournation/BLE-Heart-Rate-...

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.

Start Serial Monitor

螢幕快照 2017-04-04 下午11.02.18.png

After upload the program to Arduino Pro Micro, open Serial at Tools Menu -> Serial Monitor.

You can see "Advertising Start" message.

Connect BLE HR Sensor

IMG_4933.jpg
IMG_4934.jpg

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.

Check the Heart Rate

螢幕快照 2017-04-04 下午11.04.16.png
IMG_4935.jpg

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.

Happy BLE Sensing!

IMG_4931.jpg

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.