Let’s talk about the weather…

As some of you may remember (yeah, right, who am I kidding) I used the Epoxy hotbox Arduino to read 1-wire temperature probes and make plots of the temperature. In LA, that’s pretty much the only interesting thing to plot, but given that the weather here is, ahem, a bit more variable, I’ve decided to make a dedicated weather station. The idea is that this will be a stand-alone outside station, using a lone XBee endpoint to sample the weather and send it to the router. With just an XBee, it should use little enough power that it can run off battery with a solar cell, which is nice since you don’t want the sensors near the house. I figure I’ll mount it somewhere down in the orchard.

A standalone XBee can’t really use the 1-wire probes, so I got some analog TMP36 sensors, and also a HIH-4030 humidity sensor (the same type I used for the Wine refrigerator). The XBee has 4 analog inputs, I’ll use one more for monitoring the battery voltage and the last one for a light meter so I can measure insolation (since we’re getting solar panels).

What I really want, however, is to measure the rain! Sparkfun has a weather sensor setup, so went ahead and ordered that. This measures rain with a “tipping bucket”, that makes a digital pulse every time the bucket has filled up with a certain amount of water. By counting pulses, you can then measure the rainfall to the resolution of the bucket (which in this case is 0.01″ or 0.25mm of rain, should be plenty).

The XBee has a function where it will send a packet every time a digital line has changed, so this makes it very easy to just count the number of line changes on the router. The only snag is that this requires the XBee to be awake, since it needs to monitor the digital line. Normally in an application like this you’d program the XBee to sleep and only wake up and take a sample every 30s or so. This dramatically reduces power consumption, but with the rain meter this won’t work. My ballpark calculations say that the battery should last about 2 days, and the solar cell should have enough power to charge it back up every day. We’ll see how it works out — I’m still waiting for those to arrive.

I did breadboard the temperature and humidity sensors up to test it. I also had to improve the python code I use to talk to the XBees from linux, since it was initially designed for point-to-point communication and not getting packets from an arbitrary number of remote XBees. The breadboard is a bit flaky, but here’s an example of the current, realtime, output:

The temperature and humidity over the last 24h, as measured by the XBee.

4 Comments

  1. Pingback: Weatherstation #2 – antenna | Patrik's projects

  2. Pingback: How-To: Arduino Wireless Bootloading using XBees | Patrik's projects

Leave a Reply to Mamma Cancel reply

Your email address will not be published. Required fields are marked *