MAX31855 Error when connected to 12V Power Supply

STORY
I have 3 temperature sensors: 1 x DS18B20 & 2 x Thermocouple Type K. Those sensors reading will be used to control 1 x Water Pump, 1 x Peltier Device TEC 12705, 2 x Heater.

I use MAX31855K as signal conditioning for Thermocouple. Water pump, peltier, and Heater connected to L298 Module and VNH2SP30.

Both DS18B20 and MAX31855K use 5V for Power Supply. L298 and VNH2SP30 are both supplied by 12V power supply. The Ground of 5V and 12V are already connected (common ground).

CODE
this is my code:

//-------TC Signal Condt. START
#include <SPI.h>
#include "Adafruit_MAX31855.h"
//-------TC Signal Condt. END

//-------DS18B20. START
#include <OneWire.h>
#include <DallasTemperature.h>
//-------DS18B20. END


#define DS18B20         3 //pin 2 DS18B20. DS pin: GND, DATA, VDD
#define HEATER          4 //VNH pin IN A - OUT A: 2 x 3D Printer Heater
#define CHILLER         5 //VNH pin IN B - OUT B: TEC12705 Chiller
#define VNH_PWM         6 //VNH pin PWM 

#define MAXCS1          7 //CS  TC #1
#define MAXCS2          8 //CS  TC #2
#define MAXCLK          9 //DO  TC #1, #2
#define MAXDO          10 //CLK TC #1, #2

#define PUMP           12 //L298 IN 1 - OUT 1: Water Pump
#define CHILLER_FAN    13 //L298 IN 2 - OUT 2: Chiller Fan

//-------DS18B20 and TC INIT. START
OneWire oneWire(DS18B20);
DallasTemperature sensors(&oneWire);
DeviceAddress insideThermometer;

Adafruit_MAX31855 thermocouple1 (MAXCLK, MAXCS1, MAXDO);
Adafruit_MAX31855 thermocouple2 (MAXCLK, MAXCS2, MAXDO);
//-------DS18B20 and TC INIT. END

//------VARIABLES---------START
float DS_tempC;
double c1, c2, int_c1, int_c2;

const long timeInterval = 1000;
unsigned long timeNow = 0;
unsigned long timeLast = 0;

int count = 1;
//------VARIABLES---------END

void setup() {
  Serial.begin(115200);
  setup_DS();
  digitalWrite (HEATER, HIGH);
  digitalWrite (CHILLER, HIGH);
  digitalWrite (PUMP, HIGH);
  delay(1000);
}

void loop() {

  loop_DS();

  //interupt every second-start
  timeNow = millis();

  if (timeNow - timeLast >= timeInterval) {
    timeLast = timeNow;
    printEverySecond();
    count++;
  }
  //interupt every second-end


  if (DS_tempC > 50) {
    digitalWrite (HEATER, LOW);
    digitalWrite (CHILLER, LOW);
  }
  else {
    digitalWrite (HEATER, HIGH);
    digitalWrite (CHILLER, HIGH);
  }


  //read TC - start
  int_c1 = thermocouple1.readInternal();
  c1 = thermocouple1.readCelsius();
  if (isnan(c1)) {
    Serial.println("Something wrong with thermocouple #################1!");
    digitalWrite (CHILLER_FAN, HIGH);
  } else {
    digitalWrite (CHILLER_FAN, LOW);
  }

  int_c2 = thermocouple2.readInternal();
  c2 = thermocouple2.readCelsius();
  if (isnan(c2)) {
    Serial.println("Something wrong with thermocouple =================2!");
    digitalWrite (PUMP, HIGH);
  } else {
    digitalWrite (PUMP, LOW);
  }
  //read TC - end
}

void printEverySecond() {
  //---print ini setiap detik - start
  Serial.print("t: ");
  Serial.print(timeNow);
  Serial.print("\t");

  Serial.print("t: ");
  Serial.print(count);
  Serial.print("\t");
  
  Serial.print("DS: ");
  Serial.print(DS_tempC);
  Serial.print("\t");

  Serial.print("intTC1: ");
  Serial.print(int_c1);
  Serial.print("\t");

  Serial.print("TC1: ");
  Serial.print(c1);
  Serial.print("\t");

  Serial.print("intTC2: ");
  Serial.print(int_c2);
  Serial.print("\t");

  Serial.print("TC2: ");
  Serial.println(c2);

  //---print ini setiap detik - end
}

void loop_DS()
{
 // Serial.print("Requesting temperatures...");
  sensors.requestTemperatures(); 
  //Serial.println("DONE");
  printTemperature(insideThermometer); 
}

void printTemperature(DeviceAddress deviceAddress)
{
  DS_tempC = sensors.getTempC(deviceAddress);
}

void printAddress(DeviceAddress deviceAddress)
{
  for (uint8_t i = 0; i < 8; i++)
  {
    if (deviceAddress[i] < 16) Serial.print("0");
    Serial.print(deviceAddress[i], HEX);
  }
}

FIRST TRIAL
I only use 5V power supply.
the DS18B20 and Thermocouple reading looks good.

SECOND TRIAL <<<----PROBLEM
I only use 5V and 12V power supply.
the DS18B20 reading is OK and Thermocouple reading are NOT OK

WHAT I HAVE DONE TINKERING THIS PROBLEM?
Adding 4700uF Capacitor as Decoupling Capacitor. (Not WORKS)

QUESTION
Any hint to solve this problem?

P.S.:
Attached: Power Supply image and Circuit

thank you very much

regards,
nug

Serial Output from the First Trial and Second Trial

Serial Output of the First Trial

Dallas Temperature IC Control Library Demo
Locating devices...Found 1 devices.
Parasite power is: OFF
Device 0 Address: 289F747791100204
Device 0 Resolution: 9
t: 1114 t: 1 DS: 27.50 intTC1: 0.00 TC1: 0.00 intTC2: 0.00 TC2: 0.00
t: 2293 t: 2 DS: 27.50 intTC1: 28.44 TC1: 28.50 intTC2: 27.94 TC2: 28.00
t: 3472 t: 3 DS: 27.50 intTC1: 28.50 TC1: 28.50 intTC2: 27.94 TC2: 28.00
t: 4652 t: 4 DS: 27.50 intTC1: 28.44 TC1: 28.25 intTC2: 27.87 TC2: 28.00
t: 5831 t: 5 DS: 27.50 intTC1: 28.44 TC1: 28.25 intTC2: 27.94 TC2: 28.25
t: 7010 t: 6 DS: 27.50 intTC1: 28.44 TC1: 28.25 intTC2: 27.94 TC2: 28.00
t: 8189 t: 7 DS: 27.50 intTC1: 28.50 TC1: 28.50 intTC2: 27.94 TC2: 28.00
t: 9369 t: 8 DS: 27.50 intTC1: 28.50 TC1: 28.50 intTC2: 27.87 TC2: 28.00
t: 10548 t: 9 DS: 27.50 intTC1: 28.50 TC1: 28.50 intTC2: 27.94 TC2: 28.00
t: 11727 t: 10 DS: 27.50 intTC1: 28.44 TC1: 28.50 intTC2: 27.94 TC2: 28.00
t: 12907 t: 11 DS: 27.50 intTC1: 28.50 TC1: 28.50 intTC2: 27.94 TC2: 28.00
t: 14087 t: 12 DS: 27.50 intTC1: 28.50 TC1: 28.50 intTC2: 27.94 TC2: 28.00
t: 15265 t: 13 DS: 27.50 intTC1: 28.50 TC1: 28.50 intTC2: 27.94 TC2: 27.75
t: 16445 t: 14 DS: 27.50 intTC1: 28.50 TC1: 28.50 intTC2: 27.94 TC2: 27.75
t: 17625 t: 15 DS: 27.50 intTC1: 28.50 TC1: 28.50 intTC2: 27.94 TC2: 28.00
t: 18804 t: 16 DS: 27.50 intTC1: 28.50 TC1: 28.50 intTC2: 27.94 TC2: 28.25
t: 19984 t: 17 DS: 27.50 intTC1: 28.50 TC1: 28.50 intTC2: 27.94 TC2: 28.00

Serial Output of the Second Trial

Dallas Temperature IC Control Library Demo
Locating devices...Found 1 devices.
Parasite power is: OFF
Device 0 Address: 289F747791100204
Device 0 Resolution: 9
t: 1114 t: 1 DS: 27.50 intTC1: 0.00 TC1: 0.00 intTC2: 0.00 TC2: 0.00
t: 2293 t: 2 DS: 27.50 intTC1: 28.56 TC1: 28.50 intTC2: 28.00 TC2: 27.75
Something wrong with thermocouple =================2!
Something wrong with thermocouple =================2!
Something wrong with thermocouple =================2!
Something wrong with thermocouple =================2!
t: 3475 t: 3 DS: 27.50 intTC1: 28.56 TC1: 28.50 intTC2: 28.00 TC2: 27.75
Something wrong with thermocouple =================2!
Something wrong with thermocouple =================2!
Something wrong with thermocouple =================2!
t: 4656 t: 4 DS: 27.50 intTC1: 28.56 TC1: 28.50 intTC2: 28.00 TC2: 28.75
Something wrong with thermocouple =================2!
Something wrong with thermocouple =================2!
t: 5836 t: 5 DS: 27.50 intTC1: 28.56 TC1: 28.50 intTC2: 28.06 TC2: 28.00
t: 7016 t: 6 DS: 27.50 intTC1: 28.56 TC1: 28.50 intTC2: 28.00 TC2: 27.75
t: 8196 t: 7 DS: 27.50 intTC1: 28.56 TC1: 28.50 intTC2: 28.00 TC2: 28.50
Something wrong with thermocouple =================2!
t: 9375 t: 8 DS: 27.50 intTC1: 28.56 TC1: 28.50 intTC2: 28.00 TC2: 28.25
Something wrong with thermocouple =================2!
Something wrong with thermocouple =================2!
Something wrong with thermocouple =================2!
t: 10557 t: 9 DS: 27.50 intTC1: 28.56 TC1: 28.50 intTC2: 28.06 TC2: 28.75
Something wrong with thermocouple =================2!
Something wrong with thermocouple =================2!
Something wrong with thermocouple =================2!
t: 11738 t: 10 DS: 27.50 intTC1: 28.56 TC1: 28.50 intTC2: 28.06 TC2: 28.25
t: 12917 t: 11 DS: 27.50 intTC1: 28.56 TC1: 28.50 intTC2: 28.06 TC2: 27.75
Something wrong with thermocouple =================2!
t: 14098 t: 12 DS: 27.50 intTC1: 28.56 TC1: 28.50 intTC2: 28.06 TC2: 28.50
Something wrong with thermocouple =================2!
Something wrong with thermocouple =================2!
t: 15279 t: 13 DS: 27.50 intTC1: 28.56 TC1: 28.50 intTC2: 28.06 TC2: 29.00
Something wrong with thermocouple =================2!
Something wrong with thermocouple =================2!
Something wrong with thermocouple =================2!
t: 16459 t: 14 DS: 27.50 intTC1: 28.62 TC1: 28.50 intTC2: 28.00 TC2: 28.75
Something wrong with thermocouple =================2!
Something wrong with thermocouple =================2!
t: 17641 t: 15 DS: 27.50 intTC1: 28.62 TC1: 28.50 intTC2: 28.00 TC2: 28.00
t: 18820 t: 16 DS: 27.50 intTC1: 28.56 TC1: 28.50 intTC2: 28.00 TC2: 27.75
Something wrong with thermocouple =================2!
Something wrong with thermocouple =================2!
Something wrong with thermocouple =================2!
t: 20001 t: 17 DS: 27.50 intTC1: 28.62 TC1: 28.50 intTC2: 28.00 TC2: 28.00
Something wrong with thermocouple =================2!
Something wrong with thermocouple =================2!
Something wrong with thermocouple =================2!
Something wrong with thermocouple =================2!
t: 21183 t: 18 DS: 27.50 intTC1: 28.62 TC1: 28.50 intTC2: 28.06 TC2: 28.00

Post a wiring diagram of your complete setup. We cannot detect every wire on that photo.

pylon:
Post a wiring diagram of your complete setup. We cannot detect every wire on that photo.

Dear @pylon, here is my wiring diagram

thank you

regards,
nug

Does that VNH2SP30 create a stable 5V? Why do you take the 5V from the VNH2SP30? Have tried powering the Arduino with 12V and then using it's 5V to power the rest of the components?

pylon:
Does that VNH2SP30 create a stable 5V? Why do you take the 5V from the VNH2SP30? Have tried powering the Arduino with 12V and then using it's 5V to power the rest of the components?

The VNH2SP30 is powered by 12V (left side).
No, I didn't take the 5V from the VNH2SP30. I use the 5V from USB that connected to my PC.

No, I didn't take the 5V from the VNH2SP30. I use the 5V from USB that connected to my PC.

I cannot see that connection in the wiring diagram.

Post a link to the VHN2SP30 board you're using.

Try disconnecting the 12V power supply from the VHN2SP30 board (both +12V and the corresponding GND). How are the MAX measurements reacting?

pylon:
I cannot see that connection in the wiring diagram.

Post a link to the VHN2SP30 board you're using.

Try disconnecting the 12V power supply from the VHN2SP30 board (both +12V and the corresponding GND). How are the MAX measurements reacting?

Dear Pylon,

Yeah, sorry for the confusion. I get the 5V from PC==>Arduino (Arduino 5V pin) ===> 5V VNH2SP30 Module.
I got VNH2SP30 just like this (link) from my local store.

Anyway, i don't know how, but i think i solve the problem after I re-wire the thermocouple probe.

Thank you so much for your help, sir. :smiley:

regards,
nug