0% found this document useful (0 votes)
15 views5 pages

Smart Health Notes

Uploaded by

thalapathyajay79
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views5 pages

Smart Health Notes

Uploaded by

thalapathyajay79
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

A 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.
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

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.

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).
Hardware Wiring Diagram

Source 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);
}

You might also like