Return to Portfoliowebase.top / projects / smart-incubator
Completed2026Role: Embedded Firmware & IoT Engineer

Smart Infant Incubator

Autonomous Closed-Loop IoT Healthcare Station & Safety Engine

A safety-critical infant incubator integrating ESP32 firmware, physiological vitals monitoring, multi-sensor environmental safety loops, and remote MQTT telemetry with fail-safe local overrides.

1. The Engineering Problem

Traditional neonatal incubators are expensive, isolated medical units that lack real-time remote telemetry and predictive environmental alerts. In emergency power or sensor failure scenarios, premature infants are at immediate risk from hyperthermia, hypothermia, dehydration, or hazardous air quality. The engineering goal was building an affordable, intelligent prototype with dual fail-safes: local deterministic firmware logic that protects the infant even if internet connection drops, coupled with remote physician monitoring.

2. What Was Built

An ESP32-powered medical station reading live pulse rate and blood oxygen (MAX30102 PPG sensor), chamber temperature and humidity (DHT11), volatile organic compounds/air quality (MQ135), water basin levels, and incubator door switches. Actuators include a heating element, ventilation fan, ultrasonic humidifier, UV disinfection lamp, emergency buzzer, and RGB status lighting. All telemetry streams over MQTT to a centralized Node-RED control console.

3. System Architecture & Topology

ASCII Topology

Closed-loop cyber-physical system: sensor readings trigger real-time on-chip safety state machines. Readings publish over Wi-Fi via MQTT topics, allowing bidirectional control with persistent manual overrides.

+-----------------------------------------------------------------------+
|                           SENSORY LAYER                               |
|  - MAX30102: Heart Rate (BPM) & Blood Oxygen Saturation (SpO2)        |
|  - DHT11: Incubator Chamber Temperature & Relative Humidity           |
|  - MQ135: Air Quality & Toxic Gas Sensing                             |
|  - Reed Switch: Chamber Door Open/Close Detection                     |
|  - Water Level: Humidifier Reservoir Depletion Probe                  |
+------------------------------------+----------------------------------+
                                     | I2C / GPIO / ADC Readings
                                     v
+-----------------------------------------------------------------------+
|                    ESP32 FIRMWARE SAFETY ENGINE                       |
|  - Autonomous Closed-Loop Regulation (Heater / Fan / Humidifier)      |
|  - Hardcoded Trip Conditions: Critical Temp (>37.5°C) -> Cut Heater   |
|  - Low Water Protection: Disables Humidifier to Prevent Burnout       |
|  - Local Emergency Buzzer & RGB Alarm State Machine                   |
|  - Non-volatile storage of manual override parameters                 |
+------------------------------------+----------------------------------+
                                     | Bidirectional MQTT over Wi-Fi
                                     v (JSON Telemetry & Command Acks)
+-----------------------------------------------------------------------+
|                   NODE-RED CENTRAL MONITORING DASHBOARD               |
|  - Live Vitals Charts & Historical Trend Logging                      |
|  - Remote Chamber Setpoint Controls (Heater / Fan / UV sterilization) |
|  - Automated Alert Dispatch to Neonatal Nursing Staff                 |
+-----------------------------------------------------------------------+

4. Mohamed's Personal Implementation

Wrote the complete ESP32 C++ firmware in PlatformIO, implementing sensor polling and actuator PID/threshold regulation loops.
Interfaced the MAX30102 sensor using I2C, implementing peak-detection algorithms to derive real-time heart rate and SpO2 estimations.
Created MQTT pub/sub communications handling JSON telemetry payloads, command parsing, and status acknowledgement topics.
Designed the emergency fail-safe architecture: hardware watchdog timers and safety trips that shut off heating elements immediately upon over-temperature or water depletion regardless of network state.
Constructed the Node-RED visual dashboard displaying real-time sensor gauges, historical charts, and alert triggers.

5. Engineering Challenges & Solutions

Challenge: Ensuring Failsafe Operation During Wi-Fi Disconnection
Solution: Decoupled the physical safety logic entirely from the network task. The environmental regulation loop runs autonomously on-chip; if MQTT or Wi-Fi drops, the incubator continues regulating temperature and sounding local alarms.
Impact: Guaranteed 100% infant life-support reliability regardless of network availability.
Challenge: Noise Filtering on Physiological PPG Readings
Solution: Implemented moving-average digital filtering on the MAX30102 infrared and red wavelength reflectance signals to eliminate motion artifacts from infant movements.
Impact: Clean, reliable pulse and oxygen saturation metrics displayed on both OLED and dashboard.

6. Technology Stack

Microcontroller & Firmware
ESP32C / C++PlatformIOArduino Core
Sensors & Hardware
MAX30102 Pulse/SpO2DHT11MQ135Reed SwitchOLED Display
Actuation & Control
Relay ModulesCeramic HeaterDC FanHumidifierUV Sanitizer
Networking & Telemetry
MQTT ProtocolNode-REDPubSubClientJSON Serialization

7. Verified Outcomes

  • •Completed as the graduation project for the Pixels Egypt IoT program.
  • •Demonstrated automated temperature recovery and emergency buzzer cutoffs within 1.5 seconds of door opening or sensor thresholds.
  • •Earned official certification in IoT and embedded systems engineering.