Architecture & Hardware Integration
At the heart of the system sits a hardware pairing of an ESP8266 and an Arduino Mega coupled via a robust DIP switch configuration. This hybrid controller acts as the central classroom node. The Arduino handles the heavy array of analog and digital I/O, while the ESP8266 runs the ESP8266WebServer, seamlessly serving static dashboard files and managing local network traffic directly from the edge.
Security and alerting were integrated natively without heavy cloud middleware. The microcontroller firmware establishes direct Discord Webhookconnections, securely transmitting real-time security alerts and critical environmental threshold breaches straight to the administration's encrypted chat channels. The wider mesh relies on JSON-over-Bluetooth coordination and mDNS discovery so nodes can find each other with minimal setup friction.
Hybrid AI Prediction Engine
Rather than relying on simple threshold triggers, the system deploys a client-side TensorFlow.js (TF.js) prediction model. This model runs entirely in the browser, continuously ingesting data to predict necessary environmental actions based on an advanced matrix of 14 parameters.
The primary data feed relies on a live MH-Z14A CO2 sensor, engineered with a robust UART/PWM fallback mechanism to guarantee uninterrupted operation. When the model evaluates the sensor data against its multi-parameter matrix and detects an impending air quality saturation issue, the control loop automatically triggers networked servo motors to crack open windows, pre-emptively restoring air quality before students notice any degradation.
Key Highlights
- Designed and implemented ESP8266 + Arduino Mega sensor network for real-time environmental monitoring
- Developed hybrid AI architecture combining TensorFlow.js for client-side CO2 prediction
- Implemented JSON-over-Bluetooth protocol for low-latency device communication
- Integrated Discord Webhooks for real-time alert notifications
- Implemented mDNS for automatic device discovery on the network
- Achieved accurate CO2 saturation predictions using time-series analysis