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
The black and white wires are 3.5 VDC.
the data wire is in pin 6 of the ardunio.
Max31850 out puting NaN
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- GreenOlive
- Posts: 16
- Joined: Wed May 22, 2019 12:58 pm
Max31850 out puting NaN
Last edited by GreenOlive on Wed May 22, 2019 1:45 pm, edited 3 times in total.
- Franklin97355
- Posts: 23910
- Joined: Mon Apr 21, 2008 2:33 pm
Re: Max31850 out puting NaN
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?
- GreenOlive
- Posts: 16
- Joined: Wed May 22, 2019 12:58 pm
Re: Max31850 out puting NaN
Hey thanks for the quick reply i updated my post with more information, is there anything else that would be useful?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?
I am very new to electronics so im way out of my league.
- adafruit_support_bill
- Posts: 88087
- Joined: Sat Feb 07, 2009 10:11 am
Re: Max31850 out puting NaN
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.
- GreenOlive
- Posts: 16
- Joined: Wed May 22, 2019 12:58 pm
Re: Max31850 out puting NaN
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.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.
- adafruit_support_bill
- Posts: 88087
- Joined: Sat Feb 07, 2009 10:11 am
Re: Max31850 out puting NaN
Try running this code. It should give us more detail about the fault that was detected:
Code: Select all
#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);
}
}
- GreenOlive
- Posts: 16
- Joined: Wed May 22, 2019 12:58 pm
Re: Max31850 out puting NaN
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.adafruit_support_bill wrote:Try running this code. It should give us more detail about the fault that was detected:
Code: Select all
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
- adafruit_support_bill
- Posts: 88087
- Joined: Sat Feb 07, 2009 10:11 am
Re: Max31850 out puting NaN
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
https://datasheets.maximintegrated.com/ ... X31851.pdf
- GreenOlive
- Posts: 16
- Joined: Wed May 22, 2019 12:58 pm
Re: Max31850 out puting NaN
hey I spent some time trying to work this out, because this is my first time working on such a low leveladafruit_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
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)
- adafruit_support_bill
- Posts: 88087
- Joined: Sat Feb 07, 2009 10:11 am
Re: Max31850 out puting NaN
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.would I be correct to say its also shorting to Vdd ? <-- also what does that mean?
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.So now I know its shorting to ground, what do I do to fix that?
- GreenOlive
- Posts: 16
- Joined: Wed May 22, 2019 12:58 pm
Re: Max31850 out puting NaN
Ahh i must have made a mistake when converting from hex to binary I rechecked it and it makes sense now." If there were a short to VDD, the second digit of the 3rd byte would be 4 instead of 2."
I dont have a multimeter, but I obviously need one in general, so I will get one." 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.
If i check it and it 'agrees' what would I do to fix it?
- adafruit_support_bill
- Posts: 88087
- Joined: Sat Feb 07, 2009 10:11 am
Re: Max31850 out puting NaN
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.
- GreenOlive
- Posts: 16
- Joined: Wed May 22, 2019 12:58 pm
Re: Max31850 out puting NaN
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?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.
- adafruit_support_bill
- Posts: 88087
- Joined: Sat Feb 07, 2009 10:11 am
Re: Max31850 out puting NaN
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"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,
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.
- GreenOlive
- Posts: 16
- Joined: Wed May 22, 2019 12:58 pm
Re: Max31850 out puting NaN
Both terminals show an open circuit.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.
Please be positive and constructive with your questions and comments.