loading

Every morning when I get ready to walk the dog, I want to know what the weather is like outside. Is it raining? Cold enough for the dog's sweater? From my current NYC apartment, it's even hard to tell if I'll need sunglasses when I step outside. I usually use my phone for checking the weather, but wouldn't it be nice to have some wall decor that provides this info at a glance?

I built this IoT weather display using a small shadow box, some RGBW NeoPixel LEDs, and an Adafruit Feather Huzzah ESP8266 with seven-segment display FeatherWing. Weather data is tracked using IFTTT, an incredibly rich (and free ) API gateway, which sends data to the cloud service Adafruit IO, which is then accessed by the Arduino program running on the microcontroller.

Before attempting this project, you should be familiar with Arduino, and you can take my free Arduino Class, or Randy's LEDs & Lighting Class or Electronics Class if you need to brush up on any of the basic skills.

For this project, you will need:

As an alternative to the Feather Huzzah, you can also use the Huzzah ESP8266 breakout, for which an FTDI cable is required to upload new programs (use the standard 7-segment backpack rather than the FeatherWing version). Either power it with an AC adapter (cut off the connector or attach a female plug) or a lipoly charging circuit/battery.

Step 1: Software & Hardware Setup

Before you dive into the code for this project, you should first make sure you've got your Arduino software set up properly to program the board you are using, which involves installing the SiLabs USB driver and installing ESP8266 board support (explained in more detail in the Feather Huzzah tutorial):

  • Go to Arduino-> Preferences...
  • Look for a text field labeled "Additional Boards Manager URLs:" and paste the following URL into the field (separate multiple URLs with commas if applicable):
    http://arduino.esp8266.com/stable/package_esp8266c...
  • Click OK
  • Go to Tools->Board-> Boards Manager...
  • Search for ESP8266 and click the Install button in the box "esp8266 by ESP8266 Community" when it shows up

Huzzah ESP8266 boards have an LED connected to pin 0, and you can find a sample blink sketch by navigating to File->Examples->ESP8266->Blink, or copy it from here:

void setup() {
  pinMode(0, OUTPUT);
}
void loop() {
  digitalWrite(0, HIGH);
  delay(500);
  digitalWrite(0, LOW);
  delay(500);
}

Plug in your USB cable to the board and configure your settings under the Tools menu as follows:

  • Board: Adafruit Huzzah ESP8266
  • CPU Frequency: 80MHz
  • Flash Size: 4M (3M SPIFFS)
  • Upload Speed: 115200
  • Port: whichever one ends in SLAB_USBtoUART (Mac) or COMx (Windows)

Click the Upload button to send the program to your board. This will take several seconds (longer than you are used to with Arduino Uno). After complete, the onboard LED should start blinking.

While the Feather Huzzah auto-detects when it's being sent a new program, other ESP8266 boards may require a sequence of button presses to get into bootloader mode.

Do not proceed until you've successfully uploaded a blink test program to your board.

Follow the assembly instructions to solder up and test your FeatherWing seven-segment display.

Step 2: Code & Circuit Diagram

For this project, you will need the following Arduino Libraries. Easily search and install each one using the Library Manager by navigating to Sketch->Include Library->Manage Libraries... or download from Github and install the old fashioned way:

Download the code attached to this step and open the file "weatherdisplay_example.ino" in the Arduino IDE. Navigate to the config.h tab in the editor and customize to your own personal data:

  • SSID (Network name)
  • Wifi password
  • Adafruit IO username
  • Adafruit IO key

Upload the customized code to your board. You may want to prototype your circuit on a solderless breadboard, or use female headers on your NeoPixel wires to plug them directly to the long header pins on the Feather. You can build the circuit now or after the next few configuration steps, your choice.

Step 3: Temperature Data Feed

Log in to Adafruit IO and create a new feed called "hightemp".

Log in to IFTTT.com and create a new applet. Select Weather Underground as the trigger ("this"), and configure it to retrieve today's weather report at a particular time each day.

For the second part of the applet ("that"), select Adafruit as the action service, then "Send data to Adafruit IO" (you will have to link your IFTTT account to Adafruit IO the first time). Select your feed named "hightemp" from the dropdown menu and click the +Ingredient button to select HighTempFahrenheit (or your preferred value).

You should now have an applet that sends today's high temperature to the hightemp feed on Adafruit IO every day at the same time. Since that can be a long time from the current time, feel free to adjust the trigger time for testing, or add testing data directly to the feed in Adafruit IO.

This code displays the numerical value from the feed on the 7-segment display:

Step 4: Weather Condition Feed

Create another new feed on Adafruit IO for tracking the current weather condition called "precipitation". Rather than create one applet that sends weather data daily, I created four applets, one each for the supported condition variables: clear, cloudy, rain, and snow. Whenever the condition changes, the current condition is passed to the feed. Although only four simple conditions are used to trigger the action, the resulting feed data is much more varied.

Here's one part of the code that evaluates the weather condition string and lights up the NeoPixels accordingly (I used the example under File->Examples->08.Strings->StringComparisonOperators program as a reference):

 String forecast = data->toString();

if (forecast.equalsIgnoreCase(String("Rain")) || forecast.equalsIgnoreCase(String("Light Rain") || forecast.equalsIgnoreCase(String ("Rain Shower"))){ Serial.println("precipitation in the forecast today"); pixels.setPixelColor(0, pixels.Color(0, 30, 200, 20)); pixels.setPixelColor(1, pixels.Color(0, 30, 200, 20)); pixels.setPixelColor(2, pixels.Color(0, 30, 200, 20)); pixels.setPixelColor(3, pixels.Color(0, 30, 200, 20)); pixels.setPixelColor(4, pixels.Color(0, 0, 0, 255)); pixels.setPixelColor(5, pixels.Color(0, 0, 0, 255)); pixels.setPixelColor(6, pixels.Color(0, 0, 0, 255)); pixels.setPixelColor(7, pixels.Color(0, 0, 0, 255)); }

Step 5: Circuit Prototype

You can play around with the positioning of the various display elements before permanently attaching them-- for instance the perma-proto board fits in the corner, so the placement of the Feather will determine its position relative to the corner-- adjust as you see fit! I created triangles within the shadow box using pieces of scrap cardboard, and masking tape to temporarily secure the pixels in place. To prototype different color effects, you can send test data to the device by manually adding entries to the two feeds. Once you like the way it looks, you can proceed to finalizing the circuit a bit more.

Step 6: Shadow Box Circuit Assembly

Solder the Feather and NeoPixel wires to the perma-proto board and trim the extra long headers with flush diagonal cutters (wear eye protection, they go flyin'!). Leave the tape securing the NeoPixels or replace it with some hot glue to hold the strips to the shadow box backing plate.

Step 7: Finishing Touches

Cut, drill, or file a hole in the edge of the backing plate so the USB cable can exit the back of the shadow box. To make it sit flush with the wall, you will also need to cut a groove in the frame to accommodate the USB cable.

Thanks for reading my Instructable! If you use it to build something, I'd love to see it in the comments!

If you like this project, you may be interested in the other IoT projects in the series:

<p>Would it be possible to have it display the forecasted high temp of the day instead of the current temp? </p>
<p>It does display the forecasted high temp (not the current temp), but the weather condition display updates more frequently (triggered whenever the condition changes)</p>
<p>I made a small one without the seven segment display and directly fetch the weather data from wunderground.com. I think of adding a light sensor because it extreme bright in the night (or maybe just dim based on the hour of the day).</p><p>My source code is available from here https://github.com/ordnungswidrig/weatherframe</p>
<p>super cool, thank you so much for sharing!</p>
<p>Very nice, and well explained.</p><p>How do you get the seven segment display to shine so brightly through black paper?</p><p>Is it special paper?</p><p>Does the color of paper/color of led matter?</p>
<p>Hey,</p><p>The color of the led may not matter if you know which color does what. I didn't read the whole tutorial yet, but I believe that the colors are coded as follow:</p><p>- upper left yellow: sunny</p><p>- upper right white: clouds</p><p>- bottom left blue: rain</p><p>With these you can have pretty much everything a meteo station can send you, except maybe snow.</p>
<p>I coded it to mix in some white with the blue when it's snowing. =D</p>
<p>It's not black paper, it's plain white printer paper. It looks darker in the photos than its neighbor segment because those segments are illuminated and the corner with the numerical display is not.</p>
<p>I love the elegant simplicity of this. Your use of the shadow boxes for displays in this and other projects is not something I would have thought of, and has given me some ideas.</p><p>Have you thought of maybe incorporating a temp sensor like the DS18B20 into this to get your actual outside temperature? I have one outside my study window on a thin wire that fits through the closed window without obstructing the rubber seal.</p><p>Excellent work, you write some of the clearest Instructables I have seen so far.</p>
<p>Hi. I usually look out the window to check out the weather (   ), JOKE.. but true.<br>Your Weather-forecaster is in both design and simplycity the most style&rsquo;ish.<br>Don&rsquo;t change anything in it, it&rsquo;s &ldquo;just&rdquo; as stream-lined and functional as it can be.<br>Nice job</p>
<p>Because I live on a low floor in a tall building (facing an interior courtyard), I actually can't easily see the sky from the windows and there aren't any windows near the door/coathooks. So, good for you that you can see the current weather condition by looking out the window, I can't so I built this. =\</p>
<p>Oh.. it was just a joke with the comment of just looking out. </p><p>Your 'Ible is Fantastic in it's both design &amp; function</p>
<p>Awesome project!</p>
<p>Super cool project, love it!</p>
<p>Thank you!</p>
I've been wanting to make something like this for the exact same reason! My dog hates the rain, so this will be great to help determine whether or not to bring an umbrella as well. Thanks!
<p>Awesome!</p>
<p>Whoops, I truly apologise, I put in SIR into my comment, and even while I was typing, I was thinking, &quot;I really should check if this is a woman, FIRST&quot;.</p><p>Well...as per usual, I made that mistake, and I am truly sorry that I made it.</p>
<p>Thanks for acknowledging your unconscious bias! =D</p>
<p>I am not familiar with this weather software, so my question is can the display be programmed to &quot;go to sleep&quot;? Also, does it have the capability to alert you if there is an emergency weather alert transmitted for your area--flood, tornado, hurricane in my area. If not, can it be programmed to link into the National Weather Alert system? Please advise. I really like your weather display. You get my vote.</p>
<p>The software that runs the device is built in Arduino, and you can certainly modify the code to turn the display off, even add a button to activate it or similar. I'm not sure about tying in the National Weather Alert system (since that's not info that's readily available on IFTTT), for that I guess I'd recommend relying on your phone which does a nice job. If you want to get started programming in Arduino, try my free class: <a href="https://www.instructables.com/class/Arduino-Class/">https://www.instructables.com/class/Arduino-Class/</a></p>

About This Instructable

17,337views

262favorites

License:

Bio: Becky Stern is a content creator at Instructables. She has authored hundreds of tutorials about everything from wearable electronics to knitting. Before joining Instructables, Becky ... More »
More by bekathwia:Sheet Metal Jewelry Basics - Saw, File, Sand, & Polish  Wire Wrapped & Beaded Earrings Diffused LED Strip Sign With Arduino/Bluetooth 
Add instructable to: