Science

How a phone camera reads a heart rate.

Photoplethysmography — what it is, how we use it, where it falls short.

Gloom Scroller is an iOS app that locks selected social media apps until you complete 60 seconds of movement, using an on-device camera pulse check to estimate heart rate.

What photoplethysmography is

Photoplethysmography (PPG) is a non-invasive optical technique that detects blood-volume changes in the microvascular tissue just beneath the skin. A light source illuminates the tissue; a photodetector reads the reflected or transmitted light intensity. With each heartbeat, blood vessels expand and contract, modulating the light reaching the detector. The resulting waveform is the photoplethysmogram. Pulse oximeters use it. Smartwatches like the Apple Watch use it. So does a modern smartphone — when you press a fingertip against the rear camera while the flashlight is on, the camera becomes the photodetector and the flashlight is the light source. The technique has been used in clinical physiology since the 1930s; Allen (2007) reviews its foundations.

The signal pipeline

From raw camera frame to a BPM number takes five sequential steps:

  1. STEP 1Frame captureCamera and flashlight illuminate the fingertip at 30+ fps.
  2. STEP 2Red-channel meanAverage the red-channel intensity across the frame — strongest pulsatile signal at ~660 nm.
  3. STEP 3Bandpass filterKeep 0.5–4 Hz; covers 30–240 BPM and rejects everything else.
  4. STEP 4Peak detectionFind local maxima across recent filtered samples.
  5. STEP 5BPM estimateConvert peak-to-peak intervals to beats per minute.

Each second, the camera captures around 30 frames of red-channel intensity. The red wavelength (~660 nm) is absorbed differently by oxygenated and deoxygenated hemoglobin, and it is the channel where the pulsatile signal — the small amplitude fluctuation tied to each heartbeat — has the highest signal-to-noise ratio. The bandpass filter isolates frequencies in the human heart-rate range and rejects ambient lighting, breathing motion, and other low-frequency drift. Peak detection finds the local maxima on the filtered signal. The time between consecutive peaks gives the inter-beat interval; inverted and scaled, that becomes BPM.

Where it falls short

Smartphone-camera PPG is not medical-grade. Several real failure modes affect the signal:

  • Motion artifacts. Tremor, finger repositioning, or any movement of the camera relative to the skin overwhelms the pulsatile signal. Best results come from a steady fingertip pressed lightly against the lens. Heart-rate readings taken immediately after exercise are noisier than at rest.
  • Skin-tone variance. Melanin absorbs more light at the wavelengths PPG uses; higher-melanin skin tones produce a smaller pulsatile signal and a worse signal-to-noise ratio. This is a documented bias across consumer PPG devices, not unique to phone cameras. Castaneda et al. (2018) reviews the literature.
  • Device-model sensitivity. Different iPhone models have different sensor sensitivities, exposure-control behaviour, and flashlight characteristics. The same fingertip on two different phones can produce different readings.
  • Cold-finger vasoconstriction. When peripheral blood flow is reduced — cold fingers, dehydration, some medications — the pulsatile signal weakens. The reading becomes noisier or fails entirely.
  • Ambient light leakage. Light bleeding in around the fingertip alters the detector reading. A firm seal between fingertip and lens reduces this.

For smartphone-camera PPG specifically, Yan et al. (2017) validated phone-camera-derived pulse signals against reference measurements. For wearable-PPG accuracy more broadly, Bayoumy et al. (2021) reviews where consumer devices land relative to clinical instruments.

How Gloom Scroller uses it

I read your pulse. I'm a movement-detection nudge, not a medical device. The camera estimate tells me whether you moved — that's the only question I'm asking. I never claim clinical accuracy.

The error tolerance is asymmetric by design. A false pass — I clear the gate when your heart rate isn't actually elevated — does no harm. You still moved for sixty seconds. The interrupt still happened. A false fail — the signal was too noisy to read — is solved by heart lives and the skip option built into the game. Either way, the worst case is mild friction, not missed exercise.

Heart-rate readings stay on your phone. They are not stored on any server. They are not transmitted to a service. They are not shared with any third party. Read the privacy policy for the full data-handling story.

Why we cite these studies

Hunt et al. 2018 — social media and mood. In a 143-person trial, participants who limited daily social-media use to about 30 minutes a day reported reduced symptoms of depression and loneliness over three weeks. The effect size was modest and the sample was small, but the direction was statistically significant. We cite it because the mechanism Gloom Scroller targets — making each app open costlier — is one path to the same outcome (less daily use). We do not claim Gloom Scroller treats depression. We cite the research on what reduced daily use is correlated with.

Brooker et al. 2023 — morning movement and screen leisure. Participants who completed a morning aerobic-exercise intervention spent about 32 fewer minutes per day on screen leisure (TV and video games). The connection to sleep is indirect but plausible: morning movement establishes a circadian anchor, and reduced evening screen leisure is correlated with better sleep continuity. We cite Brooker because the morning-scroll-instead-of-morning-movement pattern is the exact behaviour Gloom Scroller's first-open-of-the-day interrupt targets.

On focus and productivity. The research on phone-use-and-deep-work is still developing, but the displacement model from Brooker generalises: every minute of doomscrolling is a minute of attention that wasn't somewhere else. Gloom Scroller's interrupt model converts the ambient phone-check loop into a per-open transaction. That doesn't “fix” productivity, but it makes the cost of casual scrolling visible (60 seconds of movement) at the moment it happens.

References

  1. Allen, J. (2007). Photoplethysmography and its application in clinical physiological measurement. Physiological Measurement. https://doi.org/10.1088/0967-3334/28/3/R01
  2. Castaneda, D., Esparza, A., Ghamari, M., Soltanpur, C., & Nazeran, H. (2018). A review on wearable photoplethysmography sensors and their potential future applications in health care. International Journal of Biosensors & Bioelectronics. https://doi.org/10.15406/ijbsbe.2018.04.00125
  3. Yan, B. P., Lai, W. H. S., Chan, C. K. Y., et al. (2017). Contact-free screening of atrial fibrillation by a smartphone using facial pulsatile photoplethysmographic signals. JMIR mHealth and uHealth. https://doi.org/10.2196/mhealth.7275
  4. Bayoumy, K., Gaber, M., Elshafeey, A., et al. (2021). Smart wearable devices in cardiovascular care: where we are and how to move forward. Nature Reviews Cardiology. https://doi.org/10.1038/s41569-021-00522-7

Last updated .