A weather moodlight

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:

W-[173,216,230][128,128,128]-Temp:6,0°C;LightBlue-Condition:Mist;Gray

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!

IKEA STORM lamp

Regular STORM lamp. Height: 160cm

 I added the Spark and a 5V/5A power source to the socket and attached the led strip to the pole.

DSC_7562 (Small)

DSC_7560 (Small)

DSC_7561 (Small)

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.

Moodlamp with single colors.

Moodlamp with single colors.

Rainbow mode

Rainbow mode

Moodlight in weather mode. Green for No Clouds, Blue for Cold.

Moodlight in weather mode. Green for No Clouds, Blue for Cold.

 

 

8 thoughts on “A weather moodlight

  1. Hi Roman.

    I am very interested in your lamp and looked at your github code, but can’t see how you control the colour manually. (I am a novice at such things).

    What I want to do is to control a lamp from a web-page, so I can use my smartphone, a laptop, a tablet, a desktop – even sending an email or a tweet (heaven help me!) to trigger the change, thus bypassing the need to install a specific app – if you’re web-connected, you can access a web-page, right?

    If you can give me a pointer, I would appreciate it.

  2. Hi Mike
    How would you like to connect to the lamp? To make it app independent I would rule bluetooth out of the equation.
    I guess the lamp should be web connected, an arduino with wifi or ethernet shield would do it.

    The spark – https://www.spark.io/ – is an excellent alternative. I used one for my project here.

    What is your starting point?

  3. Hi Roman can you please help me In explaining how I can use some rgb led tape and control the colour change using a Plc

  4. Hi, I’m curious about your lamp. Where did you get your LED lights from? Also you connected the LED to the arduino and programmed it from there?

    • The LEDs are a strip of WS2801 that I ordered from AliExpress. And the advantage of using the Spark Core is that you can program it over the air and can poll weather information through wifi. But you can use any Arduino compatible microprocessor for this project.

  5. Hi Roman, this is a pretty cool project,

    I came across cause I am planning to do something similar for a Uni project but I am using a WS2812B, can you tell me if I am able to do this with this strip. Will the coding and wiring will change a lot?

    Thank you and sorry if my question is pretty basic but I haven’t code/ used an arduino before and seems pretty intimidating your code,

    Cheers,

    Hector

    • Hi Hector
      I don’t see a problem with the WS2812B. It’s a well known product and you will find lots of examples in the www. Just take it step by step and you will advance pretty fast. All the best for your project!
      Saludos
      Roman

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.