MAX31855 (clone) and ESP32 with Oled/Battery and WIFI

Hello

I’m strugling with an MAX31855 thermocouple type K board. Can’t read internal temperature and an error message “something wrong with thermocouple” is returned

Something wrong with thermocouple!
Internal Temp = -0.06

  • The controler is an ESP32 with an OLED, WIFI and a batterie 18650 charger and socket
  • In Arduino IDE, I set the board to ESP32 Wrover. Tried also Wemos WIFI& Bluetooth Battery Oled
  • Tried two MAX31855 module with same result
  • MAX 31855 module power is driven by the ESP board at 3.3v
  • As mentionned from a post on this site, I did found a short between pin 1&2 on these MAX31855 modules. The trace has been cut
  • Did try other library and port pins with same result

Is lowering the SPI speed could help? Did not found how to do it yet

If the communication was established, I should at least read the internal temperature.?

Got another result after I made these modifications to the ports pins
I changed the ports pins for :

  • #define MAXDO 34
  • #define MAXCS 35
  • #define MAXCLK 32

Now the message is either

Something wrong with thermocouple!
Internal Temp = 85.31

**or **

Something wrong with thermocouple!
Internal Temp = 0.00

How could I validate the communication protocol and pin setup/installation?
Are these cheap boards really defective or the problem reside with my lack of understanding?

Martin

Note: Covid-19/ stay safe. I had it and it’s not fun at all… Please, protect yourself and protect others to.

#include <SPI.h>
#include "Adafruit_MAX31855.h"

// Default connection is using software SPI, but comment and uncomment one of
// the two examples below to switch between software SPI and hardware SPI:

// Example creating a thermocouple instance with software SPI on any three
// digital IO pins.
#define MAXDO   3
#define MAXCS   4
#define MAXCLK  15

// initialize the Thermocouple
Adafruit_MAX31855 thermocouple(MAXCLK, MAXCS, MAXDO);

// Example creating a thermocouple instance with hardware SPI
// on a given CS pin.
//#define MAXCS   10
//Adafruit_MAX31855 thermocouple(MAXCS);

// Example creating a thermocouple instance with hardware SPI
// on SPI1 using specified CS pin.
//#define MAXCS   10
//Adafruit_MAX31855 thermocouple(MAXCS, SPI1);

void setup() {
  Serial.begin(115200);
  
  while (!Serial) delay(1); // wait for Serial on Leonardo/Zero, etc

  Serial.println("MAX31855 test");
  // wait for MAX chip to stabilize
  delay(500);
  Serial.print("Initializing sensor...");
  if (!thermocouple.begin()) {
    Serial.println("ERROR.");
    while (1) delay(10);
  }
  Serial.println("DONE.");
}

void loop() {
  // basic readout test, just print the current temp
   Serial.print("Internal Temp = ");
   Serial.println(thermocouple.readInternal());

   double c = thermocouple.readCelsius();
   if (isnan(c)) {
     Serial.println("Something wrong with thermocouple!");
   } else {
     Serial.print("C = ");
     Serial.println(c);
   }
   //Serial.print("F = ");
   //Serial.println(thermocouple.readFahrenheit());

   delay(1000);
}

Could you post your Schematic showing all the thermocouple wiring connections from board to junction. Are you using a K thermocouple, what are the wire colors. How long are the leads?

Sorry late responce. Email from arduino forum was in junk mail

  • SPI harness about 6 inch
  • Did place a .1 uF between thermocouple legs at the connector
  • Type k probe was tested with another thermometer and are good
  • MAX 31855 power from ESP board: 3.2V
  • Port pin contact tested by writing a simple blink test on each appropriate pins
  • Don’t know how to use a schematic drawing tool.

using this code, I got these values:
Internal temperature : 127.94 'C a fix value
probe: 1124 'C value do change when I touch the probe tip

I suspect that the SPI speed to be too fast. Don’t know yet how to test at a lower speed

#include <SPI.h>
#include "Adafruit_MAX31855.h"

// Default connection is using software SPI, but comment and uncomment one of
// the two examples below to switch between software SPI and hardware SPI:

// Example creating a thermocouple instance with software SPI on any three
// digital IO pins.
#define MAXDO   19
#define MAXCS   2
#define MAXCLK  18

// initialize the Thermocouple
Adafruit_MAX31855 thermocouple(MAXCLK, MAXCS, MAXDO);

// Example creating a thermocouple instance with hardware SPI
// on a given CS pin.
//#define MAXCS   10
//Adafruit_MAX31855 thermocouple(MAXCS);

// Example creating a thermocouple instance with hardware SPI
// on SPI1 using specified CS pin.
//#define MAXCS   10
//Adafruit_MAX31855 thermocouple(MAXCS, SPI1);

void setup() {
  Serial.begin(115200);

  while (!Serial) delay(1); // wait for Serial on Leonardo/Zero, etc

  Serial.println("MAX31855 test");
  // wait for MAX chip to stabilize
  delay(500);
  Serial.print("Initializing sensor...");
  if (!thermocouple.begin()) {
    Serial.println("ERROR.");
    while (1) delay(10);
  }
  Serial.println("DONE.");
}

void loop() {

I may have a fake MAX31855k chips. My numbers printed on chips do match.

Read from Arduino forum. Chips with these number seem to be fake.
M31855K
1424A2
+780AB

Did order another board from a new supplier

Martin

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