Air quality monitoring system.
Pure Air is our project submission to the IoT HarmonyOS Hackathon organized by Huawei, getting awarded 2nd place in Europe.
The software stack is designed to be horizontally scalable through kubernetes, both Frontend and Backend are stateless and designed as a microservice that can be deployed in a container.
Run our web stack with:
docker-compose up
You can now view the web ui with http://localhost:12380
Once everything is up and running you can start sending data with your Pure Air IOT device, check out Hardware to find the sources on how to build one.
Composed of a Private area and a Private area and a Public area.
Private area | Public area |
---|---|
The private area empowers the user by giving him useful insights to make educated decisions, such as suggestsing the house ventilation schedule by fetching sensor data from the Pure Air APIs.
The public area empowers the people by giving everyone a powerful tool to monitor the city pollution. This data can be used by the authorities to improve the well being of citizens or can be used by citizens themselves to force authorities to take action.
Based on Swagger and OpenAPI and meant to be scalable through container-based replication systems such as kubernetes.
-
Three private APIs endpoints for the user private area
-
Public API endpoint
http://[BACKEND_URL]/v1/getPollutionInfo
for third parties to build upon, easing the integration process by using the standard format GeoJSON
We empower the user by providing home assist integration that can be used in conjunction within a smart home in a domotic environment.
MongoDB is our database, flexible enough and optimized for our needs is able to perform fast GeoJSON data queries using its 2dsphere geospatial index
For testing purposes we created a populator script to create, fill and index the database.
The board used for the project is a nodemcu with an esp32 microcontroller.
The following sensors are used to obtain the reads:
- Two ds18b20 for indoor and outdoor temperature measurements
- A MQ-135 sensor for indoor CO2 measurement
- A PM2.5 detector PPD42NS for outdoor pollution levels
To communicate between the internal and external modules, a normal RJ11 cable can be used, with the following setup:
- Red wire -> 5v
- Black wire -> GND
- Yellow wire -> Temperature sensor one wire bus
- Green wire -> LO-time dust sensor signal
The firmware is written in Rust, a powerful, fast and secure language that can target the esp32 chipset, with a full standard library support.
Rust has also a huge set of libraries, all open-source and hosted on crates.io, this allows faster code writing, while having much better safety than other low-level languages such as C or C++. Under the hood the Rust standard library for esp32 calls the routines of the official open-source Espressif real time os.
For information about building and running the PureAir firmware, take a look at the Hardware README
Apache 2.0 Copyright © PureAir team