Arnov Sharma
Published © MIT

MAX6675 Temp Sensor with XIAO M0

Simple How-to guide for using MAX6675 Temp sensor using an XIAO MCU

BeginnerFull instructions provided1 hour114
MAX6675 Temp Sensor with XIAO M0

Things used in this project

Hardware components

Seeed Studio XIAO SAMD21 (Pre-Soldered) - Seeeduino XIAO
Seeed Studio XIAO SAMD21 (Pre-Soldered) - Seeeduino XIAO
×1
Analog Devices max6675
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

sch

Code

code

C/C++
#include "max6675.h"

int thermoDO = 9;
int thermoCS = 7;
int thermoCLK = 8;

const int RelayPin = 1; 
const int threshold = 40;//cuttoff temp

MAX6675 thermocouple(thermoCLK, thermoCS, thermoDO);

void setup() {
  Serial.begin(9600);
  pinMode(RelayPin, OUTPUT);
  Serial.println("MAX6675 test");
  // wait for MAX chip to stabilize
  delay(500);
}

void loop() {
  // basic readout test, just print the current temp
  
   Serial.print("C = "); 
   Serial.println(thermocouple.readCelsius());
   Serial.print("F = ");
   Serial.println(thermocouple.readFahrenheit());

   
  if (thermocouple.readCelsius() > threshold) {
    digitalWrite(RelayPin, LOW);
  } else {
    digitalWrite(RelayPin, HIGH);
  }
 
   // For the MAX6675 to update, you must delay AT LEAST 250ms between reads!
   delay(1000);
}

Credits

Arnov Sharma
348 projects • 357 followers
I'm Arnov. I build, design, and experiment with tech—3D printing, PCB design, and retro consoles are my jam.

Comments