I was looking to utilize the Spark Core to monitor temps while brewing beer. I generally brew multiple batches at the same time, and being able to keep an eye on all the temps at a central location would be convenient. Then there are a ton of ways to improve upon it once I’ve gotten that far.
With the help of @Julian, who had some previous experience with the Adafruit MAX31855, I was able to connect PlayingWithFusion.com’s MAX31855K-4CH to the Core. It is a K-Type 4 Channel Breakout board. I recently had a successful test with a single thermocouple. More thermocouples are on order so that I can do some tests with all four.
Here is the current code, thanks to @Julian
It currently works with the single thermocouple. I will be adding some changes when I have the other thermocouples.
/***************************************************
This is an example for the Adafruit Thermocouple Sensor w/MAX31855
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 "math.h"
include "Adafruit_MAX31855/Adafruit_MAX31855.h"
int thermoCLK = A3;
int thermoCS = A2;
int thermoDO = A4;
double thermotemp = 0;
Adafruit_MAX31855 thermocouple(thermoCLK, thermoCS, thermoDO);
void setup() {
//...
// Register a Spark variable here
Spark.variable("thermotemp", &thermotemp, DOUBLE);
//...
// open serial terminal and press ENTER to start
Serial.begin(9600);
while(!Serial.available()) SPARK_WLAN_Loop();
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();
thermotemp = 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);
}
I hope to eventually add an LCD to view the temps as well as make the temps viewable on my phone/laptop. I’ll keep everyone posted.