Reference
MAX30102
Pulse oximeter and heart rate (18-bit).
- Connects over
- I²C
- Address
- 0x57
- Made by
- Maxim Integrated
- Datasheet
- datasheets.maximintegrated.com
Use it
hardware {
device max30102: MAX30102
}
every 1s {
let value: int = max30102.red()
log("max30102", "red={value}")
}
On its own, the declaration puts the MAX30102 on the first I²C bus (SDA 21, SCL 22 on the ESP32) at 0x57. To choose the pins or the address, declare the bus and attach the device: device max30102: MAX30102 on i2c0 at 0x57 with i2c i2c0(sda: 21, scl: 22).
Methods
-
max30102.red() -> int
Red LED raw value
-
max30102.ir() -> int
IR LED raw value
-
max30102.temperature() -> float
Die temperature °C
-
max30102.is_finger_present() -> int
1 if finger detected
Wiring
| Pin | Connect to |
|---|---|
VCC | 3.3V ONLY — 5V damages the chip |
GND | Ground |
SDA | Pull-up to 3.3V |
SCL | Pull-up to 3.3V |
INT | FIFO threshold interrupt |
Specifications
- Voltage
- 1.8V digital + 3.3V LED — breakout regulators handle both from a single 3.3V/5V input
- Current
- 600 μA – 4 mA
- Modes
- Heart-rate + SpO₂
- Leds
- Red (660 nm) + IR (880 nm)
Tips
- Designed for wearables — lower noise than MAX30100.
- Place finger over the sensor with steady pressure; movement is the #1 source of bad readings.
- Use the FIFO + interrupt rather than polling — keeps timing tight without main-loop work.
Alternatives worth knowing:
- MAX30100: Older, slightly higher noise, still common in DIY kits.