Acquires wind speed data from the 1733 anemometer interface (read first).
A computer can be used to gather, store and display data from the 1733
Click the refresh button for a snapshot of current wind speed as read by the interface.
The Interface Circuit
The serial interface in Figure 5 is one way to get wind speed data into your computer. It's based on the easy-to-use PICAXE microcontroller. Two of the chip's analog-to-digital converters read the voltage on either side of the shunt resistor and report the readings to the computer via the computer's serial port (or USB port with adapter).
*Or serial/USB adapter if no serial port is available. (Also called a FTDI adapter.)
Interface (in black box) mated with (blue) FTDI adapter
The red/black wire is 5 volt power from the computer. The black/white wire is the current loop. The silver FTDI cable plugs into a USB port on the computer. The adapter shows up in Device Manager as a COM port (typically COM5).
Program for Figure 4 PICAXE Microcontroller Interface
These chips are easily programmed. The program (in PICAXE Basic) is shown in blue below. Copy and paste the code to the PICAXE Programming Editor and program the chip:
main: SerIn 3, N2400, ("c="), b0 'gets first character after qualifier ("c=") 'from computer if b0 = "s" then gosub get_speed 'calls up "get_speed" subroutine below endif goto main get_speed: ReadADC10 1, W2 'gets voltage on I/O 1 (pin 6) 'this is one side of the shunt resistor. ReadADC10 2, W3 'gets voltage on I/O 2 (pin 5) 'this is the other side of the shunt resistor SerOut 0, N2400, (#W2, 32, #W3, 13) 'sends data to computer '(data, space, data, CR) Return
Retrieving and Processing the Data
Any number of programs written in any number of languages could be used to retrieve and process the data from the interface, so long as the program can access the computer's COM ports. The data is retrieved by sending "c=s" to the interface. The protocol is 2400/8/1/N. The interface will respond with two decimal numbers between 0 and 1023 that represent the two voltages at the inputs (one from either side of the shunt resistor). The numbers are separated by a space and end with a carriage return, like so: <voltage one><space><voltage two><carriage return>. The processing algorithm should first subtract the two numbers, then multiply the result by the scale factor .488 to convert to tens of millivolts (ie, MPH or m/s). [Note: The scale factor is derived by multiplying the power supply voltage, usually 5 volts, by 100/1024. See line 166 in the code below for more on this.] The data can then be used in whatever manor - saved to a file for plotting on a graph, passed directly to a web server, peak/average, etc.
For example, "get_windspeed.pl"
The as-built anemometer interface is connected to the server that hosts this web site. Below is the Perl code the server invokes to retrieve the data from the interface when the refresh button in the red box above is clicked. [The server then sends the data to your browser for display.] The code can be used standing alone [web server not required] or as the basis for just about any wind speed data processing algorithm you can think of. Be sure to read all the comments.
Here's the Code
Requires late-model ActivePerl installation
Copy and paste the code (in blue) to your favorite text editor. Name and save the file with .pl extension (get_windspeed.pl) to a location on the computer (ex., c:\anemometer).
Checking the Code
The code can be checked from the Command Line:
It should look something like this:
Note: If wind speed comes out as a negative number, reverse the current loop leads at the input to the computer interface.
Schematics produced with DCCAD.
Other PICAXE Stuff
Communicate with the PICAXE