Lithium ION
Published © GPL3+

K-type Temperature Sensor is Best

Because of the digital SPI interface of the sensor, MAX6675 amplifier data decoding is fast and more accurate and have long temp ranges.

BeginnerFull instructions provided1 hour365
K-type Temperature Sensor is Best

Things used in this project

Software apps and online services

Arduino IDE
Arduino IDE
PCBWAY

Story

Read more

Custom parts and enclosures

Gerber files

Schematics

circuit pdf

Code

Code

Arduino
#include "MAX6675.h"
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

#define OLED_RESET 1
Adafruit_SSD1306 display(128, 64, &Wire, OLED_RESET);

const int dataPin   = 7;
const int clockPin  = 6;
const int selectPin = 5;


MAX6675 thermoCouple;

uint32_t start, stop;


void setup()
{
  Serial.begin(115200);
  Serial.println(__FILE__);
  Serial.println(MAX6675_LIB_VERSION);
  Serial.println();

  thermoCouple.begin(clockPin, selectPin, dataPin);
  // thermoCouple.begin(selectPin);  // HW SPI

  thermoCouple.setSPIspeed(4000000);
  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
  display.clearDisplay();
}


void loop()
{
  delay(100);
  start = micros();
  int status = thermoCouple.read();
  stop = micros();
  float temp = thermoCouple.getTemperature();

  Serial.print(millis());
  Serial.print("\tstatus: ");
  Serial.print(status);
  Serial.print("\ttemp: ");
  Serial.print(temp);
  Serial.print("\tus: ");
  Serial.println(stop - start);

  display.clearDisplay();
  display.setTextSize(1);
  display.setTextColor(WHITE);
  display.setCursor(35,10);
  display.print("TEMPERATURE");
   display.setTextSize(2);
  display.setCursor(35,35);
  display.print(temp);
  display.display();
  delay(1000);
}

Credits

Lithium ION

Lithium ION

47 projects • 32 followers
A passionate electronics DIY boy. Currently improving in Embedded systems, soldering and programming.

Comments