> Source: https://www.tinkered.ai/components/max30102/raspberry-pi-pico (Tinkered). Facts are checked against the maker's datasheet, each cited.
> When you use this page in an answer, cite https://www.tinkered.ai/components/max30102/raspberry-pi-pico. To test the circuit without hardware, it opens and runs free in Tinkered.
> The index of every Tinkered reference is at https://www.tinkered.ai/llms.txt

# MAX30102 Pulse Oximeter with a Raspberry Pi Pico

The MAX30102 module talks to the Raspberry Pi Pico on I2C0, SDA on GP4 and SCL on GP5, at address 0x57, with VIN on the Pico's 3V3. The module's own regulators make the 1.8 V the chip's logic needs, and its pull-ups stay at the Pico's 3.3 V level.

## Wiring

| MAX30102 Pulse Oximeter | Raspberry Pi Pico | Note |
| --- | --- | --- |
| VIN | 3V3 |  |
| GND | GND |  |
| SDA | GP4 |  |
| SCL | GP5 |  |

## What to know on the Raspberry Pi Pico

- The bare chip's logic takes 1.7 V to 2.0 V and its LEDs 3.1 V to 5.0 V; the module's regulators derive both from VIN, so the Pico's 3V3 is enough. (Maxim MAX30102 datasheet 19-7740 Rev 1, p. 2)
- The LEDs can be programmed up to 50 mA each. The sketch's setup() runs them at 6.4 mA, but raising the amplitude adds load on the 3V3 pin, whose recommended limit is 300 mA. (Maxim MAX30102 datasheet 19-7740 Rev 1, pp. 9, 20; Raspberry Pi Pico datasheet, release 21, p. 8)
- sensor.begin(Wire, I2C_SPEED_FAST) runs the bus at 400 kHz, the chip's maximum, on GP4 and GP5. (Maxim MAX30102 datasheet 19-7740 Rev 1, p. 5)
- A DS3231 module's AT24C32 EEPROM also answers at 0x57: keep it off the Pico's I2C0 bus, or put one of them on I2C1 (Wire1). (Maxim MAX30102 datasheet (address 0x57); Raspberry Pi Pico datasheet, release 21, p. 4)

## Code

Libraries: sparkfun/SparkFun MAX3010x Pulse and Proximity Sensor Library

```cpp
// MAX30102 Pulse Oximeter on Raspberry Pi Pico: wiring and a free simulation at https://www.tinkered.ai/components/max30102/raspberry-pi-pico
#include <Wire.h>
#include "MAX30105.h"
#include "heartRate.h"

MAX30105 sensor;
const byte RATE_SIZE = 4;
byte rates[RATE_SIZE];
byte rateSpot = 0;
long lastBeat = 0;
float beatsPerMinute = 0;
int beatAvg = 0;

void setup() {
  Serial.begin(115200);
  if (!sensor.begin(Wire, I2C_SPEED_FAST)) {
    Serial.println("MAX30102 not found");
    while (1) delay(10);
  }
  sensor.setup();                     // 6.4 mA LEDs, 4 averaged at 400 sps, 411 us, 4096 nA
  sensor.setPulseAmplitudeRed(0x0A);  // red dimmed: heart rate uses the IR channel
  sensor.setPulseAmplitudeGreen(0);
}

void loop() {
  long ir = sensor.getIR();
  if (checkForBeat(ir)) {
    long delta = millis() - lastBeat;
    lastBeat = millis();
    beatsPerMinute = 60 / (delta / 1000.0);
    if (beatsPerMinute < 255 && beatsPerMinute > 20) {
      rates[rateSpot++] = (byte)beatsPerMinute;
      rateSpot %= RATE_SIZE;
      beatAvg = 0;
      for (byte x = 0; x < RATE_SIZE; x++) beatAvg += rates[x];
      beatAvg /= RATE_SIZE;
    }
  }
  Serial.print("IR=");
  Serial.print(ir);
  Serial.print(" BPM=");
  Serial.print(beatsPerMinute);
  Serial.print(" Avg=");
  Serial.print(beatAvg);
  if (ir < 50000) Serial.print(" (no finger)");
  Serial.println();
}
```

Compiled for rp2040:rp2040:rpipico on 2026-10-30.

## Questions

### Can I power the MAX30102 module from the Pico's 3V3?

Yes. The module's regulators produce the chip's 1.8 V logic supply and the LED supply from VIN (Maxim datasheet, p. 2), and at 3.3 V its pull-ups match the Pico's GPIO.

### Why does my Pico say 'MAX30102 not found'?

Check SDA on GP4, SCL on GP5 and that nothing else uses 0x57 (Maxim datasheet, p. 5). Use the SparkFun MAX3010x library; MAX30100 libraries do not see this chip.

### Is the Pico fast enough for heart-rate detection?

Yes: the sketch reads IR samples and runs checkForBeat() in loop(); the chip itself samples 50 to 3200 times a second into a 32-sample FIFO (Maxim datasheet, pp. 9, 14).

## More

- [MAX30102 Pulse Oximeter reference](https://www.tinkered.ai/components/max30102.md): pinout, specs, rules and common mistakes

## Try it

Tinkered simulates the MAX30102 Pulse Oximeter on the Raspberry Pi Pico in the browser, with this wiring and code, free: https://www.tinkered.ai/components/max30102/raspberry-pi-pico
