Arduino pulse rate monitor
1. System Overview
A pulse rate monitor measures heartbeats using an optical sensing technique called photoplethysmography (PPG). The system works as follows:
-
An LED emits light into the skin.
-
A photodiode detects variations in reflected light.
-
The signal is amplified and filtered.
-
The microcontroller processes the signal.
-
Beats per minute (BPM) are calculated.
-
The result is displayed or transmitted.
The microcontroller used in this guide is the Arduino Uno, but other compatible boards such as the Arduino Nano can also be used.
2. Required Components
Core Components
-
Arduino Uno
-
Pulse Sensor Amped
-
Breadboard
-
Jumper wires
-
USB cable
Optional Components
-
16×2 LCD display
-
OLED display (I2C)
-
10kΩ potentiometer (for LCD contrast)
-
Buzzer (heartbeat indication)
-
External power supply (9V battery)
-
Enclosure case
3. Working Principle of the Pulse Sensor
The Pulse Sensor typically contains:
-
A green LED (light source)
-
A photodiode (light detector)
-
Amplifier circuitry
-
Noise filtering stage
Principle of Operation
When the heart pumps blood:
-
Blood volume in the capillaries increases.
-
Light absorption increases.
-
Reflected light decreases.
-
The photodiode output voltage changes.
This produces a waveform known as a PPG signal, which contains periodic peaks corresponding to heartbeats.
4. Circuit Connections
Pulse Sensor to Arduino
| Pulse Sensor Pin | Arduino Pin |
|---|---|
| VCC | 5V |
| GND | GND |
| SIGNAL | A0 |
The signal pin connects to analog input A0.
Optional: 16×2 LCD (Parallel Mode)
| LCD Pin | Arduino Pin |
|---|---|
| RS | 12 |
| EN | 11 |
| D4 | 5 |
| D5 | 4 |
| D6 | 3 |
| D7 | 2 |
| VSS | GND |
| VDD | 5V |
5. Signal Processing Logic
The sensor outputs an analog waveform that includes noise. The Arduino must:
-
Continuously read analog values.
-
Detect peaks above a defined threshold.
-
Measure time between successive peaks.
-
Calculate BPM.
BPM Calculation
If IBI is the inter-beat interval in milliseconds:
BPM = 60000 / IBI
Where:
-
60000 = milliseconds per minute
-
IBI = time between two detected heartbeats
6. Arduino Code (Basic Version)
7. Code Explanation
Threshold
The threshold filters out noise. It must be adjusted depending on:
-
Finger placement
-
Ambient light conditions
-
Individual physiology
Debounce Interval (300 ms)
This prevents double counting. A 300 ms minimum interval limits detection to a maximum of approximately 200 BPM.
8. Adding LCD Display
Include the library:
In setup():
In loop():
9. Improving Accuracy
1. Moving Average Filtering
This smooths fluctuations.
2. Use Interrupt-Based Sampling
Provides more precise timing than polling in the main loop.
3. Use Hardware Timers
Using Timer2 improves sampling stability and reduces jitter.
4. Reduce Ambient Light
Use a finger clip or dark enclosure to block external light interference.
10. Calibration Procedure
-
Open Serial Monitor
-
Observe raw analog values
-
Identify:
-
Resting signal level
-
Peak signal level
-
-
Set threshold midway between these values.
Example:
-
Resting value: 520
-
Peak value: 620
-
Threshold: 570
11. Expected Output
Normal adult resting heart rate:
-
60–100 BPM
Athletes:
-
40–60 BPM
If readings fluctuate significantly:
-
Check noise filtering
-
Recalibrate threshold
-
Improve finger positioning
12. Troubleshooting
| Problem | Possible Cause | Solution |
|---|---|---|
| No reading | Wiring issue | Check connections |
| Unstable BPM | Noise | Improve filtering |
| Constant zero | Threshold too high | Lower threshold |
| Very high BPM | Threshold too low | Increase threshold |