Introduction
The DFRobot heart rate sensor is a thumb-sized heart rate monitor designed for Arduino microcontrollers. It includes a Gravity interface, for easy plug-and-play connectivity. This sensor is a pulse sensor which is developed based on PPG (PhotoPlethysmoGraphy) techniques. This is a simple and low-cost optical technique that can be used to detect blood volume changes in the microvascular bed of tissues. It is relatively easy to detect the pulsatile component of the cardiac cycle according to this theory. The sensor has two holes that you can use to attach to your belt. You can wrap on your finger, wrist, earlobe or other areas where it has contact with skin. The heart sensor has two kinds of signal output mode: analog pulse mode and digital square wave mode. You can change its output mode using the dial switch. There are many user scenarios, including education, sports or maker/interactive projects!
![]() |
Please Note: This product is NOT a medical device and is not intended to be used as such or as an accessory to such nor diagnose or treat any conditions. |
---|
Specification
- Input Voltage (Vin): 3.3 - 6V (5V recommended)
- Output Voltage: 0 - Vin (Analog), 0/ Vin (Digital)
- Operating current: <10mA
- Dimension: 28 x 24(mm), 1.102" x 0.945"(in)
- Interface Type: PH2.0-3P
Board Overview

NOTE: The switch is to set the working mode, it will change the signal type to be Digital or Analog. If it was NOT set as consistent as the code or wiring, i.e. the switch was set as "A", but you write your code as digitalRead and(or) you wire the module onto Arduino digital pin, in this case, you will fail to get any readings, vice versa. |
---|
Tutorial
In this tutorial, you will learn how to use this Heart Rate sensor in digital mode as well as analog mode, more than this, at the end of this tutorial, we will show you how to use this sensor to draw the ECG to a LCD module.
Requirements
- Hardware
- 1 x DFRduino UNO (or similar)
- 1 x This Heart Rate Sensor
- 1 x IO Expansion Shield for Arduino (suggested)
- Some wires
Software
- Arduino IDE 1.6.6+, Click to Download Arduino IDE from Arduino®
Library
Before start
Once you opened the box, you can find a black belt inside of the package. Thread it through the holes of the sensor as indicted in the photo. And then you could attach it on your finger (suggested), wrist or any other places where exposes blood vessels. Do not attach the belt too tight or too loose to your finger or the reading might be not stable. During the test, you should steady your finger and do not move too much, or the readings might be unstable.
1.Thread the belt through the holes

2.Wrap on finger

3.Wrap on wrist

4.Wrap on the back of wrist

Connection Diagram

Sample Code
The sample code could be found in the Github Page, open the example "DFRobot_Heartrate_Digital_Mode".
Digital Mode
- Wiring
- Select the sensor's mode switch as "D" for Digital
- Connect it with UNO's A1 as the code indicates (you could change it as you wish)
- Upload the code
- Open the Serial monitor.
- Adjust the finger's position until you notice the LED is flashing regularly as your heartbeat, after several seconds, the Serial Monitor will print your heart rate.
Expected results:


Draw the ECG (Electrocardiography)
Digital Mode
- Attach this sensor to Arduino D2
- Set the sensor mode switch as D (digital)
- Upload the code below
- Open the Arduino Serial Plotter (Baud: 9600)


Analog Mode
- Attach this sensor to Arduino A1
- Set the sensor mode switch as A (analog)
- Upload the code below
- Open the Arduino Serial Plotter (Baud: 9600)

Use it with LCD12864 shield
- Please download and install the library for LCD12846.
- Upload the code below
- It will display the heart rate and ECG on the LCD(12846) screen.
FAQ
For any questions, advice or cool ideas to share, please visit the DFRobot Forum. |
---|