Menu Close

MAX31855K thermocouple temperature sensor interfacing with arduino

This tutorial of Robo India explains the working of MAX31855K thermocouple temperature sensor interfacing with arduino

1. Introduction 

The MAX31855K thermocouple Breakout is a simple 14-bit resolution, SPI-compatible, serial interface thermocouple digitizer that makes reading a wide range of temperatures. A thermocouple works by taking two wires made of dissimilar metals, connecting them at the two ends, and making a temperature gradient between one end and the other (a ‘hot’ end and a ‘cold’ one). Once this is achieved, a voltage potential is formed and current flows.

The thermocouple Breakout takes a standard Type-K thermocouple in one end, digitizes the temperature measured and sends that data out the other end via a SPI interface, thereby interpreting the data and translating it .

1.2 Hardware required

S.No.ItemQuantity
1Arduino UNO 1
2MAX31855 thermocouple temperature sensor 1
3Male to male jumper wire 7

2. MAX31855 Pin Outs

These pins function as follows:

1) DO (data out) is an output from the MAX31855 (input to the microcontroller) which carries each bit of data

2) CS (chip select) is an input to the MAX31855 (output from the microcontroller) which tells the chip when its time to read the thermocouple and output more data.

3) CLK (clock) is an input to the MAX31855 (output from microcontroller) which indicates when to present another bit of data

4) VCC:-5 Volt Supply

5) GND:-Ground.

6) Minus (-) Screw: The K thermocouple minus input.

7) Plus (+) Screw: The K Thermocouple plus input.

3 Connection

S.No.Arduino PinMAX31855 Module Pin
1GND GND
25V VCC
3Digital Pin 3 DO
4Digital Pin 4 CS
5Digital Pin 5 CLK

If thermocouple wires are blue and white colored, then connect white wire to positive (+) screw and blue wire to negative (-) screw of max module.

4.MAX31855-library

Download MAX31855 library from here. .

5. Programming :

Once the circuit part is done, Here is the code to run this circuit MAX31855K thermocouple temperature sensor.

You may download this code (Arduino Sketch) from here.



#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.
#define MAXDO   3
#define MAXCS   4
#define MAXCLK  5


void setup() {
  Serial.begin(9600);
 
  while (!Serial) delay(1); // wait for Serial on Leonardo/Zero, etc

  Serial.println("MAX31855 test");
  // wait for MAX chip to stabilize
  delay(500);
}

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

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

6.Output

After the connection you will copy and paste this code in Arduino IDE.Open the serial monitor the show the result.

If you have any query please write us at support@roboindia.com

Thanks and Regards
Content Development Team 
Robo India
https://roboindia.com

Leave a Reply