Algorithmic Biometrics: Heart Rate Pulse Sensor
A simple switch is easy to program. The human heart is a terrifyingly chaotic, erratic biological pump. The Heart Rate Pulse Sensor Device uses physical photoplethysmography (flashing a green LED straight through a human fingertip) to measure the microscopic expansion of capillaries. The Arduino must utilize an immense algorithm to filter out optical noise and mathematically capture exactly when the blood violently surges!

Photoplethysmography (The PulseSensor.com Module)
The Pulse Sensor outputs a massive, jagged analog wave into A0.
- Every time your heart physically squeezes, blood surges through your finger, altering how much Green Light bounces back into the tiny internal photodiode!
- The Analog Noise Nightmare: If you just write
if (analogRead(A0) > 550) { count++; }, you will fail catastrophically. The sensor is so responsive it will pick up the microscopic vibration of your hand or the generic 50Hz blinking of the fluorescent lights in your ceiling!
The Peak-Detect Algorithm (Moving Averages)
The C++ code must run a massive filtering algorithm on the 16MHz processor!
- The Arduino samples
A0every 2 milliseconds strictly via aTimer Interrupt. - It saves the last 10 readings into a cyclical Array and mathematically calculates the "Mean" (averaging out the room noise!).
- The Peak Calculus: It looks for an incredible, sudden spike in the filtered waveform
(Signal > Threshold_Level). - When it detects the spike, it records
millis().
unsigned long currentTime = millis();
int IBI = currentTime - lastBeatTime; // Inter-Beat Interval (Milliseconds between two beats)
BPM = 60000 / IBI; // Convert milliseconds instantly to Beats Per Minute!
- The number
BPM 72violently updates onto an I2C OLED Display, accompanied by an extremely loud Piezo Buzzer 'Beep' matching the exact millisecond of the capillary surge!
Optical Biometric Components
- Arduino Uno/Nano (Excellent for running clean, uninterrupted
Timer2executions). - Generic Pulse Sensor Amped Module (Usually looks like a tiny perfect black circle with a bright Green LED and a heart logo on the front PCB).
- 0.96" SSD1306 OLED I2C Screen to completely map and draw the terrifying, sweeping EKG-like graph waveform dynamically on the display as the physical heart beats!