Page 1 of 2

max31855 thermocouple on Wemos D1?

PostPosted: Sun Feb 10, 2019 5:46 am
by Highflower
I've been using the max31855 with arduino for some time and I thought it's time to migrate the project to the esp platform. I dont find any max31855 shields for the Wemos D1 so my plan is to make one myself. However, when connecting the module to the wemos directly I cannot get any reedings at all with the sample code serialtermocouple from adafruit:

Code: Select all/***************************************************
  This is an example for the Adafruit Thermocouple Sensor w/MAX31855K

  Designed specifically to work with the Adafruit Thermocouple Sensor
  ----> https://www.adafruit.com/products/269

  These displays use SPI to communicate, 3 pins are required to 
  Adafruit invests time and resources providing this open source code,
  please support Adafruit and open-source hardware by purchasing
  products from Adafruit!

  Written by Limor Fried/Ladyada for Adafruit Industries. 
  BSD license, all text above must be included in any redistribution

#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.

//arduino nano
//#define MAXDO   4
//#define MAXCS   5
//#define MAXCLK  3

// esp8266
#define MAXDO   D6//12
#define MAXCS   D1//5
#define MAXCLK  D5//14

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

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

#if defined(ARDUINO_ARCH_SAMD)
// for Zero, output on USB Serial console, remove line below if using programming port to program the Zero!
   #define Serial SerialUSB

void setup() {
  #ifndef ESP8266
    while (!Serial);     // will pause Zero, Leonardo, etc until serial console opens
  Serial.println("MAX31855 test");
  // wait for MAX chip to stabilize

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

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

I set up a breadboard with only the max31855, an arduino and a wemos d1 to compare and locate the problem.

A photo of my setup:

The arduino nano (left) is connected via a logic level converter since it is running on 5V and the max31855 wants 3.3V. The esp is connected directly to the module. It is a bit hard to see but everything is color coded according to:

5V red
3.3V orange
gnd black
DO blue
CS purple
CLK yellow

It works perfectly fine on the arduino but from the esp I only get zero reedings:

Internal Temp = 0.00
C = 0.00

I've tested some different pins for the wemos but it does not seem to make any difference..

From what I've read it should not be any problem to use the esp together with the max chip. I am probably making some stupid beginners misstake... :roll:

If you have any suggestion what can be my problem, please guide me in the right direction!

Thanks in advance!

Best regards

Re: max31855 thermocouple on Wemos D1?

PostPosted: Sun Feb 17, 2019 4:15 am
by Highflower
Since it took one week to get this post approved, I had the time to figure it out myself. How do I remove the thread?

Re: max31855 thermocouple on Wemos D1?

PostPosted: Sun Feb 17, 2019 12:05 pm
by RichardS
Not sure how it took a week... normal turn around is less than a day.... usually less than hours :-)

You could share your findings, or let me know and I can delete.


Re: max31855 thermocouple on Wemos D1?

PostPosted: Sun Feb 17, 2019 1:37 pm
by Bonzo
As Richard said it would be good if you posted your findings as that could help somebody else in the future.

After all that is what forums are about.