Formula for calculating temp in C

Hi,

Is there any formula for converting a given resistance of the (Siemens) NTC K164/1K5 into temperature in Celsius? I'm not familiar with components, but I need to use it in software.

Thank you for helping.

Huub

Reply to
Huub
Loading thread data ...

NTC thermistor functions are somewhat complex, and it is usually more efficient to use a lookup table, with interpolation if necessary to reduce table size. The table will take less space than all the floating point stuff you'd otherwise need. You need some part-specific factors which should be in the datasheet.

This is an Excel formula for R->T a particular philips part : =(1/(0.003353832+0.0002460382*LN(H7/$R$5)+0.000003405377*LN(H7/$R$5)^2+0.000000103424*LN(H7/$R$5)^3))-273.15

Reply to
Mike Harrison

You don't give enough information. How precise does your conversion need to be? A simple linear approximation works just fine for some ranges and for some applications. A second order curve handles many others.

For a more precise curve fit, search for the Steinhart-Hart thermistor equation.

--
Rich Webb   Norfolk, VA
Reply to
Rich Webb

Thank you for this info. Could you tell me what those a, b and c stand for?

Thank you for helping.

Huub

Reply to
Huub

Ok, found it..

Reply to
Huub

This formula gives 1/T with T in Kelvin. When I rework this to Celsius by (1/(1/T))-273.15 I get a rediculous temperature in Celsius. Hence, I suppose I'm doing something wrong. Can you tell me how I should do it?

Thanks,

Huub

Reply to
Huub

Don't assume that because S-H is the "best" approximating formula that it's appropriate for real world use. Do you really need (and can you afford the computational burden) of a 0.1 degree approximation? What's the spec'd accuracy of the thermistor and associated components?

For A = 1.139456E-3, B = 2.323002E-4, C = 9.579158E-8, and R = 10000 then 1/T = 298.164 and Tc = 25.014. It's just plugging in the numbers.

--
Rich Webb   Norfolk, VA
Reply to
Rich Webb

Still assuming that I can use Steinhart - Hart for all thermistors: taken that A (diameter of NTC disc), B (width of NTC disc) and C (distance between the legs) are the physical measurements of the thermistor (Siemens NTC K164/1K5), I used metrics mm: A = 4mm, B = 1.5mm and C = 5.5mm. When I convert these to inches: A = 0.15748031", B =

0.059055118" and C = 0.21653543".

Tried in my workroom at 19C:

Tc = (1 / (0.15748031 + (0.059055118 * ln(1686.64)) + (0.21653543 * (ln(1686.64)^3)))) - 273.15 = -273.139 C

So, where do I go wrong?

Reply to
Huub

They are not the physical dimensions of the thermistor. They are empirical values determined by measuring at least three resistance - temperature pairs and then solving the resulting simultaneous equations for A, B, and C [*]. Modulo manufacturing variations, they are constant for a given thermistor material and fabrication.

[*] or use a generalized non-linear curve fitting app, like Mathcad, which makes the number crunching easy and also plots the residuals.
--
Rich Webb   Norfolk, VA
Reply to
Rich Webb

I've noticed that now. Via google I found a spreadsheet at

formatting link
in which I had to fill in those empirical values. After doing so, I found out I got the some crazy result: 273 C. Below are my values.

T (C) R (Ohm)

24 1518,49 29 1268,01 30 1198,8 32 1080,08 34 997,11 36 931,79 38 883,4 40 819,68 42 749,06 44 694,89 46 679,53 48 633,78 50 558,56 100 214,65

If you could show me how you resolve or calculate the a, b and c with them, I know where I go wrong.

Thank you for helping.

Reply to
Huub

No html server at that address.

Your resistance figures are five significant digits but your temperature measurements are only two, so don't expect that the approximating function will give results to better than two sig figs.

The curve fitting is done with Mathcad, plugging the S-H formula into its general curve fitting engine.

A = -9.009306E-4, B = 7.678299E-4, C = -3.481274E-6

R = 1686.64 --> Tc = 23

--
Rich Webb   Norfolk, VA
Reply to
Rich Webb

On Mon, 27 Jun 2005 19:19:58 +0200, Huub put finger to keyboard and composed:

Datasheet for K164 series:

formatting link

Use R/T characteristic curve 1013:

formatting link

Steinhart-Hart thermistor equation:

formatting link

1/T = A + B * ln(R) + C * ln(R)^3

where T = T(Celsius) + 273.15

Use three points (endpoints and midrange) from your R/T curve (#1013) to generate three simultaneous equations. Then solve for A, B, and C.

Note that A, B, and C are not material constants.

- Franc Zabkar

--
Please remove one 's' from my address when replying by email.
Reply to
Franc Zabkar

I assume that these results are derived from my empirical values?

Reply to
Huub

Thank you. I figured such, but it looks like I got directed to the wrong curve.

Reply to
Huub

On Thu, 30 Jun 2005 17:12:55 +0200, Huub put finger to keyboard and composed:

Here's a good Excel spreadsheet:

formatting link

This article may be of help. It includes some VB code.

formatting link

^^^^^^ The Epcos tables suggest this should be 108.2 ohm (= 1500 x 0.072139).

The method and formulae are evident from the spreadsheet.

Using the data for 25C, 50C, and 100C, I get:

A = 0.0015481 B = 0.00023793 C = 0.00000016842

Using the data for 0C, 25C, and 100C, I get:

A = 0.0015469 B = 0.00023826 C = 0.00000016547

- Franc Zabkar

--
Please remove one 's' from my address when replying by email.
Reply to
Franc Zabkar

Thank you for this information. Indeed, when filling in my values in the spreadsheet I get a good result. However, implementing the equation in my program on Linux in C++, this happens:

for 1/K:

K1 = a + (b + (log(R))) + (c * pow(log(R), 3))

to get C I invert this, i.e. 1 / (1/K), and subtract 273,15

for directly into C:

tc = (1 / (a + b * (log(R)) + c * power(log(R),3))) - 273,15

Using your a, b and c I get -221,165 C with both equations. As far as I can see, both equations are correct, but obviously something is wrong.

Reply to
Huub

On Fri, 01 Jul 2005 20:45:26 +0200, Huub put finger to keyboard and composed:

^^^ This should be a "*".

Which value are you using for R? Is it 1686.64?

Can you copy and paste your actual C++ code into your next post?

I suspect your error is in the last term. Perhaps you are evaluating the following ...

[c * log(R)] ^ 3

... instead of ...

c * {[log(R)] ^ 3}

- Franc Zabkar

--
Please remove one 's' from my address when replying by email.
Reply to
Franc Zabkar

I use the actual value read from the interface.

See below.

This is the calculating part of my code:

// here the interface is being read resultaat = inp.ax[FT_MASTER]; // here R is being calculated float R = (resultaat * 10.000977)/(3.06-(resultaat * 0.00122)); cout

Reply to
Huub

Thank you for your help. Got it finally solved now: found out by using table 1013 I was using a wrong resistance value and therefor using the wrong constants. All set now.

Huub

Reply to
Huub

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.