DEV Community

Cover image for How Does a Fitness Tracker Measure Heart Rate? A Developer's Guide to PPG Sensors
Sardar Faisal
Sardar Faisal

Posted on

How Does a Fitness Tracker Measure Heart Rate? A Developer's Guide to PPG Sensors

A fitness tracker measures heart rate with photoplethysmography (PPG). It shines light into the skin, reads how much light returns, and uses software to turn each pulse into a beats-per-minute value.

How PPG works

PPG sensors detect small changes in blood volume in the tiny vessels under your skin. Each heartbeat pushes more blood through, so the skin absorbs more light at the peak of every pulse. A photodiode records the changing light level as a wave. Software then counts the waves.

Why trackers use green light

A review of wearable pulse sensors notes that blood absorbs green light strongly, so green LEDs give the clearest pulse signal near the skin surface. Infrared light reaches deeper and often supports other measurements, such as blood oxygen.

The signal pipeline in 5 steps

  1. Emit: The LED pulses light into the skin.
  2. Detect: The photodiode measures the light that returns.
  3. Sample: The chip converts the signal into digital values, often tens of times per second.
  4. Filter: Software removes slow drift and high-frequency noise.
  5. Count: An algorithm finds the peaks and calculates beats per minute.

Sample code: find heart rate in simulated data

import numpy as np
from scipy.signal import butter, filtfilt, find_peaks

fs = 50                       # samples per second
t = np.arange(0, 30, 1/fs)
ppg = np.sin(2*np.pi*1.2*t) + 0.2*np.random.randn(len(t))  # sample data, about 72 bpm

b, a = butter(2, [0.7, 3.5], btype="band", fs=fs)  # keep 42-210 bpm
clean = filtfilt(b, a, ppg)
peaks, _ = find_peaks(clean, distance=fs*0.4)
bpm = 60 / (np.diff(peaks).mean() / fs)
print(round(bpm))
Enter fullscreen mode Exit fullscreen mode

The band-pass filter keeps frequencies in the normal heart rate range. The peak finder then measures the time between beats.

Why motion is the hard part

Motion artifacts can be larger than the pulse signal and can sit in the same frequency range as heart rate. Researchers have proposed methods that use a second light wavelength or an accelerometer as a motion reference. A 2025 study of arm-worn PPG monitors found that accuracy dropped during short, high-intensity, full-body activity, and that sensor placement changed accuracy. A review of 44 studies found the largest errors in weightlifting, cycling and other high-intensity sports.

What Star Tech's Biokoop page says

The Kieslect Biokoop Fitness Tracker is a 12.9 g, screen-free aluminum band. Star Tech lists 24/7 heart rate, HRV, SpO2, stress and sleep tracking, 3 ATM water resistance, up to 14.1 days of battery life, and 32MB of local data storage. The page does not publish LED colors, sampling rates or algorithms, so treat the pipeline above as a typical design and not a confirmed spec. The page uses the phrase "medical-grade," which is marketing language. Treat the band as a wellness tool.

Tips for better readings

  • Wear the band snug, but not tight, and keep it in the same position each day.
  • Rest for a few minutes before you check resting heart rate.
  • Keep the sensor clean and dry.
  • Expect more error during intense, irregular workouts. A chest strap is more accurate for hard training.

FAQ

Is wrist heart rate accurate?

It works well at rest and during steady activity. It is less reliable during intense or irregular movement.

Can a tracker replace an ECG?

No. A tracker can show trends, but it cannot replace a medical test. See a doctor if you have chest pain, dizziness or an irregular heartbeat.

Where to buy

Check price and warranty on Star Tech's product page, or browse the Smart Band category. Star Tech listed the band at 5,250 BDT cash price with a 1-year warranty at the time of writing.

Top comments (0)