Standalone SitePlayer Example

Weather Vane on Roof

The kids are studying weather at school, so a weather station seemed like a good thing to build. We installed a 1-wire weatherstation on the barn. The 1-wire network and devices are nice, but we had problems running the 1-wire network at distances over 100'. Our house, yard, garage, and barn are wired for ethernet, so connecting sensors to the ethernet seemed to make more sense.

At $29.95 the SitePlayer looked intriging. It's advertised as the "World's Smallest Ethernet Web Server". It is meant to be a co-processor, but it has limited I/O of it's own.

The idea is have weather sensors scattered around the yard (and neighborhood?). Each with it's own web server. HTTP/XML can be used to collect and exchange data.

RoadRunner is our connection to the Internet. RoadRunner doesn't want people running webservers attached to the Internet, luckily a small amount of space for webpages is part of their standard package. Cable routers are typically connected to RoadRunner, and running webservers behind them on the local LAN is OK.

Several weather data sites ( Weather Underground, Weather for you) accept and store historical data. The data is posted via HTTP POST or FTP. The SitePlayer doesn't support FTP, and can't initiate the HTTP POST. Another computer behind the router must collect the data from the sensor SitePlayers and post it either to the RoadRunner web page or to one of the weather sites out on the Internet. People on the local LAN can directly view the data on the sensor SitePlayers.

Wind Direction Sensor

The weathervane was made from some copper roof flashing soldered to some 3/8" brass rod. The vertical rod is connected at the balance point of the horizontal rod with the tail attached. A copper washer is soldered to vertical brass rod to act as a bearing and to prevent water from entering the housing. The housing is made out of two 4" sewer caps and a small section of 4" sewer pipe.

weathervane weathervane

A magnet attached to the weathervane and magnetic reed switches in the case were chosen as the method to detect the wind direction. The SitePlayer has eight I/O pins. With eight magnetic reed switches, the wind direction can be determined to 22.5 degrees (When the magnet is positioned between two switches, both switches are toggled). Each of the I/O pins is pulled high using a resistor network. When the magnet is near the reed switch, the I/O line goes from logic 1 to 0.

magnet magnetic reed switches

The magnet is attached to a piece of copper that is soldered to the vertical brass rod. A 3/8" hole is drilled in the center of both end caps. The piece of copper is attach after the rod is placed through the end cap. The eight reed switches are arranged in a circle on the circuit board. The circuit board is mounted inside the PVC pipe so that the magnet just passes over the reed switches when the weathervane rotates.

circuit board Power of Ethernet

Since there is no AC power on the garage roof where the weathervane is mounted, the power to the SitePlayer is supplied over the unused CAT-5 cable wires (sometimes called POE or "Power over Ethernet"). I believe that there is an IEEE standard coming out, but I just used the RJ45 pins 4&5 for the +DC, and pins 7&8 for the ground. I used a Leviton 2-Port CAT-5 jack to inject the DC power and standard ethernet signals on Pins 1,2,3, and 6. I used an 18VDC power adapter I had to insure that the 7805 voltage regulator had enough voltage at the end of a long CAT-5 wire. Inside the housing, I used another CAT-5 jack to "extract" the power before the ethernet signals were sent on to the 10 Base-T filter. Since the 10 Base-T filter doesn't fit in a standard circuit board, I soldered on lead wires and covered them with heat shrink tubing.

Parts List

1 - SitePlayer, SP1, $29.95, www.siteplayer.com
1 - 10 Base-T filters, FIL0011F (only comes in a package of 5), $24.95, www.siteplayer.com
1 - printed circuit board, 276-1499, $3.99, radioshack
1 - 5V voltage regulator, 276-1770, $1.49, radioshack
8 - magnetic reed switches, 306-1121-ND, $4.05, www.digi-key.com
2 - 10 pin SIP connectors for SP, ED7210-ND, $2.90, www.digi-key.com
1 - Bussed 10K ohm resistor network, 4610X-1-103-ND, $0.39, www.digi-key.com
4 - 0.01uF ceramic disk capacitor, 272-131, $2.40, radioshack
2 - 470uF 35V Electrolytic capacitors, 272-1018, $1.29, radioshack
1 - 0.1uF ceramic disk capacitor, 272-135, $0.99, radioshack
1 - green 5V LED
1 - 470 Ohm resistor, 271-1317, $0.99, radioshack
2 - 4" sewer pipe PVC caps, $2.00, Lowes
1 - 4" solid sewer 10' pipe, $5.00, Lowes
3 - Leviton CAT-5 jack, $19.44, Home Depot
1 - Leviton 2-Port QuickPort Surface Mount Housing, 41089-2WP, $5 Home Depot
1 - 18VDC power adapter
1 - magnet, $2 (package of 4), American Science & Surplus

Software

The SitePlayer is neat in that it allows you to create HTML web pages with special tagged variables that get substituted when the web page is retrieved. The variables and other definitions are stored in a *.SPD file. With the weathervane, I just used the standard ^p1^ tag which points to the 8 bit I/O port. When it gets substituted, it returns a decimal value from 0-255 depending on the state of the I/O port.

I created 16 small GIF images to represent the different possible wind directions. I then named them so that the decimal ^p1^ value returned for a particular wind direction was part of their filename ( wd126.gif, wd127.gif, wd159.gif, wd191.gif, wd207.gif, wd223.gif, wd231.gif, wd239.gif, wd243.gif, wd247.gif, wd249.gif, wd251.gif, wd252.gif, wd253.gif, wd254.gif, wd63.gif)

I then created the index.htm HTML file with the special tags. Since the SitePlayer doesn't have a lot of space or computational horse power, you can use JAVASCRIPT to process raw data into something more meaningful. In this example, the decimal value of the I/O port is compared and converted into a verbal wind direction (ie. 243 is printed as East, South East). The HTML META REFRESH tag tells the web browser (or at least some of them) to update every second.

The siteplayer can also be set up to return data as XML (using the URL weather.xml). A computer on the local LAN can then do a HTTP GET of the sensor siteplayer XML URL to retrieve the wind direction. It can then gather data from other SitePlayer sensors, consolidate the sensor information, and then post it to an Internet site.

What's Next?

There are a couple of SPI (Serial Peripheral Interface) sensors that can be directly connected to the SitePlayer. (e.g. LTC2415 from www.linear-tech.com). More complex sensors like the Sensirion SHT71 Humidity Sensor or the Intersema MS5534 Altimeter/ Barometer module need a microcomputer like the BS2p24 to communicate with the sensors. The Stamp Computer can use the SitePlayer serial interface to pass the measurement results back. The SitePlayer working as a co-processor would then make the sensor available through tagged variable in web pages or XML.