Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
FREEDOM251

Freedom251 › Blog › Arduino IDE

How to Use a MAX30102 Pulse Oximeter and Heart Rate Sensor with ESP32 in Arduino IDE

By Freedom251 Team · · 4 min read

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

You can connect a MAX30102 breakout to an ESP32 over I²C and use SparkFun’s MAX3010x Arduino library to read its sensor data. The key setup detail is to check your particular breakout’s voltage requirements and wiring diagram: the MAX30102 chip’s supply specifications do not, by themselves, tell you how a finished breakout should be powered.

What the MAX30102 does

The MAX30102 is an optical heart-rate and pulse-oximetry sensor that communicates with a host over I²C. Its LEDs illuminate tissue, while photodetectors measure returning light; the chip also includes optical components and low-noise electronics with ambient-light rejection. Analog Devices describes it as an integrated pulse-oximetry and heart-rate monitor module. Analog Devices MAX30102 product information and datasheet

As an Amazon Associate I earn from qualifying purchases.

The manufacturer’s datasheet, revision 1 dated November 8, 2018, specifies a 1.8 V sensor supply and a separate 3.3 V supply for the internal LEDs. Those are chip-level specifications, not a universal wiring instruction for breakout boards. A breakout may include supporting voltage circuitry, but board designs vary; consult the documentation for the exact module you have before connecting power.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The same datasheet lists the optical module at 5.6 mm × 3.3 mm × 1.55 mm and specifies an operating-temperature range of −40 °C to +85 °C. These figures describe the sensor component, not the assembled ESP32 project or its operating environment.

#1 Best Overall
Heart Rate Sensor Module MAX30102 Pulse Detection Blood Oxygen Concentration Compatible for Arduino STM32 (Pack of 2)
  • Integrates a red LED, a infrared LED, aphotodetector, an optical equipment and a low noise electronic circuit with environmental light suppression.
  • The standard I2C compatible communication interface can transmit the collected data to Arduino, KL25Z and other microcontrollers for heart rate and blood oxygen calculation.
  • Apply to wearable device for heart rate and blood oxygen collection, worn on fingers, ear lobes, wrists and other places.
  • The chip can also turn off the module by software, and the standby current is close to zero, so that the power supply can always be maintained.
  • If you have any questions or want more information, please let us know, we will be happy to help. Your satisfaction is our priority.

What you need

  • An ESP32 development board. The exact board model is not specified by the cited ESP32 tutorial, so use the I²C pins documented for your board.
  • A MAX30102 breakout module, with its own pin labels and voltage documentation.
  • A breadboard and suitable hookup wiring for your boards. SunFounder lists a breadboard for its ESP32/MAX30102 lesson. SunFounder ESP32 MAX30102 lesson
  • Arduino IDE and the SparkFun MAX3010x Sensor Library.

How to use a MAX30102 with an ESP32 in Arduino IDE

1. Check the breakout before wiring

Identify the module’s power, ground, and I²C pins from its labeling and board-specific documentation. Do not assume that a breakout accepts 3.3 V simply because an ESP32 uses 3.3 V logic, or that its pin order matches another MAX30102 board. The Analog Devices datasheet covers the IC, not the voltage handling or pin mapping of every breakout. MAX30102 manufacturer information

2. Connect the I²C bus

Connect the breakout’s SDA and SCL to the ESP32 board’s documented I²C data and clock pins, and connect the grounds. Supply the breakout only as its documentation directs. ESP32 models and breakout boards differ, so there is no single pin mapping or power recipe that can safely be stated for every combination.

Rank #2
hiBCTR MAX30102 Heart Rate and SpO2 Sensor Breakout Board
  • ​​Dual Health Monitoring​​: Measures heart rate (HR) and blood oxygen saturation (SpO2) via dual-wavelength (660nm red + 880nm IR) optical sensing.
  • Arduino/mbed Ready​​: Includes open-source C code examples for quick integration with ESP32/STM32/Raspberry Pi (I²C interface, 3.3V logic).
  • ​​Ultra-Compact Design​​: 14×14mm PCB with integrated LED drivers and ambient light cancellation for wearables/wristbands.
  • ​​Medical-Grade Precision​​: Non-invasive pulse oximetry algorithm detects 0.1% SpO2 resolution and 1bpm heart rate accuracy.
  • ​​Optimized Power Efficiency​​: <1mA active current at 50Hz sampling for battery-powered IoT health devices.

3. Install the library

  1. Open Arduino IDE and open Library Manager.
  2. Search for SparkFun MAX3010x.
  3. Install the SparkFun MAX3010x Sensor Library.

SparkFun’s library repository says the library supports MAX30102 and includes example sketches. SparkFun’s hookup guide describes using the library for I²C communication and sample reading, and documents the Library Manager installation route. SparkFun MAX3010x Sensor Library repository · SparkFun library hookup guide

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

4. Open and configure an example

In Arduino IDE, open an example supplied with the SparkFun MAX3010x library and select your ESP32 board and port. Library and example names may refer to MAX30105; that naming does not mean your sensor is a MAX30105. SparkFun explicitly lists MAX30102 support. Check the example’s I²C setup against the pins you actually wired and your ESP32 board’s documentation before compiling and uploading.

Rank #3
Diitao 5pcs Heart Rate Sensor Module MAX30102 Pulse Detection Blood Oxygen Concentration Calculation Modules Heart Rate Sensors Compatible for Arduino STM32
  • Working voltage:1.8~3.3~5.5V;LED peak wavelength:660nm/880nm;Monitoring signal type:Optical reflection signal (PPG);Communication interface:I2C interface board;Dimension of the reserved assembly hole:0.02x0.33 inch.
  • MAX30102 Integrated Module---An integrated heart rate sensor module that integrates red LED, infrared LED,optical device, photoelectric detector, and low-noise electronic circuits with ambient light suppression.
  • 50v built-in LED power supply---The chip can turn off the module through software, and the standby current is close to zero,maintaining power supply.
  • I2c-compatible communication interface---The I2C-compatible communication interface can transmit the collected data, and is compatible for Arduino,KL25Z for heart rate and blood oxygen calculation.
  • Usage---Wearable device for heart rate and blood oxygen collection.

SunFounder also provides a lesson specifically pairing an ESP32 development board with a MAX30102 module and recommends installing the SparkFun MAX3010x library through Library Manager. Its project route is useful when you want an ESP32-oriented walkthrough, while the SparkFun repository and hookup guide provide library examples and usage details. SunFounder ESP32 lesson

5. Confirm that the sensor is communicating

Run an example that initializes the sensor and reads samples. If initialization fails or no useful samples appear, recheck the module’s supply requirements, ground connection, SDA/SCL wiring, selected I²C pins, and the example’s pin configuration. The cited sources establish the library and tutorial path, but do not report a controlled test of every ESP32, breakout, wiring arrangement, and sketch combination.

Rank #4
AEDIKO 2pcs MAX30102 Heart Rate Sensor Module Pulse Detection Blood Oxygen Concentration Module
  • MAX30102 Heart Rate Sensor Module:LED Power Supply Voltage: 3.3~5V;LED Peak Wavelength: 660nm/880nm;Output Signal Interface: I2C
  • Integrates a Red LED: A Infrared LED, Aphotodetector, An Optical Equipment and Low Noise Electronic Circuit with Environmental Light Suppression
  • I2C Output Signal Interface:The Standard I2C Compatible Communication Interface can Transmit the Collected Data to KL25Z and other Microcontrollers for Heart Rate and Blood Oxygen Calculation
  • Low Current:The Chip Can Also Turn Off the Module by Software, and the Standby Current is Close to Zero, so that the Power Supply Can Always be Maintained
  • Application:MAX30102 Heart Rate Sensor Module Can Apply to Wearable Device for Heart Rate and Blood Oxygen Collection, Worn On Fingers, Ear Lobes, Wrists and Other Places
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

What the readings mean—and do not mean

The library can provide sensor samples, and examples may calculate heart-rate or oxygen-saturation-style values from those samples. Treat output from a maker build as an educational demonstration, not a medically validated measurement. The cited manufacturer, library, and tutorial sources do not establish clinical accuracy, diagnostic suitability, or equivalence to a regulated pulse oximeter.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For the SparkFun library’s MAX30102 support, the hookup guide describes use of the red and infrared LEDs. Sensor output depends on the physical setup and signal processing; the sources do not provide an accuracy ranking among libraries or validate measurements from this specific ESP32 build.

Best Value
hiBCTR MAX30102 Heart Rate and SpO2 Sensor Breakout Board
  • ​​Dual Health Monitoring​​: Measures heart rate (HR) and blood oxygen saturation (SpO2) via dual-wavelength (660nm red + 880nm IR) optical sensing.
  • Arduino/mbed Ready​​: Includes open-source C code examples for quick integration with ESP32/STM32/Raspberry Pi (I²C interface, 3.3V logic).
  • ​​Ultra-Compact Design​​: 14×14mm PCB with integrated LED drivers and ambient light cancellation for wearables/wristbands.
  • ​​Medical-Grade Precision​​: Non-invasive pulse oximetry algorithm detects 0.1% SpO2 resolution and 1bpm heart rate accuracy.
  • ​​Optimized Power Efficiency​​: <1mA active current at 50Hz sampling for battery-powered IoT health devices.

MAX30102 breakout or an integrated sensor hub?

A MAX30102 breakout is the direct route for this project: the ESP32 communicates with the sensor over I²C, and the library provides sample-reading support. Check the breakout’s voltage circuitry and wiring documentation before choosing a board, because those details are not established across all variants.

SparkFun’s MAX30101 plus MAX32664 product is a different architecture: it pairs a different optical sensor with a sensor-hub component. It is not a MAX30102 breakout, so its board behavior and processing should not be assumed to describe this project. SparkFun Pulse Oximeter and Heart Rate Monitor Hookup Guide

Common setup problems

  • The library example does not compile: confirm that the SparkFun MAX3010x Sensor Library is installed and that you have selected the intended ESP32 board in Arduino IDE.
  • The sensor does not initialize: verify power and ground against the breakout’s documentation, then check that SDA and SCL go to the ESP32’s configured I²C pins.
  • The example mentions MAX30105: SparkFun’s library supports MAX30102 as well. Use the library’s example as a starting point, but confirm its configuration matches the MAX30102 breakout and your wiring.
  • Your board’s pin labels or voltage are unclear: do not infer them from another breakout or from the chip datasheet alone. Use documentation for the exact board revision or contact its supplier.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Arduino IDEESP32Heart Rate SensorMAX30102pulse oximeter

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.