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);
}
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.
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.
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.