Using the sample code from the library (see below), two different thermocouples (also see below) both provide "nan" as the output. The value does not change based on the temp changing during the program execution. Help?
Thermocouples:
SainSmart (MAX6675 came with this thermocouple) and a generic thermocouple.
Sample code (not modified from the example sketch):
// this example is public domain. enjoy!
// www.ladyada.net/learn/sensors/thermocouple
#include "max6675.h"
int thermoDO = 4;
int thermoCS = 5;
int thermoCLK = 6;
MAX6675 thermocouple(thermoCLK, thermoCS, thermoDO);
int vccPin = 3;
int gndPin = 2;
void setup() {
Serial.begin(9600);
// use Arduino pins
pinMode(vccPin, OUTPUT); digitalWrite(vccPin, HIGH);
pinMode(gndPin, OUTPUT); digitalWrite(gndPin, LOW);
Serial.println("MAX6675 test");
// wait for MAX chip to stabilize
delay(1000);
}
void loop() {
// basic readout test, just print the current temp
Serial.print("C = ");
Serial.println(thermocouple.readCelsius());
Serial.print("F = ");
Serial.println(thermocouple.readFahrenheit());
delay(1000);
}
Sample Output:
MAX6675 test
C = nan
F = nan
C = nan
F = nan
...
I have seen alot of discussion surrounding "grounded" thermocouples, as most of the ones that I have seen sold for and with Arduino boards are all part of the body of the device, this should be a wider problem. It is also very likely that I have missed something basic - and indeed, I hope that is the case. Thank you in advance for any help/advice you can provide!