Example of use of the MAX30100 heartrate sensor with an Arduino. This example uses the Arduino-MAX30100 library. The MAX3010x series are integrated pulse oximetry and heart-rate monitor biosensor modules. Check out its datasheet here.
If you have the MAX30102 or MAX30105 sensor, consider using a more recent library like the official Sparkfun library (see below). There is also a tutorial for a MAX30102 with Raspberry Pi Pico, using Python.
Make sure to check your sensor for the exact model (its written on it). In some cases, like below, it might not be that clear. But the one below is a MAX30100.

Connecting the sensor
Place the sensor on a breadboard, and wire the pins:
Sensor | Pico |
VIN | 3V3 (Out) |
GND | GND |
SDA | A4 (SDA) |
SCL | A5 (SCL) |

There are multiple libraries available for the MAX3010x sensor series. See more in the sections below.
MAX30100 Arduino Library Installation
To install the library, search by typing MAX30100. Look for MAX30100lib by OXullo Intersecans. Click on install to install the library:
MAX30102 Arduino Library Installation
There are multiple libraries available for MAX30102 Sensor to measure the heart beat, blood oxygen and temperature. Out of all these libraries, the library from Sparkfun Electronics is the most popular one.
To install the library, search by typing MAX3010x. Look for SparkFun MAX3010x Pulse and Proximity Sensor Library. Click on install to install the library.
Checking out examples
Select File > Examples > MAX30100lib from the menu, to pick one of the examples. For instance the example MAX30100_Minimal. Hook up the USB cable to the Arduino and select the proper settings for your Arduino. Then press Upload and open the Serial Monitor to view the output. Check if the baud rate matches the set baud rate in the setup() function of the example, look for Serial.begin(…

You may also start the Plotter to view a plot of the values over time:
