AirVita: Context-Aware Environmental Health Monitoring

Authors: Ethan Herstedt, Lucas Rettig, Ian Palmroos, Tyler Leslie

Inspiration and Vision

We spend approximately 90% of our lives indoors, yet the environmental factors that actively impact our cognitive focus and long-term physiological health remain largely invisible. The AirVita project was born from a desire to bridge this visibility gap. Our vision was to create a unified standard for environmental health that translates raw atmospheric data into tangible human impact. We aimed to build a system that moves beyond static data collection by understanding the user's specific context and adjusting its recommendations accordingly.

System Overview

AirVita is a context-aware monitoring system that transforms invisible indoor metrics into actionable intelligence. Unlike traditional air quality monitors that provide fixed thresholds, AirVita utilizes a mobile-paired computer vision layer to classify the room environment. By identifying whether a user is in a bedroom, office, or social space, the system dynamically shifts its internal baseline to match the ideal conditions for that specific activity. This context-awareness is powered by Gemini 2.0 Flash, which serves as a research-backed health expert, providing synthesized summaries based on global environmental standards.


Technical Architecture

Physical Layer and Edge Computing

The system is built on a distributed hub-and-node architecture designed for building-wide deployment. At the edge, Raspberry Pi Pico nodes perform high-frequency polling of seven distinct metrics. These nodes utilize the Bosch BME688 sensor, employing a forced-mode measurement cycle with dynamic heater resistance calibration. To meet the requirements for real-time physical response, the nodes are equipped with an LCD status display and a NeoPixel array that provides ambient visual feedback—for example, transitioning to a high-visibility "Rainbow Wave" mode when light levels exceed 200 lux to signal optimal working conditions.

Adaptive Scoring and Neural Logic

At the core of the AirVita intelligence layer is a Multilayer Perceptron (MLP) Neural Network built with Scikit-Learn. This network evaluates environmental stability to generate a base health index. To account for hazardous particulates, we implement a Hybrid Penalty Logic that adjusts the neural network output based on real-time PM2.5 concentrations. Audio metrics are processed via an I2S microphone using real-time RMS and Peak analysis to filter out transient glitches and ensure accurate decibel calibration.

The final Health Index \(H\) is calculated through a composite of weighted sub-scores, adjusted by context-specific multipliers:

$$H = \sigma\left(\sum(w_i x_i) + b\right) \times C_{room} + (PM_{2.5} \times C_{particles})$$

Each sub-score \(S_i\) is derived using a linear decay model. Given an ideal range \([I_{low}, I_{high}]\) and an absolute range \([A_{min}, A_{max}]\), the score remains at 100 within the ideal range and decays to 0 as it approaches the absolute limits. The weighting for the general health score is prioritized as follows: Particulates (40%), Noise (20%), Temperature (15%), Humidity (10%), Light (10%), and Pressure (5%).

Contextual Intelligence and AI Synthesis

The intelligence layer includes a specialized Room Scanner that utilizes Places365 computer vision to lock the environmental context. This context is then injected into the Gemini 2.0 Flash model, which acts as the system's "Environmental Health Expert." Gemini analyzes current readings against ASHRAE Standard 55 for thermal comfort and WHO 2021 guidelines for air quality.

To aid in development and verification, we built a comprehensive Diagnostic Simulation Suite. This allows the system to be stress-tested against extreme preset scenarios—such as a "California Wildfire" (high particulates) or "Everest Peak" (low pressure)—to ensure the scoring logic and Gemini recommendations remain accurate across all possible real-world environments.


Context Engineering and Privacy

Temporal Stability and Object Detection

The visual intelligence layer is designed for environmental stability. Rather than relying on a single-frame inference, AirVita employs Temporal Hysteresis—a majority-voting logic that evaluates a sliding window of the last 25 classification frames. A stable room label is only confirmed when a 60% majority is reached, preventing "label flickering" in complex environments. Simultaneously, a MobileNetV3-Large object detection pass identifies specific environmental markers (e.g., electronic equipment in an office vs. bedding in a dormitory) to further refine the scoring multiplier.

Privacy-First Architecture

Privacy is central to the AirVita design philosophy. The Room Scanner captures frames as transient, in-memory base64 buffers. These frames are processed in real-time and immediately discarded after classification; no visual data is ever written to persistent storage or exposed outside the local inference cycle. This ensures that users gain the benefit of context-aware health monitoring without compromising the privacy of their personal spaces.


Development Challenges and Milestones

One of the primary technical hurdles was integrating seven distinct hardware metrics into a single, reliable Unified Score. Calibrating the neural network to ignore transient data noise while remaining sensitive to genuine air quality shifts required significant fine-tuning. We also developed a Smart Caching Engine to manage API rate limits; the system only triggers a new Gemini analysis when sensor drift exceeds specific thresholds, such as a 2°C temperature shift or a 3-point change in the health score.

We are particularly proud of the advanced telemetry dashboard, which features a Spider Chart (Radar Matrix) for high-level activity monitoring. This provides a multi-axis visualization of how the current environment impacts Sleep, Work, and Social activities simultaneously.

Future Roadmap

In the immediate future, we plan to implement granular building mapping visualizations, allowing users to view a real-time heat map of environmental health across multiple rooms. We are also preparing to integrate experimental hardware modules discovered during our prototype phase:

  • Audible Alert Infrastructure: Implementing localized sirens using piezo buzzers (tested in GP15 development) for critical air quality notifications.
  • Occupancy-Aware Management: Integrating Passive Infrared (PIR) and IR sensors to enable automated power-saving modes when rooms are vacant.
  • High-Density Visual Arrays: Expanding the current NeoPixel feedback from 8-LED rings to 16-LED high-density arrays for more granular health "level" indicators.
  • LoRa Communication Migration: Transitioning from USB-serial bridges to LoRa (Long Range) protocols to enable multi-kilometer wireless data transmission in concrete-dense environments.
  • Hardware Platform Expansion: Migrating to the ESP32 platform to leverage dual-core processing and native Wi-Fi/Bluetooth connectivity for untethered deployments.
  • Production-Ready Enclosures: Designing and 3D printing custom, ventilated industrial enclosures to protect sensitive sensor arrays in high-traffic production environments.
  • Predictive Health Trends: Utilizing historical data to warn users of hazardous spikes before they occur, moving from reactive monitoring to proactive protection.

Technical Specifications

Category Component Implementation
Artificial Intelligence Gemini 2.0 Flash Lite Expert Health Synthesis (via Google GenAI SDK)
Places365 (ResNet-18) Convolutional Neural Network for Scene Classification
Object Detection MobileNetV3-Large (Faster R-CNN) for context markers
Predictive Logic Scikit-Learn Multilayer Perceptron (MLP) Neural Network
Hardware & Edge Raspberry Pi Pico Edge Processing Node (Dual-core ARM Cortex-M0+)
Raspberry Pi 4B Central FastAPI Hub & Dockerized Infrastructure
MicroPython Real-time Edge Firmware & Serial Bridging
Peripheral Sensors Bosch BME688 Precision Temperature, Humidity, and VOC Gas Resistance
BH1750 (GY-302) High-precision Ambient Light Level (Lux) Monitoring
PMS5003 Plantower Laser PM2.5/PM10 Particulate Mass Sensing
INMP441 High-fidelity I2S Omnidirectional Digital Microphone
Communication Protocols I2C (Sensors), I2S (Audio), UART (PM2.5), One-Wire (Neo)
Secure Pairing PyOpenSSL Handshakes & QR-Link Transient Verification
Software Backend FastAPI & Uvicorn High-performance Asynchronous Routing & Serial Bridge
Data Science Stack Pandas, Numpy, and Joblib for Model Persistence
Containerization Multi-service Orchestration via Docker Compose
Frontend & UI React & Vite Real-time Responsive Dashboard Architecture
Visualizations SVG-driven Radar Matrices & History Area Charts
Styling Tailwind CSS 4.0 for Premium Industrial Aesthetics

Built With

Share this project:

Updates