Smart Air Quality Monitoring: IoT Sensors on M5StickC Plus

Air Quality Alert System built on M5StickC Plus integrated with AT6558 and SGP30 sensors integrated with Qubitro

Ujwal Kandi
5 min readJan 24, 2024

City dwellers around the world are grappling with hazardous air quality and the detrimental effects of pollution daily, especially during peak pollution season (Summer) when forest fires sweep across North America. Breathable air becomes a precious commodity as individuals navigate their daily routines, impacting their health, well-being, and overall quality of life.

This project aims to address this pervasive issue by providing a nuanced and localized solution: an air quality alert system. By employing a Gas unit sensor and GPS technology integrated into M5Stick devices, it delivers accurate, real-time air quality data, empowering residents to make informed decisions about their movements and activities.

The challenge lay in seamlessly integrating the air quality and location data, ensuring synchronization and accuracy in the datasets. Qubitro, a device data platform solves this integration challenge and introduces robust data transfer mechanisms, transmission protocols, and secure connectivity to create a comprehensive dataset that effectively maps and tracks air quality across various locations visited by the user.

https://x.com/Qubitro/status/1697923838376341693?s=20
SenseCAP T1000-B LoRaWAN Tracker, a similar device that gathers temperature with lat-long data on Qubitro

Additionally, the collection of precise location data, allows us to create a dataset on Qubitro, which, when presented over a map, empowers users to proactively plan their day, avoiding areas with elevated air pollution levels for improved well-being.

Technological Components:

  • M5StickC Plus ESP32-PICO
  • Mini GPS/BDS Unit (AT6558)
  • TVOC/eCO2 Gas Sensor Unit (SGP30)
  • Qubitro Data Platform

System Architecture
The M5StickC Plus, a mini IoT development kit serves as the core, complemented by the GPS/BDS Unit for accurate location tracking and the TVOC/eCO2 Gas Sensor Unit for real-time air quality monitoring.

Two M5StickC Plus devices serving distinct functions. Device 1 is equipped with a GPS sensor for precise location tracking. Device 2 is equipped with an SGP30 sensor for real-time air quality monitoring.

Below is the updated diagram which is way more efficient in handling the real-time data than my initial design.

Integration Hub
Qubitro platform acts as the central hub for data integration and analysis. Facilitates seamless communication between devices and data storage.

Project created on Qubitro to store data from the two modules

Data Flow
Step 1
— M5StickC devices collect real-time GPS data for spatial context along with real-time monitoring of TVOC and eCO2 levels.

Step 2 Data is transmitted to the Qubitro platform for storage and processing.

Step 3 Users can access integrated data for visualization and analysis.

Demonstration and Outcome Assessment
Now the data from both sensors would be stored in individual projects which can be combined on Qubitro’s Analytics section where it can be presented in real-time. Firstly, the Air quality sensor is implemented, where we set the threshold that was issued in the WHO report. A beep alert triggers when the readings exceed the threshold along with an alert message displayed on the LCD of the M5Stick.

Initially, the readings were taken from the car exhaust but then I opted for an electric hair dryer for the demo for a reason. Turns out hairdryers are one of the most polluting appliances in our homes as not only do they release the highest amount of VOC gases per unit of time, but it’s also the source of Ultra Fine Particles(UFP) like Benzene, which is a known carcinogenic.

It is also present in the vehicle exhaust gas along with other VOCs and the SGP30 module is ideal for measuring it. During the demo as soon as I smelled the burnt smell (ultrafine particulate matter) from the hair dryer, the readings skyrocketed reaching a max of around 25000 ppb which was way above the official WHO threshold of 1000 ppb that we set on the module.

https://drive.google.com/drive/u/5/folders/1FDKUVEojaZOr3bjNNi9YPIS834xGNFtk
Initialization of the SGP30 gas module | When the gas concentration exceeds the threshold

The source code for both the Air Quality Alert System and GPS modules is available, along with detailed outcomes of the system’s performance. Below are the demos in real-world scenarios, showcasing the system’s ability to detect harmful gases and provide accurate location data.

BDS/GPS (AT6558) — M5StickC Plus module
The readings were recorded after connecting the M5Stick to a phone for power and wifi:

bit.ly/GPS-AT6558

TVOC/eCO2 (SGP30) — M5StickC Plus module
Below are the initialization and demo recordings:

bit.ly/TVOC-SGP30

Conclusion
The Smart Air Quality Monitoring System represents a significant leap forward in the realm of air quality monitoring. By addressing existing gaps, leveraging advanced but affordable technologies, and fostering collaboration, the project not only provides a solution to a pervasive issue but also sets the stage for future innovations in environmental monitoring.

I conclude by highlighting the potential impact of the system on improving air quality awareness and empowering individuals to make informed decisions for their well-being.

Guiding Users: Beyond data analysis, the project practically guides users to areas with better air quality, enhancing their daily choices.

Environmental Research: The project’s potential extends to broader environmental research, contributing valuable data for scientific investigations.

Community-Driven Data Collection: Emphasizing a community-driven approach, users actively contribute to a collective understanding of air quality.

https://github.com/UjwalKandi/Smart-Air-Quality-Alert-System
github.com/UjwalKandi/Smart-Air-Quality-Alert-System

--

--

Ujwal Kandi

Graduate student @ McCombs School of Business - UT Austin