This project utilizes a MAX30102 pulse sensor and an SSD1306 OLED display to measure and display heart rate data (BPM) in real-time. It calculates both instantaneous and average heart rates, providing visual feedback on the OLED screen and serial output.
- Real-time heart rate monitoring using MAX30102 sensor
- Display of IR value, current BPM, and average BPM on OLED
- Finger detection alert (no finger placement)
- Data output via Serial Monitor (115200 baud)
- ESP32 development board (e.g.,
ESP32-S3-DevKitC-1-N16R8V
orESP-WROVER-KIT
) - MAX30102 Pulse & Proximity Sensor
- SSD1306 OLED Display (128x64 pixels, I2C)
- Jumper wires and breadboard
MAX30102/SSD1306 | ESP32 Board |
---|---|
VCC | 3.3V |
GND | GND |
SDA | GPIO21 (default SDA) |
SCL | GPIO22 (default SCL) |
Note: Verify I2C pins for your specific ESP32 board variant.
-
PlatformIO Setup
- Install PlatformIO for your IDE (VSCode recommended).
- Clone this repository.
- Open the project in PlatformIO.
-
Dependencies
Libraries will be automatically installed by PlatformIO: -
Upload Code
- Connect your ESP32 via USB.
- Build and upload the code using PlatformIO.
- Power the board and ensure proper sensor connections.
- Place your index finger firmly on the MAX30102 sensor.
- View real-time data on:
- OLED Display: Shows IR value, current BPM, and average BPM.
- Serial Monitor: Outputs the same data at 115200 baud rate.
- Sensor Averaging: Adjust
RATE_SIZE
in the code to change the number of readings averaged (default: 4). - I2C Addresses:
- OLED: Default
0x3C
(update indisplay.begin()
if different). - MAX30102: Automatically detected.
- OLED: Default
- Sensor Not Detected:
- Check I2C connections and power supply.
- Ensure no conflicts with other I2C devices.
- No Display Output:
- Confirm OLED I2C address (try
0x3D
if0x3C
fails).
- Confirm OLED I2C address (try
- Inconsistent Readings:
- Ensure steady finger pressure on the sensor.
- Avoid ambient light interference.
MIT License. See LICENSE for details.