🩺 IoT Patient Health Tracker
A wearable smart health system using ESP32 to monitor real-time heart rate, SpO2, and temperature.
Overview
Wearable health devices are revolutionizing modern medicine. In this project, we pair the ESP32 with the MAX30102 pulse oximeter and DS18B20 temperature sensor to track real-time vitals.
What you'll learn: Integrating I2C sensor modules, analog skin-temperature reading, publishing data asynchronously to a web dashboard, and OLED UI layouts.
Estimated time: 2-3 hours. Difficulty: ⭐⭐⭐⭐ Advanced.
Components Needed
| Component | Specification | Qty | Notes |
|---|---|---|---|
| ESP32 Development Board | 3.3V Logic, WiFi/BLE | 1 | NodeMCU or similar |
| MAX30102 PPG Sensor | I2C Interface | 1 | Heart Rate & SpO2 |
| DS18B20 Temp Sensor | One-Wire Protocol | 1 | Waterproof skin contact |
| 0.96" OLED Display | I2C (SSD1306) | 1 | Local vitals layout |
| Active Buzzer & LED | 5V/3.3V | 1 | Emergency alarms indicator |
Step-by-Step Tutorial
1
I2C Bus Interfacing
Wire the MAX30102 and OLED display in parallel to the ESP32 I2C pins: SDA (GPIO 21) and SCL (GPIO 22). Give them 3.3V and GND.
2
One-Wire Temp Sensor Connection
Connect DS18B20 VCC to 3.3V, GND to GND, and Data to GPIO 4. Connect a 4.7k pull-up resistor between Data and VCC.
3
Install Firmware Libraries
Open Arduino Library Manager and install
SparkFun MAX3010x, DallasTemperature, and Adafruit SSD1306.4
Establish Web Interface
Create a local asynchronous web server on the ESP32 that hosts a responsive dashboard displaying charts for heart rate and SpO2 levels.
5
Calibrate & Test Vitals
Place your finger gently on the MAX30102 sensor. Calibrate the DSP filter to eliminate noise from skin movement.
The MAX30102 PPG sensor requires a high-quality, noise-free power supply. Ensure your ESP32 uses a stable source, and place a decoupling capacitor close to the sensor if readings jitter.
Code / Configuration
health_tracker.ino
INO
// IoT Vitals Monitor - Volt X
#include <WiFi.h>
#include <ESPAsyncWebServer.h>
#include <Wire.h>
#include "MAX30105.h"
#include <OneWire.h>
#include <DallasTemperature.h>
const char* ssid = "YOUR_WIFI_SSID";
const char* password = "YOUR_WIFI_PASSWORD";
MAX30105 particleSensor;
OneWire oneWire(4);
DallasTemperature tempSensor(&oneWire);
AsyncWebServer server(80);
float bodyTemp = 0.0;
int heartRate = 75;
void setup() {
Serial.begin(115200);
Wire.begin();
if (!particleSensor.begin(Wire, I2C_SPEED_FAST)) {
Serial.println("MAX30102 not found!");Reviews & Ratings
—0 reviews
Sign in to leave a review
Loading reviews...