Arduino Projects

Pulse Sensor/ Heartbeat Rate/ Heart rate measurement using Arduino & Bluetooth

Heart Rate Monitoring Project Description:

 

In this tutorial, you will learn how to wirelessly monitor the Heartbeat rate or Heartbeats per minute using the Pulse Sensor, Arduino, a 16×2 LCD, and HC 05 or HC 06 Bluetooth Module. This is version 2 of the Heartbeats monitoring system.

While in version1 of the heartbeats monitoring system I explained how you can get the stable BPM values, in which I practically demonstrated how the BPM values changes when we start breathing fast and slow. In version1 of the heartbeats monitoring system, I also explained under what circumstances you get unstable values. So for the best understanding I recommend first you should watch version1, in which I explained the extreme basics and then you can resume from here.


Amazon Links:

12v Adaptor:

Arduino Uno

Arduino Nano

Mega 2560:

Bluetooth Module: Hc-05:

Pulse Sensor Arduino:

Potentiometer:

16X2 LCD

Other Tools and Components:

Top Arduino Sensors:

Super Starter kit for Beginners

Digital Oscilloscopes

Variable Supply

Digital Multimeter

Soldering iron kits

PCB small portable drill machines

*Please Note: These are affiliate links. I may make a commission if you buy the components through these links. I would appreciate your support in this way!

Pulse Sensor / Heart rate / Heartbeats monitoring Sensor:

Heart rate Bluetooth

This is the Pulse sensor which is also known as the heart rate monitoring sensor. This sensor module is provided with the transmitter and receiver leds. the light-absorbing property of Hemoglobin is used in the measurement of heart rate. Light from a green LED on the underside of the monitor is shown on blood vessels just under the skin. The light that is not absorbed but reflected back is captured by a Photodetector.  Photodetector produces an electrical signal when light strikes it. This analog signal is converted into a digital signal, and slight changes of this signal are used to measure the heart rate.

Heart rate Bluetooth

As you can see this pulse sensor has three male headers which are labeled with S, + and -. S is the Signal pin and will be connected with the analog pin of the Arduino. plus pin which is the middle pin is the VCC pin and this pin will be connected with the Arduino’s 3.3 or 5volts. While the minus pin is the ground pin and this pin will be connected with the Arduino’s Ground.


Heart rate Bluetooth Circuit Diagram:

Heart rate Bluetooth

The HC 05 Bluetooth module +5volt or VCC pin is connected with the Arduino’s 5 volts, the ground of the Bluetooth module is connected with the Arduino’s ground. Connect Rx of the Bluetooth module with pin number 1 of the Arduino and connect the Tx of the Bluetooth module with pin number 0 of the Arduino.

As you can see ground is connected with pin number 1, 5 and pin number 16…5v from arduino is connected with pin number 2 and pin number 15…the middle pin of the variable resistor or potentiometer is connected with pin number 3 of the lcd…while the other two pins are connected with the ground and 5v. Pin’s 4 to 7 of the Arduino are connected with pins D7 to D4 of the lcd.

Pin number 8 of the Arduino is connected with the enable pin of the lcd….pin number 9 of the arduino is connected with the RS pin of lcd…

The vcc pin of the pulse sensor is connected with the 5v, but you can also connect this with 3.3v. the S pin of the pulse sensor is connected with the analog pin A0 and the ground pin of the pulse sensor is connected with the Arduino’s ground. Now let’s discuss the programming.


Download Heart rate Bluetooth App: pulse sensor heartbeat rate app

 Heart Rate Monitoring Arduino Programming:

Before you start the Programming first of all make sure you download the library for the Pulse sensor. Watch Video tutorial for the library installation. The video is given at the end of this Article.

This is the same exact program that I have already explained in version1 of the heartbeats monitoring system. I didn’t even change a signal instruction. The modification is only on the hardware side. As you can see in the programming, I am sending the text and values to the Bluetooth module using Serial communication. So this time I am using the Arduino’s default Serial port for the communication with the Bluetooth Module. If you don’t want to use the Arduino’s default serial port then you can use the Softwareserial library to create another port. I have a very detailed tutorial on how to create the multiple serial ports using the softwareserial library.


#define USE_ARDUINO_INTERRUPTS true    // Set-up low-level interrupts for most acurate BPM math.
#include <PulseSensorPlayground.h>     // Includes the PulseSensorPlayground Library.   
#include <LiquidCrystal.h>
//  Variables
const int PulseWire = 0;       // PulseSensor PURPLE WIRE connected to ANALOG PIN 0
const int LED13 = 13;          // The on-board Arduino LED, close to PIN 13.
int Threshold = 550;           // Determine which Signal to "count as a beat" and which to ignore.
                               // Use the "Gettting Started Project" to fine-tune Threshold Value beyond default setting.
                               // Otherwise leave the default "550" value. 
                               
PulseSensorPlayground pulseSensor;  // Creates an instance of the PulseSensorPlayground object called "pulseSensor"

#define rs 9 
#define en 8 
#define d4 7 
#define d5 6  
#define d6 5 
#define d7 4 
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

void setup() {   

  Serial.begin(9600);          // For Serial Monitor
  // set up the LCD's number of columns and rows: 
  lcd.begin(16, 2);
  // Configure the PulseSensor object, by assigning our variables to it. 
  pulseSensor.analogInput(PulseWire);   
  pulseSensor.blinkOnPulse(LED13);       //auto-magically blink Arduino's LED with heartbeat.
  pulseSensor.setThreshold(Threshold);   

  // Double-check the "pulseSensor" object was created and "began" seeing a signal. 
   if (pulseSensor.begin()) {
    Serial.println("We created a pulseSensor Object !");  //This prints one time at Arduino power-up,  or on Arduino reset.  
    lcd.clear();
    lcd.print("BPM:"); // BEATS PER MINUTE
  }
}



void loop() {

 int myBPM = pulseSensor.getBeatsPerMinute();  // Calls function on our pulseSensor object that returns BPM as an "int".
                                               // "myBPM" hold this BPM value now. 

if (pulseSensor.sawStartOfBeat()) {            // Constantly test to see if "a beat happened". 
 Serial.println("♥  A HeartBeat Happened ! "); // If test is "true", print a message "a heartbeat happened".
 Serial.print("BPM: ");                        // Print phrase "BPM: " 
 Serial.println(myBPM);                        // Print the value inside of myBPM. 
    lcd.clear();  
  lcd.print("BPM:");
   lcd.setCursor(0,1);
  lcd.print(myBPM); 
}

  delay(20);                    // considered best practice in a simple sketch.

}

Watch Video Tutorial:

Other Related Project:

Pulse Sensor/ Heartbeat Rate (BPM) measurement using Arduino & Pulse Sensor “Stable BPM value”

Engr Fahad

My name is Shahzada Fahad and I am an Electrical Engineer. I have been doing Job in UAE as a site engineer in an Electrical Construction Company. Currently, I am running my own YouTube channel "Electronic Clinic", and managing this Website. My Hobbies are * Watching Movies * Music * Martial Arts * Photography * Travelling * Make Sketches and so on...

3 Comments

  1. Your tutorial is very helpful sir and your expalanation is superb . Sir i need your help fir my project. I want to make an app that read pulse sensor and lm-35 sensor on android and compare the value of sensor with threshold value and send an alert via message . I try the code that u send to read sensor value but it give me error.
    Plz sir plz help me becouse i am new in android.

  2. Your guides are great! its help me a lot sir thank u so much.
    but sir what i can do if i want to display the reading in single line instead of scrollview.

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button