I'm currently using the MAX31855 cold-junction compensated thermocouple-to-digital converter in a project (datasheet). Using SPI, I'm able to read the temperature feedback. From an electronics standpoint, everything appears to be work fine and I can even breath on the thermocouple and the temperature will go up. However, the problem I've noticed is that the temperature readings aren't very accurate.
U1 is the MAX31855.
X2 is a two pin female header link
Using this type K thermocouple (link)
This chip then communicates with an arduino via SPI.
My relevant code:
float SensorMAX31855::read(void)
{
uint16_t temp;
digitalWrite(PIN_SPI_CHAN0_MAIN, LOW);
temp = SPI.transfer16(0x00);
Serial.println("First two bytes:");
Serial.println(temp);
digitalWrite(PIN_SPI_CHAN0_MAIN, HIGH);
temp &= MASK_MAX31855; // MASK_MAX31855 = 0hFFFC
return (float)(temp * 0.0625);
}
Note: I should probably be using a signed integer for the temperature (per the data sheet), however, I'm just trying to do validation in which I know my temperature should be positive.
Problems: First off, over the course of 20 seconds, I'm getting temperature readings that range from 12C - 18C without even touching the device (I assume vibrations may affect the reading). Should the temperature reading be this jittery? My guess is no.
Second, the temperature should actually be 21C room temperature. However, my readings all appear to be below this number. Should I be expecting an absolute temperature? Or do I need to adjust for an offset?
Third, when reading the internal reference temperature, it came out to be a value of 26C. Does this seem warm given that the device is at room temperature?
Possible Answers It's possible that I've introduced some bad junction during the physical assembly. Would landing a K type thermocouple into a female header introduce an offset error or noisy reading?
Is it possible that this behavior should be expected? I realize the thermocouple can read a large range of temperatures, however, it still seems pretty noisy.
Any thoughts/ideas would be appreciated!