The HIP Weather Project

Welcome to the Hardware Interfacing Project (HIP) Weather Page at Earlham College. We collect, archive and publish weather data on the web using only open source software, including the Linux operating system.

This project was originally supported by Earlham's Ford/Knight Fund and Computing Services.


Weather on the roof of Dennis Hall at: 2009-03-10 17:20:01-04
  • Outside Temperature: 22.8 C ( 73 F)
  • Wind Speed: 16.0 m/s (35.79 mph)
  • Wind Direction: SW
  • Barometer: 28.83 inches
  • Humidity: 63 %
  • Daily Rain: 0.02 cm
  • Total Rain: 0.12 cm
  • Wind Chill: 23 C ( 73 F)
  • Dew Point: 15 C ( 60 F)
  • Barometric Trend: Steady

Weather Links

Hardware

Out weather station is a Davis Instruments Weather Monitor II equipped with the WeatherLink RS232 serial interface, rain collector, external temperature/humidity sensor, and a solar radiation sensor. We gather data from the station with a dedicated PC running Red Hat Linux 6.X. The PC is an old 166 MHz Pentium donated to us by Infocom, a local ISP.


Software

The software consists of three modules.

  • Weather Station Interface
    We gather the raw data and calibrate it on a PC interfaced to the weather station using C code, the tarball with the files is called getWeather.tar. The Serial-Programming-HOWTO for Linux was a big help.

  • Database
    We use a PostgreSQL database on the CS department web server. We wrote getWeather.pl, a Perl script that runs getWeather.c remotely on the weather station PC and uses the PostgreSQL perl module (Pg.pm available on CPAN) to insert data into the database. We use the cron facility to update take data with getWeather.pl every 15 minutes.

  • Web Interface
    We wrote a CGI interface to the database called currentWeather.cgi that uses the Pg module to pull the most recent data from the database. The weather data at the top of this page is displayed using currentWeather.cgi. (Our next project is to display archived data.)
  • Glue
    We make the following available as examples of _one way_ to do this. Since these scripts depend on lots of other technologies they are very sensitive to a particular system environment. Your milage may vary.

Davis provides documentation and sample C code for accessing their WeatherLink hardware. We found it useful. Here are local copies:

  • techref.txt - This file contains a technical description of the RS232 interface. It describes the primitive commands upon which all higher level functionality must be built. It also contains may examples of "C" code fragments to illustrate how the commands are used. In addition, this file contains tables of the station and link memory addresses.

  • appendix.txt - This file contains descriptions of coded numerical and bit-mapped values.

  • faq.txt - This file contains short answers to may commonly asked questions.

  • commands.c - This source was included to give you a source code reference of the commands in action.

  • serial.c - Example "C" interface to the chip.

  • serial.h - Header file for serial.c functions.

  • ascii.c - Converts a binary weather data file to ascii form.

  • ccitt.h - Tables used for the CRC checksum calculation.

  • thitable.h - A table for calculating Temperature-Humidity Index from temperature and humidity data.

Email us : hip@cs.earlham.edu

Page last updated: Summer, 2000

#132623