Inspiration
BioWake was inspired by a gap in modern sleep technology: most consumer devices observe sleep, but very few attempt to interact with it in real time. Clinical systems like polysomnography (PSG) provide highly accurate sleep staging using signals such as EEG, but they are expensive, intrusive, and impractical for daily use.
After reviewing related research, we saw a clear tradeoff: High accuracy (EEG-based systems) vs. High usability (PPG, accelerometer-based wearables) BioWake was built to explore this tradeoff, leveraging accessible sensors and edge AI to create a system that is both practical and intelligent. The goal is not to replicate PSG, but to push wearable sleep tech toward closed-loop interaction, where detection leads directly to action.
What it does
At runtime, BioWake operates as a continuous sensing and inference loop running at approximately 100 Hz. The ESP32 collects synchronized data streams from all sensors—GSR (analog), PPG (heart rate/SpO₂ via I2C), and accelerometer data (motion vectors via I2C). These signals are buffered and transformed into feature windows, where short time-series segments are processed to extract meaningful patterns such as heart rate variability, motion intensity, and skin conductance trends. The feature vector is then passed into the embedded neural network, which outputs a probability distribution over sleep stages. The system selects the most probable state. This predicted state feeds directly into a state machine that determines behavior in real time. Depending on the detected stage, the device can log data locally to an SD card, transmit summaries over Wi-Fi, or trigger Bluetooth-based actions (e.g., pausing audio during light sleep). Because all inference happens locally on the microcontroller, the system maintains low latency and does not depend on cloud connectivity, enabling reliable overnight operation and true closed-loop responsiveness.
How we built it
The system is divided into three tightly integrated components:
Wearable Hardware: We designed a custom wearable built around an ESP32-S3 microcontroller. The device integrates multiple sensing modalities identified in the literature as viable for wearable sleep staging: Photoplethysmography (PPG) → heart rate & SpO₂ Accelerometer (MPU6050) → movement & sleep activity Galvanic Skin Response (GSR) → electrodermal activity These sensors are connected over a shared I2C bus and mounted onto a flexible, body-worn platform designed to remain stable over an 8-hour sleep cycle.
Data Pipeline & Ground Truth Alignment: To train our model, we created a pipeline that aligns: High-frequency sensor data (~100 Hz), with low-frequency labeled sleep stages. Using Python tools like pandas, we implemented timestamp alignment. This produces a labeled dataset suitable for supervised learning, effectively turning consumer sleep tracking into a “teacher” for our model.
Edge AI on the ESP32: We trained a lightweight neural network using Edge Impulse to classify: . Awake . Light Sleep . Deep Sleep . REM The trained model is deployed directly onto the ESP32, enabling real-time inference without cloud dependency.
This allows the system to operate as a closed-loop controller, where: Sensor Input→Feature Extraction→Model Inference→Action For example, when the system detects a transition into light sleep, it can trigger a Bluetooth command to pause media or initiate other interventions.
Challenges we ran into
Hardware Reliability: Maintaining stable electrical connections during sleep was a major issue. Movement introduces mechanical stress, making strain relief and flexible wiring essential.
Signal Noise & Quality: Wearable sensors—especially PPG and GSR—are highly sensitive to motion artifacts, leading to noisy data that complicates classification.
Limited Ground Truth Accuracy: Consumer sleep staging is not as accurate as PSG, meaning our model learns from imperfect labels.
Power & Performance Constraints: Running continuous sensing, logging, and inference for 8+ hours required careful power management and efficient firmware design.
Model Generalization: Sleep patterns vary significantly between individuals, making it difficult to train a model that generalizes well across users.
What we learned
This project highlighted several key insights: . Sensor tradeoffs are unavoidable . As supported by the research, no single wearable-friendly sensor can fully replicate EEG-level accuracy. Combining modalities improves performance but increases complexity. . Data alignment is harder than modeling . Synchronizing noisy, high-frequency sensor data with sparse ground-truth labels required careful handling of timestamps and edge cases. . Edge AI requires constraint-driven design . Deploying models on microcontrollers forced us to optimize for memory, latency, and power consumption, not just accuracy. . Real-time systems demand deterministic code . Writing non-blocking firmware (using millis() instead of delay()) was critical to maintaining a stable 100 . Hz sampling rate.


Log in or sign up for Devpost to join the conversation.