Rabbit Powered 1-Wire Weather Station Controller

Copyright 2004-2005, Chris Nafis

LCD Version

LED Version

Overview

You can now purchase relatively inexpensive weather stations (eg. Lacrosse Technology WS-2310 ) and connect them to your PC to record the sensor data. If you have broadband access to the Internet, you can purchase software like Weather Display to post your weather data to places like the WeatherUnderground or Citizen Weather Observer Program (CWOP). You can also generate your own web page and send it to a remote Webserver. Unfortunately, these weather stations tend to be closed (i.e. can't easily add more / different sensors), and they tie up your PC.

You can address the closed nature of most weather stations by going the 1-Wire network route. Several years ago Dallas Semiconductor (Now Maxim ) developed an inexpensive weatherstation ($79) to demonstrate their chips that communicate over a single data wire. AAG Electronica now sells the weather instrument and several other sensors. Hobby Boards also sells several sensor kits and boards.

To eliminate the PC, people have tried different approaches. Tim Bitson has developed TINI Weather Server programmed using JAVA and a Basic Stamp based system that displays data on a LCD. Will Beals and Russ Chadwick developed the APRS Weather Station. It is a Molorola microcontroller-based board that transmits data via a serial port to a Terminal Node Controller (TNC).

I was intrigued by the Rabbit Semiconductor RCM3710 RabbitCore Module which is available for $49 (quantity 1). It's a small board with a Rabbit 3000A processor running at 22.1 MHz. It has 256K bytes of Flash memory and 128KB of SRAM. It has serial ports and an Ethernet connection. The processor is programmed in C and comes with a royalty-free TCP/IP stack. The C implementation also supports multitasking / cooperative processing with co-states.

The Rabbit looked like a great fit for a small processor that would read the 1-wire sensors, display the info on a LCD, and post the weather data to Internet. Since sites like the WeatherUnderground archive and graph the data, there is no need for us to do it.

The last piece of the puzzle that significantly simplifies things is the The Link from ibutton.com. It is a serial port to 1-wire interface. I originally purchased one to extend the range of my 1-wire network. It also provides an additional 5VDC line that helps when you have a lot of devices on the network (most 1-wire devices can get their power parasitically from the data line). The hidden treasure of the The Link is that it also has an ASCII interface. This relieves the processor of having to deal with difficult bus timing.

To get a quick start, I ordered a Starter kit from ImagineTools. The cost of additional systems could be easily reduced by fabricating a specific PCB board.

Controller Hardware

Optional LCD: Optional LEDs:

Weather Instruments

Assembly

RS-232 for 1-Wire Link Adapter

Using one of the 2x20 0.1 inch headers included in the starter kits, solder the following connections between the header (which plugs into J15) and the male DB-9 connector:

Heat shrink tubing can be put over the connections.

Optional LCD Display

Optional LEDs

Connecting AAG Weather Instrument

The AAG instruments and sensors use 6 position RJ-11 connectors. CAT-5 wire, connectors, and crimping tools are available at Home Depot type stores. In parasitic powered applications you only need to terminate two wires. I use CAT-5 wire with the Green wire for 1-wire GND/RETURN and the Blue wire for the 1-wire DATA. People number the pins differently. Look at the RJ-11 connector from behind (the end the wire comes out) and with the tab pointing down. You want to use the two center pins. The green wire will be on the right and the blue wire will be on the left.

For testing purposes, AAG supplies a short phone cable with the RJ-11 connectors attached.

Setting the Rabbit Clock

After the rabbit module is installed, the real-time clock will be backed up by the battery. The clock needs to be set to UTC time (not your standard time zone time). You can do this with a simple program like ( setclock.c).

Signing up for WeatherUnderground

To post weather data to the WeatherUnderground you first need to sign up to become a member. You can then add a weather station. Each of your weather stations will be assigned an ID. In my case, my rabbit based weather station ID is KNYCLIFT1. The WeatherUnderground ID and password are required by the Rabbit application software.

Signing up for CWOP

To post weather data to CWOP you first need to sign up. You will be assigned a station id. In my case, my station id is CW1411

Getting Chip ID's

Each 1-wire chip has it's own unique 64-bit serial number. The Rabbit application needs to know which device is which. A simple way to determine this is to connect the 1-wire network to a PC and run the Ibutton Viewer. If you plug the TAI-8515 Weather Instrument in to the 1-wire network, you should see three chips show up on the 1-wire network. The DS2450 handles the wind direction, the DS18S20 provides the temperature, and the DS2423 determines the wind speed. (***Please note that the C code lists the address bytes in reverse order).

screen grab of Ibutton Viewer

Software

The program ( rabbitweather.c) continually reads the AAG TAI-8515 temperature, wind direction, and wind speed counter. It displays the temperature, wind direction, wind speed, and wind gusts on the LCD. Every five minutes it attempts to post the information to the Weather Underground and CWOP.

You will need to set several variable before you compile the code:

// ibutton viewer lists in reverse byte order as 72000800140FB810
#define TAI8515_DS1820 "10B80F1400080072"
#define TAI8515_DS2450 "208DD00000000011"
#define TAI8515_DS2423 "1D484A01000000CC"

// Wind Direction Offset
#define WINDOFFSET 337.5

// Weather Underground Account info
#define WUID "xxxxxx"
#define WUPASSWORD "xxxxxx"

// CWOP info
#define CWOPCALLSIGN "CWxxxxx"
#define CWOPLAT "4249.91N"
#define CWOPLONG "07352.78W"
Depending on your network connection you may need to use a static IP address or specify a HTTP proxy server / port:
#define TCPCONFIG 3			// DHCP
#define PROXY "proxyserver.com"
#define PORT 8080

The program is broken into three major co-states. The first one continually communicates with the 1-wire network to get the sensor data. The second co-state updates the LCD display with the current time and weather data. The final co-state uses HTTP/TELNET commands to update the WeatherUnderground and CWOP sites every 5 minutes.

Additional References