# “Multiplexing” thermocouples to an IO board

I'm trying to solve a problem on a project for one of my customer, 'cause we are having hard times to find an appropriate solution.

He needs something really simple (more on this later) and as we are both not much into electronics, all we can do is to call "companies with a name" for offer on their hardware, and end up with things that are really perfect to land on the moon but really overpriced for our scenario.

I'm trying to find a different alternative, thus this question.

Scenario:

• 40 thermocouples to be sampled (brand unknown, as they are 20 years old and nobody remember were they come from, but this is not the problem 'cause we can always change them all)

• Required sampling precision: +- 0.5 degrees 2 Celsius degrees.

• Required sampling speed: a whopping once every two minutes. That is, 120 seconds divided 40, an astonishing sampling rate of one thermocouple every three seconds :-D

So, it's obvious we don't need 20k euros equipment, but it seems that there is nothing simple out there and given that we need 40 input, prices are going up really quickly.

On top of this we still need a few digital outputs (3 or 4, still unclear) and some analog inputs to sample some voltages, and all this stuff will be driven by a custom software on a Windows PC. So to the question (finally)...

In this scenario, can buying a simple I/O board and somehow multiplexing the thermocouples to a single analog input feasible? Do Multiplexer with 40 inputs exists at all? (P.S. the multiplexer should be controlled by the PC, ideally)

Ok, at the end I did a lot of work and I've been be able to get all the info I needed. Seems like there was some misunderstanding with the customer, now everything is clear and I can give more info.

First of all, the required precision is 2 Celsius degrees. As I've noticed someone pointed, it the temperature range is between 100 degrees: That is between room temperature room temperature+100

Currently used thermocouples are standard T type, from Tersid. As of now the 20 years old thermocouples are connected to a 20 years old I/O board, by 20 years old, 10-15 meters long wires, in an environment with a lot of electromagnetic noise, and work like a charm. Don't ask me how, I have no idea :-D

• Use arduino and relay boards. Relays will affect the signal the least. – Gregory Kornblum May 13 '17 at 7:58
• By the way, where is the 20k number comes from? If this is your budget, maybe you could use a partner... – Gregory Kornblum May 13 '17 at 7:59
• Just to be clear: if this can be done, then we can then pay someone to design the system for us, we are not pretending to do it ourselves. And we don't pretend to go as cheap as possible either, as the system is in some devious ways even mission critical and when used (a couple times a year) will have to be powered up and running for a month straight. We are just searching for a sweet spot between "very pricey" and "cheap" – motoDrizzt May 13 '17 at 8:00
• You will have trouble getting 0.5C repeatability between thermocouples, even before you start doing anything else. You can do some experiments quite quickly and cheaply to get a handle on what you're attmepting, and whether any of these answers will work. Get a thermocouple, cut the wire, use screw terminals to rejoin with copper wires, and experiment with a hair-drier. Add series resistors to see at what point your meter a) notices and b) goes wrong. Get a bunch of them, and see how well they agree in the same glass of water. Measure steam point (adjusting for air pressure!) – Neil_UK May 13 '17 at 12:44
• @motoDrizzt NI makes excellent lab-grade stuff. Not cheap and not as tolerant of abuse and EMI as industrial grade and process control stuff but usually more accurate. It's possible he's getting stability in that range. Repeatability and resolution? Sure. But accuracy? Probably not at temperatures much above +200°C or below -100°C. Maybe not at room temperature without trimming and with limited temperature range for the boards. WAG for a naive attempt to do this in a bespoke design without extensive prior experience in thermal design +/-3°C (+/-5°F) not including sensor errors. – Spehro Pefhany May 13 '17 at 12:46

I've recently done some PCB design with thermocouples, and have learned about how finicky they can be if they aren't treated exactly as they're supposed to be. If you want a precision of 0.5 degrees, you must be able to measure 20uV of precision across the leads of the thermocouple! Do you really trust whatever multiplexing solution you use to introduce less than 20uV of noise? Not to mention that you can no longer perform proper cold junction compensation.

I know that usual precise thermocouple equipment is very expensive, but you can spend a lot less than 20k euros and still measure each thermocouple individually. I have used the MAX31855 in the past, which works very well. It has a precision of 0.25 degrees, cold junction compensation, simple SPI interface, and it costs less than 5 euros per IC. For the sake of accuracy and simplicity, I suggest you spend less than \$200 on 40 of these thermocouple IC's instead of multiplexing the thermocouples.

• In such projects components cost is negligible compared to labor. It's just one system... – Gregory Kornblum May 13 '17 at 9:21
• That one or the MAX31850/31851. Same stuff with Onewire interface (which may come in more handy than SPI because of the 40 spread-out pieces.) – Janka May 13 '17 at 9:31

About 12 years ago, an Apps Engineer appeared in my office door, with his explanation "I'm seeing 5 degrees error in this Thermocouple-based temperature measurement system. I need less than 1 degree Centigrade."

Over the next week, we invented methods for implementing thermal shorts, thermal opens and thermal zero-gradient layout.

(1) thermal shorts are impossible, but 3 or 4 layers of PCB foil, with a via every 1cm to conduct heat between layers was our approach

(2) thermal opens are impossible, but 2cm of FR-4 with only very thin I2C/gnd/vdd/K+/K- leads crossing the gap from digital to analog/Kconnector was our approach. [FR-4 thermal conductivity is about 200X less than copper]

(3) the human FACE is a problem; I view our faces as 0.1 watt per square cm; as you hover over that PCB and move left and right to peer at components, you are differentially heating regions of the PCB more than other regions, and heat flux will flow left then right; in your final product, plan on a case, a metallic case of mass adequate to become isothermal; as was explained by others, NESTED cases may be needed

(4) do not place heat generators on, or near, the PCB; in the original PCB, (showing 5 degreeC error) a 300 milliWatt MCU dumped heat into the PCB. With heat exiting left and right, we had 150mW passing the Kconn pins which must be at the same temperature, and the TempSensor must measure that temperature; of course, that Sensor in first PCB was located 4" away.

(5) as heat flows, the thermal resistance of 70 degrees Centigrade per watt per square of foil(standard 1 ounce/foot^2 is 70 degree C), scaled by the heat flow, gives the thermal error.

In my associate's case, the small PCB used a 300 milliWatt MCU for curve-fitting and USB interfacing, placed in middle of the PCB. Kconnector was on the right. TempSensor (the cold junction) was on far left edge, 3" away from the Kconnector. The PCB was just 2 layers.

Here is his Version#2 floorplan, using our thermal-short/open thinking:

simulate this circuit – Schematic created using CircuitLab

Result of our thinking, using grid-of-resistors in SPICE to model heatflow and realizing the human head is 100watt heat source? The next PCB version was better than 1 degreeC accuracy. I never learned how much better than 1 degreeC. And this accuracy was achieved in a lab, with no thermal-mass shielding.

I think the KEY was to place the TempSensor (cold junction compensation) right between the K+ and K- pins of the Kconnector, in middle of our 3-layer thermal short (using large diameter vias, every 1cm)

Also the ADC resolution was far better than needed, thus that error contribution dropped out of the RSS error math.

I wouldn't design this myself. It would take a lot of time, which is often more valuable. The other answers here are way too specific on hardware. You want a solution fast and easy, that's why you called the moonlanding companies in the first place, right? Not to mess around with Arduino and Relays and cmos multiplexers.

For example, take Wago module 750-458 for 8 thermocouples, it's "only" €300, you'd need 5. Not anywhere near 20k!

Add a Ethernet fieldbus coupler (750-342, also €300) and you should be able to use MODBUS over ethernet to access the data. Or any other fieldbus protocol of your liking.

You're free to add more I/O modules, maximum of 64 units total I believe.

Update:
Spehro Pefhany pointed out that the accuracy of these models do not meet demands. The resolution is 0.1K and with a best case error of < +/- 4K+1K with compensation.

*Prices are catalogs that are googlable, you might get discounts at your local distributor.

• Generally a good suggestion, however error due to the module alone is 10x what he claims to required (5K). 1K + 4K for the CJC. If you allow 0.25°C for the sensor it needs to be 20 times better which is not easy. – Spehro Pefhany May 13 '17 at 11:15

Your problem is not the multiplexing per se, it's the 0.5 degrees precision after multiplexing.

Let's assume you build a multiplexer with (say) K leads in, and K lead out to your existing meter. Note this is not a meter, does not need a cold junction, that's back at the single channel meter you're going to reuse. This takes N thermocouples and connects any one of them to the output thermocouple wires, which go to your meter. The problem is the equality of temperature where the metals change from thermocouple material to/from copper, solder, and all the other stuff. That means you needs the all the screw terminals at the same temperature. That rules out relays with their high thermal dissipation. Fortunately CMOS switches take nA when static.

You may (and I emphasise may, downhill and with a following wind) be able to do it on the cheap if you can control the temperature. This means no thermal gradient across the board. This is easiest to attempt with a) no power on the board b) good thermal conductivity across the board c) insulation of the board from ambient d) another isothermal shield around the insulation.

So my suggestion to try is

a) Use CMOS switches. Check what the maximum permitted series resistance is for your thermocouple meter, and choose switches accordingly.

Mount screw terminals on the same PCB, to take the input thermocouples and the output thermocouple wire. Have a ground plane on the back to keep the temperature as uniform as possible. If you want to screw the board to a thick alli plate, then that can't hurt. Drive the switches with CMOS to avoid generating any more heat than is required. Have LDOs or other regulators somewhere else, not on this board. Did I mention don't dissipate any heat on this board?

b) bundle the output wire with the input wires, the control and power wires, so they get to be the same temperature as they pass into and out of the multiplexer. This eliminates a potential source of temperature gradient.

c) wrap the board in some insulation, eg bubble wrap. There's no heat being generated in there, so it's not going to get hot.

d) Place it all in a diecast metal box. If you want to use two, concentric diecast boxes (they're cheap compared to 20k) then so much the better.

e) After all that, keep the ambient as constant as possible. Changes in ambient will heat and cool the board via the leads, you want the thermal gradient in the board due to that to be as small as possible.

Check your thermocouple instrument manual. They may give a maximum expected thermocouple source resistance. Your switches must present an on resistance of better than this. Depending on the family you choose from, you can find CMOS switches with on resistances of 100s of ohms, down to sub-ohms. Analog and Maxim do the newest ranges of switches, if the standard HC4051 and DG411 type families are not suitable.

It's likely that a backing plate and two boxes round it is overkill. Maybe if your ambient is stable enough, just the board+backing plate, and wrapping it in some bubble-wrap is enough.

You could always start to experiment small and cheap. Start with cutting a thermocouple lead in two, and rejoin it with terminal blocks. Connect the terminal blocks with resistors to check the tolerance of the meter to extra resistance. Heat one block with a hair-drier to convince yourself what a low temperature gradient will need to be maintained.

• Unless you can guarantee constant ambient temp to better than 0.5 degrees, low power won't save you. You need a device such as a thermistor or platinum RTD to measure the temperature of the connection block and compensate. – WhatRoughBeast May 13 '17 at 13:09
• @WhatRoughBeast Doesn't need to be known, doesn't need to be constant, just needs to be uniform between the K to copper and the copper to K connections. Perhaps that wasn't sufficiently clear in the answer, I'll check and elaborate if necessary. – Neil_UK May 13 '17 at 14:05
• Sorry, Neil, but as stated the temp must be known. The OP did not state that the temp readings must track each other to 0.5 degrees (allowing a common temp shift to be ignored). The TC/copper junction forms the reference temperature, and if that changes so do the recovered temperatures. – WhatRoughBeast May 13 '17 at 14:43
• @WhatRoughBeast No, I stand by what I wrote. He wants to build a multiplexer, not a multichannel meter. The cold reference junction is back at the original meter. The multiplexer contains an input lead, and an output lead, with K to metal and metal to K transitions at the same temperature. You can break any conductor of a thermocouple with any other conductor, and as long as all of the inter-metal transitions are at the same temperature, all will cancel out. Hence the need for no gradient across the mux board. – Neil_UK May 13 '17 at 15:09

The precision target (0.5 K) is achievable, but will not allow interchanging the thermocouples (batch-to-batch, thermocouples are expected to vary by one or two degrees). Multiplexing to a PC card is a poor solution because a personal computer is not an ideal isothermal environment for the cold-junction end of the thermocouple circuit. A low-power thermocouple meter with multiple inputs (a 'thermocouple scanner'), or maybe two or three, can be tethered to your PC, and that might be the best solution.

Before using (trusting) the thermocouples, it would be wise to check the resistance and find the thermocouple type (there are many standards for such). Calibration depends on/requires the thermocouple circuit to meet the scanner's conductance specification.

Scanner output may be automatic, and the PC need only receive serial data, as the scanner does the digitization (and thermocouple voltage-to-temperature and cold junction calculations).