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