Using K-Type Thermocouple with Arduino Nano 33 BLE

Hello!

I am currently working on a project where I am trying to connect a K-Type thermocouple with an Arduino Nano 33 BLE. The current code I am using is pasted below. I have verified that the amplifier and board have been correctly soldered, and I have tried re-screwing in the thermocouple multiple times, tested every connection with a multimeter for faults, and tried a new BLE board, and tried a new thermocouple. For some reason, the code right now only outputs zero, as shown below:

<
Cold Junction Temp: 0.0
Thermocouple Temp: 0.0

I have attached pictures of the circuit. I am trying to figure out what might be going wrong here, as I have tried almost everything. Any advice would be greatly, greatly appreciated.

Thanks so much!

Code:

<#include <Adafruit_MAX31856.h>

// Use software SPI: CS, DI, DO, CLK
Adafruit_MAX31856 maxthermo = Adafruit_MAX31856(13, 14, 15, 16);
// use hardware SPI, just pass in the CS pin
//Adafruit_MAX31856 maxthermo = Adafruit_MAX31856(10);

void setup() {
Serial.begin(115200);
Serial.println("MAX31856 thermocouple test");

maxthermo.begin();

maxthermo.setThermocoupleType(MAX31856_TCTYPE_K);

Serial.print("Thermocouple type: ");
switch (maxthermo.getThermocoupleType() ) {
case MAX31856_TCTYPE_B: Serial.println("B Type"); break;
case MAX31856_TCTYPE_E: Serial.println("E Type"); break;
case MAX31856_TCTYPE_J: Serial.println("J Type"); break;
case MAX31856_TCTYPE_K: Serial.println("K Type"); break;
case MAX31856_TCTYPE_N: Serial.println("N Type"); break;
case MAX31856_TCTYPE_R: Serial.println("R Type"); break;
case MAX31856_TCTYPE_S: Serial.println("S Type"); break;
case MAX31856_TCTYPE_T: Serial.println("T Type"); break;
case MAX31856_VMODE_G8: Serial.println("Voltage x8 Gain mode"); break;
case MAX31856_VMODE_G32: Serial.println("Voltage x8 Gain mode"); break;
default: Serial.println("Unknown"); break;
}

}

void loop() {
Serial.print("Cold Junction Temp: ");
Serial.println(maxthermo.readCJTemperature());

Serial.print("Thermocouple Temp: ");
Serial.println(maxthermo.readThermocoupleTemperature());
// Check and print any faults
uint8_t fault = maxthermo.readFault();
if (fault) {
if (fault & MAX31856_FAULT_CJRANGE) Serial.println("Cold Junction Range Fault");
if (fault & MAX31856_FAULT_TCRANGE) Serial.println("Thermocouple Range Fault");
if (fault & MAX31856_FAULT_CJHIGH) Serial.println("Cold Junction High Fault");
if (fault & MAX31856_FAULT_CJLOW) Serial.println("Cold Junction Low Fault");
if (fault & MAX31856_FAULT_TCHIGH) Serial.println("Thermocouple High Fault");
if (fault & MAX31856_FAULT_TCLOW) Serial.println("Thermocouple Low Fault");
if (fault & MAX31856_FAULT_OVUV) Serial.println("Over/Under Voltage Fault");
if (fault & MAX31856_FAULT_OPEN) Serial.println("Thermocouple Open Fault");
}
delay(1000);
}>

I would have to go out to the shop to look in the thermocouple drawer to be sure. I think thermocouples have a red lead and a yellow lead. Have you tried reversing them?
Paul

In addition to what Paul has already posted you may want to look at your thermocouple board output. The board amplifier works as follows:

Temperature = (Vout - 1.25) / 0.005 V. So for example, if the voltage is 1.5VDC, the temperature is (1.5 - 1.25) / 0.005 = 50°C

Also if not labeled on the board TC Red is Neg and Yellow is Pos or in the case of bare wire or no color code with Type K TC wire the magnetic wire is the negative lead.

Anyway I would measure the board output using a DMM and see what you get and if you heat and cool the TC the value changes.

Ron

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