Overview

In this project, we will interface Pulse Sensor with Arduino to Measure Pulse Rate (BPM) or Heart Beat value. The Pulse rate will be displayed on 16×2 LCD Display.

pulse sensor is a hardware device that can be used to measure heart rate in real-time. When paired with an Arduino microcontroller, you can create a simple yet effective heart rate monitor. This sensor is quite easy to use and operate. Place your finger on top of the sensor and it will sense the heartbeat by measuring the change in light from the expansion of capillary blood vessels.

Components/Hardware Required

We need following components for this project. All the components can be purchased from the given links.

S.N. Components Quantity Purchase Link
1 Arduino UNO Board 1 Amazon | AliExpress | SunFounder
2 Pulse Sensor 1 Amazon | AliExpress | SunFounder
3 16X2 I2C LCD Display 1 Amazon | AliExpress | SunFounder
4 Jumper Wires 10 Amazon | AliExpress | SunFounder
5 Breadboard 1 Amazon | AliExpress | SunFounder

 

Pulse Sensor

The Pulse Sensor is a plug-and-play heart-rate sensor for Arduino. It can be used by students, artists, athletes, makers, and game & mobile developers who want to easily incorporate live heart-rate data into their projects.

The essence is an integrated optical amplifying circuit and noise eliminating circuit sensor. Clip the Pulse Sensor to your earlobe or fingertip. Then it into your Arduino, you are now ready to read heart rate.

The front of the sensor comes with the heart logo. This is where you place your finger. On the front side, you will see a small round hole, from where the green LED shines. Just below the LED is a small ambient light photosensor APDS9008 which adjust the brightness in different light conditions.

On the back of the module you will find MCP6001 Op-Amp IC, a few resistors, and capacitors. This makes up the R/C filter network. There is also a reverse protection diode to prevent damage if you connect the power leads reverse.

 

Pulse Sensor Technical Specifications

Physical Characteristics

  • Dimensions: Approximately 0.625″ (15.875mm) in diameter
  • Weight: Lightweight, usually around a few grams
  • Material: Biocompatible materials for safe skin contact

Electrical Characteristics

  • Operating Voltage: 3V – 5.5V
  • Current Consumption: Typically around 4mA
  • Output Signal: Analog (0.3V to VCC)
  • Signal Range: 0-1023 (10-bit ADC output of Arduino)

Sensing Technology

  • Sensor Type: Photoplethysmogram (PPG)
  • Wavelength: Typically around 565nm (Green LED)

Working of the Pulse Sensor

The Pulse Sensor works on the principle of Photoplethysmography (PPG), which is a non-invasive method for measuring changes in blood volume under the skin. The sensor essentially consists of two main components: a light-emitting diode (LED) that shines light into the skin and a photodetector that measures the amount of light that is reflected back. Here’s a detailed explanation of its working:

Pulse Sensor Working

  1. Light Emission: A green LED emits light into the skin.
  2. Reflection & Detection: The light interacts with blood and is partially reflected back, captured by a photodetector.
  3. Heart Rate: Changes in reflected light create a waveform that correlates with heartbeats.
  4. Oxygen Level: The amount of reflected light also indicates blood oxygen levels, as oxygenated blood absorbs more green light.
  5. Signal Filtering: A Low Pass Filter cleans up the noisy, raw signal from the photodetector.
  6. Amplification: An operational amplifier boosts the filtered signal for better accuracy.
  7. Data Reading: Finally, an Arduino reads the amplified signal and software algorithms translate it into heart rate and potentially blood oxygen levels.

Pulse Sensor PinOut

The pulse sensor has three pins: VCC, GND & Analog Pin.

Interfacing Pulse Sensor with Arduino

Let us interface the Pulse Sensor with Arduino and start measuring the Pulse Rate/Heart Beat/BPM Value.

Hardware Wiring Diagram

The connection diagram between Pulse Sensor and Arduino is so easy.

Pulse Sensor Arduino Connection

  • Connect the RED wire (Power) of the Pulse Sensor to the 5V pin on the Arduino.
  • Connect the BLACK wire (Ground) to the GND pin on the Arduino.
  • Connect the PURPLE wire (Signal) to Analog Pin 0 (A0) on the Arduino.

 

 

Using the Jumper Wires you can directly connect the Pulse Sensor with Arduino.

 

Pulse Sensor Library Installation

Before moving to the coding part, you need to add the Pulse Sensor Library on your Arduino Library Folder.

Download the PulseSensor Playground Library from the Arduino IDE (Go to Sketch -> Include Library -> Manage Libraries, then search for “PulseSensor Playground” and install it).

You visit Pulse Sensor Github repository to see the examples code with different microcontrollers.

Source Code/Program

Now let us take a look at the Pulse Sensor Arduino Code, taken from the library examples.

Open the example sketch that comes with the library (Go to File -> Examples -> PulseSensor Playground -> GettingStartedProject).

 

Testing & Results

After uploading the Pulse Sensor Arduino Example code, you can start the testing process.

Place the finger on the Pulse sensor as shown below.

BPM Rate Arduino

Open the Serial Monitor to see the pulse sensor data.

The Serial Monitor will display the Pulse Rate value whenever it detect the heart beat.


Displaying Pulse Rate (BPM) Value on LCD Display

Instead of displaying the BPM value on Serial Monitor, we can display the value on LCD Display. We can use a 16×2 I2C LCD Display Code and interface with Arduino Board to display Pulse Sensor BPM Value.

Hardware Wiring Diagram

Since we are using an I2C LCD Display, connect it to the Arduino I2C Pins.

Pulse Sensor Aruduino LCD

  • VCC (Power): Connect the VCC pin on the I2C LCD to the 5V pin on the Arduino.
  • GND (Ground): Connect the GND pin on the I2C LCD to the GND pin on the Arduino.
  • SCL (Clock): Connect the SCL pin on the I2C LCD to the SCL pin (A5) on the Arduino.
  • SDA (Data): Connect the SDA pin on the I2C LCD to the SDA (A4) pin on the Arduino.

Arduino Pulse Sensor BPM LCD Connection

You may use breadboard or jumper wire for connection.

Source Code/Program

The code requires I2C LCD Library for compilation. Therefore download the library and add it to the Arduino library folder.

Here is a complete code.

// Include necessary libraries
#define USE_ARDUINO_INTERRUPTS true
#include <PulseSensorPlayground.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2); // set the LCD address to 0x27 for a 16 chars and 2 line display
 
 
// Constants
const int PULSE_SENSOR_PIN = 0;  // Analog PIN where the PulseSensor is connected
const int LED_PIN = 13;          // On-board LED PIN
const int THRESHOLD = 550;       // Threshold for detecting a heartbeat
 
// Create PulseSensorPlayground object
PulseSensorPlayground pulseSensor;
 
void setup()
{
  // Initialize Serial Monitor
  Serial.begin(9600);
  lcd.init();
  lcd.backlight();
 
  // Configure PulseSensor
  pulseSensor.analogInput(PULSE_SENSOR_PIN);
  pulseSensor.blinkOnPulse(LED_PIN);
  pulseSensor.setThreshold(THRESHOLD);
 
  // Check if PulseSensor is initialized
  if (pulseSensor.begin())
  {
    Serial.println("PulseSensor object created successfully!");
  }
}
 
void loop()
{
  lcd.setCursor(0, 0);
  lcd.print("Heart Rate");
  
  // Get the current Beats Per Minute (BPM)
  int currentBPM = pulseSensor.getBeatsPerMinute();
 
  // Check if a heartbeat is detected
  if (pulseSensor.sawStartOfBeat())
  {
    Serial.println("♥ A HeartBeat Happened!");
    Serial.print("BPM: ");
    Serial.println(currentBPM);
 
    lcd.clear();
    lcd.setCursor(0, 1);
    lcd.print("BPM: ");
    lcd.print(currentBPM);
  }
 
  // Add a small delay to reduce CPU usage
  delay(20);
}

 

 

Testing & Results

Upload the above code and you can start testing the sensor working.

BPM Display Pluse Sensor

Place your finger on Pulse Sensor and you may see the BPM Value displayed on LCD Screen.

After uploading the sketch, the readings may not be immediately accurate. To get reliable results, try to keep your finger as steady as possible while waiting.

 

 


Troubleshooting Pulse Sensor Reading

To achieve stable and accurate readings from the Pulse Sensor, consider the following points:

    1. Check Operating Voltage: Ensure that the sensor is operating within its stable voltage range, which is between 3.3V and 5.5V. Using voltages outside this range can lead to unstable readings.
    2. Secure the Sensor: If you notice fluctuations in the readings, consider taping the sensor to your finger. This helps maintain constant blood flow, leading to more stable results.

Heartbeat/Pulse/BPM Rate Monitor using Arduino & Pulse Sensor

  1. Be Patient: The sensor may take some time to produce stable output. Patience is key to obtaining reliable readings.
  2. Avoid External Light: Make sure to minimize exposure to external light sources when taking measurements, as they can interfere with the sensor’s ability to accurately detect pulse.
  3. Use a Low Pass Filter: If you’re still experiencing noise in the readings, implementing a software-based low pass filter in your code can help smooth out the data.

Conclusion

In this tutorial, we’ve walked you through the step-by-step process of creating a Pulse Rate Monitor using an Arduino and a Pulse Sensor. This project is not only educational but also highly practical, offering a cost-effective solution for monitoring your heart rate in real-time. Whether you’re a healthcare professional, a fitness enthusiast, or simply curious about electronics, this project provides valuable insights into both health monitoring and Arduino programming. We hope you found this guide informative and encourage you to explore further applications of this technology for your personal or professional use.