Measuring air quality and creating (sometimes vulgar) visualizations
What A Dumpster Fire
filed under "The Dumpster Fire Project"
A while ago I had an idea for a creative coding project; A website that would change visuals depending on what my heart rate was.
Well, back then, I was in a lot more pain and stress, so now that would be less interesting.
What is more interesting, however, is air quality.
I’ve always had to be concerned about the air quality; with asthma and severe allergies, bad air quality means a very bad day for me.
After the Canadian wildfires this year, I re-thought my previous creative coding idea and decided to set the art to react to the current air quality. I figured I could capture the air quality every hour in a database, and display that result whenever folks visited.
Thus The Dumpster Fire Project was born.
While the primary idea is the unique, shifting visualization, it also goes beyond that. I haven’t fully settled on everything I plan on doing with the historic data, but at some point I’ll put together displays on the worst days, the longest stretches of bad average air quality, and more.
Let’s talk more about the visualization.
Visualizing air quality data with the Dumpster Fire Project
The actual core art theme is based on code I wrote years ago; Just a shifting color gradient to create a sort of breathing abstract visualization, with motes floating up from the bottom depending on the actual air quality score.
What may not be obvious, however, is the impact of the air quality on your actual computer and battery life: A high Air Quality Index value (higher = worse) means more floating motes, which means higher CPU and battery usage. On an average desktop computer or laptop you’ll find a higher AQI also ends up ramping up your fans in order to compensate for the extra CPU load.
Essentially, your CPU is having problems breathing, too, when the air is bad.
Beyond that, I also wanted to make sure it was accessible for folks with color blindness, motion blindness, or blindness in general. I wrote a lot of flavor text that matches up with the air quality, going from “The world is simply beautiful”, to “This may as well be a dumpster fire”. The worse it gets, the more likely you’re also going to encounter varying degrees of vulgarity; As an example, when the AQI hits 85, you might see “Did I just deep-throat Satan? This shit burns.”
This may seem counterintuitive if the idea is to raise awareness, but for the average person I want them to understand what folks like me frequently think. Just saying “It’s bad!” isn’t enough. Like some of the best art, it has to offend in order to have the right impact.
Adapting The Dumpster Fire Project to your own needs
In my case, I’m able to grab data from a sensor less than 10 blocks away from me, which means the data itself is really accurate here, but doesn’t mean much for folks in a major city, or another part of the world entirely.
That’s why I built it in a way to make it easily adaptable to your own situation. I utilized WAQI for the sensor data (partially because another developer already built an interface for it in PHP), and all you need to do is plug in your desired station in the .env variable (plus a few others) and you’ve got your own Dumpster Fire project to deploy!
You can fork the source here. I didn’t even bother including any license; There’s nothing exceptionally unique about the code, so I felt trying to limit folks’ use just wasn’t a reasonable expectation.
If you do end up deploying your own variation, feel free to share it with me (especially if you do something different with it) so I can help promote it! Just reach out using the contact info at the bottom of this site.