5x MAX31855k sensors, 3 of the TCs are connected to the same conductive component

I have set up this test rig with 5 MAX31855k sensors. It works like charm as it is (well... I haven't validated the temperature values yet :blush: ).

The problem is that in the actual application I will have 3 of the TCs connected (welded) to a steel tank. This will short circuit the TCs and I have read here and in other forums that it will cause problem. I have of course tried it in my setup and, yes, it reports =0 value for the connected TCs. The advise/solution I have seen here in this forum is like "don't do it"... But I have no choice... I want to measure the temperature on the steel tank at three positions. The operating temperature is 600-650 degrees C.

A "quick and dirty" solution(?)/idea that I thought of is to have a relay that cuts the TC circuit and only activates it when a reading of the sensor is done. I don't need continuous readings. Once every 10s is fine, probably even with longer intervals. But an electromagnet might not be the best thing to have close to a sensor? Is it possible to solve this on the software side, in the sketch? As it is now the sensors share the same CLK and DO. Will it make any difference if they are separated? Would .stop() the sensor (if there is such function) make a difference? Is there other sensors that can be used instead of the MAX31855 where this wouldn't be a problem? At work we have a DAC from National Instruments with 16 channels where one can connect all the TCs together, but just the module costs 20-30 times more than this rig including the arduino :slight_smile:

I also read that one should put a capacitor across the T+ and T-, e.g. Arduino library for 14-bit MAX31855 K-thermocouple to digital converter. It is also said that it should be placed in parallel in some other post. Erm, can someone tell a newb like me how it should be connected? I interpret "across" as between T+ and T-, but that sounds strange to me :grimacing: (but I have very limited knowledge about it).

// vi:ts=4
// ----------------------------------------------------------------------------
// LCDCustomChars - simple demonstration of lcd custom characters
// Created by Bill Perry 2016-10-06
// bperrybap@opensource.billsworld.billandterrie.com
//
// This example code is unlicensed and is released into the public domain
// ----------------------------------------------------------------------------
// You can create your own custom characters.
// Here are a couple of web pages that have a tool that will generate the data
// values needed for custom character.
// https://kakedev.github.io/GlyphGenerator/
// http://www.quinapalus.com/hd44780udg.html
// https://omerk.github.io/lcdchargen
//
#include "RTClib.h"             // Lib for the Real Time Clock
#include "Adafruit_MAX31855.h"  // Shield for reading of thermocouple data
#include <SPI.h>                // Communication with SPI device
#include <SD.h>                 // Read/write to SD card
#include <Wire.h>
#include <hd44780.h>            // include hd44780 library header file
#include <hd44780ioClass/hd44780_I2Cexp.h> // i/o expander/backpack class
hd44780_I2Cexp lcd;             // auto detect backpack and pin mappings
//
#include <Adafruit_Sensor.h>
#include <DHT.h>
#include <DHT_U.h>
#define DHTPIN 2     // Digital pin connected to the DHT sensor 
#define DHTTYPE    DHT22     // DHT 22 (AM2302)
DHT dht(DHTPIN, DHTTYPE);


// ----------------------------------------------------------------------------
// Data logger
#define LOG_INTERVAL  1000 // mills between entries (reduce to take more/faster data)
#define SYNC_INTERVAL 1000 // mills between calls to flush() - to write data to the card
uint32_t syncTime = 0;     // time of last sync()
File logfile;              // the logging file

// ----------------------------------------------------------------------------
// LCD geometry
const int LCD_COLS = 20;
const int LCD_ROWS = 4;
// some custom characters 
uint8_t smile[8] = {0x00,0x0a,0x0a,0x00,0x00,0x11,0x0e,0x00};
uint8_t degreeSymbol[8]= {0x06,0x09,0x09,0x06,0x00,0x00,0x00,0x00};


// ----------------------------------------------------------------------------
// initialize the Thermocouple
#define MAXDO   3   // creating a thermocouple instance with software SPI on any three digital IO pins.
#define MAXCLK  4
Adafruit_MAX31855 TC1(MAXCLK, 9, MAXDO);
Adafruit_MAX31855 TC2(MAXCLK, 8, MAXDO);
Adafruit_MAX31855 TC3(MAXCLK, 7, MAXDO);
Adafruit_MAX31855 TC4(MAXCLK, 6, MAXDO);
Adafruit_MAX31855 TC5(MAXCLK, 5, MAXDO);
//Adafruit_MAX31855 TC5(23, 5, 22);


char str2[3];   // need to allocate one extra bit for the null terminator at the end
char str5[6];   // need to allocate one extra bit for the null terminator at the end
char str20[21];    // need to allocate one extra bit for the null terminator at the end
char str60[61];

// ----------------------------------------------------------------------------
// RTC
RTC_PCF8523 rtc;
// for the data logging shield, we use digital pin 10 for the SD cs line
const int chipSelect = 10;
char daysOfTheWeek[7][12] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};



// ----------------------------------------------------------------------------
void error(char *str)
{
  Serial.print("error: ");
  Serial.println(str);
  while(1);
}



// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
void setup()
{

  
  // For debugging only, remove later
  Serial.begin(57600);
  Wire.begin();

  #ifndef ESP8266
    while (!Serial); // wait for serial port to connect. Needed for native USB
  #endif

  // RTC
  rtc.begin();
  if (! rtc.begin()) {
    Serial.println("Couldn't find RTC");
    Serial.flush();
    abort();
  }

  // DHT
  dht.begin();


  int status;
	status = lcd.begin(LCD_COLS, LCD_ROWS);
	if(status) // non zero status means it was unsuccesful
	{
		hd44780::fatalError(status); // begin() failed so blink error code using the onboard LED if possible
	}

  // initalization was successful, the backlight should be on now
  lcd.clear();
  lcd.print("Initializing sensors");
  delay(500);
  // 
  // Initialize the MAX31855 adapter
  if (!TC1.begin()) {
    lcd.print("ERROR1!");
    while (1) delay(500);
  }
  if (!TC2.begin()) {
    lcd.print("ERROR2!");
    while (1) delay(500);
  }
  if (!TC3.begin()) {
    lcd.print("ERROR3!");
    while (1) delay(500);
  }
  if (!TC4.begin()) {
    lcd.print("ERROR4!");
    while (1) delay(500);
  }
  if (!TC5.begin()) {
    lcd.print("ERROR5!");
    while (1) delay(500);
  }

  
  lcd.clear();
  lcd.setCursor(8,1);
  lcd.print("DONE!");
  delay(500);
  lcd.clear();
  lcd.setCursor(1,0);
  lcd.print("KOLHUGGET.SE");
  DateTime now = rtc.now();
  sprintf(str5,"%02d:%02d",now.hour(),now.minute());
  lcd.setCursor(15, 0);
  lcd.print(str5);
  

  // initialize the SD card
  // make sure that the default chip select pin is set to
  // output, even if you don't use it:
  pinMode(10, OUTPUT);
 
  // see if the card is present and can be initialized:
  if (!SD.begin(chipSelect)) {
    lcd.clear(); lcd.setCursor(1,0); 
    lcd.print("ERROR! SD card not present");
    error("Card failed, or not present");
  }

  // create a new log file
  char filename[] = "LOGGER00.CSV";
  for (uint8_t i = 0; i < 100; i++) {
    filename[6] = i/10 + '0';
    filename[7] = i%10 + '0';
    if (! SD.exists(filename)) {
      // only open a new file if it doesn't exist
      logfile = SD.open(filename, FILE_WRITE);
      break;  // leave the loop!
    }
  }
  if (! logfile) {
    error("couldnt create file");
  }

  // Write the header to the csv file
  logfile.println("Timer,Date,Time,TCi,TCm,TCy,TCved,TCgas,TCarduino");
  lcd.noBacklight();


}

// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
void loop(void)
{
  // delay for the amount of time we want between readings
  delay((LOG_INTERVAL -1) - (millis() % LOG_INTERVAL));
  DateTime now = rtc.now();  
  sprintf(str5,"%02d:%02d",now.hour(),now.minute());
  lcd.setCursor(15, 0);
  lcd.print(str5);
	// create custom characters
	lcd.createChar(1, degreeSymbol);


  // TC : inre
  int TCi = TC1.readCelsius();
  // TC : ved
  int TCved = TC4.readCelsius();
  sprintf(str20,"T_i%4d\001C Tved%4d\001C",TCi,TCved);
  lcd.setCursor(0, 1); 
  lcd.write(str20);
  Serial.println(TCved);
  
  // TC : mitten
  int TCm = TC2.readCelsius();
  // TC : gas
  int TCgas = TC5.readCelsius();
  sprintf(str20,"T_m%4d\001C Tgas%4d\001C",TCm,TCgas);
  lcd.setCursor(0, 2); 
  lcd.write(str20);
  Serial.println(TCgas);
  
  // TC : yttre
  int TCy = TC3.readCelsius();
  // TC : internt (Arduino)
  int TCint = TC3.readInternal();
  sprintf(str20,"T_y%4d\001C Tint%4d\001C",TCy,TCint);
  lcd.setCursor(0, 3); 
  lcd.write(str20);


  Serial.print(millis(), DEC);
  Serial.print(", ");
  Serial.print(now.year(), DEC);
  Serial.print("-");
  sprintf(str2,"%02d",now.month());
  Serial.print(str2);
  Serial.print("-");
  sprintf(str2,"%02d",now.day());
  Serial.print(str2);
  Serial.print(", ");
  sprintf(str2,"%02d",now.hour());
  Serial.print(str2);
  Serial.print(":");
  sprintf(str2,"%02d",now.minute());
  Serial.print(str2);
  Serial.print(":");
  sprintf(str2,"%02d",now.second());
  Serial.print(str2);
  sprintf(str60,",%d,%d,%d,%d,%d,%d",TCi,TCm,TCy,TCved,TCgas,TCint);
  Serial.print(str60);
  Serial.println();

  logfile.print(millis(), DEC);
  logfile.print(",");
  logfile.print(now.year(), DEC);
  logfile.print("-");
  sprintf(str2,"%02d",now.month());
  logfile.print(str2);
  logfile.print("-");
  sprintf(str2,"%02d",now.day());
  logfile.print(str2);
  logfile.print(",");
  sprintf(str2,"%02d",now.hour());
  logfile.print(str2);
  logfile.print(":");
  sprintf(str2,"%02d",now.minute());
  logfile.print(str2);
  logfile.print(":");
  sprintf(str2,"%02d",now.second());
  logfile.print(str2);
  logfile.print(str60);
  logfile.println();


  // Now we write data to disk! Don't sync too often - requires 2048 bytes of I/O to SD card
  // which uses a bunch of power and takes time
  if ((millis() - syncTime) < SYNC_INTERVAL) return;
  syncTime = millis();
 
  logfile.flush();

  

}

Post a well focused and lit, close-up picture of how the TCs are attached to the tank. Put something in the picture for scale, like your finger or hand or a US quarter coin. Is the tank surface flat or curved? Horizontal or vertical?

Thermocouples are already short circuited, by definition. If not, the do not work!
Only ONE side of the thermocouple can be welded to the tank and that should be the ground side of the thermocouple.
Paul

Here is an overview picture of the actual application and a close up on the attachment of thermocouples. They are welded with a thermocouple spot-welding device.


To make it more clear I attach a picture of the setup when I "simulate" the attachment of thermocouples to the same steel tank. The readings after that is =0 for the TCs that are connected.
@Paul_KD7HB bad wording of me, but hopefully it is clear what I meant now(?)

Easy to test. What is the resistance of each thermocouple wire to the tank. If BOTH are are or near zero Ohms, then you have shorted the thermocouple with the weld and of course it won't work.
The correct mounting is to CLAMP the thermocouple to the tank with an insulating layer between the thermocouple and the metal of the clamp and tank. Perhaps Kapton tape.
Paul

Welding TCs is a standard procedure to attach thermocouples to the point/object you want to measure the temperature on. Due to the different alloys in the two wires you get an electrical potential that varies with temperature which you then can relate to a temperature. But that is not the point in this question. The problem arises in this case when two (or more) TCs are attached to the same conductive body. The signal from each TC measuring module must be separated/isolated from each other some how. But I don't know how or if its even possible with these modules/arduino?

At work I have a https://www.ni.com/sv-se/support/model.ni-9213.html to which you can connect 16 thermocouples to the same measurement point if you like and it WORKS! But that system including the connector to the computer will set you back at least $2000 and secondly where Ill be doing the measurements is "off-grid" so I do not have access to electricity (10+ hours of measuring).

Adding an electrical insulator between the TC and the point that you want to measure will mean that you put a thermal insulator between the two, and then you don't measure the temperature at the wanted point. The measurement environment is quite harsh too, 650 C (~1200 F) and some mechanical wear and load.

Easy if you use separate power supplies and keep all other signals separate. Perhaps this is done by the amplifiers necessary for your thermocouples. If this is a common practice, then surely others have solved it.
Paul

@Paul_KD7HB ok, thanks for the advise. I will try to test that (pretty much a novice in this area). I have found some questions about it, but never any answers/solutions :slight_smile:

MY personal experience is thermocouples are very fragile, so I wonder how many time they have to be ground off the tank and rewelded?
Paul

So far I have only run the process two times, a pyrolysis furnace, and the thermocouples has survived so far. But you are right that they are easy to damage/come loose from the weld and I expect them to break every now and then.