0% found this document useful (0 votes)
31 views6 pages

E.5.1 Sample Program - Basic Wind Site

This document summarizes a sample program for an automated weather station. It includes wiring diagrams for sensors measuring temperature, humidity, wind speed and direction. The program is set to take measurements every 5 seconds and output hourly averages of temperature, humidity and wind speed to a data file every 15 minutes formatted with the date and time. It also performs error checks to ensure humidity readings do not exceed 100% and sets excessive readings to 100%.

Uploaded by

Serkan Sancak
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views6 pages

E.5.1 Sample Program - Basic Wind Site

This document summarizes a sample program for an automated weather station. It includes wiring diagrams for sensors measuring temperature, humidity, wind speed and direction. The program is set to take measurements every 5 seconds and output hourly averages of temperature, humidity and wind speed to a data file every 15 minutes formatted with the date and time. It also performs error checks to ensure humidity readings do not exceed 100% and sets excessive readings to 100%.

Uploaded by

Serkan Sancak
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

E.5.

1 Sample Program – Basic Wind Site 3: 2 SE Channel


;{CR10X} ;Data logger type (CR10X) 4: 3 Loc [ RH ]
;Station Information 5: .1 Mult
; Name 6: 0.0 Offset
; Number or ID
; Elevation ;-----------------------------------------------------------Begin RH Error Check
; History ; Note: automated error checks can mask measurement errors and hinder
; ; sensor diagnostics
;Program History 5: IF (X<=>F) (P89) ;Check to see if the relative humidity is
; Date of implementation 1: 3 X Loc [ RH ] ;greater than or equal to 100%. If it is, then perform
; Dates of revisions 2: 3 >= ;command number 6.
;----------------------------------------------------------Begin Wiring Diagram 3: 100 F
;Sensor #1: CS500 Relative Humidity and Temperature Probe 4: 30 Then Do
;CS500 Black = 1H
;CS500 Brown = 1L 6: Z=F (P30) ;Set the relative humidity to 100%.

Appendix E: Automated Weather Stations


;CS500 Red = 12V 1: 100 F
;CS500 Green = G 2: 0 Exponent of 10
;CS500 Clear = G 3: 3 Z Loc [ RH ]
;
;Sensor #2: 05103 Wind Monitor 7: End (P95) ;End of IF statement.
;05103 SHIELD Clear = G ;-----------------------------------------------------------End of RH Error Check
;05103 WSREF Black = G
;05103 WDREF Brown = AG 8: Excite-Delay (SE) (P4) ;Sample wind direction in degrees.
;05103 WDSIG Red = 2H 1: 1 Reps
;05103 WDEXC Green = E1 2: 5 2500 mV Slow Range
;05103 WSSIG White = P1 3: 3 SE Channel
;----------------------------------------------------------End Wiring Diagram 4: 1 Excite all reps w/Exchan 1
5: 2 Delay (units 0.01 sec)
;----------------------------------------------------------Begin Program 6: 2500 mV Excitation
*Table 1 Program 7: 4 Loc [ WIND_DIR_ ]
01: 5 Execution Interval (seconds) ;Measurements are taken every 5 sec 8: .142 Mult
9: 0 Offset
1: Batt Voltage (P10)
1: 1 Loc [ Battery ] ;Sample Battery Voltage 9: Pulse (P3) ;Sample wind speed in meters/second.
1: 1 Reps
2: Internal Temperature (P17) ;Sample the internal temperature 2: 1 Pulse Input Channel
1: 8 Loc [ IntTemp ] ;Note: This is recorded for diagnostic purposes and is 3: 21 Low Level AC, Output Hz
;not used in the program or output to the data file. 4: 5 Loc [ WIND_SPD ]
5: .0980 Mult ;For miles/hour use a multiplier of 0.2192. Always
3: Volts (SE) (P1) ;Sample air temperature in degrees C. 6: 0 Offset ;check instrument documentation for multiplier
1: 1 Reps ;values.
2: 25 2500 mV 60 Hz Rejection Range ;-----------------------------------------------------------Begin Data Output Section
3: 1 SE Channel ;-----------------------------------------------------------15 Minute Data
4: 2 Loc [ AIR_TEMP ] ;See section F.4.2 for conversion to Fahrenheit. 10: If time is (P92) ;Write to output file every 15 min.
5: .1 Mult 1: 0 Minutes (Seconds --) into a
6: -40 Offset 2: 15 Interval (same units as above)
3: 10 Set Output Flag High
113

4: Volts (SE) (P1) ;Sample relative humidity in %


1: 1 Reps 11: Set Active Storage Area (P80) ;Place 15 min data in storage area
2: 25 2500 mV 60 Hz Rejection Range 1: 2 Final Storage Area 2 ;number two.
2: 100 Array ID ;Lines containing 15 min data will
;begin with the array ID 100. 13: Sample (P70) ;Output instantaneous battery
1: 1 Reps ;voltage.
12: Real Time (P77) ;Time format: 2003,1,0950 2: 1 Loc [ Battery ]
1: 1110 Year, Day, Hour/Minute ;Year, Day of year, Hour min
23: Average (P71) ;Output hourly average of air temperature.
13: Sample (P70) ;Output instantaneous battery 1: 1 Reps
1: 1 Reps ;voltage. 2: 2 Loc [ AIRTEMP ]
2: 1 Loc [ Battery ]
24: Average (P71) ;Output hourly average of relative
14: Average (P71) ;Output 15 min average of air 1: 1 Reps ;humidity.
1: 1 Reps ;temperature. 2: 3 Loc [ RH ]
2: 2 Loc [ AIRTEMP ]
25: Wind Vector (P69) ;Output hourly average of wind
15: Average (P71) ;Output 15 min average of relative 1: 1 Reps ;speed and vector averaged wind
1: 1 Reps ;humidity. 2: 0 Samples per Sub-Interval ;direction.
2: 3 Loc [ RH ] 3: 1 S, θ1 Polar
4: 5 Wind Speed/East Loc [ WIND_SPD ]
16: Wind Vector (P69) ;Output 15 min average of wind 5: 4 Wind Direction/North Loc [ WIND_DIR_ ]
1: 1 Reps ;speed and vector averaged wind
2: 0 Samples per Sub-Interval ;direction. 26: Maximize (P73) ;Output maximum wind speed in
3: 1 S, θ1 Polar 1: 1 Reps ;the 1 hour period.
4: 5 Wind Speed/East Loc [ WIND_SPD ] 2: 0 Value Only
5: 4 Wind Direction/North Loc [ WIND_DIR_ ] 3: 5 Loc [ WIND_SPD ]
17: Maximize (P73) ;Output maximum wind speed in 27: Serial Out (P96) ;Store data to storage module.
1: 1 Reps ;the 15 minute period. 1: 71 SM192/SM716/CSM1
2: 0 Value Only
3: 5 Loc [ WIND_SPD ] End Program
18: Serial Out (P96) ;Store data to storage module. Program Output
1: 71 SM192/SM716/CSM1 Final Storage Location 1

Snow, Weather, and Avalanches


101,2003,1,0800,12.42,5.24,68.45,8.34,270,15.93
;-----------------------------------------------------------Hourly Data 101,2003,1,0900,12.40,7.45,60.34,4.72,275,8.30
Final Storage Location 2
19: If time is (P92) ;Write to output file every hour. 100,2003,1,0800,12.42,5.69,68.23,8.46,270,14.35
1: 0 Minutes (Seconds --) into a 100,2003,1,0815,12.41,5.94,66.57,7.20,272,12.30
2: 60 Interval (same units as above)
3: 10 Set Output Flag High
20: Set Active Storage Area (P80) ;Place hourly data in storage area
1: 1 Final Storage Area 1 ;number one.
21: 101 Array ID ;Lines containing 15 min data will
;begin with the array ID 100.
22: Real Time (P77) ;Time format: 2003,1,0950
1: 1110 Year, Day, Hour/Minute ;Year, Day of year, hour min
114
E.5.2 Sample Program – Basic Precipitation Site ;----------------------------------------------------------Begin Depth Sensor Call
;----------------------------------------------------------Begin Depth Sensor Status Check
;{CR10X} 3: If time is (P92) ;Perform command every 15 minutes.
;Station Information 1: 0 Minutes (Seconds --) into a
; Name 2: 15 Interval (same units as above)
; Number or ID 3: 30 Then Do
; Elevation
; History 4: If Flag/Port (P91) ;If the depth sensor is on, turn it off.
; 1: 11 Do if Flag 1 is High
;Program History 2: 21 Set Flag 1 Low
; Date of implementation
; Dates of revisions 5: End (P95)
;---------------------------------------------------------Begin Wiring Diagram ;----------------------------------------------------------End Depth Sensor Status Check
;Sensor #1 Judd Communication Depth Sensor, Interval 6: If Flag/Port (P91) ;This command allows for an instantaneous

Appendix E: Automated Weather Stations


;Clear = G 1: 11 Do if Flag 1 is High ;measurement of the snow depth from a PC
;Black = G 2: 1 Call Subroutine 1 ;that is connected to the data logger (press F1).
;Red = 12V
;Green = C1 7: If time is (P92) ;Call subroutine that measures snow depth
;White = 1H 1: 0 Minutes (Seconds --) into a
;Brown = G 2: 15 Interval (same units as above)
; 3: 1 Call Subroutine 1
;Sensor #2 Judd Communication Depth Sensor, Total
;Clear = G ;-----------------------------------------------------------Begin Data Output Section
;Black = G ;-----------------------------------------------------------15 Minute Data
;Red = 12V 8: If time is (P92) ;Specify 15 minute output interval.
;Green = C1 1: 0 Minutes (Seconds --) into a
;White = 1L 2: 15 Interval (same units as above)
;Brown = G 3: 10 Set Output Flag High
;
;Sensor #3: ETI Precipitation Gauge 9: Set Active Storage Area (P80) ;Place 15 min data in storage area number two.
;Red = 12V 1: 2 Final Storage Area 2
;Black = G 2: 100 Array ID ;Lines containing 15 min data will begin with the
;Green = P2 ;array ID 100.
;
;----------------------------------------------------------End Wiring Diagram 10: Real Time (P77) ;Time format: 2003,1,0950
*Table 1 Program 1: 1110 Year, Day, Hour/Minute ;Year, Day of year, hour min
01: 5 Execution Interval (seconds) ;Measurements are taken every 5 seconds.
11: Sample (P70) ;Output instantaneous battery voltage
1: Batt Voltage (P10) ;Sample battery voltage. 1: 1 Reps
1: 1 Loc [ Battery ] 2: 1 Loc [ Battery ]
2: Pulse (P3) ;Sample precipitation from ETI gauge. 12: Sample (P70) ;Output instantaneous air temperature from
1: 1 Reps 1: 1 Reps ;the interval depth sensor.
2: 2 Pulse Input Channel 2: 2 Loc [ DSTemp1 ]
3: 2 Switch Closure
4: 8 Loc [ PRECIP ]
115

5: .01 Mult
6: 0 Offset
13: Sample (P70) ;Output instantaneous snow depth from the
1: 1 Reps ;interval depth sensor. 25: Serial Out (P96) ;Store data to storage module.
2: 3 Loc [ IntSnow ] 1: 71 SM192/SM716/CSM1
14: Sample (P70) ;Output instantaneous snow depth from the ;-----------------------------------------------------------Begin Snow Depth Subroutine
1: 1 Reps ;total snow depth sensor. *Table 3 Subroutines
2: 4 Loc [ TotalSnow ] 1: Beginning of Subroutine (P85) ;Begin subroutine and label it number 1.
1: 1 Subroutine 1
15: Totalize (P72) ;Output the total liquid precipitation from 2: Do (P86) ;Turn on both snow depth sensors
1: 1 Reps ;the ETI gauge. 1: 41 Set Port 1 High ;(see wiring diagram).
2: 8 Loc [ PRECIP ]
3: Excitation with Delay (P22) ;Wait 0.6 seconds for the sensor to
16: Serial Out (P96) ;Store data to storage module. 1: 1 Ex Channel ;measure the air temperature
1: 71 SM192/SM716/CSM1 2: 60 Delay W/Ex (units = 0.01 sec)
3: 0 Delay After Ex (units = 0.01 sec)
;-----------------------------------------------------------Hourly Data 4: 0 mV Excitation
17: If time is (P92) ;Specify 60 minute output interval. 4: Excite-Delay (SE) (P4) ;Sample air temperature in degrees C
1: 0 Minutes (Seconds --) into a 1: 1 Reps ;from the interval snow depth sensor.
2: 60 Interval (same units as above) 2: 5 2500 mV Slow Range
3: 10 Set Output Flag High 3: 1 SE Channel
4: 1 Excite all reps w/Exchan 1
18: Set Active Storage Area (P80) 5: 0 Delay (units 0.01 sec)
21: 101 Array ID ;Lines containing 15 min data will 6: 0 mV Excitation
;begin with the array ID 100. 7: 2 Loc [ DSTemp1 ]
8: .2 Mult
19: Real Time (P77) ;Time format: 2003,1,0950 9: -273 Offset
1: 1110 Year, Day, Hour/Minute ;Year, Day of year, hour min
5: Excite-Delay (SE) (P4) ;Sample air temperature in degrees C
20: Sample (P70) ;Output instantaneous battery voltage. 1: 1 Reps ;from the total snow depth sensor.
1: 1 Reps 2: 5 ñ 2500 mV Slow Range

Snow, Weather, and Avalanches


2: 1 Loc [ Battery ] 3: 2 SE Channel
4: 1 Excite all reps w/Exchan 1
21: Sample (P70) ;Output instantaneous air temperature 5: 0 Delay (units 0.01 sec)
;from the interval snow depth sensor. 6: 0 mV Excitation
1: 1 Reps 7: 7 Loc [ DSTemp2 ]
2: 2 Loc [ DSTemp1 ] 8: .2 Mult
9: -273 Offset
22: Sample (P70) ;Output instantaneous snow depth from the
1: 1 Reps ;interval snow depth sensor. 6: Excitation with Delay (P22) ;Wait 1.8 seconds for the sensor to make
2: 3 Loc [ IntSnow ] 1: 1 Ex Channel ;10 measurements and perform air
2: 180 Delay W/Ex (units = 0.01 sec) ;temperature compensation.
23: Sample (P70) ;Output instantaneous snow depth from the 3: 0 Delay After Ex (units = 0.01 sec)
1: 1 Reps ;total snow depth sensor. 4: 0 mV Excitation
2: 4 Loc [ TotalSnow ]
7: Excite-Delay (SE) (P4) ;Sample interval snow depth in
24: Totalize (P72) ;Output the total liquid precipitation from ;centimeters.
1: 1 Reps ;the ETI gauge. 1: 1 Reps
2: 8 Loc [ PRECIP ] 2: 5 2500 mV Slow Range
116
3: 1 SE Channel E.5.2 Sample Program – Temperature Conversion
4: 1 Excite all reps w/Exchan 1
5: 0 Delay (units 0.01 sec) The air temperature measurements in the program examples are output in degrees kelvin. Within
6: 0 mV Excitation the sampling commands the temperatures are converted from degrees kelvin to degrees Celsius.
7: 3 Loc [ IntSnow ] The commands listed below can be added to any Campbell Scientific program to convert a tem-
8: -0.5 Mult ;This value outputs snow depth in centimeters perature in degrees Celsius to degrees Fahrenheit.
;Use –0.19685 for inches.
9: 100 Offset ;This number is the distance between the sensor #: Z=X*F (P37) ;Multiply the air temperature in degrees
;and the ground surface in centimeters. 1: 2 X Loc [ AIRTEMPF ] ;C by 1.8 and store it in the same location.
2: 1.8 F
8: Excite-Delay (SE) (P4) ;Sample total snow depth in centimeters. 3: 2 Z Loc [ AIRTEMPF ]
1: 1 Reps
2: 5 2500 mV Slow Range #: Z=X+F (P34) ;Add 32 to the new value to complete
3: 2 SE Channel 1: 2 X Loc [ AIRTEMPF ] ;the conversion. The temperature
4: 1 Excite all reps w/Exchan 1 2: 32 F ;in degrees F is stored in the same

Appendix E: Automated Weather Stations


5: 0 Delay (units 0.01 sec) 3: 2 Z Loc [ AIRTEMPF ] ;location.
6: 0 mV Excitation
7: 4 Loc [ TotalSnow ]
8: -0.5 Mult ;This value outputs snow depth in centimeters
;Use –0.19685 for inches.
9: 1000 Offset ;This number is the distance between the sensor
;and the ground surface in centimeters.

9: Do (P86) ;Turn off snow depth sensors.


1: 51 Set Port 1 Low

10: End (P95) ;End of snow depth subroutine

End Program ;End of program

Program Output
Final Storage Location 1
101,2003,1,0800,12.42,5.24,8.30,140.34,0.59
101,2003,1,0900,12.40,7.45,9.53,141.83,0.63
Final Storage Location 2
100,2003,1,0800,12.42,5.26,8.30,140.36,0.58
100,2003,1,0815,12.41,5.94,8.34,140.7,0.59
117
Snow, Weather, and Avalanches
118

You might also like