metachronistic

Sun, 07 Jun 2009

Arduino weather station

Current Arduino setup

Arduino setup

My Arduino-based weather station has improved in the last week to the point where it’s delivering useful data. I’ve got five DS18B20 temperature sensors hooked up and reporting their temperatures to my Goldstream Creek Weather Pages. In the image on the top of the post, the Arduino is on the left, the indoor sensors are in the middle, and the outdoor cluster of temperature sensors is on the right (under a yogurt container). At the moment, I’m just averaging the data from the two sensors that are inside and the three outside, but eventually I’d like to place each sensor in a different location. I’m not sure where the outdoor sensors will go, but one of the indoor sensors will move up to the second floor of the house. Twisted-pair telephone cables carry the data and power to the sensor clusters.

I’ve also connected a cheap photoresistor to the sensor cluster in the house. I’m converting the resistance it reports to a value from 0 (dark) to 100 (light). It’s in a place that rarely gets direct sunlight, so the values should give some idea of when the sun is up, and whether it’s sunny or cloudy. I have a more sophisticated light sensor (TSL203R) and a barometric pressure sensor (SCP1000), but haven’t tried them yet. I’ve run out of breadboards, and now that my Arduino is actively delivering data, I’m a bit less inclined to experiment.

I think it’ll be interesting to compare the outdoor temperatures from behind the house with the temperature coming from the Rainwise weather station atop the dog yard gate. Also, there ought to be an obvious relationship between outdoor temperature, light, and indoor temperature, since it seems like the house heats up much more quickly when the sun is beating on the south facing side. If I was really ambitious, the windows and window-shades could be connected to the system: it’d open the windows when it detected cooler temperatures outside than inside, and close the shades in whichever window is getting direct sunlight.

Once the design and software has stabilized, I’ll be sure to post the schematics and code.

Tags: , ,
cswingle @ 16:17:38 -0800

12 Comments »

  1. Any thoughts in wind speed? I’m trying to think of a way to read wind at a bunch (say 16) of points but want some detection at even low speeds (I’m not all that interested in absolute values, just little/some/more

    Comment by Simon — Mon, 08 Jun 2009 @ 1:41:10 -0800

  2. Simon,

    It seems like you need some sort of counter (magnet? IR?) that’s triggered as the blades of the instrument spin in the wind. There’s also having the blades spin a motor and measuring the current produced, but that seems like it’d be a lot harder to calibrate and I’m not sure how hard it would be to convert that to something the Arduino could read.

    Thinking outside the box, what about a wind sock with a flex sensor? I’m not sure how bendable those things are, but if they’re flexible enough, you could sew one into a wind sock and as the sock inflates, the sensor would straighten. It might give you a good low / medium / high signal at low cost per sensor.

    Let me know what you come up with!

    Comment by cswingle — Mon, 08 Jun 2009 @ 5:45:39 -0800

  3. [...] sensor in the Rainwise weather station at the top of the dog yard gate, a collection of sensors out behind the house under the oil tank, and a set of sensors under a collection of yogurt containers on top of a foundation post on the [...]

    Pingback by metachronistic » Weather station updates — Sun, 12 Jul 2009 @ 16:08:51 -0800

  4. Cool! I’d love to see what you have so far. I’m looking for a project to get into Arduino and I think building a weather station might be what I pick.
    I’d ideally like to measure
    Temperature
    Wind speed
    Wind Direction
    Precipitation

    Comment by David Hayes — Mon, 02 Nov 2009 @ 14:55:02 -0800

  5. David,

    My Arduino weather station currently has three sets of temperature sensors (an aspirated set to the west of our house, a set under our oil tank behind the house, and a set for indoor temperature), a humidity sensor (in with the west temperature sensors), a solar radiation sensor, and a barometric pressure sensor. I got all the sensors from SparkFun Electronics.

    Wind speed, wind direction, and precipitation are all more difficult to measure. For wind speed you could use a counter approach (as the fan blades spin, this triggers a counter based on a spinning magnet or light crossing a gap in the base of the fan blades), direction might be a series of magnetic counters around the post supporting the wind vane. Precip can be measured using weight (but how to empty the container?), or a tipping bucket counter (two offset buckets that each hold a tiny amount or precip — when one fills, it rotates around, dumps and presents the other one for filling). I’m sure you can buy these instruments from a company like Campbell Scientific, but I haven’t looked into it.

    Feel free to drop me a line if you’d like more information on the code / electrical hookups for my station.

    Cheers,

    Chris

    Comment by cswingle — Tue, 03 Nov 2009 @ 7:01:57 -0800

  6. Hello,

    nice project. I’m trying to build my own weatherstation. The only sensor i tested so far is the same as u use DS18B20 wich works fine. Since I have found others digital sensors for light ( Intersil ISL29001 ) etc (wich I haven’t tested yet), my main focus now is on passing the temperature value to my database. I also have an ethernet shiled for my arduino. I’m looking for a way to pass the temperature value to a php-page on my personal webspace. The php script should accept this value and proces it into the database and show a table with the values. I’m really stuck on this!
    Is this the same way you do it? If no, how do you do it?
    Thx in advance

    grtz,

    Bert

    Comment by Hulsmans Bert — Fri, 15 Jan 2010 @ 7:10:32 -0800

  7. Bert,

    My Arduinos are plugged into an ASUS eBox computer running Linux, which is on all the time (it draws less than 20 Watts, usually around 7), and I get the data directly from the USB connections to this system. As for your idea, I should think that would work if the Ethernet shield and software allows you to hit your web site. You could create a data insertion page that accepts a value in the URL (http://web.site/temp_insert.php?temp=-39.2). The PHP would receive this value as $temp and insert it into your database. From there, it’d be easy to add other sensors as new values in the script (?temp=-39.2&rh=67&solar=1.1 etc.).

    Cheers,

    Chris

    Comment by cswingle — Fri, 15 Jan 2010 @ 7:51:23 -0800

  8. Hey Chris,

    thanks for the response. Just like you said: I allready have that PHP script wich works fine when I hard code the temperature(you can try it on my website: http://www.bertenjoke.be/arduino.php?temperatuur=77. eg the hard coded value is added in my mysql database table. What I specificly am looking for is the code to send a http-request where I can replace the hard coded value by the value of the DS18B20.
    Maybe you can answer my question? Maybe someone will read this and … :-)

    grtz,

    Bert

    Comment by Hulsmans Bert — Fri, 15 Jan 2010 @ 13:31:02 -0800

  9. Bert,

    There’s an example of how you’d make a client connection with the Ethernet library. It’s at: http://arduino.cc/en/Reference/ClientConnect. You’d just change the IP addresses to match the Arduino and your server, and change the GET request you send to one that hits your page. The thing I’m not sure about is how you pass the web server host name, since your web site is probably a hosting provider. For example, my web site is hosted at BlueHost. The actual server that hosts my site is named box410.bluehost.com and has an IP address of 69.89.31.210. If you go to that IP address you get a generic BlueHost page because the web server doesn’t see the swingleydev.com virtual host name. Anyway, I’m sure it’s doable, I just don’t know enough about HTTP to know how the virtual host name gets passed from client to server.

    Cheers,

    Chris

    Comment by cswingle — Sat, 16 Jan 2010 @ 7:36:37 -0800

  10. Bert,

    I just looked up how virtual hosts work. HTTP/1.1 supports the Host: header. You’d modify the IP addresses in that code I pointed you to, and instead of the GET that’s listed, you’d use:

    client.println("GET /arduino.php?temperatuur=77 HTTP/1.1");
    client.println("Host: http://www.bertenjoke.be");
    client.println();
    

    Note: Wordpress has added http:// to the front of your web site address in the code above. I’m not sure how to remove it, so when you use the code, be sure you have just the hostname, starting with www and ending with be.

    All you need to do to make this work is to figure out how to get the temperature (and whatever other sensor data you have) out of your Arduino, and put the value into the GET string above.

    Cheers,

    Chris

    Comment by cswingle — Sat, 16 Jan 2010 @ 7:44:43 -0800

  11. I’m gonna give it a try and I’ll let you know if it works.
    many thanks in advance!

    cheers

    Comment by Hulsmans Bert — Sat, 16 Jan 2010 @ 12:51:33 -0800

  12. IT WORKS!!!
    THANKS MAN…
    A few days ago i also tried the webclient example. It didn’t work for me. Now I’ve ound the problem. I can’t disable DHCP on my modem!!
    Since arduino ethernet shield doesn’t support DHCP I included the dhcp library… this was my key to succes.
    Now I’m gonna take a look at implementing the rea temperature
    When I’m done I’ll create a special link to my website as tutorial with screenshots!

    cheers

    Comment by Hulsmans Bert — Sat, 16 Jan 2010 @ 14:58:49 -0800

RSS feed for comments on this post. TrackBack URI

Leave a comment

Back to Swingley Development
Powered by WordPress