I have tried to get a MAX 31855 working without success.
I have tried using UNO, Mini Pro and MEGA 2560.
I have tried with the basic MAX 31855 module and a logic level converter as per “Henry’s Bench” with his code.
I have tried with Adafruit’s MAX 31855K module with the integral level converter and the Adafruit code and Adafruit MAX31855 library.
I might sound a bit desperate, I am.
With my last attempt I get a compile error while uploading, but then a “done Uploading” message.
The temperature results showing in the serial monitor are incorrect, showing negative dec C in my room and fluctuating wildly.
Please see the code below and the compile error message below that.
/***************************************************
This is an example for the Adafruit Thermocouple Sensor w/MAX31855K
Designed specifically to work with the Adafruit Thermocouple Sensor
----> https://www.adafruit.com/products/269
These displays use SPI to communicate, 3 pins are required to
interface
Adafruit invests time and resources providing this open source code,
please support Adafruit and open-source hardware by purchasing
products from Adafruit!
Written by Limor Fried/Ladyada for Adafruit Industries.
BSD license, all text above must be included in any redistribution
****************************************************/
#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 4
#define MAXCS 5
#define MAXCLK 6
// 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);
while (!Serial) delay(1); // wait for Serial on Leonardo/Zero, etc
Serial.println("MAX31855 test");
// wait for MAX chip to stabilize
delay(500);
Serial.print("Initializing sensor...");
if (!thermocouple.begin()) {
Serial.println("ERROR.");
while (1) delay(10);
}
Serial.println("DONE.");
}
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.readFahrenheit());
delay(1000);
}
In file included from C:\Users\Windows PC\Documents\Arduino\serialthermocouple_Base\serialthermocouple_Base.ino:18:0:
C:\Users\Windows PC\Documents\Arduino\libraries\Adafruit_MAX31855_library/Adafruit_MAX31855.h:49:32: warning: passing NULL to non-pointer argument 1 of 'Adafruit_SPIDevice::Adafruit_SPIDevice(int8_t, uint32_t, BitOrder, uint8_t, SPIClass*)' [-Wconversion-null]
Adafruit_SPIDevice spi_dev = NULL;
^~~~
In file included from C:\Users\Windows PC\Documents\Arduino\libraries\Adafruit_MAX31855_library\Adafruit_MAX31855.cpp:36:0:
C:\Users\Windows PC\Documents\Arduino\libraries\Adafruit_MAX31855_library\Adafruit_MAX31855.h:49:32: warning: passing NULL to non-pointer argument 1 of 'Adafruit_SPIDevice::Adafruit_SPIDevice(int8_t, uint32_t, BitOrder, uint8_t, SPIClass*)' [-Wconversion-null]
Adafruit_SPIDevice spi_dev = NULL;
^~~~
Sketch uses 6574 bytes (21%) of program storage space. Maximum is 30720 bytes.
Global variables use 441 bytes (21%) of dynamic memory, leaving 1607 bytes for local variables. Maximum is 2048 bytes.