To create a moodlight using Arduino was always in the back of my mind. When I came accross the Spark Core on Kickstarter I also wanted it to be connected to the internet. Spark’s onboard wifi chip would make it easy to have the moodlamp reacting to outside events (apps, web sites, etc.).
In a first step I created a .NET web application that pulls weather data from OpenWeatherMap and according to the condition and temperature it would return two color codes. For example for temperature of 0 to 5 degrees celsius it would return Blue and for condition “Few Clouds” it returned Light Green.
Temperature range is from Purple (very cold) to Red (very hot) and condition is from Purple/Red for severe conditions (Thunderstorm, Hail, Tornado, etc) to White (Snow, etc) to Green (Few/No clouds) and Blue (Rain).Right now it would return:
The spark then would query this service every five minutes and then light up a WS2801 light strip: half of it in the color of the temperature, the other half in the according color for the condition.
I thought it would be a good idea to incorporate the moodlight into my existing IKEA STORM floor lamp. So at first sight it would just look like an ordinary lamp but would then blow you away with its insides!
I added the Spark and a 5V/5A power source to the socket and attached the led strip to the pole.
I also added some more funtionality to the spark, so I can control it via its cloud api. For example set a single color to the whole strip or even set the color for any of the 82 leds. I also added a rainbow mode.
Check out the github repository for the code.