sun, 31-may-2009, 12:16

Arduino and prototyping shield

Arduino and prototyping shield

Yesterday, my Arduino board showed up in the mail. It’s pictured in the photo alongside a Canadian dollar from when I drove up to Alaska. I ordered it with a prototyping shield and Getting Started with Arduino, a book written by one of the developers of the Arduino platform. The book is a great introduction to the hardware and the software you use to control the gadget. To fully appreciate the book, you’ll want to get a few extra extra components so you can try the experiments in the book. These include a breadboard, solid core wire for the breadboard, a button, light sensor, LEDs, and a variety pack of resistors.

What is it? It’s a very simple computer connected to fourteen digital input / output pins, six analog input / output pins, and a USB communication system so you can read data and put programs on the system. In other words, you can read data from the environment, control things based on that data, and send data back to a computer all on the same small board. I’m interested in using the platform to build my own weather station to complement the professional station we have. But more generically what’s cool about it is that it provides an inexpensive (my board was $35) platform for “programming” the world. Instead of buying a gadget off the shelf that someone else has built to perform a task they think you’ll want, you can build something to do exactly what you want.

In the real world.

All I’ve done with it so far is to control the flashing of the pair of LEDs that came with the prototyping shield. I know that doesn’t sound very exciting, but if you can control LEDs and make them go on and off, or vary their intensity, that means you can control anything that takes an on / off, or variable input. For example, a set of fans in your house whose speed and direction is controlled by the relationship between the temperature in the house, in the attic, and outside. Or controlling a sprinkler system that senses how wet the ground is, reads the weather forecast from the Weather Service and only turns on the sprinklers if no rain is expected. Or a system that operates a dog door, sensing which dog has approached by reading an RFID tag on their collar and then opening or locking the door depending on whether they are allowed in or out.

You get the idea. Combining any of the wide variety of input sensors available with the ability to do things based on logic that you control is a really powerful tool. And the low cost of the board makes it reasonable to experiment and try things out until you get a system working the way you want.

My initial project will include a series of temperature sensors that I’ll put in different places in the house and outside (maybe even in a dog house?), a light sensor and a barometric pressure sensor. Of course, you can buy small weather stations that have all of these things in them, but most can’t read temperatures below -40°F, and most only have one sensor. Best of all, I’ll plug mine into a “real” computer via USB and record the data as it comes in.

wed, 14-jan-2009, 19:07

The cold snap of 2008/2009 has finally broken. The plot below comes from my Ninety day weather summary plot for the Fairbanks Airport weather station (PAFA). That web page has a description of all the variables shown on the plot, but here I’m interested in the vertical red bars, which represent the high and low temperatures for the day. You’ll notice that from December 27th through January 11th, the temperature was far below normal (the 30-year normal high and low temperature are the solid blue, mostly horizontal lines. Record high and low temperatures are the green x marks. We didn’t come close to breaking any low temperature records.

Ninety day weather summary

Ninety day weather summary

So how does this cold snap compare to those in the past? Most people cite the cold snap of 1989 as the one they remember. Was the current period comparable?

My first attempt at answering this question was to generate a list of consecutive days where the low temperature for the day was below -40. It’s a fairly complex query because we need to compare a table against itself, and we need to report the results from both rows that match. Here’s the SQL:

SELECT a.dt, a.min_temp, a.temp, a.max_temp
    FROM isd_daily AS a INNER JOIN isd_daily AS b
        ON a.isd_id=b.isd_id AND a.dt=b.dt - INTERVAL ’1 DAY’
    WHERE a.isd_id=’702610-26411’ AND a.min_temp<=-40 AND b.min_temp<=-40
UNION
SELECT b.dt, b.min_temp, b.temp, b.max_temp
    FROM isd_daily AS b INNER JOIN isd_daily AS a
        ON a.isd_id=b.isd_id AND a.dt=b.dt - INTERVAL ’1 DAY’
    WHERE b.isd_id=’702610-26411’ AND a.min_temp<=-40 AND b.min_temp<=-40
ORDER BY DT

The output is a list of consecutive dates and temperatures. From there, I wrote a Python script to read these periods and calculate the length, average temperature, average minimum, and the cumulative degree days below freezing. Using this metric, our recent cold snap was the coldest since the cold snap of 1989. Here are the two compared:

For period between 1989-01-19 and 1989-02-01
 Days = 14
 Average temp = -42.9
 Average minimum = -48.0
 Cumulative degrees below freezing = 1048.7

For period between 2009-01-02 and 2009-01-11
 Days = 10
 Average temp = -40.8
 Average minimum = -44.8
 Cumulative degrees below freezing =  728.0

You can see that this doesn’t include the first portion of the cold snap, because the low temperature on New Year’s Day was a balmy -38°F. So it doesn’t seem like it really captures the full length of the recent event.

Getting the mail

Getting the mail at -53°F

The other approach I tried was to examine the entire historical record, calculating the average temperature for all periods of various lengths. It turned out that a window of 16 days resulted in the highest ranking. But even so, it was the 62nd coldest 16 day period between 1946 and the present. You can see the reason why the ranking is so low if you look at the results:

rank      Date interval     avg temp (°F)
  1  1947-01-17 - 1947-02-01  -47.19
  2  1947-01-18 - 1947-02-02  -47.06
  3  1947-01-19 - 1947-02-03  -46.84
  4  1947-01-16 - 1947-01-31  -46.82

 29  1989-01-17 - 1989-02-01  -41.43
 30  1989-01-18 - 1989-02-02  -41.27

 32  1989-01-16 - 1989-01-31  -40.96

 35  1989-01-19 - 1989-02-03  -40.58

 47  1989-01-20 - 1989-02-04  -39.56
 48  1989-01-15 - 1989-01-30  -39.53

 62  2008-12-27 - 2009-01-11  -38.07

The top four coldest 16-day periods were all part of the same, longer cold snap, that lasted from January 16, 1947 through February 3rd of that year. Because the entire period was so cold, it yielded the top four coldest 16-day periods. I also included the intervening 1989 cold periods for reference. You can see that the 1989 event was also much longer than the 14-day interval identified by the consecutive days below -40 technique. The average temperatures over the 1947 events are quite impressive when compared to the recent average and the 1989 event. As bad as it seemed, we don’t really have much too complain about.

tags: Fairbanks  weather 
sat, 13-dec-2008, 16:43

Heat gun, vent pipe

Heat gun, vent pipe

Last winter our vent pipe froze solid and I spent a couple hours in the attic with a heat gun melting the blockage. A couple days ago I noticed that flushing the toilet was pulling water out of the traps in the sink and bathtub, so I knew the vent was getting plugged again. My attempt at a fix over the summer was to put a larger pipe over the vent on the roof so the condensation might happen in the outer pipe, which could be easily removed and cleaned out. Unfortunately, when I got up on the roof today, not only was it impossible to get the outer pipe free, but the growing constriction wasn’t in the outer pipe anyway. Mid-summer my neighbor suggested replacing the section of the vent in the attic with a much larger diameter pipe (6” was his suggestion) and then insulating it. I never got around to it; almost frozen vent pipe; a priori.

The total freezing degree days to this point in the winter season has been 2,258, which ought to give me a pretty good way of estimating when I’ll have another problem. Thus far we’ve had 74 days with an average daily temperature below freezing, and the average temperature for those days was 1.4°F. That’s below normal for the year: nine of the last eleven weeks have been below average. But the heart of the winter is approaching, so it’ll take many fewer than 74 days to double our freezing degree days for the season.

My first attempt to fix the clog was to insert a heat gun into the clean out and let the warm air from the heat gun melt it (shown in the photo). I don’t think this had any real effect. I kept it going for a little over an hour, monitoring the backside of the pipe to make sure the heat gun wasn’t melting it. But it was around -10°F this morning, so I’ll bet the hot air was pretty cold by the time it rose to the ice. The second attempt was using a pipe snake from up on the roof, but it couldn’t go past the constriction, and even if it had, I’m not sure it really would have cleared out much ice. Finally, I dragged a five gallon bucket filled with hot water up onto the roof. I got about three gallons into the vent before it was filled to the top. At first I was nervous that this wasn’t going to work and I’d have three gallons of water turning to ice in the vent, but the water started dropping slowly, and after a minute, the blockage gave way and hot water came plunging down the pipe. I poured the final gallon or two through the pipe, and came down off the roof.

Tomorrow I’ll put some 2” fiberglass insulation around the part of the pipe that’s exposed in the attic, which should help. And I’ll be keeping my eye on the total freezing degree days for the rest of the winter. Once it gets up to 4,000, I may want to go back up on the roof with another bucket of hot water.

SQL query from my weather database: SELECT sum(32.0 - t_avg::double precision) FROM daily;
sat, 25-oct-2008, 17:16

Twenty-below

-20°F

Today I brewed my 80th batch of beer, One-eyed Squirrel (named after a one-eyed squirrel that showed up at our feeders this fall). I decided to brew beer earlier in the week and last night I got the brewing water from Water Wagon (a coin-operated water depot where many people in Fairbanks go to get their drinking water). It’s more convenient to brew out by the red cabin than near the house, so I haul a 55 gallon drum of water out there. The water is normally around 40°F when it goes into the drum, and that’s a perfect temperature for the cold water supply used in my plate chiller which quickly chills boiling hot wort down to yeast pitching temperatures; around 68°F. When we went to bed last night it was a balmy 2°F outside, so I wasn’t worried about leaving the water out on the red cabin’s deck.

This morning, as you can see in the image on the left, it was -20°F, and the temperature of the water in the 55 gallon drum had dropped to 32°F. As soon as I started pumping it into the pot for the mash it froze in the lines to the pump. I wound up using a heat gun to keep the pipes and lines thawed while I pumped the water into a drum inside the red cabin where it’s warm. Six hours later when I was using the water to chill the wort, the water temperature was still 32°F. There’s a lot of energy between 32°F water that’s frozen and 32°F water that’s about to be 33 degrees, and I had 50 gallons of water somewhere between those two states all day today.

The brew went well. I double-ground the grains last night, and it paid off, giving me an 82% mash efficiency. Hopefully the yeast will take off later tonight or tomorrow and the beer will be good. It’s the first time I’ve used Cascade hops in several years and I’m hoping they don’t disappoint. In the past I’ve found the flavor to be somewhat soapy, but with the worldwide hop shortage, there’s limited selection when it comes to whole leaf hops. I’ll take what I can get.

This is my first batch using our old refrigerator as a fermentation chamber instead of the chamber I built several years ago. We keep the red cabin pretty cold in the winter, so the fridge is set up with an enclosed light bulb as a heater (just like the old fermentation chamber), but using a fridge allows for the possibility of cooling it down if the fermentation heats up the interior too much (a problem I’ve had in the past with the old fermentation chamber). I’ll also use it to brew lagers at some point. After 80 beers, maybe it’s time to give a lager a try.

tags: beer  brewing  house  weather 
sun, 12-oct-2008, 10:29

Station in the snow

weather station, dog yard, snow

A week or so ago we got a weather station (it’s the thing at the top of the pole on the left side of the dog yard fence in the photo) so we can keep track of the weather at our house. We’re one of the coldest places in the Fairbanks area, so we’re excited to see just how different our weather is. We’re sending the data to the Citizen Weather Observer Program where it’s ingested, analyzed, and disseminated by NOAA. I don’t know if they use it in their forecasting, but we’ve already shown up in a few Public Information Statements from the local forecast office.

Full details on the station, with some plots and other data reports (I’m still working on most of these…) are at http://swingleydev.com/weather/dw1454/. The station code is DW1454 and shows up in MADIS as D1454.


<< 0 1 2 3 4 5 6 7 8 9 10 11 12 >>
Meta Photolog Archives