Source: https://mokxi.com/libraries/max6675
Updated: 2026-11-02

Libraries / Sensors
Arduino library · Sensors

# MAX6675: thermocouple temperatures up to 1024 C

A K-type thermocouple measures hundreds of degrees, far past any DS18B20, but its output is a few tens of microvolts per degree and needs cold-junction compensation. The MAX6675 does both jobs on one chip and hands back the temperature as a 12-bit number in quarter degrees, from 0 to 1024 C. The MAX6675 library reads it over three pins: clock, chip select and data out.

Open the example in the editor See the calls

Built in on Mokxi: #include <max6675.h> and it builds, with nothing to install. Free, and no account needed.

## What MAX6675 library does

The constructor takes the pins in the order SCLK, CS, MISO, the same order the library’s example calls thermoCLK, thermoCS and thermoDO. Any three digital pins work, because the library clocks the bits out in software rather than using the SPI hardware.

The chip needs about 220 ms to finish a conversion, and reading faster just returns the previous value. When the thermocouple is unplugged or broken, the chip sets an open-probe bit and readCelsius() returns NAN, so test for it.

Library Manager name | MAX6675 library

Author | Adafruit

Include | #include <max6675.h>

Boards | every board Mokxi compiles for

In the simulator | Simulated: it runs against the part the way it does on the bench.

Parts it drives | Thermocouple converter, MAX6675

## Install it

It builds on every board Mokxi compiles for.

In Mokxi it is built in: #include <max6675.h> and the sketch compiles, with no download, no zip and no Library Manager.

On a real board, install "MAX6675 library" by Adafruit from the Arduino IDE’s Library Manager (Sketch, Include Library, Manage Libraries), or add MAX6675 library to lib_deps in PlatformIO. Mokxi follows the calls of release 1.1.2, so a sketch written here builds there too.

ESP32-C3 · Arduino Uno · Arduino Nano · Arduino Mega 2560 · Arduino Leonardo · SparkFun Pro Micro · Arduino Micro · ESP32-C6 · ATtiny85 · Raspberry Pi Pico · Raspberry Pi Pico W · Seeed XIAO SAMD21 · STM32 · STM32 Nucleo-F411RE · STM32 Blue Pill · micro:bit V2 · Arduino Uno R4 · ESP32 DevKit · ESP32-S3-DevKitC-1 · ESP8266 NodeMCU · Arduino Pro Mini 3.3 V · Seeed XIAO ESP32-C3 · ESP32-C3 SuperMini · Seeed XIAO ESP32-C6 · ESP32-DevKitC V4 · LOLIN32 Lite · Wemos D1 R32 · Cheap Yellow Display · TTGO T-Display · Seeed XIAO ESP32-S3 · Arduino Nano ESP32 · Arduino Nano RP2040 Connect · Seeed XIAO RP2040 · Waveshare RP2040-Zero · Arduino Uno R4 WiFi

## The calls you will use

In the order a sketch meets them.

### MAX6675 thermocouple(thermoCLK, thermoCS, thermoDO)

Creates the sensor on three digital pins: clock, chip select, data out.

### thermocouple.readCelsius()

The probe temperature in degrees Celsius, in 0.25 degree steps, or NAN when the probe is open.

### thermocouple.readFahrenheit()

The same in Fahrenheit. Old sketches spell it readFarenheit(), which still works.

### delay(250)

Not a library call, but every MAX6675 loop needs it or a millis() timer: the chip converts about four times a second.

## Example: Thermocouple

On the Arduino Uno R3. It runs in the browser exactly as printed.

sketch.ino · Arduino Uno R3

Open it in the editor, wired and ready to run · Thermocouple: the project page

## Common errors and how to fix them

### readCelsius() returns NAN

The open-probe bit is set: the thermocouple is not making contact. Tighten the screw terminals, and check the probe is not broken. If the probe is fine, check the CS pin is the one in the constructor.

### The temperature falls when the probe is heated

The thermocouple leads are on the wrong terminals. On a K-type, the yellow (or red, by older color codes) lead goes to plus; swap the two wires.

### The reading never changes

You are reading faster than the chip converts, or CLK and DO are swapped. Wait at least 250 ms between reads and check the pin order SCLK, CS, MISO in the constructor.

## Keep going

### Learn

- Arduino MAX6675 Thermocouple: Wiring and Code

### Parts

- Thermocouple converter, MAX6675

### More sensors libraries

- DHT sensor library
- DHT20
- VL53L0X
- Adafruit_VL53L0X
- HX711 Arduino Library
- MPU6050
- Adafruit MPU6050
- BME280

Every built-in library · Open the editor

## Try MAX6675 library without installing anything

Open the example, change the sketch, and keep your version in a free account.

Start building free

Open the editor
