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