EPA UV Index Feed / IOT
This little device pulls your local UV index from EPA and display the UV level in 5 different colors and also displays details on the OLED. UV 1-2 is Green, 3-5 is Yellow, 6-7 is Orange, 8-10 is Red, 11+ is purple.
Supplies
Adafruit Feather M0 WiFi – ATSAMD21 + ATWINC1500
350 Mah Lipo
One NeoPixel
A server that can run php script with a Internet connection
3D printed parts (attached)
Wiring
You will need to wire the NeoPixel to Adafruit Feather M0 WiFi – ATSAMD21 + ATWINC1500
it is used to display the UV color coding at the top. You will also need t wire the slider switch to the GND and enable pin.
I use slider switch from here
Setup Server / Grab EPA Feeds
The zip file contains uv.php file, it pulls the xml from the EPA site
(Change the ZIP/***** to your zip code)
https://enviro.epa.gov/enviro/efservice/getEnvirofactsUVHOURLY/ZIP/98121
The PHP file that I included below, phrases the XML file and added a few things, such as current time and current UV index at the very end and it looks like this
?08AM 9AM:2 10AM:4 11AM:5 12PM:7 1PM:7 2PM:7 3PM:6 4PM:4 5PM:2 6PM:1 0 Adafruit MO then process the string and map that to the NeoPixel color via the char below.
Print the Case
Print the 3D printing files
Assemble
- Making sure you wire the NeoPixel to the correct PIN, I used 12 in the included code.
- Edit the WiFI SSID and Password.
- Upload the provide sketch.
- Pop in the display and lips
- Done!