This is a place to show off what went into building my AQI measuring station. https://www.lpb-air.com/
Go to file
Simon c3cba3ca89
fix nightly nan value table
2024-03-25 00:28:06 +01:00
aqi_monitor add legacy ino readme 2022-10-21 15:47:40 +07:00
aqi_monitor_py add more pi setup info 2023-03-12 17:58:07 +07:00
env add umami 2022-05-10 19:02:32 +07:00
helper_scripts delete pg source files for dbsync 2023-03-25 12:49:12 +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 fix nightly nan value table 2024-03-25 00:28:06 +01:00
.gitignore commit fonts 2024-01-06 10:11:56 +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 update documentation 2022-10-21 16:44:58 +07:00
deploy.sh remove legacy db sync function 2024-01-06 10:36:54 +07:00
docker-compose_prod.yml migrate to pg 15 2023-05-13 13:53:41 +07:00
docker-compose_testing.yml migrate to pg 15 2023-05-13 13:53:41 +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. This is a legacy option, not in use any more now due to it's limitations.

aqi_monitor_py

Rewritten sensor script in Python, runs on a raspberry pi instead.

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.