Emogotchi is a closed-loop system designed to combat student burnout. By fusing physiological data with environmental sensors, we utilize cloud-based LSTM neural networks to predict stress and actively improve the user's environment.
BPM & Motion
Noise, Light, Temp
LSTM Model
Automated Home
The system operates on a Publish/Subscribe model using MQTT. Data flows from the Edge (Sensors) to the Cloud (Processing) and back to the Edge (Feedback/Actuation), ensuring real-time responsiveness.
A key technical achievement is the implementation of FreeRTOS. A traditional "Super Loop" would fail to handle the 50ms sampling rate of the pulse sensor alongside blocking Wi-Fi operations. We utilized Core Pinning and Mutexes to ensure stability.
Dedicates high-priority processing to `Task_HeartRate` (50ms) and `Task_Sound`, ensuring no data loss during sampling.
Offloads heavy `Task_UploadData` and `Task_MQTT_Loop` to the secondary core, preventing Wi-Fi lag from freezing the UI.
Solved critical race conditions on the shared ADC (Analog-to-Digital Converter) and I2C bus using `adcMutex` and `i2cMutex`.
Distribution of RTOS tasks across physical ESP32 cores.
User stress is cumulative, not instantaneous. To capture this temporal dependency, we moved beyond simple Random Forest classifiers and implemented a Long Short-Term Memory (LSTM) neural network.
Transitioning from HTTP Polling to MQTT Push significantly reduced command latency.
Using FreeRTOS `vTaskDelay` allows the CPU to sleep between sensor ticks.