Now I know this thread is about a year old, but I thought I'd post in here anyways just in case someone stumbles on it, with similar problems. I think that SheepRustler's Code is wrong. there is no way to read the NIST function as the error that needs to be subtracted from the measured value.
I think the following is the right way:
- Convert the thermocouple temperature into a voltage using the formula in the datasheet
- Convert the reference temperature into voltage using 41.56 uV/C for t type (this is also in the datasheet as cold junction sensitivity)
- add up these two voltages
- convert into temperature using the 7 polynomals
I have tested this in the range of -195 to + 100 °C and it is more or less accurate. Not really accurate but at least in the right region. In the cryo temp region it was about 5 degrees of, and in the room temperature reagion maybe 1 or 2 degrees. I checked it against a calibrated thermometer ((RS1327K)) using a ktype thermocouple from RS.
The problem I have with this approach is, that calculating the temperature using this seven polynomal stuff is very slow, so that I can not use this.
For temperatures in the range of -50 to +100 I found that the following function is more or less ok and much faster:
(uncorrected max31855 temp)/1.3 - 5
However lower than - 50 the nonlinearity is too big and this is quickly 20 degrees off.
I need to be able to measure correctly in the area of -50 to -100 though and am not sure how to best go about it. I might try to come up with a correction function somewhere in between the above and the 7 polynomal or switch to a k type... (Does anybody have a clue about k type thermocouple accuracy in this range?)
This I guess is also the right time to mention that Maxim has seen the error of its ways and released a new version of the chip. the max31856. that has lookup tables for the whole range and does all the correction for the standard thermocouple types for you. It is however also very slow, needing about 100 ms per conversion (measurement)...
I'll give it a test when I get around to it.
So there you go...
this is all I had to add on the topic.
Sven