If you want to measure temperature with an Arduino, there are many sensors to choose from. Some of the popular options include the DHTxx series, DS18B20, LM35, and TMP36, among others, each offering unique features and capabilities to suit your specific project needs.

But what if you want to measure the temperature of something as hot as a volcano (which can reach well over 1000°C or 1800°F) or something super-cold like liquid nitrogen (which can be around −195.8 °C or −320 °F)? In such cases, the normal temperature sensor will either melt or freeze completely.

So, how do you measure extremely hot or cold things? With a cunning pair of electric cables called a Thermocouple. A thermocouple is a type of temperature sensor that uses the thermoelectric effect to measure temperatures ranging from -330°F to +2460°F.

This tutorial will guide you on how to interface the MAX6675 thermocouple module—one of the most commonly used, inexpensive, yet accurate thermocouple modules—to an Arduino. But first, let’s take a quick refresher on the basics of thermocouples.

Basics of Thermocouples

A thermocouple is made up of two dissimilar metal wires (the term “dissimilar” simply means different).

a typical thermocouple

The metal wires are connected together in only one place, typically the tip of the thermocouple, which is known as the Hot Junction, Measurement Junction, Sensing Point, or Sensing Junction. As the name implies, this junction is exposed to the heat source of interest.

The opposite end of the metal wires is known as the Cold Junction and is connected to the measuring device. Typically, the cold junction is not exposed to the same level of thermal energy as the hot junction.

Thermoelectric Effect

All thermocouples work the same way—they generate a small voltage when they are exposed to heat.

When you heat up a piece of metal, the heat excites the electrons in the metal, causing them to jiggle around. As the metal gets hotter, more electrons tend to “diffuse” and move towards the cooler end of the metal.

thermoelectric effect animation

This makes the hotter end slightly positively charged and the cooler end slightly negatively charged, creating a voltage difference. This is known as the Thermoelectric Effect or Seebeck Effect, named after the German scientist Thomas Seebeck, who discovered this phenomenon in 1821.

Thermocouple Working

A thermocouple operates based on the movement of electrons in its metal wires caused by the heat difference between the hot and cold junctions.

If the two wires of the thermocouple were made up of the same type of metal, say copper, electrons in both wires would move away from the heat and accumulate at the cold ends in equal amounts, resulting in no measurable voltage difference.

thermocouple working similar metals

But if you recall, thermocouples are made up of two different types of metal wire. So if two wires of the thermocouple were made up of different materials, say one of copper and one of iron, the metals would conduct heat differently, resulting in a distinct temperature gradient. This causes varying electron buildup at the cold ends, resulting in a measurable voltage difference.

thermocouple working dissimilar metals

This voltage difference is very small. The actual change in voltage per degree Celsius is minuscule. For example, for a Type-K thermocouple, the change is about 41 µV/°C.

Thermocouple Wire Leads

When exposed to heat, the electrons in each of the thermocouple wires react differently and move at different rates.

The wire in which more electrons are accumulated at the cold junction is called negative wire lead, while the wire in which fewer electrons are accumulated at the cold junction is called positive wire lead.

This difference in charge between the positive and negative wire leads can be measured and used to determine the temperature at the hot junction.

Type-K Thermocouple

There are different types of thermocouples, such as Type-J, Type-K, Type-E, Type-T, etc., based on the combination of metals or alloys used for the two wires. Each type of thermocouple has its own characteristic function, temperature range, accuracy, and application.

thermocouple voltage temperature characteristic

However, the most widely used thermocouple in industrial applications is Type-K, because it responds predictably over a wide temperature range (around -328 °F to +2300 °F) and has a sensitivity of approximately 41 μV/°C. It consists of a positive wire made of Chromel (nickel-chromium alloy) and a negative wire made of Alumel (nickel-aluminum alloy).

Thermocouple Digitizer

To make the thermocouple useful, it is necessary to calibrate it by testing it against known temperatures and recording the voltages generated. A formula can then be used to calculate the temperature based on the measured voltage.

This is where thermocouple digitizer ICs like the MAX6675 IC come into play. These integrated circuits (ICs) are designed to perform cold-junction compensation and digitize the signal received from a thermocouple.

MAX6675 Thermocouple Module

The MAX6675 thermocouple module typically includes a MAX6675 breakout board and a Type-K thermocouple probe. Let’s learn more about them.

MAX6675 Breakout

At the heart of the breakout is a cold-junction-compensated Type-K thermocouple digitizer IC from Microchip, the MAX6675.

max6675 breakout

The breakout takes a standard Type-K thermocouple in one end, digitizes the temperature measured and sends that data out the other end via a SPI interface, thereby interpreting the data and translating it for you to read!

The MAX6675 IC includes a 12-bit analog-to-digital converter (ADC), which means the IC can resolve temperatures to 0.25°C (12-bit resolution).

The MAX6675 can measure temperatures ranging from 0 °C to +1024 °C with an accuracy of ±3 °C. However, keep in mind that the range is dependent on the type of probe you use.

In addition to its low cost, small size, and wide range, the MAX6675 operates on +3.0V to +5.5V and draws approximately 700 µA. The maximum current that it can draw is approximately 1.5 mA.

Type-K Thermocouple Probe

The thermocouple probe that comes with the module is approximately 18 inches in length and has a measurement range of 0 °C to 80 °C.

type k thermocouple probe

The red terminal of the probe is the positive lead made of Chromel (nickel-chromium alloy), and the blue terminal is the negative lead made of Alumel (nickel-aluminum alloy).

The probe has fiberglass insulation, a material known for its ability to withstand high temperatures and harsh conditions. This makes it a suitable choice for a wide range of projects.

The probe terminates in an M6 threaded connection. This type of connection allows for the thermocouple to be attached to an object such as a heatsink, where it can be screwed in or secured with a nut.

Technical Specifications

Here are the specifications:

Operating Voltage3.0 to 5.5V
InterfaceHigh-Speed SPI
Current Consumption700µA (typ.), 1.5mA (max)
Temperature Range0 – 1024 °C (of MAX6675)0 – 80 °C (of supplied probe)
Accuracy±3 °C
Resolution12-Bit (0.25 °C)
Conversion Time~170 ms

For more information about the MAX6675 IC, please refer to the datasheet below.

MAX6675 Module Pinout

Now let’s have a look at the pinout.

max6675 module pinout

Input Connector

VCC is the power pin. Connect it to a power supply ranging from 3V to 5.5V.

GND is the ground pin.

SCK is the SPI clock pin.

CS is the chip select pin. Pull this pin low and apply a clock signal at SCK to read the results at SO. Pulling it low immediately stops any conversion process. Initiate a new conversion process by pulling it high.

SO is the Serial data Out / MISO pin, for 12-bit data sent from the module to your Arduino. A sequence of all zeros means the thermocouple reading is 0°C. A sequence of all ones means the thermocouple reading is +1023.75°C.

Thermocouple Connector

On the other side of the module, there is a 2-pin terminal block for connecting a Type-K thermocouple probe.

is where you attach Alumel Lead (blue) of Type-K thermocouple.

+ is where you attach Chromel Lead (red) of Type-K thermocouple.

Wiring MAX6675 Module to an Arduino

Let’s connect the MAX6675 module to the Arduino. The connections are straightforward.

Begin by connecting the VCC pin on the module to 5V on the Arduino and the GND pin to ground.

Now connect the three digital pins to use as the SPI interface. We are using pins 4, 5, and 6 in the example.

Finally, attach the thermocouple probe to the module. Connect the red lead (Chromel Lead) of the thermocouple to the ‘+’ terminal of the module, and the blue lead (Alumel Lead) to the ‘-‘ terminal.

The following table lists the pin connections:

MAX6675 ModuleArduino
VCC5V
GNDGND
SCK6
CS5
SO4

The image below shows how to build the circuit.

wiring max6675 thermocouple module to arduino

Because the module consumes very little power (less than 1.5ma), it is possible to power it using a digital output pin on the microcontroller. If you decide to go with this method and power down the MAX6675 in between readings, you should wait a few seconds after turning the power back on before attempting a reading.

Library Installation

There’s a really great library available for working with the MAX6675 module. You will need to download and install it in your Arduino IDE.

To install the library, navigate to Sketch > Include Library > Manage Libraries… Wait for the Library Manager to download the libraries index and update the list of installed libraries.

manage libraries 2

Filter your search by entering ‘MAX6675’. Look for the MAX6675 library by Adafruit. Click on that entry and then choose Install.

max6675 library installation

Arduino Example Code

Now that we have everything hooked up, let’s run a simple sketch to quickly test the MAX6675 module. Go ahead and upload it to your Arduino. You should see the ambient temperature printed to the serial interface.

#include "max6675.h"

// Define the Arduino pins, the MAX6675 module is connected to
int SO_PIN = 4;  // Serail Out (SO) pin
int CS_PIN = 5;  // Chip Select (CS) pin
int SCK_PIN = 6; // Clock (SCK) pin

// Create an instance of the MAX6675 class with the specified pins
MAX6675 thermocouple(SCK_PIN, CS_PIN, SO_PIN);

void setup() {
  Serial.begin(9600);
  delay(500);
}

void loop() {
  // Read the current temperature and print it to the serial monitor

  // Read the temperature in Celsius
  Serial.print("Temperature: ");
  Serial.print(thermocouple.readCelsius());
  Serial.print("\xC2\xB0"); // shows degree symbol
  Serial.print("C  |  ");

  // Read the temperature in Fahrenheit
  Serial.print(thermocouple.readFahrenheit());
  Serial.print("\xC2\xB0"); // shows degree symbol
  Serial.println("F");

  delay(1000);
}

Once the sketch is uploaded, open your serial monitor, setting the baud rate to 9600 bps. Try placing the thermocouple in contact with the material to be measured. You should see the measured temperature begin to stream by.

max6675 output

Code Explanation:

The sketch begins by including the MAX6675 header file. It allows the Arduino code to interact with the MAX6675 module.

#include "max6675.h"

In that same global area, three integers SO_PIN, CS_PIN and SCK_PIN are declared, which specify the Arduino pin you’ve connected to the module’s serial out (SO) pin, chip select (CS) pin, and clock (SCK) pin.

int SO_PIN = 4;  // Serail Out (SO) pin
int CS_PIN = 5;  // Chip Select (CS) pin
int SCK_PIN = 6; // Clock (SCK) pin

Next, an instance of the MAX6675 class called thermocouple is created. That’s what we’ll be referring to from now on to read the module. It initializes the thermocouple object with the defined SCK, CS, and SO pins.

MAX6675 thermocouple(SCK_PIN, CS_PIN, SO_PIN);

The setup section of the code initializes the serial communication with the computer at a baud rate of 9600.

void setup() {
  Serial.begin(9600);
  delay(500);
}

In the loop(), we read from the MAX6675 thermocouple and print it to the Serial Monitor. For this, two library functions are used:

  • thermocouple.readCelsius(): returns temperature in Celsius.
  • thermocouple.readFahrenheit(): returns temperature in Fahrenheit.
Serial.print("Temperature: ");
Serial.print(thermocouple.readCelsius());
Serial.print("\xC2\xB0"); // shows degree symbol
Serial.print("C  |  ");

// Read the temperature in Fahrenheit
Serial.print(thermocouple.readFahrenheit());
Serial.print("\xC2\xB0"); // shows degree symbol
Serial.println("F");

The loop continues executing indefinitely, repeatedly reading and printing the temperature every second.


Login
ADS CODE