
SR50A Sonic Ranging Sensor
- 41 -
Example 1:
For a given station a reading is taken every 5 seconds for 1
minute and the median value is taken from the readings.
If 11 consecutive values are as
such for snow depth:
After being sorted from low
to high:
0.33
-1.1
0.34
0.10
0.35
0.28
-1.1 (erroneous reading)
0.32
2.0 (erroneous reading)
0.33
0.37
0.33
0.28
0.34
0.36
0.35
0.10 (High error value)
0.36
0.33
0.37
0.32
2.0
The best course of action would be to ignore the 5 lowest
values and take the 6
th
value (0.33).
Datalogger Program Example 1:
The CR1000 can be programmed with the SortSpa Instruction
which will sort your array of 11 (in this example) from low to
high and then the middle (median) value is selected.
'CR1000 Series Datalogger
'This program example is written for use with an SR50A. This will require the use
'of an external Air Temperature measurement (i.e. AirTC).
'Const Dist2Gnd should be set equal to the distance between the bottom of the
' SR50A and the ground, in meters. Then snow depth will be recorded.
'SR50A Wiring:
'Red - 12V (power)
'Black, White & Clear - G (ground)
'Green - C1 (SDI-12)
'************************************************************************
'Declare Public Variables
'************************************************************************
'Diagnostics Parameters
Public Batt_V
Public PTemp_C