Wednesday, June 15, 2011

Nerd Project: Household Temperatures

I spent most of Saturday crawling around the attic and drilling small holes in the ceiling to complete a project I've been batting around for over a year now. Since we put in our whole-house fan (about a year and a half ago) I've been curious to see what effect the fan would have in reducing the temperature in our attic. This got me thinking about temperature regulation in our house in general: the basement having much smaller changes in temperature during both the winter and the summer, the temperature in the two bedrooms we've don't used and have closed off, how much cooking in the kitchen heats the house, et cetera.

Enabled by a friend of mine who loaned me a critical piece of hardware (because he's even nerdier than me and had extras just laying around his house), I built a little system that measures the temperature in six locations around our house throughout the day. This collection of little programs creates an internal webpage that shows the current temperature for all six locations in the house and every morning creates a graph of the previous day's data and adds a link to that graph on the webpage.

Here's an example from yesterday.

A few items of note:
  • The dark blue line for our garage shows a little ramp starting around 5:30am. This is when we started the clothes drier which vents into our garage and thus, warms it up. My wife has been interested to see how pronounced this effect is and whether we need to try to modify the venting so it dumps the air outside.
  • The spike in the purple line a little after 6pm is dinner being cooked. Again, another wife-requested measurement.
  • You can see attic (green) gets very hot during the day, hotter than the outside temperature. It was too hot yesterday to run the whole-house fan so there was no circulation in the attic. This data seems to suggest that getting some kind of attic fan that ventilates the attic better throughout the day may help in keeping the house cooler. We've got a fair amount of insulation but with the temperature knocking around 130'F during the peak of the day when the outside air is barely at 90'F, it seems like our attic could be acting as a heat source and some of that heat is sure to be leaking its ways back into our house.
  • Relatedly, the garage is definitely getting warmer than the outside our throughout the day as well. More insulation between the garage and the house would help but an easier solution may be to open the garage doors to allow the air to ventilate. There are plenty of hot days left in the summer to try this.
This system has been running for a few days now with only minor hitches. The biggest bug is that I something is wrong the basement measurements. I know the sensor is good as it was the first (and easiest) one to install and I used it as a proof-of-concept. I've been talking with my nerd-enabling friend and we've got a few ideas I'm going to pursue. I'm also a bit perplexed at how noisy the data is at times. The indoor data (kitchen and hallway) seem very smooth but the rest vary much more than I would expect. Maybe its not noise and the temperatures do vary that much.

Aside from adding a few more sensors (closed-off rooms, maybe the bedroom and the living room), I would also like to add sensors that detect when the whole-house fan is running and when the air-conditioning/furnace fan is running. I hope to get those last two in sometime this summer but I need to figure out the best/easiest way to do it.

I'll write another post soon in a few days detailing the specifics of how the system is put together for any fellow nerd out there who is interested.

3 comments:

  1. If you're gonna go calling me a nerd anyway, I may as well confess that I took a data acquisition class in college and what you call noise I call quantization error. I even know a guy who taught a little about quantization last December -- you should look him up sometime.

    Anyway, a couple of things come to mind. The first is simple oversampling and averaging, possibly with some sort of running average just to make your graph look all purty. The problem is that if your signal is at 37.25 A/D units, you're always going to read 37 and oversampling doesn't increase your effective resolution (but you can fake it with a moving average).

    The second is to add noise to the signal deliberately (Wikipedia says "uncorrelated noise") and oversample. If the noise is truly uncorrelated and has an appropriate amplitude (>= +- .5 units) and flat distribution, then you increase your effective resolution:

    1/4 of the time you'll see 36.75 to 36.99... units and read 36
    1/4 of the time you'll see 37.00 to 37.249... units and read 37
    1/4 of the time you'll see 37.25 to 37.49... units and read 37
    1/4 of the time you'll see 37.50 to 37.749... units and read 37

    and you'll average it to (ta-da!) 37.25.

    That's a lot of work just to smooth your quantization. Write a moving average function, eh?

    ReplyDelete
  2. Keith,

    I'm actually oversampling quite a bit right now; I'm using the average of 35 samples per data point. This is the reason that, say, the hallway and kitchen traces is as smooth as they are. These results are in-line with what I was seeing when I was running a test set-up with a single sensor in the basement and upstairs. The fact that my two indoor traces look pretty good makes me mostly confident that there is not some fundamental flaw in the system. Once I get the basement sensor working correctly we'll see if this pattern holds.

    My attic data is a bit mysterious. Smooth ramp up and ragged cooling down. Could that actually be the way the temperature is fluctuating up there? Most mysteriously, the outdoor temperature has four and five degree swings over the course of an hour.


    The more I think about it, though, the more it seems that perhaps the data is valid. The ramp rates are not extreme (the divisions on the x-axis are two hours apart) and the stability of the temperature controlled readings seems to correspond to reality well. Maybe the temperature in these environments is moving around this much and I'm just now getting the data to show it?

    Relatedly, sensor placement could be an issue, particularly for the outdoor sensor. I needed to place it in a covered location to avoid problems with precipitation and direct sunlight but I also didn't want to place it up under the eave of our roof where hot air can get trapped. Perhaps the current location is such that depending on the wind, the hot eave air or the cooler ambient air are blowing over the sensor. Regardless, the current location will have to do; its been wife-approved.

    ReplyDelete
  3. Are you oversampling, averaging, and then quantizing back to an integer, perhaps? I ask because your graph looks extremely aliased, and I'm very curious how it looks if you graph at the full vertical resolution you've oversampled/averaged.

    Interesting that by 02:00 your attic is cooler than any interior space in your house. When is someone going to invent windows that we can open and close with 5V? Couple that with a relay on the attic fan and you'd have a nice thermal headstart on the next day.

    ReplyDelete