An ESP32-based heartbeat monitoring and alert system designed to monitor heart rate, display BPM information, and provide visual and audible alerts when the detected or simulated heart rate falls outside configurable thresholds.
This project combines embedded systems, sensor interfacing, real-time monitoring, alert handling, Python simulation, and Wokwi circuit simulation.
β οΈ Educational Project: This project is developed for educational and demonstration purposes only. It is not a medical diagnostic device.
The Heartbeat Monitor & Alert Embedded System is designed around an ESP32 microcontroller and a MAX30102 optical heart-rate sensor.
The system is intended to:
- Acquire heart-rate readings from the MAX30102 sensor.
- Process the sensor data.
- Calculate heart rate in BPM.
- Display BPM and status information on an OLED display.
- Detect LOW, NORMAL, and HIGH heart-rate conditions.
- Activate LEDs according to the detected condition.
- Activate a buzzer when an abnormal condition is detected.
- Provide software and Wokwi simulation modes for testing.
- Develop an ESP32-based heartbeat monitoring system.
- Interface the MAX30102 sensor with ESP32.
- Calculate and monitor BPM.
- Display heart-rate information using an OLED.
- Provide visual alerts using LEDs.
- Provide audible alerts using a buzzer.
- Implement configurable threshold-based alert logic.
- Demonstrate the system using software simulation and Wokwi.
- β€οΈ Heart-rate monitoring
- π BPM calculation
- π₯οΈ OLED display
- π’ Normal-condition indication
- π΄ Abnormal-condition indication
- π Audible buzzer alert
- βοΈ Threshold-based classification
- π§ͺ Python BPM simulation
- π Graphical monitoring interface
- ποΈ Potentiometer-based Wokwi simulation
- π ESP32 embedded implementation
- π» PlatformIO development environment
ββββββββββββββββββββ
β MAX30102 β
β Heart Rate Sensorβ
ββββββββββ¬ββββββββββ
β
βΌ
ββββββββββββββββββββ
β ESP32 β
β Microcontroller β
ββββββββββ¬ββββββββββ
β
βΌ
ββββββββββββββββββββ
β BPM Processing β
ββββββββββ¬ββββββββββ
β
βΌ
ββββββββββββββββββββ
β Threshold Logic β
ββββββββββ¬ββββββββββ
β
βββββββββββββββΌββββββββββββββ
β β β
βΌ βΌ βΌ
LOW NORMAL HIGH
β β β
βΌ βΌ βΌ
π΄ RED π’ GREEN π΄ RED
β β β
βΌ βΌ βΌ
π ON OFF π ON
β
βΌ
ββββββββββββββββββββ
β OLED Display β
β BPM + Status β
ββββββββββββββββββββ
| Component | Purpose |
|---|---|
| ESP32 DevKit | Main microcontroller |
| MAX30102 | Heart-rate sensing |
| OLED Display | BPM and status display |
| Green LED | Normal-condition indication |
| Red LED | Alert indication |
| Buzzer | Audible alert |
| Resistors | LED current limiting |
| Breadboard | Circuit prototyping |
| Jumper Wires | Component connections |
| Component | ESP32 Pin | Function |
|---|---|---|
| OLED SDA | GPIO 21 | IΒ²C Data |
| OLED SCL | GPIO 22 | IΒ²C Clock |
| Green LED | GPIO 25 | Normal indication |
| Red LED | GPIO 26 | Alert indication |
| Buzzer | GPIO 27 | Audible alert |
| Potentiometer | GPIO 34 | Simulated BPM input |
The MAX30102 communicates with the ESP32 through the IΒ²C interface.
MAX30102 SDA β ESP32 GPIO 21
MAX30102 SCL β ESP32 GPIO 22
The simulation uses the following demonstration thresholds:
| BPM Range | Status | Green LED | Red LED | Buzzer |
|---|---|---|---|---|
| Below 60 | LOW | OFF | ON | ON |
| 60β100 | NORMAL | ON | OFF | OFF |
| Above 100 | HIGH | OFF | ON | ON |
Note: These thresholds are demonstration values for this educational project and should not be interpreted as clinical or medical limits.
A Python-based simulation is included to test the alert logic without physical hardware.
Run:
python simulator/heartbeat_simulator.pyExample:
==========================================
HEARTBEAT MONITOR SOFTWARE SIMULATOR
==========================================
Enter BPM: 80
=============================================
HEARTBEAT MONITOR SYSTEM
=============================================
Heart Rate : 80 BPM
Status : NORMAL
LED : GREEN
Buzzer : OFF
=============================================
Enter BPM: 50
Heart Rate : 50 BPM
Status : LOW
LED : RED
Buzzer : ON
Enter BPM: 120
Heart Rate : 120 BPM
Status : HIGH
LED : RED
Buzzer : ON
A Python/Tkinter graphical interface is also included.
Run:
python simulator/heartbeat_monitor_gui.pyThe GUI provides:
- Current BPM display
- NORMAL status
- LOW ALERT status
- HIGH ALERT status
- Normal LED indicator
- Alert LED indicator
- Buzzer indicator
- Simulated BPM slider
- Live heartbeat waveform
- Start/Stop monitoring controls
The project also contains a Wokwi-based embedded simulation.
βββββββββββββββ
β ESP32 β
ββββββββ¬βββββββ
β
ββββββββββββββΌβββββββββββββ
β β β
βΌ βΌ βΌ
OLED Potentiometer LEDs
β
βΌ
Buzzer
The potentiometer is used as a simulated BPM input in the Wokwi environment.
- C++
- Arduino Framework
- ESP32
- MAX30102
- IΒ²C
- SSD1306 OLED
- PlatformIO
- Python
- Tkinter
- Wokwi
The embedded implementation uses:
SparkFun MAX3010x Pulse and Proximity Sensor Library
Adafruit GFX Library
Adafruit SSD1306
git clone https://github.com/VaishnavaDevi-R/Heartbeat-Monitor-Alert-Embedded-System.gitOpen the project folder in Visual Studio Code.
Install the PlatformIO IDE extension in VS Code.
Use:
PlatformIO
β Project Tasks
β esp32dev
β Build
python simulator/heartbeat_simulator.pypython simulator/heartbeat_monitor_gui.pyHeartbeat-Monitor-Alert-Embedded-System/
β
βββ src/
β βββ main.cpp
β βββ simulation/
β βββ main.cpp
β
βββ simulator/
β βββ heartbeat_simulator.py
β βββ heartbeat_monitor_gui.py
β
βββ screenshots/
β βββ wokwi-heartbeat-monitor-circuit.png
β βββ 01-normal-monitor.png
β βββ 02-low-heart-rate-alert.png
β βββ 03-high-heart-rate-alert.png
β βββ 04-wokwi-heartbeat-monitor-circuit.png
β
βββ test/
β βββ README.md
β
βββ diagram.json
βββ platformio.ini
βββ README.md
βββ LICENSE
βββ .gitignore
Input BPM : 80
Status : NORMAL
Green LED : ON
Red LED : OFF
Buzzer : OFF
Input BPM : 50
Status : LOW
Green LED : OFF
Red LED : ON
Buzzer : ON
Input BPM : 120
Status : HIGH
Green LED : OFF
Red LED : ON
Buzzer : ON
Heartbeat Signal
β
βΌ
Sensor Input
β
βΌ
ESP32 Processing
β
βΌ
BPM Calculation
β
βΌ
Threshold Analysis
β
βββββββββΌββββββββ
βΌ βΌ βΌ
LOW NORMAL HIGH
β β β
βΌ βΌ βΌ
Alert Normal Alert
β β β
βΌ βΌ βΌ
LED + Green LED +
Buzzer LED Buzzer
β
βΌ
OLED Display
This project is intended strictly for educational and embedded-systems demonstration purposes.
It is not intended to:
- Diagnose medical conditions.
- Replace professional medical equipment.
- Provide clinical decisions.
- Be used as a certified healthcare device.
The thresholds used in the simulation are demonstration values.
B.Sc. Digital & Cyber Forensic Science
Coimbatore, Tamil Nadu, India
This project is licensed under the MIT License.
See the LICENSE file for details.



