MAX31855 Deep Sleep for K-type sensor

Hi All, I am very new at programming boards and creating my own IOT sensors. I have already used wemos d1 mini to measure temperature from DHT11/22 and Dallas one-wire sensors, and in both cases, I was able to add a sleep mode to the program.

Now, I am trying to do the same, but with a K-type sensor connected to the Adafruit MAX31855 amplifier. I manage to run the program and measure temperature correctly, however, whenever I add the sleep mode (ESP.deepSleep) the program seems to not be able to wake up if the MAX31855 is connected to the GRD and V5 (or 3V3) of the Wemos. The program runs okay if I have the CLK, CS, and D0 are connected but, of course, it only reads 0.00°C.

#define MAXDO 12  // D6
#define MAXCS 13  // D7
#define MAXCLK 15 // D8

//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);

void setup () {
  Serial.begin(9600);
 
  Serial.println("MAX31855 test");  //Wait for MAX chip to stabilize
  delay(500);


  //ESP.deepSleep(20e6);
}

void loop () {
  //Basic readout test, just print the current temp
  Serial.print("Temperature:");

  double c = thermocouple.readCelsius();
   
  if(isnan(c)) {
    Serial.println (" Something wrong with thermocouple!");
   }  else  {
    Serial.print(String (c) + "°C,");
    Serial.println(String (thermocouple.readInternal()) + "°C (internal)");
   }
   
  Serial.println("I will go to sleep now");
  ESP.deepSleep(20e6);
  //delay(5000);
  
}

Playing with it a bit more, I feel like the issue lies in restarting the program (after deep sleep) while the GRD and 5V (or 3V3) pins are connected to the amplifier. I don't really know why this might happen or how to solve it.

Any ideas would be greatly appreciated! :slight_smile:

Look at the SPI pins on this page.
And the pins you should use with care.
Leo..

Hi, Leo. Thanks so much for your reply.

I double-checked the pins and are connected as shown in the link you sent. Is there anything else I could check/test?

Best,
Javiera

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