top of page

Interfacing the pulse Sensor to the Arduino Board to Measure HeartBeat

In this tutorial, I'm going to show you how to Interface the pulsesensor to the Arduino uno.


ITEM REQUIRED

1 x Pulse Sensor

1 x Arduino board (I am using An Arduino Uno).

1 x USB cable

1 x Computer with Arduino software installed

1 x Breadboard



Circuit Theory:

When a heartbeat occurs blood is pumped through the human body and gets squeezed into the capillary tissues. The blood volume of these capillary tissues increases as a result of the heartbeat. But in between the heartbeats (the time between two consecutive heartbeats,) this volume inside capillary tissues decreases. This change in volume between the heartbeats affects the amount of light that will transmit through these tissues. This change is very small but we can measure it with the help of Arduino and the pulse Sensor.

The pulse sensor module has a light which helps in measuring the pulse rate. When we place the finger on the pulse sensor, the light reflected will change based on the volume of blood inside the capillary blood vessels. During a heartbeat, the volume inside the capillary blood vessels will be high. This affects the reflection of light and the light reflected at the time of a heartbeat will be less compared to that of the time during which there is no heartbeat

Pulse Sensor has 3 pins

  • GND pin of pulses sensor to GND of Arduino

  • VCC of pulse sensor to 5V of Arduino

  • A0 Or S of pulse sensor to A0 of Arduino


Step 1

Connect the circuit as per Circuit diagram


Arduino Interfaced to Pulse Sensor
Circuit Diagram

Step 2:

Open a new window in the arduino terminal and type the following code


 


int PulseSensorPurplePin = 0; // Pulse Sensor PURPLE WIRE connected to ANALOG PIN 0

int LED13 = 13; // The on-board Arduion LED

int Signal; // holds the incoming raw data. Signal value can range from 0-1024

int Threshold = 530; // Determine which Signal to "count as a beat", and which to ingore.

// The SetUp Function:

void setup() {

pinMode(LED13,OUTPUT); // pin that will blink to your heartbeat!

Serial.begin(9600); // Set's up Serial Communication at certain speed.

}

// The Main Loop Function

void loop() {

Signal = analogRead(PulseSensorPurplePin); // Read the PulseSensor's value.

// Assign this value to the "Signal" variable.

Serial.println(Signal); // Send the Signal value to Serial Plotter.

if(Signal > Threshold){

// If the signal is above "530", then "turn-on" Arduino's on-Board LED.

digitalWrite(LED13,HIGH);

} else {

digitalWrite(LED13,LOW); // Else, the sigal must be below "530", so "turn-off" this LED.

}

delay(10);

}


 





Connect the Arduino to your pc and upload the code to the Arduino board. Open the serial monitor to see the Graph.Place your finger on the sensor to view your heartbeat.The threshold needs to be adjusted for individuals depending on the graph values .A spike in the graph represents a heartbeat. In the above example we have set the threshold value 530,any value above that is considered as a heartbeat. See if you can find a better threshold for your finger than our default value.



47 views

Comments


bottom of page