Multiple thermocouples giving non-sensical data MAX6675

Newbie here, and yes, I searched until I finally gave up and decided to ask for help.

My end game goal is to have an eight cylinder Exhaust Gas Temperature measurement system for optimizing electronic fuel injection systems.

There are probably an infinite number of off-the-shelf devices to do this, but what challenge is there in that, and how elegant would it be?

I had successfully used the MAX6675 with a nano and was able to repeatedly confirm zero degrees centigrade when exposed to an ice cube and 100'C (or close enough) when in a steam plume from the tea kettle.

I finally received a second thermocouple (I have eight coming from a single vendor and my hope is that they will be sufficiently similar to be consistent between all eight) and found I have a somewhat consistent difference between the two of about seven degrees.

This morning, I used a hose clamp to attach both sensors to a stainless steel vessel on a hot plate/magnetic stirrer filled with room temp water, intending to elevate the temp and watch the response (I was a chemist in an earlier life). When configured in this manner, the temperature readout is WAY off-I suspect it may be an issue with grounding of the sensors.

My question is two (or maybe three-) fold.

1: are thermocouples simply not precise/accurate enough to expect two to provide the same data points?
2: is the common connection between the two thermocouples causing a problem by grounding the cases together?

Any help is much appreciated. I'm learning quickly but his a roadblock once in a while.

2: is the common connection between the two thermocouples causing a problem by grounding the cases together?

Very likely. This is NOT trivial, because you are dealing with such very low sensor voltages.

Post a detailed wiring diagram and a link to the amplifier board.

I'll work on finding the wiring diagram I'm using, but while that would be enlightening to you, if we keep in mind that when I have a single thermocouple, it reads as expected. When I add the second one, the second one reads about seven degree difference-even when the two thermocouples are not at the same ground potential.

The thermocouple and amplifier link:

And the sketch. Keep in mind that there is much superfluous code as I want to print to a serial monitor as well as the OLED display.

#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

// If using software SPI (the default case):
#define OLED_MOSI  11   //D1
#define OLED_CLK   12   //D0
#define OLED_DC    9
#define OLED_CS    8
#define OLED_RESET 10

Adafruit_SSD1306 display(OLED_MOSI, OLED_CLK, OLED_DC, OLED_RESET, OLED_CS);




// Sample Arduino MAX6675 Arduino Sketch

#include "max6675.h"

int ktc2SO = 2;
int ktc2CS = 3;
int ktc2CLK = 4;

int ktcSO = 5;
int ktcCS = 6;
int ktcCLK = 7;

MAX6675 ktc(ktcCLK, ktcCS, ktcSO);
MAX6675 ktc2(ktc2CLK, ktc2CS, ktc2SO);

  
void setup() {
  Serial.begin(9600);
  // give the MAX a little time to settle
  delay(500);

  //  Serial.begin(9600);
  display.begin(SSD1306_SWITCHCAPVCC);
  display.display();
  delay(2500);
  display.clearDisplay();
  display.setTextSize(1);
  display.setTextColor(WHITE);
}

void loop() {
  // basic readout test

  
  Serial.print("Exhaust Gas Temperature cyl1 ");
   Serial.print("Deg C = "); 
   Serial.print(ktc.readCelsius());
   Serial.print("\t Deg F = ");
   Serial.println(ktc.readFahrenheit());

   Serial.print("Exhaust Gas Temp Cyl2 ");
   Serial.print("  Deg C = " );
  Serial.print(ktc2.readCelsius());
  Serial.print("\t2 Deg F = ");
  Serial.print(ktc2.readFahrenheit());
 
   delay(2500);

   static unsigned long thisMicros = 0;
  static unsigned long lastMicros = 0;
  display.clearDisplay();
  display.setCursor(0,0);
  display.print("Exh Gas Temp Cyl  1 ");
  display.print(" Deg F = ");
  display.println(ktc.readFahrenheit());
  display.display();
  
 
  display.print("Exh Gas Temp Cyl 2 ");
  display.print("  Deg F = ");
  display.print(ktc2.readFahrenheit());
  display.display();
  
  
  lastMicros = thisMicros;
  thisMicros = micros();

}

How do I resolve the grounding issue of the thermocouples as my application will require them all to be at ground potential as they will be placed in the exhaust stream and held in place in welded-in threaded fittings.

Again, everything worked fine with a single sensor, it worked OK with two sensors, but not both at ground potential.

Why call out SPI.h if you're not using the on-chip SPI hardware?

Do you need to declare a bunch of the pins as OUTPUT in setup() ?
Or do the libraries take care of that for you?

Actually, you do not want the thermocouple to be grounded.

There are plenty of technical web sites that discuss this problem and how to avoid it. A few examples:

Thank you both. Looks like I wasted some $ on the MAX6675-until I start looking into how to resolve the issue.

Crossroads-I don't know. I plagiarized fragments of code to get where I am. As I said, I'm still learning what I'm doing here.

It's an SPI interface. I would connect SCK and MISO to all of them in parallel, give each a unique chip select line, and access one at a time.
http://datasheets.maximintegrated.com/en/ds/MAX6675.pdf

Force CS low and apply a clock signal at SCK to read
the results at SO. Forcing CS low immediately stops
any conversion process. Initiate a new conversion
process by forcing CS high.
Force CS low to output the first bit on the SO pin. A
complete serial interface read requires 16 clock cycles.
Read the 16 output bits on the falling edge of the clock.
The first bit, D15, is a dummy sign bit and is always
zero. Bits D14–D3 contain the converted temperature
in the order of MSB to LSB. Bit D2 is normally low and
goes high when the thermocouple input is open. D1 is
low to provide a device ID for the MAX6675 and bit D0
is three-state.
digitalWrite (ssPin, LOW);
byte0 = SPI.transfer(0);
byte1 = SPI.transfer(0);
digitalWrite (ssPin, HIGH);
//  combine the two bytes into an int, shift right 3 bits to drop D2-D1-D0, the remaining bits are your data. Interpret as  needed.

Really, it should be that simple.
Repeat for each chip, each gets a unique ssPin.

Now that I'm back on a device where I can respond, I will.

Thank you CrossRoads. I will experiment with your comments, but at this point, I don't think the MAX6675 will work unless I can figure out how to resolve the grounding of the sensor issue.

I'm aware of the issues with ground loops, but in this case, did not even begin to think about the really low voltages being used when one is using thermocouples.

You need to look at your thermocouples - they should have two wires that are isolated from the sheath , thus there are no earthing problems and the MAX device, one per thermocouple should work fine.
Example:
http://www.tmswebshop.co.uk/buy/type-k-mineral-insulated-thermocouple-3mm-dia-50mm-long-0-6m-lead-with-mini-plug-exstdk50600.html