user-img

Rachana Jain

  • 8 Projects
  • 0 Followers
  • Dec 01,2026
+ Follow

ESP32 Patient Health Monitoring System with 7-Inch ESP32-P4

An ESP32-based patient health monitoring prototype using MAX30102, AD8232, and LM35 sensors. It transfers sensor data through RS485 to a 7-inch ESP32-P4 Smart HMI Display, where an interactive LVGL dashboard displays SpO₂, heart rate, ECG, respiration rate, and temperature.

ESP32 Patient Health Monitoring System with 7-Inch ESP32-P4
 
  • thumbnail-img
 

Story

This project demonstrates a multi-parameter patient health monitoring prototype built using an ESP32, three sensor modules, and a 7-inch ESP32-P4 Smart HMI Display.

The system collects different types of sensor data and transfers the measurements to a touchscreen dashboard using RS485 communication. It integrates the MAX30102 for SpO₂ estimation, the AD8232 for ECG signal acquisition and heart-rate calculation, and the LM35 for temperature measurement.

The display uses the LVGL graphics library to present the readings through an interactive interface. Users can select individual parameters from the main screen and open dedicated monitoring pages with graphs.

One important design feature is the separation of sensor acquisition and graphical processing. A dedicated ESP32 handles the sensors, while the ESP32-P4 display manages the dashboard. The two controllers communicate through TTL-to-RS485 converter modules.

Project Features

  • Multi-parameter monitoring using three sensor modules.

  • MAX30102-based SpO₂ estimation.

  • AD8232-based ECG acquisition and heart-rate calculation.

  • Respiration-rate estimation from the AD8232 ECG signal.

  • LM35-based temperature measurement.

  • RS485 communication between two ESP32 controllers.

  • 7-inch ESP32-P4 touchscreen dashboard with 1024 × 600 resolution.

  • LVGL-based graphical interface.

  • Individual screens for heart rate, SpO₂, temperature, respiration rate, and ECG waveform.

  • ECG waveform visualization with a 60-second data buffer.

Hardware Components

The following components are used in the prototype:

  • VIEWE ESP32-P4 Smart HMI Display – 7-inch, 1024 × 600 touchscreen

  • ESP32 DevKit C development board

  • MAX30102 pulse oximeter sensor

  • AD8232 ECG sensor module

  • ECG electrode pads

  • LM35 analog temperature sensor

  • Two TTL-to-RS485 converter modules

  • Two 4.7 kΩ resistors

  • Breadboard

  • Jumper wires

2. System Architecture

The project is divided into two main units.

Sensor-Side Unit

An ESP32 DevKit C acts as the sensor data-acquisition controller. It interfaces with the MAX30102, AD8232, and LM35.

The sensors use different interfaces:

  • MAX30102 communicates through I2C.

  • AD8232 provides an analog ECG output and digital lead-off signals.

  • LM35 provides an analog voltage proportional to temperature.

The ESP32 reads the sensor outputs, processes the required measurements, and responds to commands received from the display controller.

Display-Side Unit

The VIEWE ESP32-P4 Smart HMI Display acts as the main monitoring interface.

Its key specifications include:

  • ESP32-P4 dual-core RISC-V processor operating at 400 MHz.

  • ESP32-C6 wireless co-processor with Wi-Fi 6 and Bluetooth 5.

  • 7-inch MIPI-DSI IPS TFT display.

  • 1024 × 600 resolution.

  • Capacitive multi-touch.

  • RS485 interface.

  • LVGL graphics library support.

  • 32 MB PSRAM and 16 MB Flash.

  • USB Type-C connectivity.

The display receives measurement data from the sensor-side ESP32 and updates the LVGL dashboard.

Why Use Two Controllers?

The sensors could also be connected directly to the ESP32-P4 display controller. However, this project uses a separate ESP32 for sensor acquisition.

This architecture keeps sensor reading and processing independent of touchscreen interactions and graphical updates. It also allows the sensor firmware and display firmware to be developed and maintained separately.

The additional ESP32 is not essential for a single-node implementation, but the arrangement demonstrates how the system could be expanded with suitable device addressing and communication firmware.

Sensor Integration

MAX30102 Pulse Oximeter Sensor

The MAX30102 is an optical sensor that uses red and infrared LEDs along with a photodetector. It works using photoplethysmography (PPG), which detects changes in blood volume through variations in reflected light.

By processing the red and infrared light measurements, the system estimates blood oxygen saturation (SpO₂).

In this particular implementation, the MAX30102 is used for SpO₂ measurement. Heart rate is obtained separately from the AD8232 ECG signal.

ESP32 connections:

  • 3.3V → Vin

  • GND → GND

  • GPIO 22 → SCL

  • GPIO 21 → SDA

Two external 4.7 kΩ pull-up resistors are connected between SDA and 3.3V and between SCL and 3.3V.

Practical implementation observation

During development, the MAX30102 breakout board did not respond to an I²C address scan. The issue was traced to its onboard SDA and SCL pull-up resistors being connected to the internal 1.8V regulator instead of the 3.3V supply rail.

To resolve this issue, the onboard SDA and SCL pull-up resistors were removed and two external 4.7 kΩ pull-ups were connected to 3.3V. The INT pin was not used, so its onboard pull-up was left unchanged.

After this modification, the sensor was successfully detected and communicated with the ESP32 over I²C.

AD8232 ECG Sensor Module

The AD8232 is a single-lead ECG front-end module used to capture the electrical activity of the heart.

It detects low-amplitude electrical signals and provides a conditioned analog output that can be sampled by the ESP32. The module includes amplification and signal-conditioning circuitry to help acquire the ECG waveform.

It uses three electrodes:

  • RA – Right arm

  • LA – Left arm

  • RL – Right leg

ESP32 connections:

  • 3.3V → 3.3V

  • GND → GND

  • GPIO 34 → Output

  • GPIO 33 → LO−

  • GPIO 32 → LO+

The analog output is sampled through GPIO 34. GPIO 33 and GPIO 32 are used for lead-off detection. The SDN pin is not used in this project.

The ECG signal is used for waveform visualization and heart-rate calculation. The system also estimates respiration rate from the AD8232 ECG signal.

LM35 Temperature Sensor

The LM35 is an analog temperature sensor that provides an output voltage proportional to temperature.

Its sensitivity is 10 mV/°C, meaning the output voltage increases by approximately 10 mV for every 1°C increase in temperature.

ESP32 connections:

  • 5V → Vcc

  • GND → GND

  • GPIO 35 → Out

The ESP32 reads the analog output through its ADC and converts the voltage into a temperature reading.

RS485 Communication Between the Controllers

The sensor-side ESP32 and the ESP32-P4 display communicate through two TTL-to-RS485 converter modules.

The first converter changes the sensor controller's UART signals into differential RS485 signals. At the receiving end, the second converter converts the RS485 signals back into UART signals for the display controller.

Sensor-side connections:

  • 3.3V → Converter 3.3V

  • GPIO 16 → RX pin

  • GPIO 17 → TX pin

  • GND → GND

Display-side connections:

  • 3.3V → Converter 3.3V

  • GPIO 47 → RX pin

  • GPIO 46 → TX pin

  • GND → GND

The A+ and B− terminals of both converters are connected to their corresponding RS485 communication lines.

RS485 is used to demonstrate an expandable communication architecture. With suitable addressing and firmware, multiple sensor-side units could communicate with a central display. Direct UART communication would also be suitable for a simple one-to-one connection.

5. Command-Response Protocol

The ESP32-P4 display requests individual measurements from the sensor-side ESP32 using a predefined command-response format.

Command format:

[Slave_Address] [Command]

Example: 01 F1

Response format:

[Slave_Address] [Command] [Status] [Response Data byte 1] ... [Response Data byte n]

The commands used in this project are:

Command Measurement Sensor / Source Response data
0xF1 Heart rate AD8232 2 bytes, BPM × 10
0xF2 Respiration rate Estimated from AD8232 ECG 2 bytes, breaths/min × 10
0xF3 SpO₂ MAX30102 1 byte, percentage
0xF4 Temperature LM35 2 bytes, °C × 10
0xF5 ECG waveform AD8232 50 signed 16-bit samples

This protocol allows the display to request only the parameter needed for the currently selected monitoring screen.

For example, opening the heart-rate screen triggers command 0xF1. The sensor-side ESP32 processes the AD8232 signal and returns the heart-rate value.

For ECG visualization, the display sends command 0xF5 and receives 50 signed 16-bit waveform samples.

How the System Works

The complete data flow is as follows:

  1. The sensor-side ESP32 initializes the MAX30102, AD8232, LM35, and UART interface.

  2. The ESP32-P4 initializes the LVGL dashboard and RS485 communication.

  3. The display sends a command requesting a particular measurement.

  4. The sensor-side ESP32 checks the device address and command code.

  5. It reads or processes the corresponding sensor data.

  6. The sensor-side controller prepares the response using the defined data format.

  7. The response travels through the RS485 communication link.

  8. The ESP32-P4 receives and decodes the response.

  9. The corresponding measurement or waveform is updated on the display.

This request-response process allows the display to retrieve and present individual measurements as the user navigates through the interface.

7. LVGL Touchscreen Dashboard

The ESP32-P4 uses the LVGL graphics library to create an interactive monitoring interface.

The main screen provides access to separate parameter pages:

  • Heart rate

  • SpO₂

  • Temperature

  • Respiration rate

  • ECG waveform

When a user selects a parameter and presses the start button, the display sends the corresponding command to the sensor-side ESP32.

The received data is decoded and displayed on the selected screen. The display also maintains a buffer containing the latest 60 seconds of ECG samples, allowing the waveform to be visualized over time.

This approach keeps the main dashboard organized while allowing users to examine individual measurements through dedicated screens.

Software Requirements

The project uses separate development environments for the two controllers.

Sensor-side ESP32:

  • Arduino IDE version 2.3.9 or above

  • SparkFun_MAX3010x_Sensor_Library version 1.1.2

ESP32-P4 display:

  • Visual Studio Code version 1.144.0 or above

  • ESP-IDF extension version 2.3.0 or above

  • ESP-IDF version 5.5.5

  • Python version 3.11.2

  • LVGL port version 9.2.3

The sensor firmware runs on the ESP32 development board using Arduino IDE. The display firmware is developed using ESP-IDF in Visual Studio Code.

The original project package includes both firmware projects and their supporting source and configuration files.

Testing and Operation

After completing the hardware connections and uploading the firmware to both controllers, power on the system.

The ESP32-P4 initializes the LVGL interface and RS485 communication, then displays the main dashboard.

Select a parameter to open its dedicated screen:

Heart rate: Connect the AD8232 electrodes according to the module labels. Open the Heart Rate screen and press start. The display sends command 0xF1, and the sensor-side ESP32 returns the heart-rate value derived from the ECG signal.

SpO₂: Place a finger over the MAX30102 optical sensing area and keep it still. Open the SpO₂ screen and press start. The display sends command 0xF3 and receives the estimated oxygen saturation percentage.

Temperature: Open the Temperature screen and press start. The display sends command 0xF4 and receives the LM35 temperature reading.

ECG waveform: Connect the RA, LA, and RL electrodes according to the module instructions. Open the ECG screen and press start. The display sends command 0xF5 and receives the waveform samples.

Respiration rate: Open the Respiration Rate screen and request the measurement using command 0xF2. The value is estimated from the AD8232 ECG signal rather than measured using a separate respiration sensor.

The complete project tutorial, including hardware connections, sensor integration, communication details, and display implementation, is available on Play with Circuit.

Disclaimer: This is an educational electronics prototype intended for learning and demonstration. Its sensors, algorithms, and measurements have not been clinically validated and must not be used for medical diagnosis or treatment decisions.

Topic
View All

ESP32 Patient Health Monitoring System with 7-Inch ESP32-P4

An ESP32-based patient health monitoring prototype using MAX30102, AD8232, and LM35 sensors. It transfers sensor data through RS485 to a 7-inch ESP32-P4 Smart HMI Display, where an interactive LVGL dashboard displays SpO₂, heart rate, ECG, respiration rate, and temperature.

24
 
12
0
0

Share your project on social media to expand its influence! Get more people to support it.

  • Comments( 0 )
  • Like( 12 )
/1000
Upload a photo:
You can only upload 1 files in total. Each file cannot exceed 2MB. Supports JPG, JPEG, GIF, PNG, BMP

You May Also Like

View All
Add to cart
Board Type : GerberFile :
Layer : Dimensions :
PCB Qty :
Different PCB Design
PCB Thickness : PCB Color :
Surface Finish : Castellated Hole :
Copper Weight : 1 oz Production Time :
Total: US $
As a sharing platform, our community will not bear responsibility for any issues with this design and parameters.

PCB Assembly

PCBA Qty: BomFile:
NO. OF UNIQUE PARTS: NO. of Components:
Country: Shipping Way:
Assembly Cost: US $
As a sharing platform, our community will not bear responsibility for any issues with this design and parameters.
Add to cart
3dPrintingFile : Size :
Unit : Volumn :
3D Printing Qty : Material :
Total: US $12.99
As a sharing platform, our community will not bear responsibility for any issues with this design and parameters.
Add to cart
Acrylic Type : AcrylicFile :
Dimensions: Engrave:
Acrylic Qty :
Acrylic Thickness:
Acrylic Color:
Total: US $12.99
As a sharing platform, our community will not bear responsibility for any issues with this design and parameters.
Add to cart
CNC Milling File : Size:
Unit: Volumn:
CNC Milling Qty : Material:
Type of Aluminum: Surface Finish:
Tolerance:
Surface Roughness:
Total: US $12.99
As a sharing platform, our community will not bear responsibility for any issues with this design and parameters.
Add to cart
Item Price Qty Subtotal Delete
Total: US $0.00
Certified Product | Guaranteed Purchase: Full techsupport