Caught in the Rain « My Site/Blog
Untitled Document

Caught in the Rain

IMG_9449

Weather has never really been a concern of mine in the past. If I got caught out in the rain I usually just wait it out or run through until I could find shelter. However, when you’re commuting to work at an office building you really can’t show up late or soaking wet just because you didn’t know it was supposed to rain. This is where the motivation for this project comes from. Now those of you who are, perhaps, more collected might be wondering why I don’t just check my phone every morning like a normal person. Those of you, perhaps, do not realize the small miracles that must occur each morning for me to walk out the door, on time, with all the necessary belongings for the day.

I wanted something simple. I wanted to know weather (whether) or not the forecast called for rain during any of the hours of the day where I would most likely be walking outside (say 8-9 in the morning and 5:30-6:30 in the evening). I wanted to know as soon as I got up, in a very simple and intuitive way that even my morning grogginess couldn’t obscure.

This project gave me the perfect opportunity to use the Intel Galileo I’ve had sitting under my desk. While it definitely could have been done with an Arduino, the Galileo happens to have a built in ethernet jack and I didn’t have an ethernet shield lying around (or Arduino).

I started with the data. I needed easy access to some simple weather info which Yahoo happens to provide in xml. It’s pretty basic and doesn’t really offer the hourly data I wanted but, it’s a start. The Galileo is running a javascript environment called galileo-io which is based on the Johnny-Five Arduino framework (essentially javascript for the arduino). Getting the data I want is quite simple. In this case I’m only concerned with one value, the first instance of code in the yweather:forecase tag (the present forecast). Yahoo provides a simple guide which explains each code, making it easy to create a binary situation: rain/thunderstorms bad, everything else-whatever. I created a simple list of values that I could compare the given code to that, if matched, would indicate some sort of rain. Adding a simple delay() then allows me to have this GET request run every day, making sure that the Galileo will always have relevant data.

Pretty straight-forward so far, and the hardware side is no different. Having essentially narrowed this down to a two-case problem (rain or no rain) I could get away with having a single LED turning on or off. But that’s not really what I’m going for. My hope it to connect it to the audio controller that currently controls the LED strips in my room, in order create a much more immersive and dynamic visual (think flashing lights or gentle fades for thunderstorms and showers). I, unfortunately, don’t have access to my room right now but I’ll be sure to post an update once I have something more visually interesting to show.

Untitled Document

no comments

leave a response

Untitled Document