Skip to content
An easy way to collect and display data about the air we breathe
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


An easy way to collect and display data about the air we breathe. Use this project along with my air-multisensor project to get the graphs I've shown below. Note: this project relies on HighCharts to display the data.

Alt text


You need Python 3. Run python3 either through linux/cron, or use a watch command as follows:

watch -n 60 python3 ~/beautiful-air/

You need any web server to host the csv files, as well as the index.html. A simple Python web server can be started as follows:

cd ./beautiful-air/
python3 -m http.server 8080

Both can be integrated into /etc/rc.local so that the scripts will run on boot. I add a twist by running each command in a screen, a virtual terminal that allows reconnection:

su -c "cd ~/beautiful-air/ && screen -dmS miniserver python3 -m http.server 8080" -s /bin/sh pi
su -c "cd ~/beautiful-air/ && screen -dmS collect watch -n 60 python3 ~/beautiful-air/" -s /bin/sh pi
#      directory of csv/html.          friendly name   update interval     path to             username


The modular form of this project means that you can easily add or erase blocks of code from both index.html and and add any sensor of your choice. Duplicate a csv file, rename it, and change the header/labels. Add a url request, and add your new file to Copy/edit a block from index.html, and change the url to your own. Use the humidity code block as a template for a single sensor plot, or the particulate matter one for multiple plots.


If the charts aren't displaying properly, this could mean there are inconsistencies in the ordering for your time values. If the times aren't strictly increasing, highcharts runs into some problems. Run in the directory with your .csv files.

You can’t perform that action at this time.