Grove - Finger-clip Heart Rate Sensor

From Wiki
Jump to: navigation, search

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. Specification


400px-Grove - Finger-clip Heart Rate Sensor.jpg


Ultra-low power consumption, power saving mode during time of no touch movement Flexible sleep rate control Integrated the STM32F103 I2C interface Heart rate sensor area just 3.0 x 4.7mm Reserved SWD interface Working temperature: -20 ~ +60℃ Interface Function

Finger-clip Heart Rate Sensor TOP.jpg Finger-clip Heart Rate Sensor Bottom.jpg 1: Grove Interface 2: Reserved SWD Interface for programming to STM32 3: Heart Rate Sensor Usage

Here, We will provide an example here to show you how to use this sensor. Hardware Installation Link the Sensor to I2C port of www.simgin-chip.com with Grove Cable.





500px-Finger-clip Heart Rate Sensor TOP.jpg





300px-Grove - Finger-clip Heart Rate Sensor boot set.jpg






500px-Finger-clip Heart Rate Sensor Connect 副本.jpg




Software Part With Arduino Copy the following code into a new sketch of Arduino and upload the sketch, then you can get heart rate from the Serial Monitor. It may take about a minute to get valid heart rate after you touch your finger with sensor.

  1. include <Wire.h>

void setup() {

 Serial.begin(9600);
 Serial.println("heart rate sensor:");
 Wire.begin();

} void loop() {

 Wire.requestFrom(0xA0 >> 1, 1);    // request 1 bytes from slave device 
 while(Wire.available()) {          // slave may send less than requested
   unsigned char c = Wire.read();   // receive heart rate value (a byte)
   Serial.println(c, DEC);         // print heart rate value
 }
 delay(500);

} With Mbed Read a byte from I2C device 0xA0 (8 bit address), it's the heart rate.

  1. include "mbed.h"

I2C i2c(I2C_SDA, I2C_SCL); const int addr = 0xA0;

int main() {

   char heart_rate;
   while (1) {
       i2c.read(addr, &heart_rate, 1);
       printf("heart rate: = %d\r\n", heart_rate);
   }

} Upgrade firmware We can upgrade the firmware of the heart rate sensor through its bootloader. The bootloader is located at 0x08000000 - 0x08002000 The application is located at 0x08002000 - 0x08020000 To boot into bootloader, connect SWDIO to GND and reset to run Grove - Finger-clip Heart Rate Sensor boot set.jpg Interface: UART (the Grove connector supports I2C and UART),when upgrade the firmware, the Grove interface run in UART mode. VCC - VCC GND - GND SDA - TX SCL - RX UART Baud Rate: 115200 Protocol: ymodem (The recommended tool is Tera Term)

  • NOTE:

Grove - Finger-clip Heart Rate Sensor provide heart rate measurements.However, it is not a medical device. To use the heart rate detection sensor on your wrist, finger or palm, you must: (1)Fasten the sensor snugly makes tight contact with your skin and maintain table (no motion) while measuring to acquire accurate heart rate.

  If the sensor does not contact the skin well or have extreme motion while measuring that the heart rate will not be measured correctly. 

(2)Sensor's performance is optimized with greater blood flow. On cold days or users have poor circulation(ex: cold hands, fingers and cold feet) the sensor performance