Thermocouple measurement
ManAtWork
Posts: 2,176
I plan to make a propeller based reflow oven controller. To measure high temperatures (up to 300°C) I have to use thermocouples. I think I'll use the LTC2440 as ADC. It has enough resolution to measure the thermo voltage directly without pre-amplifier, so I can get rid of any offset and calibration problems.
But as thermocouples only measure relative temperatures I have to add an absolute temperature sensor for cold junction compensation. What is the preferable device for this? The LM75B would be nice as it has an I²C interface and doesn't require any extra pins but can be connected to pins 28/29 where the EEPROM already is connected. It is cheap but has relatively poor accuracy (+/-2° in the -25 to +100°C range).
I have seen there is a TMP102 object in the OBEX and a DS2760 thermocouple kit. The TMP102 looks good but when I look at the datasheet of the DS2760 it shows a Li battery monitor that has nothing to do with a thermocouple, IMHO.
I have to read at least 6 thermocouples. There is a 4-input version of the LTC2440 but as I need 6 I think I'd better handle multiplexing externally. (The 8 channel versions are single ended, only) Has anybody already done something similar. What would you suggest?
But as thermocouples only measure relative temperatures I have to add an absolute temperature sensor for cold junction compensation. What is the preferable device for this? The LM75B would be nice as it has an I²C interface and doesn't require any extra pins but can be connected to pins 28/29 where the EEPROM already is connected. It is cheap but has relatively poor accuracy (+/-2° in the -25 to +100°C range).
I have seen there is a TMP102 object in the OBEX and a DS2760 thermocouple kit. The TMP102 looks good but when I look at the datasheet of the DS2760 it shows a Li battery monitor that has nothing to do with a thermocouple, IMHO.
I have to read at least 6 thermocouples. There is a 4-input version of the LTC2440 but as I need 6 I think I'd better handle multiplexing externally. (The 8 channel versions are single ended, only) Has anybody already done something similar. What would you suggest?
Comments
I agree with JonnyMac. The MAX31855 is a great chip. it takes care of the cold junction for you. and outputs a 14-bit value for your thermocouple temperature. Evey bit is equaled to .25ºC.
I got these for mine. Maxim made them and tested them, so I know they would work right out of the box. They even came with a thermocouple wire in the box.
I agree that the MAX31855 is a nice chip for a single (or low number of) thermocouple(s). But I'd prefer a general purpose ADC so that I can also connect other sensors (pressure, vibration, strain gauges) later for the turbine or other projects.
BTW, Maxim makes different versions of the chip for 7 different types of thermocouples? What a waste of money, time and stock space. A uP could easily select the type if they assigned an SDI to the DNC pin. If Parallax had those resources, they'd had the P2 out years ago.
The temperature sensor should be "right next to" the cold junction, not the ADC. The cold junction is where the thermocouple
wires bond to copper wires - the t'couple I have sitting here has spade terminals, so the cold junction is actually the crimped-on
spades, which might be on the outside of the box, not the warm circuit board inside the enclosure, which would give significant
error in fact! I presume screw terminals mounted on the PCB would be a good compromise, then the thermal sensor can be
right next to the terminal block (and away from any sources of heat like voltage regulators).
Devices like the MAX31855 and AD595 do cold junction compensation, but AFAIK they don't do linearity correction. The MAX31855 claims +/- 2 degrees over the range of -200 to +700 °C for type K, or +/- 6°C over -270 to +1370 °C, but the specs are a bit dodgy, always, "Note 4: Not including cold-junction temperature error or thermocouple nonlinearity."
The DS2760 is (discontinued? was) intended as a battery management IC. It includes a high gain amplifier with a narrow span that was intended for current sensing but made it suitable for a thermocouple. Parallax sold a kit for a while.
Huh, most of the thermocouple connectors I've see are made out of the same material as the thermocouple wire to specifically avoid extra junctions. I.e. with copper-constantan (T-type) wire you use a set of terminals with copper and Constantan contacts. (i.e. also use T-type terminals)
Marty
The board size is 100x100mm. The gap in the middle is to install a "heat shield" between the analogue part on the left side and the power output stages (top right) and voltage regulators (bottom right).
The other features are:
I'm attaching my thermocouple object, in case it might help with the linearization/compensation. It is set up with a table for the K thermocouple. There is a PUB degC_to_uV(refTemp), which converts the reference temperature to the equivalent µV that a K couple would produce at that temperature. That is a direct lookup/interpolation in the table. Then there is a PUB compensate(refuV, hotuV), which takes the reference µV from the first step and combines it with the µV reading from thermocouple. That is a lookdown with interpolation in the same table. The PUB temperature(refTemp, hotuV) is a direct chaining of the two operations that returns °C to tenths.
See ITS-90 Thermocouple Direct and Inverse Polynomials.
It would be nice if the polynomials would fit into 32bit integer math.
I suspect one doesn't need to use all the polynomials.
Just a thought.
Duane J
The cold junction temperature sensor (TMP102) and the ADC (LTC2440) are already working. What caused me some headache is that the LTC2440 seems to have a bug, it doesn't ignore SCLK pulses while chip select is inactive and the converter is ready. Although the data sheet does nowhere guarantee that SCLK is allowed to toggle while /CS is high, I think, calling that pin "chip select" should imply that assumption.:frown:
As I share SCLK, SDI and SDO signals with the IO expansion shift registers to save propeller pins this results in the restriction that I can only drive the shift registers while the ADC is busy. But toggling the serial bus signals while the conversion is in progress adds noise to the analogue inputs. So I only have 22 instead of 24 usable bits. This is around 1.2µV Resolution which means much better than 0.1°C with a type K or J thermocouple.
The whole board is highly specialized for my existing Zevatech reflow oven, so I think it doesn't fit very well for anybody else and it doesn't make sense to put it to OBEX. However, if anybody is interested I could post schematics and source code (when it's finished).
At first I was writing successfully to the configuration register and then started to fail without seeming to have changed anything. Do you have any example code for reading and writing the registers that would help me check my work?
Thanks.
if you only have to handle one thermocouple then an all-in-one-chip solution like the MAX31855 (see post #2) would be better, I think. I use a general purpose high resolution ADC plus a TMP102 for the cold junction compensation because I wanted to be more flexible about the types of sensors. This way I could also connect strain gauges or pressure sensors or different types of thermocouples with the same board.
Not trying to speak out of turn, and certainly off-topic, but as much as possible I don't connect additional hardware to those pins. When I started with the Propeller, I would do the usual things that people do with those pins, and I hung a Wii Nunchuk on them too, but then it occurred to me that any hardware failure on those pins could eliminate the ability of the Propeller to load any program. I wondered what might happen if my little Nunchuk's cord got damaged somehow, and I stopped using those pins for my stuff.
I'm not completely neurotic about it, just something that I try to consider.
Well that might not be neurotic for something that extends the I2C pins over a flexible cable that is constantly being jerked through the air but to apply it to ANYTHING ELSE on the bus is illogical. I2C was originally designed for use within a TV chassis, so between boards and tuner etc, and all this was within one protected assembly, no problem there. I just think that if you quote one extreme use as justification for or against then you are not being realistic or practical, you need to have a balanced holistic view.
One of the things I tend to be "neurotic" about is this tendency to have this one single big 3.3V regulator powering the CPU and all the peripheral chips on and off board. There is no sense in that, and a fault or noise on that line will affect the CPU. Much easier and better and just as cheap to have multiple smaller regulators close to where they are needed and if a peripheral overloads its 3.3V line then at least the CPU can continue to operate and take appropriate action. With one single big regulator you have no recourse.
EDIT: My apologies if this is a little OT
Both of you have valid points for the particular situations you refer to. No point in wasting pins if you can use one I2C connection for multiple peripherals as long as it can be done safely. OTOH once you start running cables outside of an enclosure the risk of damage goes up, particularly if the cable has higher voltage signal or power conductors in it. In the case of pins on the propeller a +5V supply shorting to the I2C conductors would be bad. Even cable in conduit is vulnerable. I had a card reader on a post outside an entrance door stop working and found the wires for the Weigand zero and one signals were shorted together. Looked like the building settled and crushed the conduit.
@Peter
Like you, I prefer to put small regulators on each board rather than have a single one for all of them. Must be a holdover from the S100 days. It makes sense though, since it enhances heat removal, increases reliability, and allows for more flexible modular systems.
I've been doing that more and more lately myself.
I recommend the following:
1. To compensate from non-linearities with a lookup table, interpolate using straight line linear or polynomial segments of unequal lengths instead of one polynomial for large temperature ranges. Polynomials that are tweaked for each segment can improve accuracy, but straight line segments can achieve adequate accuracy by using small enough segments
2. Average the thermocouple readings over a time period equal to one cycle of 60 Hz (50 Hz in Europe) to achieve very high noise immunity