0

Max31850 out puting NaN
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Max31850 out puting NaN

by GreenOlive on Wed May 22, 2019 1:07 pm

Hello

I am having problems with an Max31850 amplifier.
I am using the following libraries
https://github.com/adafruit/MAX31850_Da ... lob/master
https://github.com/adafruit/MAX31850_On ... lob/master

The wiring I have i didnt do and its not going to be legible in a picture but iv checked it multiple times and it is the same as this example:
https://learn.adafruit.com/adafruit-1-w ... g-and-test

I am using an arduino uno, i loaded on the single example and i get an output of Not a Number for the temperature.

I am running this example code from the dallas temp library, with the one wire bus changed from 2 to 6: https://github.com/adafruit/MAX31850_Da ... Single.pde

the output is :
Dallas Temperature IC Control Library Demo
Locating devices...Found 1 devices.
Parasite power is: OFF
Device 0 Address: 3B4F2C180000000E
Device 0 Resolution: 12
Requesting temperatures...DONE
Temp C: nan Temp F: nan
Requesting temperatures...DONE
Temp C: nan Temp F: nan
Requesting temperatures...DONE
Temp C: nan Temp F: nan

Wiring:
As you can see there is a lot of other wiring for a LCD screen
IMG_0387.jpg
IMG_0387.jpg (235.73 KiB) Viewed 166 times

The black and white wires are 3.5 VDC.
IMG_0388.jpg
IMG_0388.jpg (139.65 KiB) Viewed 166 times


IMG_0389.jpg
IMG_0389.jpg (185.41 KiB) Viewed 166 times

the data wire is in pin 6 of the ardunio.
Last edited by GreenOlive on Wed May 22, 2019 1:45 pm, edited 3 times in total.

GreenOlive
 
Posts: 16
Joined: Wed May 22, 2019 12:58 pm

Re: Max31850 out puting NaN

by franklin97355 on Wed May 22, 2019 1:23 pm

We would like you to try posting photos anyway. There is no way from the information you provided to asses the problem. What code are you running and what output do you get when you run the program?

franklin97355
 
Posts: 21081
Joined: Mon Apr 21, 2008 2:33 pm
Location: Lacomb, OR.

Re: Max31850 out puting NaN

by GreenOlive on Wed May 22, 2019 1:47 pm

franklin97355 wrote:We would like you to try posting photos anyway. There is no way from the information you provided to asses the problem. What code are you running and what output do you get when you run the program?


Hey thanks for the quick reply i updated my post with more information, is there anything else that would be useful?
I am very new to electronics so im way out of my league.

GreenOlive
 
Posts: 16
Joined: Wed May 22, 2019 12:58 pm

Re: Max31850 out puting NaN

by adafruit_support_bill on Wed May 22, 2019 2:22 pm

NaN (Not a Number) is returned by the device when it detects a fault in the thermocouple probe, Typically, this is is a short circuit or a broken probe. We can't clearly see the probe or the soldering on the probe terminals in the photos.

adafruit_support_bill
 
Posts: 74337
Joined: Sat Feb 07, 2009 10:11 am

Re: Max31850 out puting NaN

by GreenOlive on Wed May 22, 2019 3:13 pm

adafruit_support_bill wrote:NaN (Not a Number) is returned by the device when it detects a fault in the thermocouple probe, Typically, this is is a short circuit or a broken probe. We can't clearly see the probe or the soldering on the probe terminals in the photos.

IMG_0391.jpg
IMG_0391.jpg (165.36 KiB) Viewed 148 times

IMG_0392.JPG
IMG_0392.JPG (141.65 KiB) Viewed 148 times

IMG_0393.JPG
IMG_0393.JPG (184.33 KiB) Viewed 148 times


I can show a picture of the probe but it is a K type and brand new, it is in the case of a melting chamber for plastic and got stuck in there because of a plastic leak. However I did do some test before hand with the probe out the metal case, because i thought there might a be a a short , but it still ouputted Nan.

GreenOlive
 
Posts: 16
Joined: Wed May 22, 2019 12:58 pm

Re: Max31850 out puting NaN

by adafruit_support_bill on Wed May 22, 2019 4:43 pm

Try running this code. It should give us more detail about the fault that was detected:

Code: Select all | TOGGLE FULL SIZE
#include <OneWire.h>
#include <DallasTemperature.h>

// Data wire is plugged into port 2 on the Arduino
#define ONE_WIRE_BUS 2

// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
OneWire oneWire(ONE_WIRE_BUS);

// Pass our oneWire reference to Dallas Temperature.
DallasTemperature sensors(&oneWire);

// arrays to hold device address
DeviceAddress insideThermometer;

void setup(void)
{
  // start serial port
  Serial.begin(9600);
  Serial.println("Dallas Temperature IC Control Library Demo");

  // locate devices on the bus
  Serial.print("Locating devices...");
  sensors.begin();
  Serial.print("Found ");
  Serial.print(sensors.getDeviceCount(), DEC);
  Serial.println(" devices.");

  // report parasite power requirements
  Serial.print("Parasite power is: ");
  if (sensors.isParasitePowerMode()) Serial.println("ON");
  else Serial.println("OFF");
 
  // assign address manually.  the addresses below will beed to be changed
  // to valid device addresses on your bus.  device address can be retrieved
  // by using either oneWire.search(deviceAddress) or individually via
  // sensors.getAddress(deviceAddress, index)
  //insideThermometer = { 0x28, 0x1D, 0x39, 0x31, 0x2, 0x0, 0x0, 0xF0 };

  // Method 1:
  // search for devices on the bus and assign based on an index.  ideally,
  // you would do this to initially discover addresses on the bus and then
  // use those addresses and manually assign them (see above) once you know
  // the devices on your bus (and assuming they don't change).
  if (!sensors.getAddress(insideThermometer, 0)) Serial.println("Unable to find address for Device 0");
 
  // method 2: search()
  // search() looks for the next device. Returns 1 if a new address has been
  // returned. A zero might mean that the bus is shorted, there are no devices,
  // or you have already retrieved all of them.  It might be a good idea to
  // check the CRC to make sure you didn't get garbage.  The order is
  // deterministic. You will always get the same devices in the same order
  //
  // Must be called before search()
  //oneWire.reset_search();
  // assigns the first address found to insideThermometer
  //if (!oneWire.search(insideThermometer)) Serial.println("Unable to find address for insideThermometer");

  // show the addresses we found on the bus
  Serial.print("Device 0 Address: ");
  printAddress(insideThermometer);
  Serial.println();

  // set the resolution to 9 bit (Each Dallas/Maxim device is capable of several different resolutions)
  sensors.setResolution(insideThermometer, 9);
 
  Serial.print("Device 0 Resolution: ");
  Serial.print(sensors.getResolution(insideThermometer), DEC);
  Serial.println();
}

// function to print the temperature for a device
void printTemperature(DeviceAddress deviceAddress)
{
  // method 1 - slower
  //Serial.print("Temp C: ");
  //Serial.print(sensors.getTempC(deviceAddress));
  //Serial.print(" Temp F: ");
  //Serial.print(sensors.getTempF(deviceAddress)); // Makes a second call to getTempC and then converts to Fahrenheit

  // method 2 - faster
  float tempC = sensors.getTempC(deviceAddress);
  Serial.print("Temp C: ");
  Serial.print(tempC);
  Serial.print(" Temp F: ");
  Serial.println(DallasTemperature::toFahrenheit(tempC)); // Converts tempC to Fahrenheit
}

void loop(void)
{
  // call sensors.requestTemperatures() to issue a global temperature
  // request to all devices on the bus
  Serial.print("Requesting temperatures...");
  sensors.requestTemperatures(); // Send the command to get temperatures
  Serial.println("DONE");
 
  // It responds almost immediately. Let's print out the data
  printTemperature(insideThermometer); // Use a simple function to print out the data

  uint8_t ScratchPad[9];
  sensors.readScratchPad(insideThermometer, ScratchPad);
  for (int i = 0; i < 9; i++)
  {
    Serial.println(ScratchPad[i], HEX);
  }
}

// function to print a device address
void printAddress(DeviceAddress deviceAddress)
{
  for (uint8_t i = 0; i < 8; i++)
  {
    if (deviceAddress[i] < 16) Serial.print("0");
    Serial.print(deviceAddress[i], HEX);
  }
}

adafruit_support_bill
 
Posts: 74337
Joined: Sat Feb 07, 2009 10:11 am

Re: Max31850 out puting NaN

by GreenOlive on Thu May 23, 2019 2:24 pm

adafruit_support_bill wrote:Try running this code. It should give us more detail about the fault that was detected:


Hey here is some of the output from that code, some of the Hex seems to change so I took quite a big piece of it.
Code: Select all | TOGGLE FULL SIZE
Dallas Temperature IC Control Library Demo
Locating devices...Found 1 devices.
Parasite power is: OFF
Device 0 Address: 3B4F2C180000000E
Device 0 Resolution: 12
Requesting temperatures...DONE
Temp C: nan Temp F: nan

2D
1
52
13
F0
FF
FF
FF
8C
Requesting temperatures...DONE
Temp C: nan Temp F: nan

2D
1
52
13
F0
FF
FF
FF
8C
Requesting temperatures...DONE
Temp C: nan Temp F: nan
29
1
42
13
F0
FF
FF
FF
C2
Requesting temperatures...DONE
Temp C: nan Temp F: nan
2D
1
52
13
F0
FF
FF
FF
8C
Requesting temperatures...DONE
Temp C: nan Temp F: nan
29
1
52
13
F0
FF
FF
FF
99
Requesting temperatures...DONE
Temp C: nan Temp F: nan
2D
1
52
13
F0
FF
FF
FF
8C
Requesting temperatures...DONE
Temp C: nan Temp F: nan
2D
1
52
13
F0
FF
FF
FF
8C
Requesting temperatures...DONE
Temp C: nan Temp F: nan
2D
1
52
13
F0
FF
FF
FF
8C
Requesting temperatures...DONE
Temp C: nan Temp F: nan
2D
1
62
13
F0
FF
FF
FF
61

GreenOlive
 
Posts: 16
Joined: Wed May 22, 2019 12:58 pm

Re: Max31850 out puting NaN

by adafruit_support_bill on Thu May 23, 2019 3:14 pm

The low 3 bits of the 3rd byte are the fault indication bits. Looks like bit 0 and bit 2 are always clear. And bit 1 is set. That bit indicates a short to GND (see page 13 of the data sheet)

https://datasheets.maximintegrated.com/ ... X31851.pdf

adafruit_support_bill
 
Posts: 74337
Joined: Sat Feb 07, 2009 10:11 am

Re: Max31850 out puting NaN

by GreenOlive on Sat May 25, 2019 2:24 pm

adafruit_support_bill wrote:The low 3 bits of the 3rd byte are the fault indication bits. Looks like bit 0 and bit 2 are always clear. And bit 1 is set. That bit indicates a short to GND (see page 13 of the data sheet)

https://datasheets.maximintegrated.com/ ... X31851.pdf


hey I spent some time trying to work this out, because this is my first time working on such a low level
would I be correct to say its also shorting to Vdd ? <-- also what does that mean?

So now I know its shorting to ground, what do I do to fix that?Where might the problem be?( Im very new to the electronics scene)

GreenOlive
 
Posts: 16
Joined: Wed May 22, 2019 12:58 pm

Re: Max31850 out puting NaN

by adafruit_support_bill on Sat May 25, 2019 2:40 pm

would I be correct to say its also shorting to Vdd ? <-- also what does that mean?

Vdd is the supply voltage. If there were a short to VDD, the second digit of the 3rd byte would be 4 instead of 2. If there were a short to both Vdd and GND, then you wouldn't be able to communicate to the device at all.

So now I know its shorting to ground, what do I do to fix that?

The first thing to do is get a 'second opinion'. Use your multimeter to check the resistance between each of the thermocouple screw terminals and the GND pin to see if it agrees that there is a short circuit.

adafruit_support_bill
 
Posts: 74337
Joined: Sat Feb 07, 2009 10:11 am

Re: Max31850 out puting NaN

by GreenOlive on Sat May 25, 2019 3:07 pm

" If there were a short to VDD, the second digit of the 3rd byte would be 4 instead of 2."


Ahh i must have made a mistake when converting from hex to binary I rechecked it and it makes sense now.

" Use your multimeter to check the resistance between each of the thermocouple screw terminals and the GND pin to see if it agrees that there is a short circuit.

I dont have a multimeter, but I obviously need one in general, so I will get one.
If i check it and it 'agrees' what would I do to fix it?

GreenOlive
 
Posts: 16
Joined: Wed May 22, 2019 12:58 pm

Re: Max31850 out puting NaN

by adafruit_support_bill on Sat May 25, 2019 3:11 pm

If you confirm that there is a short circuit, then it is a matter of narrowing down the cause. If you disconnect the thermocouple probe and you still measure a short at the terminals, then the problem is likely on the board itself. Otherwise, the probe is most likely touching something that is grounded.

adafruit_support_bill
 
Posts: 74337
Joined: Sat Feb 07, 2009 10:11 am

Re: Max31850 out puting NaN

by GreenOlive on Wed Jun 05, 2019 2:37 pm

adafruit_support_bill wrote:If you confirm that there is a short circuit, then it is a matter of narrowing down the cause. If you disconnect the thermocouple probe and you still measure a short at the terminals, then the problem is likely on the board itself. Otherwise, the probe is most likely touching something that is grounded.


Hello I got a multimeter and I have done this, Im not completely sure how to check for a short circuit. however from what i understood the idea is to see if there is a connection between the points you mentioned. As this is my first time doing this Id like to double check my process, I set the meter to resistance and touched the two probes on the terminals and GND. The meter read the same as before anything was touching, it read 1 so I understand this to mean there is a short circuit. I get the same result when the thermocouple is disconnected. Do I need to but a new amplifier?

GreenOlive
 
Posts: 16
Joined: Wed May 22, 2019 12:58 pm

Re: Max31850 out puting NaN

by adafruit_support_bill on Wed Jun 05, 2019 2:48 pm

I set the meter to resistance and touched the two probes on the terminals and GND. The meter read the same as before anything was touching,

The difference between and open circuit and a short circuit can be confusing on some meters. Set the meter to read resistance, and hold the two probes apart. That is an open-circuit reading. On some meters this is shown as "0L" or "L"

Now touch the two probes together. That is a short circuit. This should be "0" or some very small number.

Now put one probe on the GND pin of the MAX31850 and touch the other one to each of the screws on the terminal. If either of them shows a short circuit, the problem is on the board and we can replace it.

adafruit_support_bill
 
Posts: 74337
Joined: Sat Feb 07, 2009 10:11 am

Re: Max31850 out puting NaN

by GreenOlive on Wed Jun 05, 2019 2:55 pm

Now put one probe on the GND pin of the MAX31850 and touch the other one to each of the screws on the terminal. If either of them shows a short circuit, the problem is on the board and we can replace it.


Both terminals show an open circuit.

GreenOlive
 
Posts: 16
Joined: Wed May 22, 2019 12:58 pm

Please be positive and constructive with your questions and comments.