An LED setup inside a sun/solar flare-like contraption that changes color at the peak of a solar flare. Yellow for beginning, Red for Peak, Orange for End, or some variation. The data is updated daily so I should be able to see some kind of change. I chose this project because space is something I have always been really interested in. For a long period in my childhood I wanted to be an aerospace engineer at NASA. I would go to the museums and attractions, daydreaming what it would be like to create the technology for things like this. The next best thing now is using the API to work with NASA’s data.Setting Up My Webhook
First step was creating a webhook so I could receive the Solar Flare data from the DONKI (The Space Weather Database Of Notifications, Knowledge, Information ) API. Getting an API key is as easy as giving your name and email. There is an hourly request limit of 1, 000 which is significantly more than you'll need for the scope of this project.
Next I used the Particle Console Integration set up.
I subscribed to the hook-response/flare/0 and the data from the event is an argument in myHandler. I used the method of making tokens from the String response in order to break up each hour and minute of the beginning, peak, and end of the flare. I then converted the different times into integers to be used in the clock.
I used the WS2812B led strip, the Amazon link is in the hardware section. I really liked this strip because there are 2 points for connection on either end of the strip. There are also some extra wires you can utilize. This was the perfect option for me because there was no soldering required. JST connection was not necessary like some other strips found on Adafruit.
There is too many different functions to break down each individual one, but all my LED code is consolidated in one of the code files found below. I used the NeoPixel library found in the Particle library. This is not the only LED library that is compatible with the ws2812b LED strip but it is the one that worked best for me. The FastLED library is not compatible with the Argon/ has not been updated recently. Some of the most important notes are below:
In my loop(), I used the data from myHandler that has been converted into integers. The beginning, peak, and end hours are compared with the current hour to determine the time period in which the LEDs will change light patterns. Each period in between the important time stamps will have a different display of lights and patterns. If I do not see the light changes in real time (for example I'm not in the room), I will still know if the event happened due to my stripRan boolean. The light will change from a default of red to a breathing cyan.
I decided to use a styrofoam circle to present the LED, opposed to a straight strip for a cooler effect.