So air quality in Norway is pretty bad during winter. We have a public monitoring service at http://luftkvalitet.info with an open API at https://api.nilu.no/docs. I wanted a simple panel to mount on the wall near the door that can convey the current reports.
I have made a breadboard version that correctly fetches and displays the status via RGB codes that are conveniently served over JSON. It uses 5mm NeoPixels to show WiFi status, HTTP/ parsing status, NO2 levels, PM10 (particles < 10 nanometer) PM2.5 (particles < 2.5 nanometer).
A bushbutton is wired to RST, waking the esp from deep sleep mode. I use a local server to fetch the original JSON so I can serve it locally over HTTP, thereby removing the need for my ESP to do HTTPS.
Currently I am designing the enclosure in 2d but will add 3d version from Fusion 360.
Files
ESP_AirQualityMonitor.ino
The code currently running on this ESP8266
Will consider using micropython instead.
The NeoPixels render the web colors very bright, using unnecessary amounts of power and also a bit ambigous - so I might select some more appropriate colors and rather rely on the index value for the different values.
However, at the moment my primary focus is to make a nice enclosure.
Will add some 3D files, feel free to comment. The idea is to try to mill this from aluminium using my OtherMill, but I have not really mastered 3d milling yet...