Problems logging data from thermocouple multiplexer to SD data logger

I am having problems logging data from the Ocean Controls thermocouple multiplexer shield to the Adafruit data logger using the Arduino uno. I have resolved all SPI pin conflicts, as per the Adafruit forum… http://forums.adafruit.com/viewtopic.php?f=31&t=39699 Both shields work together, however whenever I try to write sensor data to the SD card the data is written as 0.00 rather than say 25.50. I have tried to convert the float value from the sensor to a string using sprintf, however the same problem occurs. All outputs are printed to the serial monitor correctly.

The partial code is as follows. I have cut the end out as it was too long for this post.

#include <string.h> //Use the string Library
#include <ctype.h>
#include <EEPROM.h>

#include <SD.h> // Libraries for SD shield
#include <SPI.h>

// Libraries for RTC
#include <Wire.h>
#include "RTClib.h"

RTC_DS1307 rtc; //RTC command

// SD pins
int CS_pin = 10;

//#define SHOWMEYOURBITS // Display the raw 32bit binary data from the MAX31855

#define PINEN 7 //Mux Enable pin
#define PINA0 4 //Mux Address 0 pin
#define PINA1 5 //Mux Address 1 pin
#define PINA2 6 //Mux Address 2 pin
#define PINSO 12 //TCAmp Slave Out pin (MISO)
#define PINSC 13 //TCAmp Serial Clock (SCK)
#define PINCS 9  //TCAmp Chip Select Change this to match the position of the Chip Select Link



int Temp[8], SensorFail[8];
float floatTemp, floatInternalTemp;
char failMode[8];
int internalTemp, intTempFrac;
unsigned int Mask;
//char data[16];
char i, j, NumSensors =1, UpdateDelay;
char Rxchar, Rxenable, Rxptr, Cmdcomplete, R;
char Rxbuf[32];
char adrbuf[3], cmdbuf[3], valbuf[12];
int val = 0, Param;     
unsigned long time;

void setup()   
{     
  Serial.begin(9600);  
  Serial.println("TCMUXV3");
  
   // SD set up and test

  pinMode(CS_pin, OUTPUT); // CS pin is an output
  // If CS_pin reads false the program will terminate
  if(!SD.begin(CS_pin, 11, 12, 13))
  {
    Serial.println("Card Failure");
    return;
  }
  
    // RTC set up and test
  
  #ifdef AVR
  Wire.begin();
#else
  Wire1.begin(); // Shield I2C pins connect to alt I2C bus on Arduino Due
#endif
  rtc.begin();

  if (! rtc.isrunning()) 
  {
    Serial.println("RTC is NOT running!");
    return;
  }
  
  if (EEPROM.read(511)==1)
  {
    NumSensors = EEPROM.read(0);
    UpdateDelay = EEPROM.read(1);
  }
  pinMode(PINEN, OUTPUT);     
  pinMode(PINA0, OUTPUT);    
  pinMode(PINA1, OUTPUT);    
  pinMode(PINA2, OUTPUT);    
  pinMode(PINSO, INPUT);    
  pinMode(PINCS, OUTPUT);    
  pinMode(PINSC, OUTPUT);    
  
  digitalWrite(PINEN, HIGH);   // enable on
  digitalWrite(PINA0, LOW); // low, low, low = channel 1
  digitalWrite(PINA1, LOW); 
  digitalWrite(PINA2, LOW); 
  digitalWrite(PINSC, LOW); //put clock in low
  


}

void loop()                     
{
  if (millis() > (time + ((unsigned int)UpdateDelay*1000)))
  {
    time = millis();
    //for(j=0;j<NumSensors;j++)
    //{
    if (j<(NumSensors-1)) j++;
    else j=0;
      
      switch (j) //select channel
      {
        case 0:
          digitalWrite(PINA0, LOW); 
          digitalWrite(PINA1, LOW); 
          digitalWrite(PINA2, LOW);
        break;
        case 1:
          digitalWrite(PINA0, HIGH); 
          digitalWrite(PINA1, LOW); 
          digitalWrite(PINA2, LOW);
        break;
        case 2:
          digitalWrite(PINA0, LOW); 
          digitalWrite(PINA1, HIGH); 
          digitalWrite(PINA2, LOW);
        break;
        case 3:
          digitalWrite(PINA0, HIGH); 
          digitalWrite(PINA1, HIGH); 
          digitalWrite(PINA2, LOW);
        break;
        case 4:
          digitalWrite(PINA0, LOW); 
          digitalWrite(PINA1, LOW); 
          digitalWrite(PINA2, HIGH);
        break;
        case 5:
          digitalWrite(PINA0, HIGH); 
          digitalWrite(PINA1, LOW); 
          digitalWrite(PINA2, HIGH);
        break;
        case 6:
          digitalWrite(PINA0, LOW); 
          digitalWrite(PINA1, HIGH); 
          digitalWrite(PINA2, HIGH);
        break;
        case 7:
          digitalWrite(PINA0, HIGH); 
          digitalWrite(PINA1, HIGH); 
          digitalWrite(PINA2, HIGH);
        break;
      }
      
      delay(5);
      digitalWrite(PINCS, LOW); //stop conversion
      delay(5);
      digitalWrite(PINCS, HIGH); //begin conversion
      delay(100);  //wait 100 ms for conversion to complete
      digitalWrite(PINCS, LOW); //stop conversion, start serial interface
      delay(1);
      
      Temp[j] = 0;
      failMode[j] = 0;
      SensorFail[j] = 0;
      internalTemp = 0;
      for (i=31;i>=0;i--)
      {
          digitalWrite(PINSC, HIGH);
          delay(1);
          
           //print out bits
         #ifdef SHOWMEYOURBITS
         if (digitalRead(PINSO)==1)
          {
            Serial.print("1");
          }
          else
          {
            Serial.print("0");
          }
          #endif
          
        if ((i<=31) && (i>=18))
        {
          // these 14 bits are the thermocouple temperature data
          // bit 31 sign
          // bit 30 MSB = 2^10
          // bit 18 LSB = 2^-2 (0.25 degC)
          
          Mask = 1<<(i-18);
          if (digitalRead(PINSO)==1)
          {
            if (i == 31)
            {
              Temp[j] += (0b11<<14);//pad the temp with the bit 31 value so we can read negative values correctly
            }
            Temp[j] += Mask;
            //Serial.print("1");
          }
          else
          {
           // Serial.print("0");
          }
        }
        //bit 17 is reserved
        //bit 16 is sensor fault
        if (i==16)
        {
          SensorFail[j] = digitalRead(PINSO);
        }
        
        if ((i<=15) && (i>=4))
        {
          //these 12 bits are the internal temp of the chip
          //bit 15 sign
          //bit 14 MSB = 2^6
          //bit 4 LSB = 2^-4 (0.0625 degC)
          Mask = 1<<(i-4);
          if (digitalRead(PINSO)==1)
          {
            if (i == 15)
            {
              internalTemp += (0b1111<<12);//pad the temp with the bit 31 value so we can read negative values correctly
            }
            
            internalTemp += Mask;//should probably pad the temp with the bit 15 value so we can read negative values correctly
            //Serial.print("1");
          }
          else
          {
           // Serial.print("0");
          }
          
        }
        //bit 3 is reserved
        if (i==2)
        {
          failMode[j] += digitalRead(PINSO)<<2;//bit 2 is set if shorted to VCC
        }
        if (i==1)
        {
          failMode[j] += digitalRead(PINSO)<<1;//bit 1 is set if shorted to GND
        }
        if (i==0)
        {
          failMode[j] += digitalRead(PINSO)<<0;//bit 0 is set if open circuit
        }
        
        
        digitalWrite(PINSC, LOW);
        delay(1);
        //delay(1);
      }
      //Serial.println();
    
      //Serial.println(Temp,BIN);
      Serial.print("#");
      Serial.print(j+1,DEC);
      Serial.print(": ");
      if (SensorFail[j] == 1)
      {
        Serial.print("FAIL");
        if ((failMode[j] & 0b0100) == 0b0100)
        {
          Serial.print(" SHORT TO VCC");
        }
        if ((failMode[j] & 0b0010) == 0b0010)
        {
          Serial.print(" SHORT TO GND");
        }
        if ((failMode[j] & 0b0001) == 0b0001)
        {
          Serial.print(" OPEN CIRCUIT");
        }
      }
      else
      {
        floatTemp = (float)Temp[j] * 0.25;
        Serial.print(floatTemp,2);

        Serial.print(" degC");

    }
    
    Serial.print(" Int: ");
    floatInternalTemp = (float)internalTemp * 0.0625;
    Serial.print(floatInternalTemp,4);

    Serial.print(" degC");
    Serial.println("");
   
   //***********************************************
   //**** LETS TRY TO LOG DATA TO SD CARD HERE *****
   
   SD.begin(CS_pin, 11, 12, 13);
   File dataFile = SD.open("test.txt", FILE_WRITE);
   dataFile.println(floatTemp); // write the temp output to file
   dataFile.close();

I also have problems logging data from the RTC, to say name a file by todays date, or to write the time next to the sensor data. The SD card is formatted to fat16, and the data logger and RTC work fine with the single Adafruit thermocouple amplifiler.

Any insight into this problem would be greatly appreciated. I am a novice with arduino/C++ code. I have spent the last couple of days trying to resolve this without getting anywhere apart from learning a bit more about coding :P. The end result is to use the unit as a data acquisition module to process monitor a solar water heater.

gabscar:
All outputs are printed to the serial monitor correctly.

I understand you are deriving the temperatures as floats
If you can do that and print them to serial, that should be all you need to know. The number is the same and the procedure is more or less the same, for serial, display, and recording.

Serial.print(InTemp);       // Serial port
lcd.print(InTemp);           // LCD
myFile.print(InTemp);    // SD

The following code is actually for three temperature sensors but demonstrate all this and has a date as filename. Strip out what you don’t need.

/* 
//  This Arduino sketch reads DS18B20 "1-Wire" digital
//  temperature sensors.
//  http://www.hacktronics.com/Tutorials/arduino-1-wire-tutorial.html
//  Serial print commands are for PLX-DAQ
 size 22 894
 */
#include <OneWire.h>
#include <DallasTemperature.h>
#include <SPI.h>                  

#include <PCD8544.h>        // Nokia 5110
#include <SD.h>                  // SD card
#include <string.h>              // from Date As Filename 
#include "RTClib.h"              // from Date As Filename
#include "Wire.h"                // MUST HAVE lib for LCD disp, SD card, and serial

#define DS1307_ADDRESS 0x68

RTC_DS1307 RTC;
static PCD8544 lcd;

File myFile;
char filename[] = "00000000.CSV";

// Custom symbols
static const byte DEGREES_CHAR = 1;
static const byte degrees_glyph[] = { 0x00, 0x07, 0x05, 0x07, 0x00 };
static const byte SLASH_CHAR = 2;
static const byte slash_glyph[] = {0x00,0x20,0x10,0x08};

// Yellow group Lismore
byte InThermo[8] =  {
  0x28, 0x39, 0xFD, 0x50, 0x04, 0x00, 0x00, 0X69};
byte OutThermo[8] = {
  0x28, 0x09, 0xA9, 0xC0, 0x03, 0x00, 0x00, 0x95};
byte DrainThermo[8] = {
  0x28, 0x62, 0xA5, 0x2D, 0x04, 0x00, 0x00, 0x21}; 

#define ONE_WIRE_BUS 3
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);

int  second, minute, hour, weekDay, monthDay, month, year;
int k=0;

const int chipSelect = 4;

float InTemp, OutTemp, DrainTemp, diff;    

// Define the strings for our datastream IDs
char sensorId0[] = "InThermo";
char sensorId1[] = "OutThermo";
char sensorId2[] = "DrainThermo";
char calcId1[] = "diff";

void setup() {
   lcd.begin(84, 48);
     // Register the custom symbols...
  lcd.createChar(DEGREES_CHAR, degrees_glyph);
  lcd.createChar(SLASH_CHAR, slash_glyph);
  
  Wire.begin();
  Serial.begin(9600);

  delay(300);//Wait for newly restarted system to stabilize
  
  lcd.setCursor (0,0);
  lcd.print("Initializing");
  delay(2000);
  lcd.setCursor (0,1);

  pinMode(53, OUTPUT);

 if (!SD.begin(chipSelect)) 
  {
    lcd.print("failed!");
    delay (2000);
    return;
  }
  lcd.println("init. OK!");
  delay(2000);
      getFileName();
        lcd.setCursor (0,2);
      lcd.println(filename);
        delay(2000);
  lcd.clear();

// First serial output "LABEL" is an Excel command, printed on reset
  Serial.println("LABEL,Time,InTemp,OutTemp,diff,DrainTemp");

  sensors.setResolution(InThermo, 12);
  sensors.setResolution(OutThermo, 12);
  sensors.setResolution(DrainThermo, 12);
  
    running();
}

void loop() {

  GetClock();
  if (hour == 0 && minute == 0 && second <2)
  {
    getFileName();
  }

  //get the values from the DS8B20's 
  sensors.requestTemperatures();

  InTemp = (sensorValue(InThermo));
  OutTemp = (sensorValue(OutThermo));  
  DrainTemp = (sensorValue(DrainThermo)); 

  diff = OutTemp - InTemp;
  
 Serial.print("DATA,TIME,");  // Excel commands 
  Serial.print(InTemp);
  Serial.print(" ,  ");
  Serial.print(OutTemp);
  Serial.print(" ,  ");
  Serial.print(diff);
  Serial.print(" ,  ");
  Serial.println(DrainTemp);
 
  lcd.setCursor(49,0);
  lcd.print(InTemp);
  lcd.setCursor(49,1);
  lcd.print (OutTemp);
  lcd.setCursor(49,2);
  lcd.print(DrainTemp);
  lcd.setCursor(49,3);
  lcd.print(diff);  
   lcd.print(" ");
  lcd.setCursor(20,5);
  
     if( second==0)
  {
   lcd.print("         ");
   lcd.setCursor(20,5);
   } 
  
  lcd.print(hour);
  lcd.print(":");
  lcd.print(minute);
  lcd.print(":");
  lcd.print(second);
  

  k=k+1;  

  if (k>9 )
  {  
  myFile = SD.open(filename, FILE_WRITE);//<<<<<<<<<<<<< OPEN
  myFile.print(hour);
  myFile.print(":");
  myFile.print(minute);
  myFile.print(":");
  myFile.print(second);
  myFile.print(",");

  myFile.print(InTemp);
  myFile.print(",");
  myFile.print(OutTemp);
  myFile.print(",");
  myFile.print(DrainTemp);
  myFile.print(",");
  myFile.println();
       myFile.close();//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>CLOSE
       
      k=0;
  }
  delay(850);
}  // loop ends here

//sensorValue function
float sensorValue (byte deviceAddress[])
{
  float tempC = sensors.getTempC (deviceAddress);
  return tempC;
}

byte bcdToDec(byte val)  {
  // Convert binary coded decimal to normal decimal numbers
  return ( (val/16*10) + (val%16) );
}

void GetClock(){
  // Reset the register pointer
  Wire.beginTransmission(DS1307_ADDRESS);
  byte zero = 0x00;
  Wire.write(zero);
  Wire.endTransmission();
  Wire.requestFrom(DS1307_ADDRESS, 7);

  second = bcdToDec(Wire.read());
  minute = bcdToDec(Wire.read());
  hour = bcdToDec(Wire.read() & 0b111111); //24 hour time
  weekDay = bcdToDec(Wire.read()); //0-6 -> sunday - Saturday
  monthDay = bcdToDec(Wire.read());
  month = bcdToDec(Wire.read());
  year = bcdToDec(Wire.read());
}

void getFileName(){

   // Turns file_today_name into date.txt format Seems to work OK!
   sprintf(file_today_name, "%02d%02d%02d.csv", now.day(), now.month(), now.year());
}

void running(){
  lcd.setCursor(0,0);
  lcd.print("In");
  lcd.setCursor(31,0);
  lcd.print("\001C ");
  lcd.setCursor(0,1);
  lcd.print("Out");
  lcd.setCursor(31,1);
  lcd.print("\001C ");
  lcd.setCursor(0,2);
  lcd.print("Drain");
  lcd.setCursor(31,2);
  lcd.print("\001C ");
  lcd.setCursor(0,3);
  lcd.print("diff");
  lcd.setCursor(31,3);
  lcd.print("\001C "); 
    lcd.setCursor(8,4);
  lcd.print("PLX to Excel");  
}

Thanks for your reply. The code you listed is similar to what I have been running with the single thermocouple amplifier, however with the multiplexer, the code I listed isnt working as expected. Data is writing to the SD file but all values are 0.00 =(

Your code to name the file by todays date can also be done with the sprintf function as follows.....

// Create char to hold today's file name by date
char file_today_name[30];

DateTime now = rtc.now();
   
   // Turns file_today_name into date.txt format
   sprintf(file_today_name, "%02d%02d%02d.txt", now.day(), now.month(), now.year());
   
   // create SD file
   File dataFile = SD.open(file_today_name, FILE_WRITE);
[quote author=gabscar link=topic=230406.msg1662357#msg1662357 date=1396451873]
Thanks for your reply. The code you listed is similar to what I have been running with the single thermocouple amplifier, however with the multiplexer, the code I listed isnt working as expected. Data is writing to the SD file but all values are 0.00  =(

This is probably because the values are 0.00. The only fileprint I see is floatTemp and the only time I see it assigned anything is on an “else” line, so who knows if the loop ever gets there? While I understood the end result is float, it is not clear that you are printing the same data to both destinations, or even if that is your intention. Right now, it looks like it isn’t Clearly, there is nothing wrong with the SD or the recording process, and if you can see what you expect to see on the monitor, there can’t be anything seriously wrong.

It would help if all the serial prints were brought together, followed by all the fileprints.

Your code to name the file by todays date can also be done with the sprintf function as follows…

I thought you had a problem with date as filename. I think I have seen that code before but I have never tried it.

The serial prints are separated because the multiplexer can read up to 8 channels, so loop through them. At the moment I just have one thermocouple connected, but once it is deployed I will be logging several using this one unit. I have to admit my understanding of the multiplexer code is very limited. The code is an example from ocean controls which can be found here... http://oceancontrols.com.au/KTA-259V3.html This code prints the temperature readings to a serial monitor. I am trying to adapt this code to write to the SD logger. I have tested moving around the point where I log the data, and tested this with additional serial prints which confirm the value is not 0.00 at those valid points.

once it is deployed I will be logging several using this one unit.

This is solar water, right? I think the first thing you need to do is expand on what this project is really all about - particularly the temperatures involved, the geography, and the environment

Look, this may be inappropriate and pardon my bombast, but, when I clicked on your link, all my worst fears were confirmed. Exactly what gear have you bought from these guys and what do you intend to get? No, spare me that, just tell us all how much more money you intend to waste with them.

I submit the dollars are what your next step is all about. If you have bought all the gear, i.e. no more money to waste, then it might be time to work out how best to get relief from banging your head against the brickwork. If you haven't bought all the gear, it might be time to cut your losses and start over.

You say the code I posted is similar to what you were running with a single sensor but in fact it is code for multiple sensors and, (ahem) if you allow sanity to prevail, you could could actually use it more or less verbatim.

Please no lectures I work at a university and am trying to build an arduino based data acquisition module to process monitor some solar water heaters for R&D purposes. The other option is to deploy very expensive national instrument equipment.

My problem is that the MULTIPLEXER which reads multiple thermocouples, prints expected temperature values to the serial monitor, however when writing then to an SD card all values are 0.00.

Please attach your latest code. To Nick's point, it does indeed sound as you're not printing the same thing to serial as you are to the SD card - add some serial prints at the point you write to the card to prove it to yourself.

You mentioned sprintf earlier - the version the arduino uses doesn't handle floats. You can use dtostrf to do the conversion if necessary.

Here’s the latest code. With the sanity check…

#include <string.h> //Use the string Library
#include <ctype.h>
#include <EEPROM.h>

#include <SD.h> // Libraries for SD shield
#include <SPI.h>

// Libraries for RTC
#include <Wire.h>
#include "RTClib.h"

RTC_DS1307 rtc; //RTC command

// SD pins
int CS_pin = 10;

//#define SHOWMEYOURBITS // Display the raw 32bit binary data from the MAX31855

#define PINEN 7 //Mux Enable pin
#define PINA0 4 //Mux Address 0 pin
#define PINA1 5 //Mux Address 1 pin
#define PINA2 6 //Mux Address 2 pin
#define PINSO 12 //TCAmp Slave Out pin (MISO)
#define PINSC 13 //TCAmp Serial Clock (SCK)
#define PINCS 9  //TCAmp Chip Select Change this to match the position of the Chip Select Link



int Temp[8], SensorFail[8];
float floatTemp, floatInternalTemp;
char failMode[8];
int internalTemp, intTempFrac;
unsigned int Mask;
//char data[16];
char i, j, NumSensors =1, UpdateDelay;
char Rxchar, Rxenable, Rxptr, Cmdcomplete, R;
char Rxbuf[32];
char adrbuf[3], cmdbuf[3], valbuf[12];
int val = 0, Param;     
unsigned long time;
void setup()   
{     
  Serial.begin(9600);  
  Serial.println("TCMUXV3");
  
   // SD set up and test

  pinMode(CS_pin, OUTPUT); // CS pin is an output
  // If CS_pin reads false the program will terminate
  if(!SD.begin(CS_pin, 11, 12, 13))
  {
    Serial.println("Card Failure");
    return;
  }
  
    // RTC set up and test
  
  #ifdef AVR
  Wire.begin();
#else
  Wire1.begin(); // Shield I2C pins connect to alt I2C bus on Arduino Due
#endif
  rtc.begin();

  if (! rtc.isrunning()) 
  {
    Serial.println("RTC is NOT running!");
    return;
  }
  
  if (EEPROM.read(511)==1)
  {
    NumSensors = EEPROM.read(0);
    UpdateDelay = EEPROM.read(1);
  }
  pinMode(PINEN, OUTPUT);     
  pinMode(PINA0, OUTPUT);    
  pinMode(PINA1, OUTPUT);    
  pinMode(PINA2, OUTPUT);    
  pinMode(PINSO, INPUT);    
  pinMode(PINCS, OUTPUT);    
  pinMode(PINSC, OUTPUT);    
  
  digitalWrite(PINEN, HIGH);   // enable on
  digitalWrite(PINA0, LOW); // low, low, low = channel 1
  digitalWrite(PINA1, LOW); 
  digitalWrite(PINA2, LOW); 
  digitalWrite(PINSC, LOW); //put clock in low
  


}

void loop()                     
{
  if (millis() > (time + ((unsigned int)UpdateDelay*1000)))
  {
    time = millis();
    //for(j=0;j<NumSensors;j++)
    //{
    if (j<(NumSensors-1)) j++;
    else j=0;
      
      switch (j) //select channel
      {
        case 0:
          digitalWrite(PINA0, LOW); 
          digitalWrite(PINA1, LOW); 
          digitalWrite(PINA2, LOW);
        break;
        case 1:
          digitalWrite(PINA0, HIGH); 
          digitalWrite(PINA1, LOW); 
          digitalWrite(PINA2, LOW);
        break;
        case 2:
          digitalWrite(PINA0, LOW); 
          digitalWrite(PINA1, HIGH); 
          digitalWrite(PINA2, LOW);
        break;
        case 3:
          digitalWrite(PINA0, HIGH); 
          digitalWrite(PINA1, HIGH); 
          digitalWrite(PINA2, LOW);
        break;
        case 4:
          digitalWrite(PINA0, LOW); 
          digitalWrite(PINA1, LOW); 
          digitalWrite(PINA2, HIGH);
        break;
        case 5:
          digitalWrite(PINA0, HIGH); 
          digitalWrite(PINA1, LOW); 
          digitalWrite(PINA2, HIGH);
        break;
        case 6:
          digitalWrite(PINA0, LOW); 
          digitalWrite(PINA1, HIGH); 
          digitalWrite(PINA2, HIGH);
        break;
        case 7:
          digitalWrite(PINA0, HIGH); 
          digitalWrite(PINA1, HIGH); 
          digitalWrite(PINA2, HIGH);
        break;
      }
      
      delay(5);
      digitalWrite(PINCS, LOW); //stop conversion
      delay(5);
      digitalWrite(PINCS, HIGH); //begin conversion
      delay(100);  //wait 100 ms for conversion to complete
      digitalWrite(PINCS, LOW); //stop conversion, start serial interface
      delay(1);
      
      Temp[j] = 0;
      failMode[j] = 0;
      SensorFail[j] = 0;
      internalTemp = 0;
      for (i=31;i>=0;i--)
      {
          digitalWrite(PINSC, HIGH);
          delay(1);
          
           //print out bits
         #ifdef SHOWMEYOURBITS
         if (digitalRead(PINSO)==1)
          {
            Serial.print("1");
          }
          else
          {
            Serial.print("0");
          }
          #endif
          
        if ((i<=31) && (i>=18))
        {
          // these 14 bits are the thermocouple temperature data
          // bit 31 sign
          // bit 30 MSB = 2^10
          // bit 18 LSB = 2^-2 (0.25 degC)
          
          Mask = 1<<(i-18);
          if (digitalRead(PINSO)==1)
          {
            if (i == 31)
            {
              Temp[j] += (0b11<<14);//pad the temp with the bit 31 value so we can read negative values correctly
            }
            Temp[j] += Mask;
            //Serial.print("1");
          }
          else
          {
           // Serial.print("0");
          }
        }
        //bit 17 is reserved
        //bit 16 is sensor fault
        if (i==16)
        {
          SensorFail[j] = digitalRead(PINSO);
        }
        
        if ((i<=15) && (i>=4))
        {
          //these 12 bits are the internal temp of the chip
          //bit 15 sign
          //bit 14 MSB = 2^6
          //bit 4 LSB = 2^-4 (0.0625 degC)
          Mask = 1<<(i-4);
          if (digitalRead(PINSO)==1)
          {
            if (i == 15)
            {
              internalTemp += (0b1111<<12);//pad the temp with the bit 31 value so we can read negative values correctly
            }
            
            internalTemp += Mask;//should probably pad the temp with the bit 15 value so we can read negative values correctly
            //Serial.print("1");
          }
          else
          {
           // Serial.print("0");
          }
          
        }
        //bit 3 is reserved
        if (i==2)
        {
          failMode[j] += digitalRead(PINSO)<<2;//bit 2 is set if shorted to VCC
        }
        if (i==1)
        {
          failMode[j] += digitalRead(PINSO)<<1;//bit 1 is set if shorted to GND
        }
        if (i==0)
        {
          failMode[j] += digitalRead(PINSO)<<0;//bit 0 is set if open circuit
        }
        
        
        digitalWrite(PINSC, LOW);
        delay(1);
        //delay(1);
      }
      //Serial.println();
    
      //Serial.println(Temp,BIN);
      Serial.print("#");
      Serial.print(j+1,DEC);
      Serial.print(": ");
      if (SensorFail[j] == 1)
      {
        Serial.print("FAIL");
        if ((failMode[j] & 0b0100) == 0b0100)
        {
          Serial.print(" SHORT TO VCC");
        }
        if ((failMode[j] & 0b0010) == 0b0010)
        {
          Serial.print(" SHORT TO GND");
        }
        if ((failMode[j] & 0b0001) == 0b0001)
        {
          Serial.print(" OPEN CIRCUIT");
        }
      }
      else
      {
        floatTemp = (float)Temp[j] * 0.25;
        Serial.print(floatTemp,2);
        Serial.print(" degC");
      //}
        //delay(1000);
    }//end reading sensors
    //Serial.println("");
    Serial.print(" Int: ");
    floatInternalTemp = (float)internalTemp * 0.0625;
    Serial.print(floatInternalTemp,4);
    Serial.print(" degC");
    Serial.println("");
   
  
  
   //**** LETS TRY TO LOG DATA TO SD CARD HERE *****
   
   SD.begin(CS_pin, 11, 12, 13);
   File dataFile = SD.open("test1.txt", FILE_WRITE);
   dataFile.println(floatTemp); // write the temp output to file
   dataFile.close();
   
   Serial.println(floatTemp); // Test output is not 0.00
   
  }
}

Here's a snippet from the reference for file.print:

data: the data to print (char, byte, int, long, or string)

It doesn't look like it takes float. I'd prove it with a much simpler sketch that just prints a float constant to a file in setup.

If it really doesn't work, use dtostrf to get the float into a string and print that to the file.

Thanks for your help. I have successfully used the sprintf command to go from float to string. The board I have is the Arduino Uno SMD R3 . I will try using dtostrf and post if there is any progress.