Arduino Nano ESP32 - MAX6675 Thermocouple Module

Every other temperature tutorial in this series - the DHT11/DHT22, the DS18B20, the TMP36 - shares the same weakness: none of them can survive being dropped into anything actually hot. Their plastic packages and silicon dies start to give up well under 150°C, which rules out roasting a batch of coffee beans, watching over a pottery kiln, or checking the flue temperature on a wood stove.

The fix is a completely different sensing technology called a thermocouple, paired with a small breakout board that turns its output into a number the Arduino Nano ESP32 can read. This tutorial covers wiring and programming the MAX6675 thermocouple module with the Arduino Nano ESP32.

Arduino Nano ESP32 MAX6675 thermocouple module

Hardware Preparation

1×Arduino Nano ESP32
1×USB Cable Type-A to Type-C (for USB-A PC)
1×USB Cable Type-C to Type-C (for USB-C PC)
1×MAX6675 Thermocouple Module
1×Jumper Wires
1×Breadboard
1×Recommended: Screw Terminal Expansion Board for Arduino Nano
1×Recommended: Breakout Expansion Board for Arduino Nano
1×Recommended: Power Splitter for Arduino Nano ESP32

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 .

Overview of MAX6675 Thermocouple Module

What ships as "a MAX6675 module" is really two things bundled together: a small breakout board built around the MAX6675 chip, and a Type-K thermocouple probe wired into it.

MAX6675 thermocouple module pinout
image source: diyables.io

What Is a Thermocouple?

Strip away the marketing, and a thermocouple is nothing more than two dissimilar metal wires welded together at one tip, called the hot junction. Heat that junction and a small voltage appears across the wires, growing or shrinking as the temperature changes. There's no chip, no silicon, nothing to melt - which is exactly why a thermocouple can be pushed into places that would instantly kill a normal sensor.

Thermocouples come in several flavors (J, K, E, T, and others), named after the metal pairing used. Type-K - made from Chromel and Alumel - is the one you'll run into most often, and it comfortably spans roughly -328°F to +2300°F.

On its own, though, that millivolt-level signal is awkward to work with. It needs amplifying, linearizing, and converting into an actual temperature figure before an Arduino Nano ESP32 can do anything useful with it - and that conversion job belongs to the MAX6675.

MAX6675 Module Pinout

The breakout constantly samples the probe's tiny voltage, feeds it through a 12-bit analog-to-digital converter, and hands the finished reading to the Arduino Nano ESP32 over a 3-wire read-only link:

  • VCC: power input, accepts 3.0V to 5.5V.
  • GND: ground reference.
  • SCK: serial clock, driven by the Arduino Nano ESP32 to shift each reading out.
  • CS: chip select - the Arduino Nano ESP32 pulls this low whenever it wants to take a reading.
  • SO: serial data output, the module's MISO line, carrying the 12-bit result back to the Arduino Nano ESP32. There is no MOSI pin at all, since the chip never needs data sent to it.

Along the opposite edge sits a 2-pin screw terminal for the probe: the red wire clips into +, the blue wire into -.

The probe bundled with the module runs about 18 inches long and is only rated for 0°C to 80°C, even though the MAX6675 chip itself can digitize readings anywhere from 0°C up to 1024°C. Measuring anything hotter than 80°C means fitting a higher-temperature-rated Type-K probe in its place.

Quick specs:

  • Operating Voltage: 3.0V - 5.5V
  • Digitized Range: 0 - 1024°C (bundled probe limited to 0-80°C)
  • Accuracy: ±3°C
  • Resolution: about 0.25°C

Wiring Diagram

The Arduino Nano ESP32's own logic runs at 3.3V, and the MAX6675 module is happy anywhere between 3.0V and 5.5V, so power VCC from the board's 3V3 pin and tie GND to GND. Pick any three spare digital pins for SCK, CS, and SO, then clip the probe's red and blue wires into the module's + and - terminals.

The wiring diagram between Arduino Nano ESP32 and MAX6675 thermocouple module

This image is created using Fritzing. Click to enlarge image

Wiring table of MAX6675 Module and Arduino Nano ESP32

MAX6675 Module Arduino Nano ESP32
VCC → 3V3
GNDGND
SCK → D4
CS → D3
SO → D2

Arduino Nano ESP32 Code

/* * This Arduino Nano ESP32 code was developed by newbiely.com * * This Arduino Nano ESP32 code is made available for public use without any restriction * * For comprehensive instructions and wiring diagrams, please visit: * https://newbiely.com/tutorials/arduino-nano-esp32/arduino-nano-esp32-max6675-thermocouple-module */ #include "max6675.h" // Define the Arduino Nano ESP32 pins the MAX6675 module is connected to int SCK_PIN = D4; // Clock (SCK) pin int CS_PIN = D3; // Chip Select (CS) pin int SO_PIN = D2; // Serial Out (SO) pin // Create the thermocouple object using the pins above MAX6675 thermocouple(SCK_PIN, CS_PIN, SO_PIN); void setup() { Serial.begin(9600); delay(500); // give the MAX6675 time to stabilize before the first read } void loop() { // Read the current temperature in both units float temperature_C = thermocouple.readCelsius(); float temperature_F = thermocouple.readFahrenheit(); Serial.print("Thermocouple reading: "); Serial.print(temperature_C); Serial.print("\xC2\xB0"); // degree symbol Serial.print("C / "); Serial.print(temperature_F); Serial.print("\xC2\xB0"); // degree symbol Serial.println("F"); delay(1000); // MAX6675 only refreshes its conversion roughly once per second }

Detailed Instructions

To get started with Arduino Nano ESP32, follow these steps:

  • If you are new to Arduino Nano ESP32, refer to the tutorial on how to set up the environment for Arduino Nano ESP32 in the Arduino IDE.
  • Wire the MAX6675 module to the Arduino Nano ESP32 according to the table and diagram above.
  • Connect the Arduino Nano ESP32 board to your computer using a USB cable.
  • Launch the Arduino IDE on your computer.
  • Select the Arduino Nano ESP32 board and its corresponding COM port.
  • Open the Library Manager by clicking on the Library Manager icon on the left navigation bar of Arduino IDE
  • Type "MAX6675" on the search box, then look for the MAX6675 library by Adafruit.
  • Click Install button to install the 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 Nano ESP32
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 Nano ESP32 on COM15
1
  • Copy the above code and paste it to Arduino IDE.
  • Compile and upload code to Arduino Nano ESP32 board by clicking Upload button on Arduino IDE.
  • Touch the thermocouple tip to whatever you want to measure - a mug of hot water works well for a first test.
  • Open Serial Monitor to see the readings roll in.
Newbiely | Arduino IDE 2.3.8
──
File
Edit
Sketch
Tools
Help
Arduino Nano ESP32
Newbiely.ino
···
8 Serial.println("Hello World!");
Output
Serial Monitor
Message (Enter to send message to 'Arduino Nano ESP32' on 'COM15')
New Line
9600 baud
Thermocouple reading: 24.75°C / 76.55°F Thermocouple reading: 24.75°C / 76.55°F Thermocouple reading: 26.25°C / 79.25°F Thermocouple reading: 29.50°C / 85.10°F Thermocouple reading: 34.00°C / 93.20°F Thermocouple reading: 38.75°C / 101.75°F Thermocouple reading: 41.25°C / 106.25°F
Ln 11, Col 1
Arduino Nano ESP32 on COM15
2

※ NOTE THAT:

If the Serial Monitor keeps printing the same value or something clearly wrong, recheck the SCK/CS/SO wiring against the pins used in the sketch, and make sure the probe's red and blue leads are actually clamped inside the terminal block rather than just touching it.

Code Explanation

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

#include "max6675.h"

Three pin numbers are then defined for the connection between the Arduino Nano ESP32 and the module's clock, chip-select, and data-out lines.

int SCK_PIN = D4; // Clock (SCK) pin int CS_PIN = D3; // Chip Select (CS) pin int SO_PIN = D2; // Serial Out (SO) pin

A MAX6675 object named thermocouple is created next, telling the library which pin plays which role.

MAX6675 thermocouple(SCK_PIN, CS_PIN, SO_PIN);

setup() opens the Serial connection and pauses briefly, giving the module a moment to settle before the sketch asks it for its first reading.

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

Inside loop(), two library functions do all the work: thermocouple.readCelsius() and thermocouple.readFahrenheit() each trigger a fresh conversion on the chip and return the result in the requested unit.

float temperature_C = thermocouple.readCelsius(); float temperature_F = thermocouple.readFahrenheit();

Both figures are then printed on a single Serial Monitor line, followed by a one-second delay, matching the pace at which the MAX6675 can actually produce new conversions.

Serial.print("Thermocouple reading: "); Serial.print(temperature_C); Serial.print("\xC2\xB0"); // degree symbol Serial.print("C / "); Serial.print(temperature_F); Serial.print("\xC2\xB0"); // degree symbol Serial.println("F"); delay(1000);

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!