Thermocouple PDF
Thermocouple PDF
Thermocouple PDF
Unlike semiconductor temperature sensors such as the TMP36 (https://adafru.it/ckT) , thermocouples have no
electronics inside them, they are simply made by welding together two metal wires. Because of a physical effect of two
joined metals, there is a slight but measurable voltage across the wires that increases with temperature. The type of
metals used affect the voltage range, cost and sensitivity, which is why we have a few different kinds of
thermocouples. The main improvement of using a thermocouple over a semiconductor sensor or thermistor is that the
temperature range is very much increased. For example, the TMP36 can go from -50 to 150°C, after that the chip itself
can be damaged. Common thermocouples on the other hand, can go from -200°C to 1350°C (K type) and there are
ones that can go above 2300°C!
Thermocouples are often used in HVAC systems, heaters and boilers, kilns, etc. There are a few different kinds but this
tutorial will discuss K type, which are very common and easier to interface with.
One difficulty in using them is that the voltage to be measured is very small, with changes of about 50 uV per °C (a uV
is 1/1000000 Volts). While it is possible to read these voltages using a clean power supply and nice op-amps, there are
other complications such as a non-linear response (its not always 50uV/°C) and cold-temperature compensation (the
effect measured is only a differential and there must be a reference, just as ground is a reference for voltage). For that
reason, we suggest only using an interface chip that will do the heavy lifting for you, allow you to easily integrate the
sensor without as much pain. In this tutorial we will use a MAX6675 K-thermocouple interface chip which doesn't even
require an ADC, spitting out a nice digital data signal of the temperature.
First thing to determine is which wire is which. As you recall, thermocouples are made by welding together two wires,
the chip reads the voltage difference between the two. One is the negative (for K-type its made of Alumel) and the
other positive (ditto, Chromel). Luckily the wires are color coded, and almost all of the time you'll find the Alumel is red
and the Chromel is yellow.
The MAX6675 and MAX31855 thermocouple amplifiers are not compatible with grounded thermocouples.
We've seen some K type thermocouples where the leads were marked incorrectly, so if you find that the
thermocouple temperature goes down instead of up when heated, try swapping the red and yellow wires
If you're planning to use the MAX6675/MAX31855, there's a little more work to be done. First off, Vin and GND must
connect to a 3-5V supply. Then the three data pins must connect to digital IO pins:
CLK (clock) is an input to the MAX6675/MAX31855 (output from microcontroller) which indicates when to present
another bit of data
DO (data out) is an output from the MAX6675/MAX31855 (input to the microcontroller) which carries each bit of
data
CS (chip select) is an input to the MAX6675/MAX31855 (output from the microcontroller) which tells the chip
when its time to read the thermocouple and output more data.
In the beginning of our sketches, we define these pins. For our examples DO connects to digital 3, CS connects to
digital 4, and CLK connects to pin 5
The MAX31855 does not support grounded thermocouples - if the sensor touches ground the chip will return an error
Arduino Library
If you have an older MAX6675 breakout, download the Adafruit MAX6675 library from the Arduino library manager.
If you have the newer MAX31855 breakout, download the Adafruit MAX31855 library from the Arduino library
manager.
If you have a MAX6675 breakout, search for the MAX6675 library and install it
As you can see, its pretty simple to use the library, simply tell the sensor object what the clock, chip select and data
pins are, then call readCelsius() or readFahrenheit() to get a floating point result.
Adding a Display
A common request is to have the temperature output onto a 'classic' character LCD such as the ones in this
tutorial (https://adafru.it/c8r).
We have an example sketch for this as well. First get the LCD working by following our tutorial (https://adafru.it/c8r).
Now load up the new sketch File->Examples->MAX31855>lcdthermocouple and plug in the thermocouple module as
we did in the serial thermocouple test, you'll see the internal temperature and the thermocouple temperature
displayed in Celsius
You can use this sensor with any CircuitPython microcontroller board or with a computer that has GPIO and Python
thanks to Adafruit_Blinka, our CircuitPython-for-Python compatibility library (https://adafru.it/BSN).
First make sure you are running the latest version of Adafruit CircuitPython (https://adafru.it/tBa) for your board.
Next you'll need to install the necessary libraries to use the hardware--carefully follow the steps to find and install these
libraries from Adafruit's CircuitPython library bundle (https://adafru.it/zdx). For example the Circuit Playground Express
guide has a great page on how to install the library bundle (https://adafru.it/Bf2) for both express and non-express
boards.
Remember for non-express boards like the Trinket M0, Gemma M0, and Feather/Metro M0 basic you'll need to
manually install the necessary libraries from the bundle:
adafruit_max31855.mpy
adafruit_bus_device
Before continuing make sure your board's lib folder or root filesystem has
the adafruit_max31855.mpy, and adafruit_bus_device files and folders copied over.
Next connect to the board's serial REPL (https://adafru.it/Awz) so you are at the CircuitPython >>> prompt.
Once that's done, from your command line run the following command:
If your default Python is version 3 you may need to run 'pip' instead. Just make sure you aren't trying to use
CircuitPython on Python 2.x, it isn't supported!
import board
import busio
import digitalio
import adafruit_max31855
spi = busio.SPI(board.SCK, MOSI=board.MOSI, MISO=board.MISO)
cs = digitalio.DigitalInOut(board.D5)
max31855 = adafruit_max31855.MAX31855(spi, cs)
Now you can read the temperature property to retrieve the temperature from the sensor in degrees Celsius:
import time
import board
import busio
import digitalio
import adafruit_max31855
The temperature of my thermocouple seems to be backwards! If I heat up the probe the reported
temperature goes down
This is likely caused by the thermocouple wires being labled incorrectly. Try swapping the two thermocouple leads,
even if yellow and red wires are in the right slots - we've seen some thermocouple where the wire colors are wrong.
The MAX31855 is surprisingly sensitive, we've found a good way to fix this is to place a 0.01uF to 0.1uF capacitor
across the thermocouple leads (that is, place the capacitor into the blue terminal block, or solder to the bottom as
shown below).
K thermocouples are not precision temperature measurement devices! There will be offsets & differences between
thermocouples. Most thermocouple thermometers have the offset corrected in software which is what we suggest.
See this guide for tips on calibration:
You can connect as many MAX31855's as you have pins. Simply share the CLK and DO pins of all the breakouts and
have a unique CS pin for each one
Then you can create new thermocouples using the following style:
You can also try having same CS and CLK pins but all different DO pins
The 31855 chip handles the linear range of the K-type thermocouples very well. It does not provide correction for
Thermocouple Linearization
Jeelabs has a detailed walkthrough for a reflow controller (uses an AD595-type chip) (https://adafru.it/aLl)
Schematic
Click to embiggen
Fabrication Print
Dimensions in Inches