Malvern Vale Weather: Technical Information


Hardware

The weatherstation hardware used for this website consists of a collection of discrete wireless sensors from the WS2000 series at www.elv.de. There are lots of weatherstation bits on sale at the Elv.de website, but they may not all be compatible. (Feb 2016: I am not certain whether Elv.de are still offering compatible equipment, as I haven't checked for a while.)

See Thalreit.de for more details of the hardware I use. Feb 2016: The Thalreit site seems to have gone now.

The ELV / WS2000 sensors send data back to a tiny radio box with an RS232 serial output. The weather data also appears on a portable LCD display. This system is fairly low in cost, and has the advantage of not needing power or signal cables running to the sensors. The sensors are mostly solar-powered but one or two of them use standard alkaline AA batteries. Being quite cheap, the sensors are not of the quality that you would need if you wanted to feed your reports into the Met Office.

This system is easily interfaced to your Linux, Unix or MacOS X computer using free open-source software (see Software section below). The software could also be made to work on Windows with only a bit of effort. However, the radio transmission protocol seems to lack checksums, so you do need to put some checks into your software so that wild values are thrown out. My software doesn't do as much checking as it probably ought to, but I do make some checks. In particular I don't trust rainfall data if it seems to be changing rapidly, so during really big sustained downpours it can take time for my software to catch up.

If you don't mind paying rather more, then much higher-quality kit is available. Make sure you get a documented, RS232-compatible output signal - and make sure there's some error detection in the radio protocol. At the top end, you might look for an "aspirated" outdoor temperature sensor. This means there's a fan that draws air through the device, so that you get to measure true air temperature without the device itself getting warm due to sunlight falling on it. This makes siting of the sensor less crucial. However, it's worth pointing out from the outset that most domestic stations will not return Met Office quality data anyway, because it's very rare that your house and garden are big enough (and sufficiently free of sheltering trees, land or buildings) to let your sensors get a really accurate picture. Most of my own sensors aren't too bad, but the wind readings are impaired by tall trees etc nearby.

Software

In my installlation, everything is done using free and open source software. This is a good solution provided that you are prepared to invest the time to compile the software from the source code. It might also help if you have some knowledge of an SQL database.

A FreeBSD file server receives weather data from the WS2000 wireless sensors via an RS232 serial port using the PCWSR program.

Documentation for the PCWSR program, along with information on the use of WS2000 weatherstations under Unix, can be found at Thalreit.de while the official source code is part of the wth weatherstation project hosted by Berlios. Feb 2016: The Thalreit and Berlios sites seem to have gone now. There is an archived copy of the WTH project over on Sourceforge.net: http://sourceforge.net/projects/wth.berlios/.

For backup purposes, I've copied the last two releases of the WTH software onto my web server in case the Sourceforge archive goes. My local download links for the software are here: pcwsr-0.1.4.tar.gz and here: pcwsr-0.1.5.tar.gz.

The PCWSR program decodes the binary data transmissions into readable ASCII data, with one line of text being output for each data update. This then is ideally suited for a classic Unix pipeline, so the data is simply piped into a second program called pcwsr_to_postgresql which reads the data, does some error checking, and then stores the readings into an SQL database, which is powered by Postgresql.

Every 15 minutes, a shell script is kicked off from a cron job. The shell script calls a small set of quick and dirty PHP scripts to query the SQL database, build the web page and graph images for the last 7 days, and upload them to the web server. A nightly cron job does a similar job for the last 12 months of data, building a web page showing the long-term view. The graphs themselves are plotted using an excellent open source graphing program called Ploticus. My shell scripts and PHP scripts can be downloaded here but be warned, they are pretty klunky!

The software versions currently in use are:

	pcwsr version 0.1.4    (From www.Berlios.de WTH project)

	ploticus version 2.20 (This is a little old, but recent versions
	caused a problem with the rainfall graph when there was no rain
	for a week).

	postgresql-client-8.1.5 PostgreSQL database (client)
	postgresql-libpqxx-2.6.7 A new C++ interface for PostgreSQL
	postgresql-server-8.1.5 The most advanced open-source database available anywhere

	php4-4.4.4_1        PHP Scripting Language (CLI)
	php4-pgsql-4.4.4_1  The pgsql shared extension for php

	FreeBSD 6.1-RELEASE-p10 i386

I hope this is useful. The weak points of this system are the tacky shell/PHP scripts used for building the web display code. This display code could really do with some improvement. Also, a more rigorous pipeline filter could be used to make a noise filter to drop erroneous radio data more cleanly.

Martin Johnson
January 2007