Introduction
This experiment demonstrates how to detect the heartbeat using the MAX30100 sensor with Arduino.

Components Needed
- MAX30100 Heartbeat Sensor
- Arduino
- Jumper Wires
Circuit Setup
- Connect the MAX30100 sensor to the Arduino using the I2C interface (SCL and SDA).
- Connect VCC and GND pins to the Arduino’s 5V and GND.
The MAX30100 sensor uses infrared light to detect blood flow and heartbeat.

Code for Heartbeat Detection
Upload the following code to your Arduino to measure heartbeat:
#include
#include
MAX30100_PulseOximeter pox;
void setup() {
Serial.begin(9600);
if (!pox.begin()) {
Serial.println("Couldn't find the sensor");
for(;;);
}
}
void loop() {
pox.update();
if (pox.isHeartRateUpdated()) {
Serial.print("Heart Rate: ");
Serial.println(pox.getHeartRate());
}
delay(1000);
}
Explanation
The MAX30100 sensor uses optical sensing to detect the blood flow caused by heartbeats, which is then processed by the Arduino to measure the heart rate.
Troubleshooting
- If the sensor isn't working, ensure the I2C connections are secure and the sensor is powered correctly.
- If the readings are unstable, check the placement of the sensor on the finger or skin.