1 Reply Latest reply on Jun 29, 2015 8:33 AM by DiegoV_Intel

    Edison and the Adafruit Max31855

    baluu

      Hi Guys,

       

      i would mesaure the temperature with a Intel Edison. In my project i measure tempaure values about 500 °C so i need a thermocouple typ k. Software tools are Arduino Sektch and i include the libary for the max31855. When i start the programm i dont work and i dont know why. Thats my problem. The serial Output ist evertime   "Something wrong with the thermocouple" because of the "isana"

       

      Thanks for your help.

      #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 DO   3
      #define CS   4
      #define CLK  5
      Adafruit_MAX31855 thermocouple(CLK, CS, DO);
      
      
      // Example creating a thermocouple instance with hardware SPI (Uno/Mega only)
      // on a given CS pin.
      //#define CS   10
      //Adafruit_MAX31855 thermocouple(CS);
      
      
      void setup() {
        Serial.begin(9600);
        
        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());
      
      
      
         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);
      }
       delay(1000);
      }
      

       

       

      Baluu

        • 1. Re: Edison and the Adafruit Max31855
          DiegoV_Intel

          Hello baluu,

           

          I suggest you to check that the SPI data is being sent properly. I checked and ran the code and I got the same message as you: "Something wrong with thermocouple!". The function isnan() makes sure that the value returned by thermocouple.readCelsius() is actually a number ("isnan" means "is not a number"). I don't have the MAX31855 breakout board so I guess that I'm getting that output message because my Edison is not getting any data through the SPI, but since you have the MAX31855 breakout board I recommend you to check that the SPI data sent/received by the Edison is correct.

           

          One more observation, in the code you posted you have a duplicate section from line 50 to line 61.

           

          Regards,

          Diego.