Tag Archives: thermocouple

Use a K-Type Thermocouple with the Raspberry Pi

Whether you are working in a lab, at home, in the office or in the field, occasionally one needs to have the capability to measure the temperature of different sorts of materials such as solids, liquids and chemicals. The temperature range involved may be small or large – its measurement usually requires the use of a thermocouple. This is not very easy to interface, as you need a sensor amplifier that has to measure a very small voltage generated by the thermocouple.

In general, type-K thermocouples are useful in most applications. Extension grade K-type thermocouples are made of Nickel and Aluminum alloy conductors good for measuring a temperature range of 0-200°C. However, other constructions are available that can measure a temperature range of -270 to 1260°C. Thermocouple conductors, when subjected to a temperature gradient, generate a minute amount of voltage – this is called the Seebeck effect. Type-K thermocouples have a nearly linear voltage output versus a temperature gradient. This simplifies interfacing to an electronic circuitry.

The ADS1118 development board from Texas Instruments (TI) is a ready-made platform for using the K-type thermocouple with the Raspberry Pi or RBPi, the tiny credit card sized single board computer. The development board comes with a k-type thermocouple and a high-resolution LCD module. Using eight jumper wires, you can connect this board to the RBPi via the SPI pins on its GPIO. Alternately, use an adapter board to plug in the ADS1118 development board directly to the GPIO pins on the RBPi. Follow the diagram on the left.

The advantage in using an RBPi for interfacing a thermocouple is you can check up on the temperature of your experiment remotely via your smartphone or your PC. The basic idea is to use the RBPi as a web server and to project the temperature measured as a figure on the website that comes up. The following diagram sums up the entire scheme –

The RBPi interfaces with the ADS1118 development board to collect the temperature data via the Serial Peripheral Interface or SPI. It passes this information to the Webserver and application logic. The RBPi also runs a JavaScript in the background for the Webpage content and browser side.

On receiving a request, the web server delivers the webpage containing the temperature data, updating it frequently. This allows remote monitoring of the temperature data from your smartphone or PC. You only have to point your browser to the correct IP address of the webpage.

TI provides a wealth of code for the MSP430 micro-controller on the ADS1118 board. Usually, temperature measurement is a little more than the simple read the ADC value and convert to temperature. It usually involves compensation for the cold junction. For the ADS1118, this means reading another temperature sensor reference on the board. The code does the job of interleaving the readings of the internal sensor and the external thermocouple.

Additionally, the readings need to be corrected for the non-linearity of the thermocouple for accurate interpretation of the thermocouple voltage into temperature. The TI code includes the non-linearity of the thermocouple and translates the ADC value accordingly to actual temperature.

Versatile Chip to Convert Temperature to Bits Directly

LTC2983One of the most fundamental aspects of our lives is temperature. As yet, measuring temperature accurately is difficult. Galileo was possibly the first person to have invented a thermometer that could measure changes in temperature. Two hundred years after Galileo, Seebeck discovered the principle of thermocouples – a device that generates a tiny voltage related to temperature gradients in dissimilar metals. Today, we use many elements such as semiconductor elements and temperature dependent resistive elements for measuring temperature electrically.
Most temperature measuring elements are analog devices. Digitization of these analog devices leads to measurement of temperature with greater accuracy and precision. So far, this was achievable only with expertise in analog and digital circuit design. However, a versatile chip is now available that helps to convert temperature directly to the required digital bits.

The LTC2983 carries within itself all the analog circuitry that different sensors need. It also has the necessary temperature measurement algorithms and data for linearization so that each sensor can measure temperature directly and the LTC2983 can output the results in degrees Centigrade. The IC makes it easy to handle all the challenges unique to diodes, thermistors, RTDs and thermocouples.

For example, a thermocouple will generate a voltage when there is a temperature difference between its tip and its cold junction – the tip touches the surface whose temperature is to be measured, while the cold junction is on the circuit board. Now, for an accurate measurement of the thermocouple temperature, you also require an accurate measurement of the temperature of the cold junction. A separate non-thermocouple temperature sensor, placed at the cold junction, usually does that.

With the LTC2983, you can connect diodes, RTDs or thermistors to measure the cold junction temperature. To convert the voltage output from the thermocouple into temperature, one has to solve a 14th order polynomial equation for both the voltage from the tip as well as from the cold junction. The advantage with the LTC2983 is that it has the required polynomials built into it for all the eight standard types of thermocouples – J, K, N, T, R, S and B – used in the industry. Therefore, not only does the LTC2983 measure the thermocouple output and the cold junction temperature, it also performs all the required calculations for reporting the thermocouple temperature in degrees Centigrade.

Thermocouples usually generate less than 100mV at full-scale output. Voltages at such low levels require the Analog to Digital Converter to have very low offset and noise. Furthermore, the reference voltage needed for the absolute voltage reading requires good accuracy and low drift. The 24-bit ADC within the LTC2983 has all these qualities – its noise and offset is below 1µV, and its reference voltage has a maximum drift of 10ppm/°C.

If the tip of the thermocouple is exposed to temperatures below that of the cold junction, the voltage output goes below the ground level. This complicates matters, as the circuitry requires an additional negative supply or circuitry that can shift the input level. The LTC2983 handles all this with a single ground-referenced supply, as it incorporates a front-end that can digitize signals below ground. In addition, the LTC2983 has high input impedance, low input currents and is able to accommodate external protection resistors and filtering capacitors.