Arduino UNO R3, Adafruit Max31856 Thermocouple Reading

Good morning,
I'm working on an Arduino UNO R3 with an Adafruit MAX31856. My goal is to get a thermocouple type t reading from it. When running the serial monitor through Arduino IDE, it only gives me 0c 32f. The code is below. Any help is much appreciated!!!

#include <Wire.h>
#include <Adafruit_MAX31856.h>
// Define the connections
#define CS_PIN 10
// Create an instance of the Adafruit_MAX31856 class
Adafruit_MAX31856 thermocouple(CS_PIN);
void setup() {
Serial.begin(9600);
Serial.println("MAX31856 Thermocouple Test");
  // Initialize the MAX31856
if (!thermocouple.begin()) {
Serial.println("MAX31856 initialization failed!");
while (1);
}
  // Wait for the MAX31856 to stabilize
delay(500);
  // Set the thermocouple type (Type-T)
thermocouple.setThermocoupleType(MAX31856_TCTYPE_T);
}
void loop() {
  // Read temperature values
float celsius = thermocouple.readCJTemperature();
float fahrenheit = (celsius * 9.0 / 5.0) + 32.0;
  // Print temperature values
Serial.print("Temperature (C): ");
Serial.print(celsius);
Serial.print(" °C, ");
Serial.print("Temperature (F): ");
Serial.print(fahrenheit);
Serial.println(" °F");
  // Check for faults
uint8_t fault = thermocouple.readFault();
if (fault) {
Serial.print("Fault Code: 0x");
Serial.println(fault, HEX);
}
  // Delay before the next reading
delay(1000);
}

Follow this tutorial:

Do you have the thermocouple connected the correct way?
Does your thermocouple have a metal case?

Thank you for this. It's very helpful to see a step by step tutorial. Unfortunately after following all of the instructions, it's still reading 0. This could be a connection error since I'm using a bread board with jumper wires. If you have any more advice, I'll gladly take it.

Type T, blue to positive, red to negative. The thermocouple doesn't have a metal case.

@dml96
All correct and OK

Turns out I had to apply some pressure to the pins that connected the 31856 to the bread board. Works like a charm!

1 Like

Are they soldered?

Bad breadboards and bad connections are common on this forum
Glad you got it working
Have a nice day!

Post a photo of your project, mainly showing the breadboard.
There are breadboards where GND, (blue line side) and +V, (red line side), are interrupted in the middle.
Maybe it could be your case.

image

I've seen a couple of people having that issue as well. I got the breadboard from Adafruit so I'm assuming it's quality. I feel like the jumper wires are just a little too flimsy. Maybe some solid 22awg wire will give me a little bit more of a secure connection. Not too confident in my soldering ability, but will definitely have to give that a go at some point.

At one time that was true. Now it seems that lady ada's main concern is making money.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.