Measuring Heart Rate Using Grove Sensor and Arduino

For me (and for now), this is the easiest heart rate sensor for Arduino...

INTRODUCTION

Grove – Finger-clip Heart Rate Sensor is based on PAH8001EI-2G, a high performance and low power CMOS-process optical sensor with Green LED and DSP integrated serving as a Heart Rate Detection(HRD) sensor. This module is based on optical technology which measures the variation human blood movement in the vessel. Low power consumption and flexible power saving mode make it suitable for wearable device. Cause the heart rate sensor chip need high processing speed for the algorithm of heart rate data, this module integrate a STM32, reserved SWD interface allow users to reprogram the STM32. This module also provide tow bandages and 3D printing shell for finger test and arm test.

VIDEO

This video will show you how to measure heart rate using Grove sensor and Maker UNO.

HARDWARE PREPARATION

Table below shows the connection between Heart Rate Grove sensor and Arduino.

Grove – Finger-clip Heart Rate SensorMaker UNO (Arduino Uno Compatible)
GNDGND
VCC5V
SDASDA / A4
SCLSCL / A5

Arduino Sample Code

This sample code is customised to read heart rate and update data to Blynk app. You may require ESP8266 WiFi Shield and set the RX, TX pin to D2 and D3.

/*
Project Video: https://www.youtube.com/watch?v=Dzq4tnJ0LjA
Product required:
1. Grove - Finger-clip Heart Rate Sensor
https://www.cytron.io/p-grv-heart-finger
2. Maker UNO:
https://www.cytron.io/p-maker-uno
Tutorial:
https://tutorial.cytron.io/2018/08/30/measuring-heart-rate-using-grove-sensor-and-arduino/
*/
/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial
#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>
#include <Wire.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "YourAuthToken";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "YourNetworkName";
char pass[] = "YourPassword";
// Hardware Serial on Mega, Leonardo, Micro...
//#define EspSerial Serial1
// or Software Serial on Uno, Nano...
#include <SoftwareSerial.h>
SoftwareSerial EspSerial(2, 3); // RX, TX
// Your ESP8266 baud rate:
#define ESP8266_BAUD 9600
ESP8266 wifi(&EspSerial);
unsigned long currentMillis = 0;
unsigned long previousMillis = 0;
const int interval = 500;
unsigned char bpm = 0;
void setup()
{
// Debug console
Serial.begin(9600);
delay(10);
// Set ESP8266 baud rate
EspSerial.begin(ESP8266_BAUD);
delay(10);
Wire.begin();
Blynk.begin(auth, wifi, ssid, pass);
}
void loop()
{
Blynk.run();
currentMillis = millis();
if (currentMillis - previousMillis > interval) {
previousMillis = currentMillis;
Wire.requestFrom(0xA0 >> 1, 1); // Request 1 bytes from slave device
while (Wire.available()) { // Slave may send less than requested
bpm = Wire.read(); // Receive heart rate value (a byte)
Serial.println(bpm, DEC); // Print heart rate value
}
}
}
BLYNK_READ(V0)
{
Blynk.virtualWrite(0, bpm);
}
Blynk App Configuration

You can use Value Display widget and configure as shown below.

Related Products

You can consider to buy the product from the list below.

Thank you

References:

  1. WIKI Grove – Finger-clip Heart Rate Sensor

Thanks for reading this tutorial. If you have any technical inquiry, please post at Cytron Technical Forum.

Leave a Comment

Your email address will not be published.

Share this Tutorial

Share on facebook
Share on whatsapp
Share on email
Share on print
Share on twitter
Share on pinterest
Share on facebook
Share on whatsapp
Share on email
Share on print
Share on twitter
Share on pinterest

Latest Tutorial

DIY Digital Alarm Clock Using REKA:BIT With Micro:bit
Display Internet Time (NTP) on micro:bit
DIY Interactive Robot Using REKA:BIT With Micro:bit
BLTouch Installation for Ender 3 with 32-bit V4.2.2 Board
Pick and Send Random Meal’s Option and Locations through Telegram Bot Using Grove WiFi 8266 on micro:bit
Tutorials of Cytron Technologies Scroll to Top