Max 6675 problem

Hi everyone,

I have a problem with using a thermocouple, my arduino is returning NAN or an useless value.

I use a card max6675 and the adafruit library (GitHub - adafruit/MAX6675-library: Arduino library for interfacing with MAX6675 thermocouple amplifier)
I tried with 3 different K-TC coming from ( TC Direct, mesure et régulation de température)

Anyone have an idea of what is wrong ?

My code is the following:

// this example is public domain. enjoy!// Thermocouple sensor tutorial

#include “max6675.h”

int thermoDO = 4;
int thermoCS = 5;
int thermoCLK = 6;

MAX6675 thermocouple(thermoCLK, thermoCS, thermoDO);
int vccPin = 3;
int gndPin = 2;

void setup() { Serial.begin(9600);

// use Arduino pins
pinMode(vccPin, OUTPUT);
digitalWrite(vccPin, HIGH);
pinMode(gndPin, OUTPUT);
digitalWrite(gndPin, LOW);
Serial.println(“MAX6675 test”);
// wait for MAX chip to stabilize

void loop() {
// basic readout test, just print the current temp
Serial.print("C = "); Serial.println(thermocouple.readCelsius());
Serial.print("F = "); Serial.println(thermocouple.readFahrenheit());


You can't usually power things using Arduino output pins, too much impedance, the thermocouple amp may need solid supply voltages.

Have you tried powering the chip properly? With decoupling?

Hi markT,

Yes i tried to power it with the VCC 5v and the gnd but it doesn't help

How long is the wiring between sensor board and Arduino.

NAN can mean that no valid data is read from the sensor. See line 38 of the max6675.cpp library.

Not sure what's going on here. Miso and CS are used throughout the library, and no hardware SPI pins are used. Leo..

It's quite short actually, less than 5 cm.

This problem is a mistery for me