Measuring thermocouples with the HE 1.0
Thermcouples are neat sensors. Thermocouple wire consists of two conductors composed of specific metals. The wire can be very light weight allowing thermocouples to be placed in places other temperature sensors can't go, like inside of a flower bud or glued to a leaf. They can also be exposed to a wider range of temperatures than other sensors, like those found in a kiln. There are several different types of thermocouples (K, J, T, etc) based on their composition.
It's easy to make a sensor with thermocouple wire. On one end of the wire, the insulation is stripped and the conductors are made to touch, either by being twisted, welded, or crimped together. The other ends of the conductors are connected to a differential analog channel of a datalogger (like the HE's high-resolution ADC). A voltage difference is created that is proportional to the temperature difference between the connected and open ends of the wire.
While it's easy to make a thermcouple, it's more difficult to get a temperature reading. The signal is small, like 0.05 mV per degree C so you need a high resolution ADC and/or an amplifier. The relationship between voltage and temperature is nonlinear making the conversion complicated. And you need to know the temperature at the open end of the thermocouple (the cold-junction temperature) to calculate the difference at the closed end.
The HE 1.0 has no problem reading the thermocouple signal with its high resolution ADC. It also has a built in temperature sensor in the real time clock. You can measure the ADC and temperature using the following commands in the SODA library:
adcRead(int ch, int bit, int gain);
getClockTemp();
In many datalogging applications I would advocate simply recording the thermcouple voltage and temperature and then doing the conversion to temperature once the data are downloaded. If you were concerned about a temperature gradient between the real-time clock, where the temperature sensor is located, and the ADC, you could even place a digital temperature sensor (like a DS18B20) closer to the high resolution ADC terminals for your cold junction temperature.
BUT, in other cases it's necessary to get an actual temperature reading. I added the following command for type-K thermcouples to the SODA library:
tcReadK(int ch);
Temperature is returned in degrees C as a int value.
The function uses the RTC sensor for the cold junction temperature and a linearized version of the temperature-voltage relationship. It's actually four-linear segments. This makes the math easy enough for the HE 1.0 to handle. With a few exceptions across the temperature range, the linear functions will produce temperatures within 2 degrees C of the official complex, high-order polynomial function.
Here's the expected error in temperature caused by using the linear functions:
It's easy to make a sensor with thermocouple wire. On one end of the wire, the insulation is stripped and the conductors are made to touch, either by being twisted, welded, or crimped together. The other ends of the conductors are connected to a differential analog channel of a datalogger (like the HE's high-resolution ADC). A voltage difference is created that is proportional to the temperature difference between the connected and open ends of the wire.
While it's easy to make a thermcouple, it's more difficult to get a temperature reading. The signal is small, like 0.05 mV per degree C so you need a high resolution ADC and/or an amplifier. The relationship between voltage and temperature is nonlinear making the conversion complicated. And you need to know the temperature at the open end of the thermocouple (the cold-junction temperature) to calculate the difference at the closed end.
The HE 1.0 has no problem reading the thermocouple signal with its high resolution ADC. It also has a built in temperature sensor in the real time clock. You can measure the ADC and temperature using the following commands in the SODA library:
adcRead(int ch, int bit, int gain);
getClockTemp();
In many datalogging applications I would advocate simply recording the thermcouple voltage and temperature and then doing the conversion to temperature once the data are downloaded. If you were concerned about a temperature gradient between the real-time clock, where the temperature sensor is located, and the ADC, you could even place a digital temperature sensor (like a DS18B20) closer to the high resolution ADC terminals for your cold junction temperature.
BUT, in other cases it's necessary to get an actual temperature reading. I added the following command for type-K thermcouples to the SODA library:
tcReadK(int ch);
Temperature is returned in degrees C as a int value.
The function uses the RTC sensor for the cold junction temperature and a linearized version of the temperature-voltage relationship. It's actually four-linear segments. This makes the math easy enough for the HE 1.0 to handle. With a few exceptions across the temperature range, the linear functions will produce temperatures within 2 degrees C of the official complex, high-order polynomial function.
Here's the expected error in temperature caused by using the linear functions:
Next came time to test the function. I needed a quick program and some cold and hot environments where I could verify the temperature. Here's the program:
#include <EEPROM.h>
#include "SODA.h"
#include <SdFat.h>
#include <Wire.h>
SODA soda;
void setup(){
soda.begin();
}
void loop(){
float t = soda.getClockTemp();
int k = soda.tcReadK(1);
Serial.print("Reference Temp: ");
Serial.println(t);
Serial.print("Thermocouple Temp: ");
Serial.println(k);
Serial.println();
Serial.println();
}
#include <EEPROM.h>
#include "SODA.h"
#include <SdFat.h>
#include <Wire.h>
SODA soda;
void setup(){
soda.begin();
}
void loop(){
float t = soda.getClockTemp();
int k = soda.tcReadK(1);
Serial.print("Reference Temp: ");
Serial.println(t);
Serial.print("Thermocouple Temp: ");
Serial.println(k);
Serial.println();
Serial.println();
}
Now some test.
Freezer at home:
Freezer at home:
Tea Kettle:
Hot-air rework station: