For the past week smoke and particulate matter from the Camp Fire in Northern California has lingered in San Francisco, creating a hazardous environment. The EPA ranks the air quality with the Air Quality Index, a value that ranges from 0 - 500. San Francisco often stays in the 'good' range of 0-50, but recently was in the 'very-unhealthy' range. School and businesses have been canceling activities and government officials are encouraging residents to shelter indoors and wear a NIOSH N95 mask when outdoors.
As we increasingly deal with the impact of global climate change it seemed appropriate to create a visualization of the AQI, so I can determine if I need to wear a mask before heading outdoors. Fortunately, the EPA has an API for checking the current AQI by zipcode at airnowapi.org. Additionally, the EPA has assigned colors for the different ranges and provides specific hexidecimal color codes for each.
This project checks the AQI at a regular interval and adjusts the color of a series of LEDS. The project is fit inside a selenite crystal lamp because it diffuses the colors and looks really cool.
I explored Circuit Python because I was interested in using the Adafruit Fancy Led library, but ultimately Circuit Python lacked a urequests
alternative.
- 1 Adafruit Feather HUZZAH with ESP8266
- 1 NeoPixel Ring - 12 x 5050 RGB LED
- 1 Selenite Crystal Lamp
- Assorted wires and tools including soldering iron
- Solder wires to NeoPixel Ring
- Solder wires to Feather HUZZAH
- Connect ground to ground, 3v to 3v, and Data in to Pin 14
- Slide into the Selenite Crystal
- Download and install micropython on the Feather HUZZAH
- Download or Clone this repository
- Open
boot.py
and add yourSSID
andSSID_PW
- Request API Access at airnowapi.org
- Copy your top secret API KEY
- Open
main.py
and add yourAPI_KEY
andZIP_CODE
as a string - [Load the code onto the Feather HUZZAH] (https://learn.adafruit.com/micropython-basics-load-files-and-run-code/overview)