Measure and display real-time heart rate in Beats Per Minute (BPM) using a PPG-based Pulse Sensor and 16×2 I²C LCD — with simulation support so you can build it hardware-free.
🗓 Updated: April 2026⏱ Build time: ~30 min⚡ Difficulty: Beginner❤️ Biomedical / Health
⚕️ Educational Use Only
This project is for learning and prototyping purposes only. It must not be used for clinical or professional medical diagnosis.
1 Project Overview
This beginner-friendly biomedical project measures heart rate in real time using the photoplethysmography (PPG) principle. The Pulse Sensor reads analog voltage changes caused by blood flow, sends the data to an Arduino UNO which calculates BPM, then displays the result on a 16×2 I²C LCD and Serial Monitor simultaneously.
The project is fully simulation-compatible — no physical hardware needed to learn the concept.
Dual OutputBPM shown on 16×2 LCD and Serial Monitor
🔗
I²C CommunicationSingle SDA/SCL bus for LCD
💻
Simulation ReadyTest on CircuitDesign.app without hardware
📚
Library-BasedUses PulseSensorPlayground for clean signal processing
🎚️
Adjustable ThresholdTune detection sensitivity for your environment
2 Components Required
🔵
Arduino UNO
× 1
❤️
Pulse Sensor (PPG)
× 1
🖥️
16×2 I²C LCD
× 1
I²C addr: 0x27
🔌
USB Cable
× 1 (Type-B)
🟡
Jumper Wires
× 8–10
⬜
Breadboard
× 1 (optional)
Required Libraries
Library
Purpose
Install via
PulseSensorPlayground
Pulse signal processing & BPM calculation
Arduino Library Manager
LiquidCrystal_I2C
16×2 I²C LCD control
Arduino Library Manager
Wire.h
I²C communication
Built-in (no install needed)
3 How Photoplethysmography (PPG) Works
The Pulse Sensor uses photoplethysmography — a non-invasive optical technique that detects blood volume changes in the microvascular tissue. Here's the 5-step process:
💡LED emits light into skin
→
🩸Blood flow absorbs varying light
→
👁️Photodetector measures intensity
→
⚡Analog voltage pulse output
→
📊Arduino calculates BPM from peaks
Each detected voltage peak = one heartbeat. The time between consecutive peaks is used to calculate the beats per minute value.
4 Circuit & Wiring Diagram
Fig 1 — Full wiring diagram. Pulse Sensor → A0 | LCD via I²C (A4=SDA, A5=SCL)
Pin Connection Reference
Device
Device Pin
Arduino Pin
Wire Colour
Pulse Sensor
VCC
5V
🟢 Green
Pulse Sensor
GND
GND
⚫ Black
Pulse Sensor
Signal
A0 (Analog)
🔵 Blue
16×2 I²C LCD
VCC
5V
🟢 Green
16×2 I²C LCD
GND
GND
⚫ Black
16×2 I²C LCD
SDA
A4 (SDA)
🟣 Purple
16×2 I²C LCD
SCL
A5 (SCL)
🟡 Yellow
6 Step-by-Step Instructions
1
Install Required Libraries
Open Arduino IDE → Sketch → Include Library → Manage Libraries. Search and install PulseSensorPlayground by Joel Murphy & Yury Gitman. Then install LiquidCrystal_I2C by Frank de Brabander. Wire.h is built-in.
In newer Arduino IDE 2.x, use the library panel on the left sidebar for faster searching.
2
Wire the Pulse Sensor to Arduino
Connect the three Pulse Sensor wires: VCC → 5V, GND → GND, Signal → A0. The sensor has a small PCB with an LED and photodiode facing down — place the component side against your fingertip.
Verify: No heat, no smoke. LED on the Pulse Sensor should faintly glow red when powered.
3
Wire the 16×2 I²C LCD
Connect the four LCD pins: VCC → 5V, GND → GND, SDA → A4, SCL → A5. The I²C backpack reduces the 16-pin LCD down to just 4 wires.
If your LCD shows blocks but no text, use a small screwdriver to adjust the blue contrast potentiometer on the I²C backpack.
4
Find Your LCD I²C Address
Most 16×2 I²C LCDs use address 0x27. If nothing displays, upload an I²C scanner sketch to find the correct address. Update this line in the code if needed:
LiquidCrystal_I2C lcd(0x27, 16, 2); // Change 0x27 if needed
5
Upload the Code
Open Arduino IDE, paste the full code from Section 7, select Board: Arduino UNO and the correct COM port, then click Upload. Wait for "Done uploading".
Open Serial Monitor at 9600 baud. You should see "Pulse sensor started successfully."
6
Place Your Finger on the Sensor
Rest your fingertip gently over the Pulse Sensor (LED side facing your skin). Keep steady pressure — not too hard. After 5–10 seconds, BPM values will appear on the LCD and Serial Monitor.
If readings are unstable, adjust the threshold value. Try values between 512 and 600 — lower = more sensitive.
7
Tune the Detection Threshold
The default threshold is 535. If you get false detections (very high BPM) increase it. If BPM isn't detected, decrease it. This value depends on your sensor, ambient light and skin tone.
pulseSensor.setThreshold(535); // Tune: 512–600 typical range
8
Test on Simulation (Optional)
Use the diagram.json from Section 5 to load the circuit in Wokwi or CirkitDesigner. The simulation generates synthetic pulse waveforms so you can verify the LCD output and code logic without any hardware.
Simulation BPM will be a fixed synthetic value — real hardware gives real readings.
7 Full Arduino Code
pulse_sensor_bpm.ino
/*
* Arduino Sketch for Heart Pulse Sensor with LCD Display
* MakeMindz.com — Arduino Pulse Sensor BPM Monitor
*
* Hardware:
* - Arduino UNO
* - Pulse Sensor (Signal → A0)
* - 16x2 I2C LCD (SDA→A4, SCL→A5, addr 0x27)
*
* Libraries:
* - PulseSensorPlayground
* - LiquidCrystal_I2C
*/#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <PulseSensorPlayground.h>
// Pin where the pulse sensor signal wire is connectedconstint PULSE_SENSOR_PIN = A0;
// Create instance of PulseSensorPlayground
PulseSensorPlayground pulseSensor;
// Initialize LCD: I2C address 0x27, 16 columns, 2 rows
LiquidCrystal_I2C lcd(0x27, 16, 2);
voidsetup() {
// Start serial communication
Serial.begin(9600);
// Initialize LCD
lcd.begin(16, 2);
lcd.backlight();
// Configure pulse sensor
pulseSensor.analogInput(PULSE_SENSOR_PIN);
pulseSensor.setSerial(Serial);
pulseSensor.setThreshold(535); // Adjust for sensitivity (512–600)// Attempt to start the pulse sensorif (pulseSensor.begin()) {
Serial.println("Pulse sensor started successfully.");
lcd.setCursor(0, 0);
lcd.print("Pulse Sensor OK");
} else {
Serial.println("Pulse sensor failed to start.");
lcd.setCursor(0, 0);
lcd.print("Sensor Fail");
}
}
voidloop() {
// Get current BPM from libraryint myBPM = pulseSensor.getBeatsPerMinute();
// If a new heartbeat peak was detectedif (pulseSensor.sawStartOfBeat()) {
Serial.print("BPM: ");
Serial.println(myBPM);
// Update LCD row 1 (row 0 = status line)
lcd.setCursor(0, 1);
lcd.print("BPM: ");
lcd.print(myBPM);
lcd.print(" "); // Clear trailing digits
}
// Small delay for stable readingsdelay(10);
}
8 Key Library Functions Explained
pulseSensor.analogInput(A0)
Tells the library which Arduino pin is connected to the sensor's signal wire. Must be called before begin().
pulseSensor.setThreshold(535)
Sets the minimum signal strength to count as a heartbeat. Lower = more sensitive. Default 535 works for most setups. Range: 0–1023.
pulseSensor.begin()
Initialises the sensor and starts background sampling using a hardware timer interrupt. Returns true if successful.
pulseSensor.sawStartOfBeat()
Returns true once per detected heartbeat peak. Use this to trigger your BPM display update — it fires only on a new beat.
pulseSensor.getBeatsPerMinute()
Returns the calculated BPM as an integer, based on the time interval between the last two detected peaks.
pulseSensor.setSerial(Serial)
Enables the built-in serial output for debugging. Waveform data is streamed to Serial Monitor at the configured baud rate.
9 Simulation Links
Test this project entirely online — no hardware required. These platforms let you simulate the Arduino, Pulse Sensor and LCD all in your browser.
📋 Simulation Instructions
1. Go to Wokwi.com and create a new Arduino UNO project. 2. Click the diagram.json tab and paste the JSON from Section 5. 3. Click sketch.ino and paste the full code from Section 7. 4. Press the ▶ Play button to start simulation and watch BPM appear on the LCD.
10 Key Features
❤️
Real-Time BPMContinuous heart rate measurement using PPG
📟
Dual DisplayLCD shows BPM; Serial Monitor shows waveform data
📚
Library-BasedClean code using PulseSensorPlayground library
🎚️
Tunable ThresholdAdjustable sensitivity for different conditions
💻
Simulation-ReadyWorks in Wokwi and CirkitDesigner
🔗
Minimal WiringOnly 7 connections total for full system
🎓
Beginner FriendlyClear code, simple circuit, full tutorial
🏥
STEM / BiomedicalIdeal for science fairs and IoT health projects
Comments
Post a Comment