Elizabeth and I are building a weather station...
Been a while, but progress has been made. First, lessons learned:
So, we spent some time uploading the Sparkfun Weather Shield sketch and watching it work (Thanks, Nate!). Then, on a business trip, I did some uploading of the Sparkfun Wifi Shield sketch and watching it work. No problems. Then, I started integrating the Wifi code into the Weather Station code, and ran into my nemesis: 2k of RAM. Most Arduino boards have separate flash and volatile address spaces, you load your program into the flash, and it uses the volatile memory for variables and other storage. Well, that 'other' storage includes string literals you define in your code, and you need a whole bunch of them to do posting to the various data services. That, and just declaring the WiFi and client classes ate significant storage, and I quickly ran out on the 2K Redboard. This is why they used an Electric Imp for the tutorial weather station; it has processing capability of its own that they use to handle the HTTP-based protocol used for the phant service at data.sparkfun.com.
I started to tackle this problem by enclosing all the string literals with the F() macro; a neat little tool that compels the compiler to store the string in flash, and then read it byte-by-byte when it's used. Still, I didn't gain enough memory to make the sketch fit. The solution that finally worked was to recode all the WiFi and TCP things needed to post data in a hard-coded set of routines specifically tailored to weather data posting, using the native AT commands of the WiFi Shield. Being new to Arduino, that was a challenge, took the better part of a week to get it working.
We did mount the hardware to it's outdoor location, atop the playhouse in the back yard. I recently put a new roof on it, so it's serving well to both shield the electronic components as well as expose them to the ambient air. I ran an extension cord for power, but our next task will be to integrate the solar panel and battery.
I'm also thinking through enclosures; the one the Sparkfun tutorial used looks quite handy, but I'm thinking of trying to stack some discount-store plastic plates. One of those more-time-than-it's-worth endeavors...
The parts arrived! Vanes, cups, shields, batteries, it's all here. I did miss one thing, a 3.5mm screw terminal block to put on the Sunny Buddy battery charger, so we don't have to solder the power cable to it. I may be able to get that in town, either at Radio Shack (while they last) or at OEM parts (surplus, hit and miss). Ordering just that would be rather expensive shipping, and I think Elizabeth would like OEM Parts...
We assembled the wind and rain sensors on the mast, and I found that my old camera tripod held the mast perfectly. Here's a picture of my ardent assistant, on the task:
We also soldered the stacking headers on the shields:
We also managed to download the Sparkfun weather shield demo code with CodeBender and run it, with all the sensors, Cool Beans! Arduino is really easy, compared to the old 28v EPROM thing. I did download the Arduino IDE, and I tried the WiFi shield code. I was worried I'd borked the WiFi shield, as I'd downloaded the weather code to the Redboard with the WiFi shield in HW mode (see the note in the hookup guide for why not to do that), but I later got it to work with the right setting, whew! Now, the trick will be to sift through all the codes and figure out how to integrate them into an internet-accessible weather station.
Next steps will be the code, integrating the power components, and fabricating or procuring an enclosure.
Elizabeth and I have been working on electronics projects using a kit that has "snap conduits", where you lay out the components on a plastic board and connect them with bars that snap into the component terminations, the same sort of snaps you'd see on your clothing. Really neat, and you can set up and tear down projects with abandon. After about 30 or so, I thought she was ready to see something more involved, so I introduced the Weather Station...
I've wanted to do one for some time. The pieces-parts have been available from a few places for quite a while, but I don't think it was easy enough for a fourth grader until Arduino. The relative ease of uploading code, combined with stackable shield boards to do the interfacing make it easy to put one together while explaining it in simple terms. So, here we go.
We spent Saturday building our component list. We started first by identifying all the things you'd want to measure weather-wise; here's our list:
We worked up the list by studying the Current Conditions page for our location on weather.gov. You'll notice two items have asterisks; I told Elizabeth that Dewpoint was not a measurement per se, it's a calculation using two measurements, and Visibility was going to be a bit harder to automate than we were prepared to take on, but the rest of the items formed the basis for our parts search.
Well okay, the parts search was pretty simple, Sparkfun has everything except a housing. Here's our wishlist:
The Weather Shield measures temperature, humidity, and barometric pressure right on the board, and provides the interface to the Weather Meters, one-stop shopping for all the interfaces. Having the temperature and humidity sensors directly on the board will present some challenges in deployment, as the whole Arduino stack will have to be "out in the cold", so to speak. One might want to get separate sensors to handle that complication (and Sparkfun sells them), but I figured we'd try it on-board first. The wind and rain sensors require 6-pin RJ-11 jacks, which will have to be soldered onto the board.
The WiFi Shield is a relatively new item; Sparkfun's weather station tutorial uses the older Electric Imp board. I'm not sure specifically how we're going to put data on the internet yet, but it appears to have the flexibilty to do both client connection to an external server as well as serving up connections on it's own. We're going to install the weather station in our back yard and connect it to the household WiFi in any final configuration, and the WiFi Shield looks up to that task. I have a couple of unused Raspberry Pi Model B boards that we'll probably press into service for early integration using USB, and as a backup solution if the Weather Shield doesn't pan out.
Power was relatively simple, using the Sparkfun tutorial as a guide to parts selection. We're going to use a solar panel to charge a 6ah battery, and Sparkfun has all the necessary parts. It all pretty well plugs together, but we're going to have to build a power cable to connect the Arduino stack, hence the barrel jack. I already have wire...
The Sparkfun RedBoard is almost tailor-made for the application, an Arduino board processor for a great price. I gave some thought to just wiring a Raspberry Pi straight to the Weather Shield, but that was going to be more complex a task than what I wanted Elizabeth to have to deal with.
There will be soldering: the RJ-11s, the power cable, and the Arduino stackable headers on the Weather and WiFi Shields. This is good; it shouldn't be just plug-n-play, and these items will be relatively easy to solder, not like trying not to cook a transistor.
We ordered the parts today, and we're going to "brass board" assemble the whole thing, get it working, then figure out a housing. Fun will be had, and hopefully will result in an operable weather station.