This Arduino-based project uses the MAX30102 pulse oximeter sensor to measure heart rate (in BPM). It collects a fixed number of valid BPM readings and prints the average once complete. It also draws a real-time heart rate graph using the Arduino Serial Plotter.
- MAX30102 sensor module
- Arduino Uno, Nano, or compatible microcontroller
- Jumper wires
| MAX30102 Pin | Arduino Uno Pin |
|---|---|
| VIN | 3.3V or 5V |
| GND | GND |
| SDA | A4 |
| SCL | A5 |
🔎 Use 3.3V if unsure—some boards are not 5V tolerant.
Install these via the Arduino Library Manager:
- SparkFun MAX3010x Sensor Library
Wire(built-in with Arduino)heartRate.h(included in the SparkFun library)
This project reads IR signals from your finger and calculates heart beats per minute (BPM) using the MAX30102. It collects 20 valid readings (between 40–180 BPM) and then prints the final average BPM.
It also sends the BPM values continuously to the Serial Monitor, which can be visualized as a real-time BPM graph using the Arduino Serial Plotter.
- Place your finger on the sensor.
- Valid beats are detected and BPM is calculated.
- After 20 valid readings, it computes the average.
- Final result is printed, and the system halts further readings.
Initializing...
Place your finger on the sensor...
72.1
74.0
75.3
...
Final Average BPM (from 20 readings):
73
The MAX30102 communicates using I²C, which is an open-drain protocol. This means devices on the I²C bus can pull the line low, but not high. Pull-up resistors are needed to ensure signal levels return to HIGH properly.
- ✅ Most MAX30102 breakout boards include 4.7kΩ pull-ups on the SDA and SCL lines.
- ❌ If you’re using a raw sensor or a custom PCB, you must add them manually (typically 4.7kΩ–10kΩ between SDA/SCL and VCC).
- Ensure consistent pressure of the finger—too light or too hard will cause noise.
- Avoid motion during measurement.
- Use the Serial Plotter in Arduino IDE to observe the IR signal and fine-tune detection.
This project is open-source under the MIT License.
📌 Ahmed Attay 🔗 LinkedIn Profile