Wearables & IoTTechnician

Heart-Rate Display with a MAX30102 and a Pico

Rest a fingertip on an optical sensor and watch your pulse wave and beats per minute on a tiny OLED — a learning project, not a medical device.

LevelTechnician
Time1.5 h
Est. cost~$42
Steps5

The MAX30102 shines red and infrared light into your skin and measures how much bounces back. Each heartbeat pushes a bit more blood through the capillaries, so the reflected light pulses. Counting the peaks over time gives beats per minute.

⚠ SAFETY
This is not a medical device and must not be used to diagnose or monitor any health condition. If you have health concerns, see a doctor.

Mission steps

  1. Wire the I2C bus

    Connect the MAX30102 and the OLED to the same I2C pins: SDA to GP4, SCL to GP5, power from 3V3 and GND.

  2. Flash MicroPython

    Install MicroPython on the Pico 2 W and add a community MAX30102 driver plus the ssd1306 driver with Thonny or mip.

  3. Read raw samples

    Read IR values about 100 times per second and plot them in Thonny's plotter; you should see a clear wave.

  4. Detect beats

    Subtract a moving average, find the peaks, and average the time between the last few beats to get BPM.

  5. Show it

    Draw the scrolling pulse wave and the BPM number on the OLED.

Questions

Why does the number jump around?

Finger movement and pressing too hard ruin the signal. Rest your finger lightly and keep still for 10 seconds before reading.