Problems with MAX31855 and Thermocouple K-type

Hallo all
I have a project where I need to read temperatures in a range of 50-220 degrees. I have tried to follow this guide but run into some problems with the monitor output.

The guide I been trying:

My Set up:
Arduino Uno R3 with MAX 31855 and a thermocouple K-type

The places I maybe think it could be is:

  • Wrong Thermocouple
  • Something wrong with the code
  • Bad soldering on the MAX31855, from when I put it together
  • Wrong set up on the breadboard/Uno

I am new to Arduino so would really like this to work.
Hope someone can see my error and help my fix it =)

The Code:

/*************************************************** 
  This is an example for the Adafruit Thermocouple Sensor w/MAX31855K

  Designed specifically to work with the Adafruit Thermocouple Sensor
  ----> https://www.adafruit.com/products/269

  These displays use SPI to communicate, 3 pins are required to  
  interface
  Adafruit invests time and resources providing this open source code, 
  please support Adafruit and open-source hardware by purchasing 
  products from Adafruit!

  Written by Limor Fried/Ladyada for Adafruit Industries.  
  BSD license, all text above must be included in any redistribution
 ****************************************************/

#include "Adafruit_MAX31855.h"

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

Adafruit_MAX31855 thermocouple(thermoCLK, thermoCS, thermoDO);
  
void setup() {
  Serial.begin(9600);
  
  Serial.println("MAX31855 test");
  // wait for MAX chip to stabilize
  delay(500);
}

void loop() {
  // basic readout test, just print the current temp
   Serial.print("Internal Temp = ");
   Serial.println(thermocouple.readInternal());

   double c = thermocouple.readCelsius();
   if (isnan(c)) {
     Serial.println("Something wrong with thermocouple!");
   } else {
     Serial.print("C = "); 
     Serial.println(c);
   }
   //Serial.print("F = ");
   //Serial.println(thermocouple.readFarenheit());
 
   delay(1000);
}

#include "Adafruit_MAX31855.h"

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

Adafruit_MAX31855 thermocouple(thermoCLK, thermoCS, thermoDO);

:): check your CLK and D0 connections..........pin numbers look reversed, either h/w or code, probably is of little consequence.

Try connecting 5V to the Vin pin on the breakout board. If the board has a 3.3V regulator as described, then 3.3V input may not be enough.

Damn guys this is awesome it works XD

Swapped the pinNumber on the DO and CLK, and change the power supply to 5V instead of 3V and it works. A newbie mistake with the pinNumber and a good reason not to works late night on this project, your stop thinking at some point :wink:
Thanks a lot, this really saved my day. :slight_smile:

The Code I change

#include "Adafruit_MAX31855.h"

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

Glad you got it working. Since there was a wiring error, I'd be curious to know if it still works if the breakout board is switched back to 3.3V.

Both 3.3V and 5V works so it was the wiring error. Still thanks a lot =)