SmartFusion is an intelligent IoT-based air quality monitoring system
that leverages Multi-Level Data Fusion to provide accurate CO gas
concentration and environmental risk assessments.
The system integrates hardware edge nodes with a Python-based
intelligent gateway and cloud-hosted databases.
- Multi-Level Fusion
- Kalman Filtering (Data-level)
- Dempster-Shafer Theory (Decision-level)
- Dual Protocol Support
- HTTP (REST -- Legacy)
- MQTT (Publish/Subscribe -- Optimized)
- Fault Tolerance
- Local buffering for offline data persistence
- Real-time Analytics
- Performance metrics: SNR, RMSE, VUR
- Cloud Integration
- MongoDB Atlas
- Adafruit IO
The system utilizes the following hardware at the Edge layer:
- NodeMCU (ESP8266) -- Main processing unit and WiFi gateway\
- MQ-7 Gas Sensor -- Carbon Monoxide (CO) detection\
- DHT11 Sensor -- Temperature and Humidity monitoring\
- Level Shifters / Potentiometers -- Sensor calibration and voltage matching
- Arduino IDE -- Programming and flashing NodeMCU firmware\
- VS Code / PyCharm -- Python Gateway and data analysis scripts
- MongoDB Atlas -- Cloud-hosted NoSQL database\
- Adafruit IO -- Real-time IoT dashboard and monitoring\
- HiveMQ -- Public MQTT broker
Python - paho-mqtt (v2.1.0) - pymongo - matplotlib - numpy - Adafruit_IO
Arduino - ESP8266WiFi - PubSubClient - DHT Sensor Library
- Architecture: Client--Server (Request--Response)
- Workflow: NodeMCU sends JSON payloads via POST requests to a Flask-based Python server
- Best for: Simple point-to-point communication
- Architecture: Publish/Subscribe
- Broker:
broker.hivemq.com - Workflow: Decouples sensor nodes from the gateway, enabling lower latency and higher reliability
The NodeMCU firmware (AQI.ino) is responsible for:
- Initializing WiFi and MQTT connections
- Sampling data from MQ-7 (Analog) and DHT11 (Digital) sensors
- Packaging sensor data into JSON format
- Publishing data to the
smart_fusion/sensorstopic every 5 seconds
| Metric | Value (Avg) | Description |
|---|---|---|
| SNR | > 25 dB | Signal-to-Noise Ratio |
| RMSE | < 0.05 | Root Mean Square Error |
| VUR | ~ 85% | Variance Reduction |
- Clone the repository
git clone https://github.com/yourusername/SmartFusion.git- Install dependencies
pip install paho-mqtt pymongo matplotlib numpy Adafruit_IO- Configure Database
- Update
MONGO_URIinmain_gateway.py
- Run the Gateway
python main_gateway.py- Run the Visualizer
python output_analysis.pyDeveloped by Shady Nikooei as an Computer Engineer.