Thermocouple tables are published from which you find the relationship between millivolt (mV) measurements and thermocouple temperature, typically in degrees C. That relationship between temperature and mV, in the case of a type-K thermocouple, happens to be approximated as an 8th-order polynomial.

The GWBASIC program below uses that polynomial to find an approximation of thermocouple mV output given a specific temperature in degrees C. This can be useful in making simulations where you really don't want to have to deal with a real device sitting on your workbench at multi-hundreds of degrees.

Some tabulated results from this program are as follows:

The code itself is as follows:

10 CLS:SCREEN 9:COLOR 15,1:DIM EREF(12)

20 PRINT "save "+CHR$(34)+"typek.bas"+CHR$(34):PRINT:PI=3.14159265#

30 PRINT "save "+CHR$(34)+"a:\typek.bas"+CHR$(34):PRINT:PRINT

40 A$=" Temp. Table Equation Difference":PRINT A$

50 B$=" #### deg C ##.### mV ##.### mV ###.### mV"

60 C$=" #### deg C yields ##.### mV":GOTO 110

70 MV=T*29.131/700:REM Seed value for iteration.

80 E=MV/1000:TCALC=(((((((A8*E+A7)*E+A6)*E+A5)*E+A4)*E+A3)*E+A2)*E+A1)*E+A0

90 IF ABS(T-TCALC)<.001 THEN RETURN

100 MV=MV+.0001*SGN(T-TCALC):GOTO 80

110 READ A0,A1,A2,A3,A4,A5,A6,A7,A8:REM Polynomial coefficients.

120 DATA .226584602#,24152.109#,67233.4248#,2210340.682#

130 DATA -860963914.9#,4.83506E+10,-1.18452E+12,1.3869E+13,-6.33708E+13

140 FOR XX=2 TO 12:READ EREF(XX):NEXT XX

150 DATA 8.138,12.209,16.397,20.644,24.905,29.129:REM Table values of mV for

160 DATA 33.275,37.326,41.276,45.119,48.838:REM 200 to 1200 deg C.

170 FOR XX=2 TO 12:T=XX*100:GOSUB 70:DEL=MV-EREF(XX)

180 PRINT USING B$;T,EREF(XX),MV,DEL:NEXT XX

190 LOCATE 19,1:PRINT " For temperatures between 200øC and 1200øC:"

200 LOCATE 21,1:PRINT " ":LOCATE 21,1:PRINT " Temp deg C =";

210 INPUT T: IF T<200 THEN T=200 ELSE IF T>1200 THEN T=1200

220 GOSUB 70:LOCATE 22,1:PRINT USING C$;T,MV

230 FOR ZZ=1 TO 1000000!:NEXT ZZ:GOTO 200

At the end of this code, there is a loop that asks the user for other temperature values for which the resultant mV calculations are then derived. This loop may be exited by issuing the usual CTRL-Break.

Note that the temperature range dealt with here is limited to values between 200°C and 1200°C

It's just a hunch, but temperature related phenomena generally have an exponential function. Have you tried fitting an exponential series ae^t + be^2x ... me^it + ne^i2t ? You might get a better fit with fewer terms and less bad behaviour outside the data range.

Posted by: Richard Mayo | March 05, 2012 at 09:40 AM

I got the equation from an Omega catalog. I didn't derive it.

Posted by: John Dunn | March 05, 2012 at 11:36 AM

Richard,

For most practical purposes, this is good enough. Sometimes, piece-wise linear approximations are used, in order to simplify the math even further in systems that have limited computing power. For better accuracy, RTDs have better linearity and yield more accurate results.

Posted by: Gustavo Castro | March 05, 2012 at 10:32 PM

Another useful source of information on thermistors can be found here:

http://www.meas-spec.com/product/t_resources.aspx?id=592;

The note on the Steinhart-Hart Thermistor Equation and the associated Excel calculator are particularly good.

http://www.meas-spec.com/downloads/MEAS_Steinhart-Hart_Thermistor_Equation.pdf;

and the calculator is here:

http://www.meas-spec.com/WorkArea/DownloadAsset.aspx?id=6651.

About 10 years ago I wrote an Octave script to derive the Steinhart-Hart (SH) coefficients for an NTC thermistor used in a temperature compensated power supply for an Avalanche Photo Detector. The SH based calculations gave considerably closer correlation between modelled and measured performance than the simple exponential model:

R = Ro exp( Beta/T - Beta/To)

A bit of background can be found here:

http://en.wikipedia.org/wiki/Thermistor

Posted by: Andy Fierman | March 06, 2012 at 06:22 AM