Hardware + C++ Firmware · FreeRTOS

ESP32 Patient Vitals & Safety Monitor

An embedded vitals monitoring prototype built with an ESP32, a MAX30102 pulse oximeter, and a waterproof DS18B20 temperature probe. Runs non-blocking FreeRTOS tasks to sample PPG waveforms at 100 Hz, renders real-time readings on a local 128x64 OLED, fires hardware buzzer alarms on critical threshold breaches, and logs time-series data over Wi-Fi.

Role Hardware, Firmware (C++), Telemetry
Microcontroller ESP32 DevKit V1 (FreeRTOS)
Sensors MAX30102, DHT11, DS18B20
Buses & Protocols I2C (0x3C, 0x57), 1-Wire, Wi-Fi HTTP
System architecture & bus interfaces I2C + 1-Wire + 802.11 b/g/n
MAX30102 Sensor I2C: SDA (21), SCL (22) DHT11 + DS18B20 1-Wire Bus (GPIO 4) ESP32 Core (C++) Task 1: Sensor Poll (100 Hz) Task 2: FreeRTOS OLED View Task 3: Wi-Fi Telemetry SSD1306 OLED (I2C 0x3C) Wi-Fi HTTP REST Webhook Google Sheets Sync Dashboard Telemetry UI
SSD1306 OLED (0x3C) — FreeRTOS Task 2 SPO2: 98.4% [NOMINAL]
BPM: 74 [REGULAR] TEMP: 36.7 °C / AMB: 23.8 °C

What I Personally Built

This unit was developed from physical breadboard to soldered circuit board and firmware. My implementation covered electrical layout, firmware architecture, and cloud ingestion:

  • Hardware Wiring & Electrical Integration: Designed the circuit schematics coordinating dual I2C slaves (OLED screen and MAX30102) alongside a 1-Wire bus pull-up network (4.7kΩ on DS18B20) to ensure signal integrity without bus contention.
  • FreeRTOS Multitasking Firmware in C++: Partitioned the firmware into distinct FreeRTOS tasks pinned to ESP32 cores. Task 1 handles high-frequency ADC sampling of the PPG optical sensor; Task 2 drives the SSD1306 frame-buffer refresh; Task 3 asynchronously batches Wi-Fi telemetry packets.
  • Biometric Vitals Processing: Implemented signal filtering to identify cardiac systolic peaks from raw red and infrared LED photodiode reflections, converting AC/DC ratios into real-time SpO2 percentages.
  • Local Failsafe & Remote Telemetry: Implemented audible and visual alert thresholds directly in firmware so patients or caregivers receive immediate warnings even if internet connectivity drops. Simultaneously dispatched JSON payloads to Google Sheets and a clinical web interface.

Engineering Challenges & Solutions

1. Non-Blocking 1-Wire Conversion vs. 100 Hz Heart-Rate Sampling

The digital temperature probe (DS18B20) requires up to 750 ms to complete a 12-bit analog-to-digital conversion. Standard blocking reads froze the microcontroller core and caused missed pulses on the PPG heart-rate sensor.
Solution: Restructured the OneWire driver into an asynchronous non-blocking state machine using FreeRTOS software timers. The firmware triggers a temperature conversion request and retrieves the cached reading 750 ms later without stalling the vital signs sampling loop.

2. I2C Bus Lockup Recovery Under Sensor Movement

During patient movement, physical contact with the sensor wires occasionally caused the SDA line to be held low, locking the I2C hardware bus on the microcontroller.
Solution: Implemented an automated I2C bus recovery routine in firmware that detects timeout conditions, clocks SCL 9 times to release any hung slave device, and re-initializes the I2C peripherals cleanly without rebooting the ESP32.

Contact

I am open to internships, junior IoT roles, and firmware engineering opportunities.

If you are working on embedded hardware, connected devices, or backend telemetry, get in touch: