Arduino Mega - MAX6675 Thermocouple Module

The Arduino Mega is usually the board people reach for when a project has outgrown an Uno - it has 54 digital I/O pins and 16 analog inputs, so it can happily drive a thermocouple reading alongside a stack of relays, a keypad, an LCD, and a row of limit switches, all in the same sketch. This tutorial focuses on just the temperature side of that kind of build: wiring a MAX6675 thermocouple module to the Mega and getting live readings into the Serial Monitor.

Sensors like the DHT11, DS18B20, or LM35 are great for room temperature, a fridge, or a garden bed, but none of them will survive being poked into a kiln, a furnace, or the flame of a gas stove. For that kind of job you need a thermocouple - a sensor made from nothing more than two joined metal wires, with no delicate silicon anywhere near the heat.

In this tutorial, we will cover:

Arduino Mega MAX6675 thermocouple module

Hardware Preparation

1×Arduino MEGA
1×Alternatively, DIYables MEGA Development Board
1×USB 2.0 cable type A/B (for USB-A PC)
1×USB 2.0 cable type C/B (for USB-C PC)
1×MAX6675 Thermocouple Module
1×Jumper Wires
1×Recommended: Screw Terminal Block Shield for Arduino Uno/Mega
1×Recommended: Sensors/Servo Expansion Shield for Arduino Mega
1×Recommended: Breadboard Shield for Arduino Mega
1×Recommended: Enclosure for Arduino Mega

Or you can buy the following kits:

1×DIYables Sensor Kit (18 sensors/displays)
Disclosure: Some of the links provided in this section are Amazon affiliate links. We may receive a commission for any purchases made through these links at no additional cost to you.
Additionally, some of these links are for products from our own brand, DIYables .

What Is a Thermocouple?

A thermocouple is just two different metal wires joined together at one end, called the hot junction. Heat that junction and it produces a tiny voltage that rises and falls with temperature - a simple trick, but one that lets the sensor survive heat levels that would instantly wreck a normal electronic component. Several thermocouple types exist (J, K, E, T, and more), each pairing different metals, but Type-K - made from Chromel and Alumel wires - is by far the most common, covering roughly -328°F to +2300°F. The catch is that the voltage it produces is only a few millivolts, far too small to read directly, which is exactly why a dedicated chip like the MAX6675 exists to do that conversion for us.

Overview of MAX6675 Thermocouple Module

The MAX6675 module you'll find for sale is a small breakout board built around the MAX6675 chip, sold together with a Type-K thermocouple probe.

MAX6675 Module Pinout

MAX6675 thermocouple module pinout
image source: diyables.io

The breakout board samples the probe's tiny voltage, runs it through a 12-bit analog-to-digital converter, and hands the result to the Arduino Mega over a simple 3-wire interface. There's no MOSI line on this chip - the Mega only ever reads from it, never writes to it. The module has five pins on the Arduino-facing side:

  • VCC: power pin, accepts 3.0V to 5.5V.
  • GND: ground pin.
  • SCK: serial clock, driven by the Mega to shift each reading out of the chip.
  • CS: chip select, pulled low whenever the Mega wants to take a reading.
  • SO: serial data out (the module's MISO line), carries the 12-bit reading back to the Mega.

On the opposite edge of the board is a 2-pin screw terminal for the thermocouple probe: clamp the red wire into + and the blue wire into -. The bundled probe is about 18 inches long, reads from 0°C to 80°C, and its metal tip is what actually gets pressed against - or into - whatever you're measuring.

Quick specs:

  • Operating Voltage: 3.0V - 5.5V
  • Interface: 3-wire digital (SCK / CS / SO)
  • Digitized Range: 0°C to 1024°C (bundled probe limited to 0-80°C)
  • Accuracy: ±3°C
  • Resolution: about 0.25°C

Wiring Diagram

Connect the module's VCC pin to the Arduino Mega's 5V pin and GND to GND, then pick any three free digital pins for SCK, CS, and SO - they don't need to be the Mega's hardware SPI pins (50/51/52), since the MAX6675 library talks to the chip in software. Finally, clip the thermocouple probe into the module's terminal block: red wire to +, blue wire to -.

The wiring diagram between Arduino Mega MAX6675 thermocouple module

This image is created using Fritzing. Click to enlarge image

Wiring table of MAX6675 Module and Arduino Mega

MAX6675 Module Arduino Mega
VCC → 5V
GNDGND
SCK → 5
CS → 4
SO → 3

Arduino Mega Code

/* * This Arduino Mega code was developed by newbiely.com * * This Arduino Mega code is made available for public use without any restriction * * For comprehensive instructions and wiring diagrams, please visit: * https://newbiely.com/tutorials/arduino-mega/arduino-mega-max6675-thermocouple-module */ #include "max6675.h" int SCK_PIN = 5; // Clock (SCK) pin int CS_PIN = 4; // Chip Select (CS) pin int SO_PIN = 3; // Serial Out (SO) pin MAX6675 thermocouple(SCK_PIN, CS_PIN, SO_PIN); void setup() { Serial.begin(9600); delay(500); // give the module a moment to stabilize } void loop() { Serial.print("Temperature: "); Serial.print(thermocouple.readCelsius()); Serial.print("\xC2\xB0"); // shows degree symbol Serial.print("C | "); Serial.print(thermocouple.readFahrenheit()); Serial.print("\xC2\xB0"); // shows degree symbol Serial.println("F"); delay(1000); // MAX6675 needs about 220ms between conversions, so this is plenty }

Detailed Instructions

Work through these one at a time:

  • Wire the MAX6675 module to the Arduino Mega following the table and diagram above.
  • Connect the Arduino Mega to your computer using a USB cable.
  • Open the Arduino IDE on your computer.
  • Choose Arduino Mega as your board and select the correct COM port.
  • Click the Libraries icon on the left side of the Arduino IDE.
  • Search for "MAX6675" and pick the library published by Adafruit.
  • Click Install to add the MAX6675 library.
  • Search for MAX6675 library created by Adafruit and click the Install button.
Newbiely | Arduino IDE 2.3.8
──
File
Edit
Sketch
Tools
Help
Arduino Mega Or...
Library Manager
Type:
All
Topic:
All
MAX6675 library by Adafruit
Arduino library for interfacing with MAX6675 thermocouple amplifier More info
1.1.2
INSTALL
Newbiely.ino
···
1 void setup() {
Output
Serial Monitor
Ln 1, Col 1
Arduino Mega Or... on COM15
1
  • Copy the code above and open it in the Arduino IDE.
  • Click the Upload button to send the code to the Arduino Mega.
  • Touch the tip of the probe to something warm, or just hold it between your fingers.
  • Open the Serial Monitor and watch the readings.
Newbiely | Arduino IDE 2.3.8
──
File
Edit
Sketch
Tools
Help
Arduino Mega Or...
Newbiely.ino
···
8 Serial.println("Hello World!");
Output
Serial Monitor
Message (Enter to send message to 'Arduino Mega Or...' on 'COM15')
New Line
9600 baud
Temperature: 22.00°C | 71.60°F Temperature: 22.25°C | 72.05°F Temperature: 23.50°C | 74.30°F Temperature: 26.00°C | 78.80°F Temperature: 29.75°C | 85.55°F Temperature: 33.25°C | 91.85°F
Ln 11, Col 1
Arduino Mega Or... on COM15
2

※ NOTE THAT:

If the Serial Monitor shows a value that never changes, or looks completely wrong, check that SCK, CS, and SO are wired to the exact pins used in the sketch, and make sure the probe's red and blue wires are clamped firmly into the module's + and - terminals.

Code Explanation

The sketch starts by pulling in the MAX6675 library, which takes care of all the low-level communication with the chip.

#include "max6675.h"

Three pin numbers are defined next, matching whichever Mega pins you wired to the module's clock, chip-select, and data-out lines.

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

A thermocouple object is then created from the MAX6675 class, passing in those three pins so the library knows exactly where to find the module.

MAX6675 thermocouple(SCK_PIN, CS_PIN, SO_PIN);

setup() only needs to start the serial connection and give the module a brief moment to stabilize before the first reading is requested.

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

Inside loop(), two library functions do all the work: readCelsius() triggers a fresh conversion and returns the result in Celsius, while readFahrenheit() does the same in Fahrenheit.

Serial.print("Temperature: "); Serial.print(thermocouple.readCelsius()); Serial.print("\xC2\xB0"); // shows degree symbol Serial.print("C | "); Serial.print(thermocouple.readFahrenheit()); Serial.print("\xC2\xB0"); // shows degree symbol Serial.println("F"); delay(1000);

The one-second delay at the end keeps the loop from polling the MAX6675 faster than the chip can actually produce new conversions.

Video Tutorial

※ OUR MESSAGES

  • As freelancers, We are AVAILABLE for HIRE. See how to outsource your project to us
  • Please feel free to share the link of this tutorial. However, Please do not use our content on any other websites. We invested a lot of effort and time to create the content, please respect our work!