Interactive Weather Forecast Cloud

by vir2des in Circuits > LEDs

3008 Views, 68 Favorites, 0 Comments

Interactive Weather Forecast Cloud

IMG_5382.jpeg
Thumbnail Option 2.jpeg
IMG_5388.jpeg
IMG_5389.jpeg
IMG_5374.jpeg

Do you find yourself often forgetting to check the weather in the morning, and paying for it later in the day when you're completely unprepared for the conditions outside? Yeah, me too.

I made this interactive weather cloud for my physical computing class at Boston College with Professor Gallaugher to help fix my dilemma. The cloud is a hangable light fixture with two main functions, both of which are controllable via an AdafruitIO dashboard:

1.) Ambient Lamp - the cloud can display a chosen color

2.) Display Weather Forecast - At a set time (such as in the morning as you're waking up), the cloud lights up in one of eight colors that correspond to your location's weather forecast for that day:

If there is precipitation in the forecast:

  • Cyan = Mist/Fog
  • Aqua = Drizzle
  • Deep Blue = Rain/Thunderstorm
  • Eggshell White = Snow

If there's no precipitation in the forecast:

  • Red = Below 35 F
  • Yellow = Between 36 and 60 F
  • Green = Over 60 F
  • Flashing Rainbow = Indicates an unusual forecast that doesn't fit any of the criteria above, such as a tornado or hurricane

I often forget to check the weather in the morning, and wind up getting soaked or shivering since I did not dress appropriately. I plan to set the cloud to illuminate with the weather forecast at the same time as my daily alarm, so I will know how to dress for the day without having to check the weather forecast.

Below, find all the instructions to make the cloud and program your circuit board + build an AdafruitIO dashboard.

Thanks for reading!

Supplies

This project doesn't require any special machinery or tools besides the ones I mentioned above, but the LocTite spray gets everywhere, so set some old towels down or find a spot that you don't mind getting sticky.

Zip-Tie Together Lanterns and Add LED Strip

Lantern View.jpeg
Lantern View Open.jpeg
Wiring Close Up.jpeg
Zip Tie Lantern 2.jpeg
Zip Tie Lantern.jpeg
Zip Tie LED strip.jpeg

The cloud uses the Chinese Lanterns as it's skeleton, so the first step is to shape the lanterns. I used two 6-inch lanterns and an 8-inch lantern, with the large lantern in the middle and the small ones flanking each side. Feel free to size up, but keep in mind the cloud will look substantially larger once you add the polyfill.

Linking the Lanterns:

The lanterns are made of paper and wire - rigid enough to use as a frame, but easy enough to link together and feed wires into. To start:

  • Poke holes at an even height on the middle lantern and one small lantern.
  • Feed a zip tie through each hole, wrap around the wiring of the lanterns, and cinch the zip tie as tight as you can. Do this three times to create a solid bind.
  • Repeat with the small lantern on the other side.

Once you're done, your lanterns should look like the first two pictures above, minus the LED strip (we'll do this next).

Wrapping the LED Strip Around the Lanterns:

The middle lantern is where we will house the circuit board, so start by making a hole in the middle lantern and feeding the alligator clips of the LED strip through the hole so that you can connect the LED strip to the circuit board later.

Once you've done that, wrap the LED strip around the lanterns. The 1m strip is just long enough to wrap fully around.

Periodically poke a hole in the lantern and wrap a zip tie around the wiring. Cinch the zip tie tightly around the LED strip, and trim the excess zip tie.

It's a bit hard to explain the process using words, but I've included plenty of pictures of my zip-tie method above. Hopefully this part of the process is clear!

Add Polyfill to Shape the Cloud

In Process 2.jpeg
Test Cloud.jpeg
Male Jumpers.jpg

Next, we'll take polyfill and use the LocTite Spray to secure it to our skeleton to finish up the cloud. We will do this in ~4" sections at a time, to allow proper shaping and bonding.

To ensure a secure bond:

First, spray a spot the on paper lantern with LocTite spray. Then, spray a small clump of the Polyfill, and stick this side to the spot on the lantern. Spraying both the lantern and the Polyfill creates a permanent bond.


Coat as much of the lantern as you can with Polyfill, until only the open tops and bottoms of the lanterns are visible. Starting with the bottom, spray the Polyfill that is already bound to the lantern, then attach more loose Polyfill until the bottom is no longer visible. Repeat this with the top, BUT do not cover the top hole of the middle lantern. We need this to be open so that we can insert the Circuit Board and hang the lantern later.

If it's your first time working with Polyfill (it was mine!), I recommend making a test cloud first. This will allow you to get a feel for the shaping and placement of the materials. I did this, and it was really helpful.

Build AdafruitIO Dashboard

Screen Shot 2023-04-27 at 2.28.17 PM.png
Screen Shot 2023-04-27 at 2.33.57 PM.png
Screen Shot 2023-04-27 at 2.34.18 PM.png
Screen Shot 2023-04-27 at 2.38.31 PM.png

If you don't have an account already, create an Adafruit account, which is where we'll create the dashboard to control the clouds. Once that is complete, click the IO tab in the top menu, and then find the "Dashboard" Page. Once you're there:

  1. Press the blue button that says "New Dashboard"
  2. Create a new dashboard called "Cloud Lamp"
  3. Click the settings gear in the corner, then click "Create New Block."
  4. Select the Color Picker widget, then connect it to a new feed named "cloud_color". This button allows you to pick and change the color of the cloud.
  5. Title the block "Pick a Color"
  6. Next, create a new block and pick the "toggle" button. This button is an on/off switch for the color picker function.
  7. Connect it to a new feed named "cloud_on_off"
  8. Title the Block "On/Off"
  9. Set "Button On Text" to "ON"
  10. Set "Button Off Text" to "OFF"
  11. Leave "Button On Value" and "Button Off Value" blank
  12. Finally, create a new block and pick the "Text" block. This button allows you to enter the time that you would like to see the weather forecast. Simply type in a time, in 24hr format, and the code will schedule the cloud to illuminate with the weather forecast at this time. You can enter more than one time per day, if you would like.
  13. Connect it to a new feed named "time_feed"
  14. Title the Block "Enter a time in 24HR Format"
  15. Select the 'clock-o' icon in the "Icon" Field.
  16. Leave the rest of the fields as their defaults.


I've added pictures of the Final Dashboard, as well as the Block settings for all three blocks. If you're totally unfamiliar with AdafruitIO, I recommend watching this video that my Professor made about it. It's incredibly helpful and beginner-friendly, and will likely aid you if you have any stumbles in this step.

Set Up the Code

Screen Shot 2023-04-27 at 2.49.27 PM.png

Time to get the Pico W ready! Connect it to your computer, and open your CircuitPython editor of choice (I like Mu Editor).

I've included two files below: a settings.toml text file and the CircuitPython code for the lamp. We'll start with the settings.toml file:

settings.toml:

This file allows the Pico W to access Wifi (which we need for the time and weather forecast), and stores the info necessary to connect to the AdafruitIO Dashboard.

To make this file work with your AdafruitIO Dashboard and WiFi, you need to change 4 items in this file:

  1. WIFI_SSID = change this to your Wifi address
  2. WIFI_PASSWORD = change this to your Wifi password
  3. AIO_USERNAME = change this to your Adafruit Username
  4. AIO_KEY = change this to your AdafruitIO key (this is not your Adafruit password! You can access it in the AdafruitIO website settings).

The file currently ends with ".py", but once you've made the changes above, save the file to your Pico W as "settings.toml". Make sure that you don't save it as a .py file by accident - it must end with .toml, otherwise it won't work.

code.py:

Once the settings.toml file is properly installed, the code.py file should run without changing anything. However, there are a few things you'll likely want to change so that the weather function works properly for your location.

  1. Line 47: Change the time zone of the API to your local timezone (unless you also happen to be on America's East Coast.)
  2. Line 60/61: Change raw_offset = 14400 to raw_offset = json["raw_offset"] if you're in a location without DST. If you are in a location with DST, you may have to do some math to figure out your raw offset from unixtime and hardcode the value, like I have done in the file.
  3. Line 83: Create a key on https://openweathermap.org/api, and insert your key here.
  4. Line 84: Change "YourZipCodeHere" to your ZIP code to sync up with your local weather forecast.
  5. Line 85: If you don't use imperial units, change this line.
  6. Line 91: If you want to customize the colors that flash for certain weather conditions, change the conditions themselves, or change how long the cloud illuminates for after receiving the weather (default is 300 secs), then play around with this function.

3 and 4 are the only required changes, but feel free to play around with them all. Once you make these changes, save the file to your Pico W as code.py, and you're almost good to go!

Connect Wiring and Attach Hanger

Wiring Close Up.jpeg
Male Jumpers.jpg
Breadboard Config.jpg
Electronics.jpg
Hanger.jpg

The wiring scheme is simple:

  1. Connect three alligator clip-to-male jumper cables to the alligator clips on the LED strip. Then connect the male ends to the breadboard as follows:
  2. RED = 3V
  3. BLACK = GND
  4. WHITE = GP15

Finally, attach some kind of hanger (I used a long zip tie, but you can also use fishing wire, tweed, etc. to hang the cloud) to the top of the center lantern.

Connect your power supply to the Pico W, then put the breadboard and power supply into the hollow middle of the lantern. Once power is going into the Pico, you will be able to control the cloud from your Adafruit Dashboard.

Hang and Enjoy!

Interactive Weather Cloud
Daytime Cloud.jpg

You can now hang your cloud from wherever you want: the ceiling, a wall mount, or a stand (like I did in the video), and control it from your Dashboard. I hope you liked this project and that the instructions were easy to follow - if you have any questions, leave them below and I'll help you out!