ESP8266 - MAX6675 Thermocouple Module

Most of the temperature sensors we cover in other tutorials - the DHT11/DHT22, the DS18B20, the LM35 - top out somewhere between 100°C and 150°C. That's plenty for weather stations, incubators, or a kitchen gadget, but it's useless if you need to keep an eye on a pottery kiln, a wood-fired oven, a metal casting furnace, or the exhaust of a small engine, all of which run far hotter than any of those chips can survive.

For jobs like that, you need a completely different kind of sensor: a thermocouple. This tutorial walks through wiring a MAX6675 thermocouple module to an ESP8266 board and reading temperature over its 3-wire digital interface.

ESP8266 NodeMCU MAX6675 thermocouple module

Hardware Preparation

1×ESP8266 NodeMCU ESP-12F
1×Alternatively, ESP8266 D1 Mini NodeMCU ESP-12F
1×Micro USB Cable
1×Alternatively, ESP8266 NodeMCU ESP-12E (Uno-form)
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 ESP8266

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 .

How a Thermocouple Works

A thermocouple is simply two different metal wires welded together at one end. That joint is called the hot junction, and once it gets hot, it generates a very small voltage that rises and falls along with the temperature. It's a crude trick, but a very effective one - since there are no delicate silicon components sitting in the heat, a thermocouple can survive temperatures that would instantly destroy a regular electronic sensor.

Several thermocouple types exist, named with letters (J, K, E, T, and so on) depending on which two metals are welded together. Type-K is by far the most common, built from Chromel and Alumel wires, and it covers an enormous span of roughly -328°F to +2300°F.

The catch is that the voltage coming off a thermocouple junction is tiny - just a few millivolts - and turning that into a usable temperature reading takes a dedicated chip. That's the job of the MAX6675.

Overview of MAX6675 Module

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

MAX6675 Module Pinout

MAX6675 thermocouple module pinout
image source: diyables.io

Internally, the MAX6675 samples the thermocouple's voltage, runs it through a 12-bit analog-to-digital converter, and makes the result available over a simple 3-wire read-only interface. There's no MOSI line here because the ESP8266 never has to send data to the chip - it only ever reads:

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

On the opposite edge of the board sits a small screw terminal for the probe: the red wire clamps into the + slot and the blue wire into the - slot.

The probe itself is roughly 18 inches of cable ending in a metal tip, and although the MAX6675 chip can digitize readings all the way up to 1024°C, the probe that comes bundled with the module is only rated for 0-80°C. If your project needs to measure hotter than that, you'll need to pair the MAX6675 breakout with a higher-temperature-rated Type-K probe sold separately.

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

The MAX6675 module is a 3.3V-5V part, but the ESP8266 itself is strictly a 3.3V board - its GPIOs are not 5V-tolerant. So power the module's VCC pin from the ESP8266's 3.3V pin, never from 5V, and wire GND to GND. Then pick any three free GPIOs for SCK, CS, and SO.

The wiring diagram between ESP8266 NodeMCU and MAX6675 thermocouple module

This image is created using Fritzing. Click to enlarge image

See more in ESP8266's pinout and how to supply power to the ESP8266 and other components.

Wiring table of MAX6675 Module and ESP8266 NodeMCU

MAX6675 Module ESP8266 NodeMCU
VCC → 3.3V
GNDGND
SCK → D5
CS → D6
SO → D7

ESP8266 Code

/* * This ESP8266 NodeMCU code was developed by newbiely.com * * This ESP8266 NodeMCU code is made available for public use without any restriction * * For comprehensive instructions and wiring diagrams, please visit: * https://newbiely.com/tutorials/esp8266/esp8266-max6675-thermocouple-module */ #include "max6675.h" // ESP8266 NodeMCU pins wired to the MAX6675 module #define SCK_PIN D5 // Clock (SCK) pin #define CS_PIN D6 // Chip Select (CS) pin #define SO_PIN D7 // 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() { // Grab a fresh reading in both units and print them together float temperature_C = thermocouple.readCelsius(); float temperature_F = thermocouple.readFahrenheit(); Serial.print("Thermocouple: "); 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

  • If this is your first time working with the ESP8266, start with the environment setup for ESP8266 on Arduino IDE tutorial.
  • Wire the MAX6675 module to the ESP8266 NodeMCU following the table and diagram above.
  • Clip the thermocouple probe's + and - wires into the module's terminal block if you haven't already.
  • Plug the ESP8266 into your computer with a USB cable.
  • Open the Arduino IDE, pick the correct ESP8266 board entry (e.g. NodeMCU 1.0 (ESP-12E Module)) and the matching COM port.
  • Open the Libraries panel from the left sidebar.
  • Search "MAX6675" and find the library published by Adafruit.
  • Click Install to add it to your IDE.
  • Search for MAX6675 library created by Adafruit and click the Install button.
Newbiely | Arduino IDE 2.3.8
──
File
Edit
Sketch
Tools
Help
Nodemcu 1.0 (ESP-12E Module)
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
Nodemcu 1.0 (ESP-12E Module) on COM15
1
  • Paste the code above into a new sketch.
  • Press Upload to flash the sketch onto the ESP8266.
  • Hold the tip of the probe against something warm (a mug of coffee, your fingertip, a hair dryer at a safe distance) and watch the numbers move.
  • Open the Serial Monitor to watch the live readings.
Newbiely | Arduino IDE 2.3.8
──
File
Edit
Sketch
Tools
Help
Nodemcu 1.0 (ESP-12E Module)
Newbiely.ino
···
8 Serial.println("Hello World!");
Output
Serial Monitor
Message (Enter to send message to 'Nodemcu 1.0 (ESP-12E Module)' on 'COM15')
New Line
9600 baud
Thermocouple: 24.50°C / 76.10°F Thermocouple: 24.75°C / 76.55°F Thermocouple: 25.50°C / 77.90°F Thermocouple: 27.25°C / 81.05°F Thermocouple: 30.00°C / 86.00°F Thermocouple: 33.50°C / 92.30°F Thermocouple: 35.75°C / 96.35°F
Ln 11, Col 1
Nodemcu 1.0 (ESP-12E Module) on COM15
2

※ NOTE THAT:

Getting no reading, a frozen value, or a wildly wrong temperature almost always traces back to wiring: double-check SCK/CS/SO match the pins in the sketch, and confirm the probe's + and - wires are seated firmly in the terminal block rather than just resting against it.

Code Explanation

The sketch pulls in the MAX6675 library, which handles all the bit-banged communication with the chip for us.

#include "max6675.h"

Three pins are defined for the ESP8266 side of the link - the clock line, the chip-select line, and the data-out line coming from the module.

#define SCK_PIN D5 // Clock (SCK) pin #define CS_PIN D6 // Chip Select (CS) pin #define SO_PIN D7 // Serial Out (SO) pin

A single MAX6675 object named thermocouple is constructed, telling the library which pin plays which role.

MAX6675 thermocouple(SCK_PIN, CS_PIN, SO_PIN);

setup() just opens the Serial connection and pauses briefly, giving the module a moment to settle before the first conversion is requested.

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

Inside loop(), the two library functions readCelsius() and readFahrenheit() each trigger a fresh read from the chip and hand back the temperature in the requested unit.

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

Both values are then printed to the Serial Monitor on one line, followed by a one-second pause - which comfortably matches the MAX6675's own internal conversion rate, so we're never polling faster than it can actually produce new data.

Serial.print("Thermocouple: "); 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!