Skip to content

Latest commit

Β 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

❀️ Heartbeat Monitor & Alert Embedded System

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.


πŸ“Œ Project Overview

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.

🎯 Objectives

  • 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.

✨ Features

  • ❀️ 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

🧠 System Architecture

                     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                     β”‚     MAX30102     β”‚
                     β”‚ Heart Rate Sensorβ”‚
                     β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚
                              β–Ό
                     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                     β”‚      ESP32       β”‚
                     β”‚  Microcontroller β”‚
                     β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚
                              β–Ό
                     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                     β”‚  BPM Processing  β”‚
                     β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚
                              β–Ό
                     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                     β”‚ Threshold Logic  β”‚
                     β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚
                β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                β”‚             β”‚             β”‚
                β–Ό             β–Ό             β–Ό
              LOW          NORMAL          HIGH
                β”‚             β”‚             β”‚
                β–Ό             β–Ό             β–Ό
             πŸ”΄ RED        🟒 GREEN       πŸ”΄ RED
                β”‚             β”‚             β”‚
                β–Ό             β–Ό             β–Ό
             πŸ”” ON          OFF          πŸ”” ON
                              β”‚
                              β–Ό
                     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                     β”‚   OLED Display   β”‚
                     β”‚   BPM + Status   β”‚
                     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ”§ Hardware Components

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

πŸ”Œ Pin Configuration

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

MAX30102

The MAX30102 communicates with the ESP32 through the IΒ²C interface.

MAX30102 SDA β†’ ESP32 GPIO 21
MAX30102 SCL β†’ ESP32 GPIO 22

🚦 Alert Logic

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.


πŸ–₯️ Software Simulation

A Python-based simulation is included to test the alert logic without physical hardware.

Command-Line Simulator

Run:

python simulator/heartbeat_simulator.py

Example:

==========================================
   HEARTBEAT MONITOR SOFTWARE SIMULATOR
==========================================

Enter BPM: 80

=============================================
       HEARTBEAT MONITOR SYSTEM
=============================================
Heart Rate : 80 BPM
Status     : NORMAL
LED        : GREEN
Buzzer     : OFF
=============================================

LOW Condition

Enter BPM: 50

Heart Rate : 50 BPM
Status     : LOW
LED        : RED
Buzzer     : ON

HIGH Condition

Enter BPM: 120

Heart Rate : 120 BPM
Status     : HIGH
LED        : RED
Buzzer     : ON

πŸ–₯️ Graphical Monitoring Interface

A Python/Tkinter graphical interface is also included.

Run:

python simulator/heartbeat_monitor_gui.py

The 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

πŸ§ͺ Wokwi Simulation

The project also contains a Wokwi-based embedded simulation.

Simulated Components

                β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                β”‚    ESP32    β”‚
                β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
                       β”‚
          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
          β”‚            β”‚            β”‚
          β–Ό            β–Ό            β–Ό
        OLED     Potentiometer    LEDs
                                   β”‚
                                   β–Ό
                                Buzzer

The potentiometer is used as a simulated BPM input in the Wokwi environment.

Wokwi Circuit

Wokwi Heartbeat Monitor Circuit


πŸ› οΈ Technologies Used

  • C++
  • Arduino Framework
  • ESP32
  • MAX30102
  • IΒ²C
  • SSD1306 OLED
  • PlatformIO
  • Python
  • Tkinter
  • Wokwi

πŸ“¦ Libraries

The embedded implementation uses:

SparkFun MAX3010x Pulse and Proximity Sensor Library
Adafruit GFX Library
Adafruit SSD1306

πŸš€ Getting Started

1. Clone the Repository

git clone https://github.com/VaishnavaDevi-R/Heartbeat-Monitor-Alert-Embedded-System.git

2. Open the Project

Open the project folder in Visual Studio Code.

3. Install PlatformIO

Install the PlatformIO IDE extension in VS Code.

4. Build the ESP32 Firmware

Use:

PlatformIO
β†’ Project Tasks
β†’ esp32dev
β†’ Build

5. Run the Python Simulator

python simulator/heartbeat_simulator.py

6. Run the Graphical Simulator

python simulator/heartbeat_monitor_gui.py

πŸ“ Project Structure

Heartbeat-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

πŸ§ͺ Test Cases

Test Case 1 β€” Normal Heart Rate

Input BPM : 80
Status    : NORMAL
Green LED : ON
Red LED   : OFF
Buzzer    : OFF

Test Case 2 β€” Low Heart Rate

Input BPM : 50
Status    : LOW
Green LED : OFF
Red LED   : ON
Buzzer    : ON

Test Case 3 β€” High Heart Rate

Input BPM : 120
Status    : HIGH
Green LED : OFF
Red LED   : ON
Buzzer    : ON

πŸ“Š Monitoring Workflow

        Heartbeat Signal
               β”‚
               β–Ό
          Sensor Input
               β”‚
               β–Ό
          ESP32 Processing
               β”‚
               β–Ό
          BPM Calculation
               β”‚
               β–Ό
        Threshold Analysis
               β”‚
       β”Œβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”
       β–Ό       β–Ό       β–Ό
      LOW    NORMAL    HIGH
       β”‚       β”‚        β”‚
       β–Ό       β–Ό        β–Ό
     Alert   Normal    Alert
       β”‚       β”‚        β”‚
       β–Ό       β–Ό        β–Ό
    LED +    Green     LED +
    Buzzer     LED     Buzzer
               β”‚
               β–Ό
          OLED Display

πŸ“Έ Project Screenshots

Wokwi Circuit

Wokwi Circuit

Normal Monitoring

Normal Monitoring

Low Heart Rate Alert

Low Heart Rate Alert

High Heart Rate Alert

High Heart Rate Alert


πŸ” Safety & Disclaimer

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.


πŸ‘©β€πŸ’» Author

Vaishnava Devi R

B.Sc. Digital & Cyber Forensic Science

Coimbatore, Tamil Nadu, India


πŸ“„ License

This project is licensed under the MIT License.

See the LICENSE file for details.

About

ESP32-based heartbeat monitoring and alert system using MAX30102 with OLED display, LED indicators, buzzer alerts, and a software simulation for educational testing.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages