Whats wrong with this sensor definition?

Doug1

I love flying!
Joined
Jun 4, 2016
Messages
35
Hi
all
Just defined a sensor definition to use with a thermistor to measure temperature.
Mapped to pin 12, the sensor debug screen correctly shows the raw voltage and the calibrated temperature.
The problem occurs when I go to setup the sensor range high value and low value.
I am trying to choose 0 deg as the low value and 99 deg as the high value.
The low value can be set correctly but the high value cannot be set to any value above 36deg or so.
If you try the valued entered turns red and no change occurs
I had a mistake in the polynomial originally which is now fixed. I have uploaded the new sfg file and can see evidence of this working by looking at the sensor debug screen.
But when I setup a sensor the maximum value cannot be set to 99 and the actual calibrated value it shows is incorrect as if it is using the old polynomial.
I have loaded the new sfg file a number of times.
Anyone have any ideas?
Doug

Sensor definition is:

sensor={
id=TDK B57703M 10K THERMISTOR
function=TEMPERATURE
pins=C37_P4 C37_P6 C37_P7 C37_P8 C37_P9 C37_P10 C37_P11 C37_P12 C37_P20 C37_P21 C37_P22 C37_P23 C37_P31
name=TEMP
min_val=0
max_val=100
resolution=0
round=1
is_piecewise=0
low_coeff={
c_x4=1.2231
c_x3=-13.555
c_x2=54.005
c_x1=-110.34
c_x0=128.18
}
low_resistance=PULL_UP_10K
low2high_cross=0
high_coeff={
c_x4=0
c_x3=0
c_x2=0
c_x1=0
c_x0=0
}
high_resistance=PULL_UP_10K
high2low_cross=0
}
 

kurtfly

I love flying!
Joined
Jun 21, 2014
Messages
256
I haven't check your calibration data but just looking at the fact you are capped at 36 ( 37 C = 100F) is it possible you have your cal in Degrees F, but your user preference is in Degrees C?

check you user config file.

units_temp_oat=UNITS_TEMP_F
units_temp_other=UNITS_TEMP_F
 

Doug1

I love flying!
Joined
Jun 4, 2016
Messages
35
Thanks Kurt
That gave me the clue!

The sensor definition I made was volts to Celsius, not volts to Fahrenheit.
The thermistor specs were expressed in Celsius as are all the temperatures on my SV,
so I got tricked into thinking I needed to be in Celsius in the definition, forgetting that
SV does a conversion from its native Fahrenheit based on the settings.
Have now redone the definition for Fahrenheit and all is well:

sensor={
id=TDK B57703M 10K THERMISTOR
function=TEMPERATURE
pins=C37_P4 C37_P6 C37_P7 C37_P8 C37_P9 C37_P10 C37_P11 C37_P12 C37_P20 C37_P21 C37_P22 C37_P23 C37_P31
name=TEMP
min_val=32
max_val=212
resolution=0
round=1
is_piecewise=0
low_coeff={
c_x4=2.2016
c_x3=-24.399
c_x2=97.208
c_x1=-198.61
c_x0=262.73
}
low_resistance=PULL_UP_10K
low2high_cross=0
high_coeff={
c_x4=0
c_x3=0
c_x2=0
c_x1=0
c_x0=0
}
high_resistance=PULL_UP_10K
high2low_cross=0
}

BTW this thermistor is about A$10 from RS components ( RS stock no. 706-2743) and has a drilled lug on it allowing easy screw/bolt mounting, although you will need to solder and secure some extension wires to it.

Doug
 

kurtfly

I love flying!
Joined
Jun 21, 2014
Messages
256
Good to hear you figured it out. You may want to use a Arduino LM35 temp sensor. They output a linear Temp to V ( 10mV/degree C) making you calibration much easier. You can find these for about $10 and already on a board with leads. Works with 4 to 20VDC excitation.
 
Top