This is a place to show off what went into building my AQI measuring station. https://www.lpb-air.com/
Go to file
simon 7b52192ea5 specify compose file 2021-11-03 16:19:23 +07:00
.vscode some housekeeping 2021-07-07 19:18:06 +07:00
aqi_monitor point to new api endpoints 2021-07-07 19:16:33 +07:00
env added postgres to docker for later integration 2021-02-16 17:57:25 +07:00
helper_scripts some housekeeping 2021-07-07 19:18:06 +07:00
nginx major app rebuild into a single flask application 2021-07-07 19:08:46 +07:00
postgres indexing on epoch_time for faster where queries 2021-07-07 19:17:26 +07:00
web speedup deployment with slim python image and build step outside of compose 2021-09-09 10:57:26 +07:00
.gitignore major app rebuild into a single flask application 2021-07-07 19:08:46 +07:00
.pylintrc ignore unsave import message 2021-07-30 18:00:17 +07:00
LICENSE.md minimum viable product 2021-02-16 10:40:22 +07:00
README.md updated for new comined flask app 2021-07-12 13:21:41 +07:00
deploy.sh specify compose file 2021-11-03 16:19:23 +07:00
docker-compose.yml lock postgres 13 2021-11-03 16:18:48 +07:00

README.md

AQI sensor project

social_preview.jpg
This is a place to show off what went into building my AQI measuring station currently publishing to:

lpb-air.com

This site is under constant development. The main purpose is educational.

The webserver is a simple VPS, provisioned with docker-compose.yml.

aqi_monitor

aqi_monitor.ino is the arduino script running on the nodeMCU ESP8266 microcontroller. The microcontroller posts data to the flask backend on a regular interval. Connected to that is:

  • SDS011: pm2.5 and pm10 sensor from Nova Fitness.
  • BME280: Pressure Humidity Temperature Sensor Module.

web

A flask based application that takes the data from the ESP8266 for processing and storage and renders a HTML/CSS/JavaScript frontend from template.
Postgres handles the storage of the measurements. The data is split up into two different tables, one for aqi related data and one for the weather data.
Python interacts with Postgres with the help of the psycopg library.
The flask app is recreating the graphs to visualize the aqi, PM 2.5 and PM 10 values on an interval. Aggregating is done with the Pandas Python library and the graphs are created with matplotlib.
New data is pulled from the backend on a interval with JavaScript and XMLHttpRequest library.

credits

The Lightbox to take a closer look at the graphs is curtesy of Lokesh Dhakar.