Heart Rate Monitor Using Pulse Sensor and Maker Nano

Introduction

If you are doing biomedical related project, heart rate data can be really useful. In this tutorial, I will share on how to interface pulse sensor using Maker Nano and display the heart rate (BPM) on LCD. Besides, heartbeat pattern is also animated by 12 LEDs on Maker Nano.

Video

This video shows how to monitor heart rate using pulse sensor and Maker Nano.

Hardware Preparation

This is the list of items used in the video.

Sample Program

This is Arduino sample program to monitor heart rate using pulse sensor and Maker Nano. Please install following libraries through the Library Manager.

  • Grove LCD RGB Backlight by Seeed Studio V1.0.0 (Manager)
  • PulseSensor Playground by Joel Murphy, Yury Gitman, Brad Needham V1.5.1 (Manager)
/*
Project: Heart Rate Monitor Using Pulse Sensor and Maker Nano
Board: Arduino Nano (Maker Nano)
Connections:
Nano | I2C LCD Grove
GND – GND
5V – VCC
SDA – SDA
SCL – SCL
Nano | Pulse Sensor
GND – GND
5V – VCC
A0 – SIG
External libraries:
– Grove LCD RGB Backlight by Seeed Studio V1.0.0 (Manager)
– PulseSensor Playground by Joel Murphy, Yury Gitman, Brad Needham V1.5.1 (Manager)
*/
#define USE_ARDUINO_INTERRUPTS true
#include <PulseSensorPlayground.h>
#include <rgb_lcd.h>
const int PulseWire = 0;
int Threshold = 550;
PulseSensorPlayground pulseSensor;
rgb_lcd lcd;
byte led, ledOn;
int pulseAdc;
void setup()
{
for (led = 2; led < 13; led++) {
pinMode(led, OUTPUT);
}
Serial.begin(9600);
lcd.begin(16, 2);
pulseSensor.analogInput(PulseWire);
pulseSensor.setThreshold(Threshold);
if (pulseSensor.begin()) {
Serial.println("We created a pulseSensor Object !");
lcd.print("Heartrate (BPM)");
}
}
void loop()
{
pulseAdc = analogRead(PulseWire);
ledOn = map(pulseAdc, 0, 1000, 2, 14);
for (led = 2; led < ledOn; led++) { // Turn on LEDs
digitalWrite(led, HIGH);
}
for (led = ledOn; led < 13; led++) { // Turn off LEDs
digitalWrite(led, LOW);
}
int myBPM = pulseSensor.getBeatsPerMinute();
if (pulseSensor.sawStartOfBeat()) {
Serial.println("♥ A HeartBeat Happened ! ");
Serial.print("BPM: ");
Serial.println(myBPM);
lcd.setCursor(0, 1);
lcd.print(myBPM); lcd.print(" ");
}
}

Thank You

References:

Thanks for reading this tutorial. If you have any technical inquiries, please post at Cytron Technical Forum.

Please be reminded, this tutorial is prepared for you to try and learn.
You are encouraged to improve the code for better application.

Leave a Comment

Your email address will not be published.

Share this Tutorial

Share on facebook
Share on whatsapp
Share on email
Share on print
Share on twitter
Share on pinterest
Share on facebook
Share on whatsapp
Share on email
Share on print
Share on twitter
Share on pinterest

Latest Tutorial

Real-Time IoT Room Monitoring on Maker Pi Pico Using pyRTOS
Build an IoT Plant Monitoring System with MicroBit and Grove WiFi Module
Snap & Fit ABS Case and ICE Tower Cooling Fan Case Stress Test
Raspberry Pi Zero 2 W – Quad-core and 64-bit CPU
IoT Push Notification Using Rain Sensor with MicroBit
Tutorials of Cytron Technologies Scroll to Top