CRBasic Example 1: Half bridge CR1000X program
'CR1000X Series data logger
'This example program measures a single 110PV-L probe using
'the BrHalf instruction once a second and stores the average
'temperature in degrees C every 10 minutes.
'Declare variables for temperature measurement using Half Bridge configuration
Public
T110PV_mV
Public
T110PV_Res
Publi
c T110PV_Temp_C
Public
T110PV_Temp_F
'Declare Constants to be used in Steinhart-Hart equation
Const
A=1.129241*10^-3
Const
B=2.341077*10^-4
Const
C=8.775468*10^-8
Const
R_cable=0
'see sensor cable for cable resistance
'Declare variable units
Units
T110PV_mV= millivolts
Units
T110PV_Res=Ohms
Units
T110PV_Temp_C=Deg C
Units
T110PV_Temp_F=Deg F
'Define a data table for 10 minute averages
DataTable
(AvgTemp,1,-1)
DataInterval
(0,10,Min,10)
Average
(1,T110PV_Temp_C,FP2,False)
EndTable
BeginProg
Scan
(1,Sec,3,0)
'Measure 110PV-L probe
BrHalf
(T110PV_mV,1,mV5000,1,VX1,1,2500,True,0,60,1,0)
'Convert mV to ohms
T110PV_Res=4990*(1-T110PV_mV)/T110PV_mV
'Subtract off cable resistance (see 110PV-L cable for R_cable)
T110PV_Res= T110PV_Res-R_cable
'Using the Steinhart-Hart equation to convert resistance to temperature
T110PV_Temp_C = (1/(A+B*
LN
(T110C*(
LN
(T110PV_Res))^3))-273.15
'Convert Celsius to Fahrenheit
T110PV_Temp_F = T110PV_Temp_C * 1.8 + 32
'Call AvgTemp data table
CallTable
AvgTemp
NextScan
EndProg
110PV Surface Temperature Probe
18