How to Arduino Thermocouple Interface

How to Arduino Thermocouple Interface: In this article, you will learn about interfacing K-type thermocouples and display temperature in Celsius and Fahrenheit on I2C LCD.

Introduction of Thermocouple

A thermocouple consists of a pair of dissimilar metal wires joined together at one end, called a sensing junction, and terminated at the other end, called the reference junction which is maintained at a known constant temperature called the reference temperature. When the sensing junction and the reference junction are at different temperatures, a potential difference gets produced which causes a current in the circuit, this effect is called the Seebeck effect. Microammeter or a recording instrument is connected across the reference end as shown in figure 1. Then the meter current is proportional to the temperature difference between the hot junction and the reference junction.

thermocouple arrangement

The magnitude of the thermal emf v depends on the wire material used and on the temperature difference (t-t0) between the junctions and may be expressed as below:

v = At + Bt^2 + ct^2

Where t is the sensing junction temperature and A, B, C is constants of the thermocouple material.

The simplest temperature measurement using a thermocouple is by connecting a sensitive millivoltmeter directly across the cold junction. The deflection of the meter is directly proportional to the difference in temperature between the sensing junction and the reference junction. However, this method suffers from the drawback that the thermocouple can supply very limited power to drive the meter movement and is, therefore, not commonly used. An amplifier with a proper circuit is most commonly used to indicate temperature.

Advantage of Thermocouple

  1. Cheaper in comparison to RTD (Resistance Temperature Detector). Check out the article on how to measure temperature using PT100 and Arduino)
  2. Wide temperature measuring range i.e. -2700C to 27000C
  3. Does not require a bridge circuit and hence good sensitivity in comparison to RTD.
  4. Response to temperature change is quite good in the range of 0.2 seconds.
  5. It has rugged construction and can be used in harsh environments like extremely hot or cold.

Disadvantage of Thermocouple

  1. Temperature sensitivity is poor in comparison to semiconductor-type sensors. checkout the article on How to get stable temperature using LM35 (LM35, DS18B20).
  2. Need proper amplifier and cold junction compensation because output voltage is very small in a range of few microvolts.
  3. Thermocouples might pickup stray voltage.
  4. It might show non-linearity.

Several types of circuits have been developed for automatic recording of temperature and the automatic control unit.

Check the article on

In the article, we are going to measure temperature using a K-type thermocouple and a MAX6675.

Working Principle of Thermocouples

The output produced from the Seebeck effect is called thermoelectric emf and in the range of uV. This voltage is so small that, no microcontroller can detect it. Thus, we need a voltage amplifier circuit with higher gain. As measure voltage at the colder end thus we also need cold function compensation. The output of thermocouples is analog and for that, we need an analog to digital converter (ADC).

The output of the thermocouple is converted in digital voltage in three steps

  1. Cold junction compensation
  2. High gain voltage amplifier
  3. analog to digital converter

For all the above operations we use an IC MAX6675 because it has inbuilt all the features we need.

MAX6675 is a cold junction compensates k thermocouple amplifier IC from Maximum Integrated. It has features like

  1. Inbuild cold-junction compensation, ADC, and high gain voltage amplifier.
  2. Serial peripheral interface i.e. SPI compatible interface
  3. 12-bit with 0.250C resolution
  4. Automatic k-type thermocouple detection.

characteristics of MAX6675

Components Required for Arduino Thermocouple Interface

  1. Arduino UNO / NANO x 1
  2. MAX6675 breakout board x 1
  3. Type K thermocouple with connector x 1
  4. 16×2 I2C LCD x 1
  5. Breadboard x 1
  6. USB Cable for Arduino programming
  7. Connector

Description of Arduino Thermocouple Interface

The circuit is designed around Arduino UNO, MAX6675, and 16×2 I2C LCD. (You can also use Arduino nano without any modification in circuit and code).

circuit diagram of arduino thermocouple interface

The thermocouple is connected to the header connected to the MAX6675 breakout board, where the RED terminal of the thermocouple is connected to the positive (+) terminal and the blue is connected to the negative (-) terminal. Polarity is very important here, so before connection make sure of polarity and connect it to the corresponding terminal. 5V and GND from Arduino are connected to VCC and GND pin of MAX6675 breakout board respectively. SPI pin of MAX6675 i.e. CS, SCK, and SO is connected to Arduino pin D5, D6, and D7 pin.

Here, we are using I2C 16×2 LCD to display the value of temperature and other parameters. SDA and SCL pin of LCD is connected to I2C pin of Arduino UNO i.e. SDA (A4) and SCL (A5) Pin respectively.

author prototype of arduino thermocouple interface

Figure: Author Prototype of Arduino Thermocouple Interface

Software Code: Software code is written in Arduino programming language and compiled using Arduino IDE.

Software Description

Library and pin definition: Here, we are using two libraries one for SPI communication and the other for I2C LCD. No dedicated library for temperature measurement is used. The code is simple and easy, at first we define the address, number of columns, and number of rows of I2C LCD. After that, we define the pin for MAX6675.

setup function: In this function LCD is initialized and the backlight function is called in order to glow the backlight of the LCD.

void function: In this function, we call the Thermocoule_read function which returns the measured temperature value. When the returned value is nan (not a number) then it displayed the message “connect thermocouple” and recall the loop function. But if the value is number type then it first converts the Celsius to Fahrenheit and displays the temperature value in Celsius as well as Fahrenheit.

Thermocouple_read() function: This function is used to measure the temperature using thermocouples and return the value. When the thermocouple is not connected then it returns nan (not a number), but when the thermocouple is connected it returns the temperature value which is basically voltage multiplied by 0.25 (resolution of MAX6675).

2 Thoughts to “How to Arduino Thermocouple Interface”

  1. DAnny

    hello,
    help for PT1000
    how can connect with arduino?
    BEst
    danny

    1. Hi, Danny
      We had already posted a complete article and video on how to interface PT100 with Arduino. please go through the link.
      https://bestengineeringprojects.com/measuring-temperature-using-pt100-and-arduino/

Leave a Comment