The focus of this project is real time Air Quality Monitoring (AQI) within indoor environment using a hybrid Edge–Fog–Cloud architecture. The edge node is an ESP32 microcontroller and PMS5003 particulate matter sensor pair that collects, and preprocesses data for air quality, including PM1.0, PM2.5 and PM10 concentration. Data collected from the edge node is sent to a local Fog node that consists of an InfluxDB instance running in Docker container which gives the advantage of low latency data storage, processing and real-time alerts generation. In order to scale and ensure long term analytics, the fog node writes the data to an InfluxDB Cloud instance to store the data long time and make it remote available. Dashboard with InluxDB’s native visualization tools helps to get current and historical air quality trends. The Fog layer monitors continuously and remains resilient in the case of network outages while the Cloud layer is for large scale data analysis and report generation. The system responsiveness is optimized with this hybrid architecture, so as to reduce the reliance on external networks to carry out critical operations and to achieve a scalable solution for indoor air quality management. In future, multi room expansion, more advanced alerting mechanisms and predictions of air quality deterioration are also expected.
Introduction
I. Introduction & Need
With urbanization and increased indoor time, maintaining healthy indoor air quality (IAQ) is critical—especially as PM1.0, PM2.5, and PM10 pollutants affect respiratory health. Traditional air quality monitoring systems are cloud-dependent, causing latency and internet reliance. To solve this, a hybrid Edge–Fog–Cloud system is proposed for real-time, resilient, and scalable indoor air quality monitoring and alerting.
II. System Overview
Edge Layer:
Hardware: ESP32 microcontroller + PMS5003 sensor.
Function: Captures PM data, smooths/filter readings, calculates AQI, and transmits to Fog layer via Wi-Fi.
Benefits: Low latency, local decision-making, reduced bandwidth usage.
Fog Layer:
Hardware: Local server with InfluxDB in a Docker container.
Function: Temporarily stores AQI data, provides real-time visualization, dashboarding, and alerts. Operates independently of internet connectivity.
Cloud Layer:
Service:InfluxDB Cloud for long-term storage, analytics, and remote monitoring.
Function: Periodic replication of data from Fog, supports historical trend analysis and stakeholder access.
III. Literature Review Highlights
Previous works explored Edge–Fog–Cloud architectures, but with limitations:
Focused on outdoor or industrial settings.
Lacked multi-layer architecture for indoor monitoring.
Didn’t integrate real-time alerting, fault tolerance, or fog-based processing.
The proposed system addresses these gaps by enabling local resilience, real-time responsiveness, and cloud analytics, making it ideal for indoor environments like homes, hospitals, or offices.
IV. Proposed Methodology
A. Sensor Data Collection
PMS5003 uses laser scattering to detect PM1.0, PM2.5, PM10.
ESP32 reads via UART, timestamps, and stores raw data for processing.
B. Edge Processing
Filters anomalies, averages readings, calculates AQI based on EPA standards.
Reduces false alarms, ensures meaningful alerts, and lowers data transmission loads.
C. Fog Node
InfluxDB stores data for short-term.
Triggers real-time alerts upon AQI threshold breach.
Ensures system functions offline during internet failures.
D. Cloud Node
InfluxDB Cloud stores replicated data from Fog.
Supports historical analysis, trend detection, and multi-site comparisons.
V. Latency Analysis
Edge Processing Latency: < 50 ms (due to light computations).
Fog Layer Latency: < 50 ms (Wi-Fi + local DB storage).
Cloud Synchronization Latency: Variable (5–10 mins acceptable for historical storage).
VI. Architecture Overview
Three-tier model:
Edge (ESP32 + PMS5003): Local AQI computation.
Fog (Local Server + InfluxDB Docker): Dashboard, alerting, offline continuity.
Cloud (InfluxDB Cloud): Long-term storage and advanced analytics.
This structure balances real-time performance, reliability, and scalability.
VII. Hardware Flow & Data Path
Sensor data → ESP32 → AQI Computation → Transmit to Fog → Store + Alert → Sync to Cloud.
Data pipeline is fault-tolerant: In case of failure, syncing resumes automatically.
VIII. Results & Discussion
The system successfully monitors indoor AQI in real time.
Local alerts are generated promptly when air quality is hazardous.
Scalable to multiple environments with efficient data handling and minimal latency.
Ideal for smart environments, offering both real-time action and historical insight.
Conclusion
Indoor AQI monitoring with the proposed hybrid edge–fog–cloud architecture is successfully combined by combining the strengths of low latency local processing and scalable cloud storage. PMS5003, the ESP32 are used at the edge to capture the critical air quality parameter and process in real time to generate alerts and quick response for deteriorating air conditions. A fog layer provided by a Dockerized InfluxDB system optimizes local data handling and analytics; with periodic synchronization to the InfluxDB Cloud, securely stored old data is processed. The experimental results validate the reliability, responsiveness and the suitability to be deployed in smart homes, offices and resource constrained environment.
As part of future enhancements, machine learning models could actually be incorporated in the fog or cloud layers to leverage the capability of the models to perform predictive analytics, like predicting air quality trends and predicting ventilation actions. The system can be further expanded to support more environmental parameters such as temperature, humidity and CO? levels. Also, building of a user facing mobile or web dashboard with live visualization and alert features can change the usability as well as the system impact. Additionally, the architecture could be scaled into a multi room, building wide deployment with limited modifications.
Moreover, the system supports easy upgrade and customization for various domains of applications like industrial safety, school air monitor, public health surveillance. With the collaboration of IoT security frameworks further data privacy and protection can be achieved and it will also ensure compliance with emerging regulations. All in all, this work provides a solid base for developing intelligent, reliable and scalable indoor environmental monitoring which would sound and create healthier and working space.
References
[1] Fernando, N., Shrestha, S., Loke, S. W., & Lee, K. (2025). On Edge-Fog-Cloud Collaboration and Reaping Its Benefits: A Heterogeneous Multi-Tier Edge Computing Architecture.
[2] Dogea, R., Yan, X.-T., & Millar, R. (2023). Implementation of an edge-fog-cloud computing IoT architecture in aircraft components. MRS Communications,
[3] Aserkar, A. A., Godla, S. R., El-Ebiary, Y. A. B., Krishnamoorthy, M., & Ramesh, J. V. N. (2024). Real-time Air Quality Monitoring in Smart Cities using IoT-enabled Advanced Optical Sensors. International Journal of Advanced Computer Science and Applications, 15(4)
[4] Shahid, S., Brown, D. J., Wright, P., Khasawneh, A. M., Taylor, B., & Kaiwartya, O. (2025). Innovations in Air Quality Monitoring: Sensors, IoT and Future Research. Sensors, 25(7), 2070.
[5] Othman, H., Azari, R., & Guimarães, T. (2024). Low-Cost IoT-based Indoor Air Quality Monitoring. Technology Architecture and Design, 8(2),
[6] Pazhanivel, D. B., Velu, A. N., & Palaniappan, B. S. (2024). Design and Enhancement of a Fog-Enabled Air Quality Monitoring and Prediction System: An Optimized Lightweight Deep Learning Model for a Smart Fog Environmental Gateway. Sensors, 24(15)
[7] Mota, A., Serôdio, C., Briga-Sá, A., & Valente, A. (2025). Implementation of an Internet of Things Architecture to Monitor Indoor Air Quality: A Case Study During Sleep Periods. Sensors, 25(6),
[8] Kairuz-Cabrera, D., Hernandez-Rodriguez, V., Schalm, O., Martinez, A., Merino Laso, P., & Guardia, A. (2024). Development of a Unified IoT Platform for Assessing Meteorological and Air Quality Data in a Tropical Environment. Sensors, 24(9),
[9] Hercog, D., Lerher, T., Trunti?, M., & Težak, O. (2023). Design and Implementation of ESP32-Based IoT Devices. Sensors, 23(15),
[10] Sargent, A. (2021). How InfluxDB Works with IoT Data. InfluxData Blog.