1 2 Previous Next 15 Replies Latest reply on Oct 15, 2014 4:36 PM by userc_42176

# transfer function of a temperature sensor

OK I am new at temperature sensors, I have a STLM20 sensor with an attached below transfer function.

according to my calculations, T should equal the following:

T=85.543*(1.8641-V0)

is this correct? because it is measuring -15.75 degrees C.

• ###### 1. Re: transfer function of a temperature sensor

Ok so I solved the negative temperature problem.

the problem is now it is reading too high (27.5 degrees) in a 20 degrees environment.

int main()

{

float T;

int32 voltcount;

float volt;

char str[16];

LCD_Start();

for(;;)

{

T=85.543*(1.8641-volt);

sprintf(str, "%+1.1f", T);

LCD_Position(0u,0u);

LCD_PrintString(str);

CyDelay(1000);

}

}

• ###### 2. Re: transfer function of a temperature sensor

Is this reading by the PSoC5 or by a multimeter?

• ###### 3. Re: transfer function of a temperature sensor

by POSC5.

• ###### 4. Re: transfer function of a temperature sensor

Is the ADC reference set to a Vdd derived reference or the internal

bandgap 1.024 reference ? If former Vdd is +/- 5% typically out of

a regulator.

You need to perform a complete signal path error analysis to know

what accuracy, precision you will get.

Regards, Dana.

• ###### 5. Re: transfer function of a temperature sensor

The equation given in the PDF is mixing units mV and V. You should take that into account when you rearrange the equation,

And where do you get the Item 85.543 from?

I calculate

Vo - 1.8663V = T[°C] * 11,8639mV/°C = T * 11.8639mV

T = (Vo - 1.8663V) / 0.011.8639 V

As you can see a calibration at the midpoint of your temperature scale could get rid of some errors.

Bob

• ###### 6. Re: transfer function of a temperature sensor

• ###### 7. Re: transfer function of a temperature sensor

dividing 1/0.0118639 yeilds 85.543.

I have used (0.0 to 2.038 single ended 0 to Vref*2) input range of the ADC with a 100K conversion rate and it gave me more reliable results. but still there is a big difference between the real value and the measured value.

I am switching to the long equation. any idea on how to get the sqaure root of a float number?

• ###### 8. Re: transfer function of a temperature sensor

The sensor tolerance is +/- 1.5 C, what are you using to determine T to

compare to PSOC result ? Ice bath one of the easy methods to cal a T

sensor at one point.

GCC and sqrt -               http://forums.debian.net/viewtopic.php?f=8&t=109385

Regards, Dana.

• ###### 9. Re: transfer function of a temperature sensor

I am using an old digital thermometer that is installed in a digital watch. it is currenttly reading 26 degrees while my sensor is reading 24.5 degrees.

1.5 degrees is tolerable error. thanks everyone

• ###### 10. Re: transfer function of a temperature sensor

The first thing you should do is to use the equation for V0 that is relevant for your temperature range (given in Table 2 of the attached document). Secondly use a more accurate temperature sensor than using a digital thermometer that is installed in a watch. This will give you true temperature reading to compare with PSOC result.

• ###### 11. Re: transfer function of a temperature sensor

@deniz, just a thought, do you think customer still watching a 6 month old thread ?

Regards, Dana.

• ###### 12. Re: transfer function of a temperature sensor

Well Dana, most people won't do that. But I'm a special case, I even check threads that are more than a year old

weird? or simply eccentric?

• ###### 13. Re: transfer function of a temperature sensor

At least regular visitors here can look for forum with new stuff since their last visit (you just need to remember when it was :). And inside there the newest threads are on top making it easy to find new stuff even after a week or so.

• ###### 14. Re: transfer function of a temperature sensor

But is this a geometric progression of time needed, and soon you will have no time

to eat, sleep :(

Reagrds, Dana.

1 2 Previous Next