Introduction

The HW-827 module is a heart rate monitor. They can be used in various projects such as health monitoring, biofeedback or wearable medical devices. The part of the sensor with the heart-shaped logo is where you place your finger.

How does the heart rate sensor work?

A pulse sensor, like any other optical heart rate sensor, works by projecting green light (~ 550nm) onto the finger and measuring the amount of reflected light using a photosensor.
Oxygenated hemoglobin in arterial blood has the property of absorbing green light. The redder the blood (the higher the hemoglobin), the greater the absorption of green light. With each heartbeat, blood is pumped into the finger, resulting in a change in the amount of reflected light, which in turn produces a waveform at the output of the photosensor.
By continuing to illuminate and take measurements from the photosensor, you soon start to get a heartbeat measurement.

  • HW-827 sensor pins

Signal: Connect to one of the analog pins

Vcc: Connect to +3.3V on Arduino board

Ground : Connect to GND on Arduino board

Electronic diagram

Here is the circuit diagram for connecting the heart sensor to the Arduino Uno board:

Programming

To use the heart rate sensor you’ll need to install the PulseSensor library:

Here is the program that uses the PulseSensor library to read your heartbeat in BPM :

Caution!

As this program optically detects heart rate, it may produce erroneous results. Please DO NOT USE FOR ANY MEDICAL DIAGNOSIS.

 

The result can be seen on the serial monitor: