How to have a stable thermocoupling reading

Hi guys,
In my arduino UNO project I would like to control the temperature of 30 liters beer mash with a heater powered by a PID that reads a thermocouple. A MAX6675 module is use to convert the voltage signal into temperature.

I have 3 thermocouples, all K type: two of them are very cheap, the other one is an industrial product so high quality.

Since my first trials I noticed that if i read the temperature value every x milliseconds ( i tried 50ms such as 2s), the value is fluctuating in a range of +-1,00°C ( ex. 17,50-18,00-17,00-16,50). This happens with all 3 type of thermocouple. Is this the higher accuracy can we achieve by our system?

Therefore, some moments i have an high misreading (17,00-17,25-22,00-20,00-17,25). This happens with all 3 types of thermocouple, less with the expensive one. Do you ever faced this problem?

Other "problem", i have a different mean value by using one instead of the other thermocouple. Is it possible that is caused by the thermocouple cable lenght?

I think i need to filter the thermocouple reading, but what is the best method? I would like to read the temperature every 10 seconds. At the moment the high misreading problem doesn't let me use the mean reading value.

Thanks in advice for all your future support
Gabriele

You may have electrical interference in the thermocouple sensor wiring. The signals are very low voltage and good construction techniques (grounding, shielded leads) are generally required. Keep the thermocouple leads as far as possible from heater and other wiring.

A median filter works well to reject occasional outliers.

I had convection ovens with thermocouple wire over 20 ft. in length. ALL had shielding braid over the wire pairs. EACH thermocouple must be individually calibrated.

Did you have all the thermocouples adjacent to each other while you were testing?

@jremington thanks, i will try the median filter as soon as possible. I think i have an interference problem too but i can't find it.

@Paul_KD7HB wires are shielded in those thermocouples. I thought the delta lecture can derive from the different wire lenght between each thermocouple (one is 1 meter, one 2 meters, the other one 5 meters) and the small voltage drop by lenght. As you said, this is not a real problem and resolvable with a calibration.

For the high misreading I tried to keep arduino and the module as far as possible from the thermocouple but the problem persists. The others thermocouples where keep apart. I tried also different pins on arduino.

Thermocouples have more error at lower temperatures. Mines can have 5-10ºC error at room temperature. If you are going to measure temps in the low range, other sensor are better suited, of the thermistor type. I have several transistor sensors I made and calibrated myself, they work very well with error less than 0.5ºC.

So, your code reads two bytes from the MAX6675 and puts them together into a 16 bit integer and that is your temperature, correct?

Why thermocouples? I wouldn't have thought a beer mash would get so hot that a DS18B20 couldn't do the job.

@Paul_KD7HB i use the max6675 library and my code simply print the value. The module amplifies the input voltage signal and makes the conversion from voltage to temperature automatically (for K type thermocouple there is a linear dependency from voltage to temperature). Any case, tomorrow i will post the code if you want. Do you think could be an error/malfunctioning in max6675 module?

@wildbill i already had those completely inox thermocouples before starting the project. I had to buy only the max6675 module. Beer mash reach at maximum 80°C temperature, so a inox protection for the immersed sensor is recommended. I keep in mind that i could use a thermistore in future projects, thanks.

In my daily work i use bunches of K-thermocouples and them are accurate and have a great stability at low and high temperature (20 to 800°C).
How can i figure out if there is an interference problem?

Guess that must do all the fun stuff for you. Can the library give you the raw bytes coming from the max6675?

I don't know, let me search for that

Something else you may want to consider. Thermocouples have limits of error, the remainder of your measurement plane aside the actual thermocouple has error.

Type K Standard Limits:
Temp Range >0 to 1250°C >32 to 2282°F
Tolerance Value 2.2°C or 0.75% 4.0°F or 0.75%

You can also buy special limits thermocouples and you can buy calibrated thermocouples (charted) for a range you call out.

Depending on things like sheath material and sheath diameter thermocouples have a response time so you may want to consider that. How long a thermocouple takes to respond to a change in temperature. Factor that in with your sample rate. Beer Mash you may want to consider a stainless steel sheath if it is going to be in contact with the product. Thermocouple response times. Also if your thermocouple is a grounded (junction connected to sheath) or ungrounded (junction isolated). So here are few things to consider. For slow changes in temperature you only need a slow sample rate between one and maybe ten samples per second.

Ron

Thank you Ron for your answer. I've considered the response delay and i think is not a problem, I use a 8mm diameter immersed thermocouple that has a "great" delay but in a beer mash you have a enormous thermal inertia (approximate 4,2 kJ x kg x °C!!!) and with my 1,5kW heater i should obtain at maximum 1 degree per minute heating. This is a slow heating that fits well with my thermocouple. In my trials i understood that i should select a slow sample rate and i tried also slower sample rate than yours, such as one reading per second and the output value calculated as the mean of ten readings.

My problem is that i have great misreadings (ex. 17,5-17,75-18,00-23,00-21-17,5-17,75...) , and those are indipendent from the sample rate. So my output value is always uncorrect.

@Paul_KD7HB this evening i try to get the raw data from the module.

@Paul_KD7HB i found how to get the raw data.

int state = thermocouple.read(); uint32_t value = thermocouple.getRawData(); // Read the raw Data value from the module

Moreover i 've read that i have to insert a pull-up resistor from the MISO pin and the 5vcc in order to avoid measurments noise. I will try and i ll keep you posted. Thanks

Now you getting into the debugging mode!

Here's an example that uses 3 Max6675 thermocouples.

The delay they put between reads I guess is to ensure that at least 250ms elapses before a given sensor is read again.

  temp1 = thermocouple1.readCelsius(); 
  delay(100);
  temp2 = thermocouple2.readCelsius();
  delay(100);
  temp3 = thermocouple3.readCelsius();
  delay(100);

Replacing the delays with millis() timers will be a better option to ensure the minimum 250ms sample period requirement.

Because the voltage read by the MAX6675 is so small you need to make sure that the other activity in the circuit doesnt affect it. So for example do you have a star point for your grounds?

Can you plot how the high misreadings relate to other activity in the project - eg heater current?

With a thermocouple the output voltage depends on the difference in temperature between the measurement point and the “ cold junction” at the thermocouple amplifier . If the difference is say 5C then your amplifier may only be seeing 200microvolts .
The cold junction at the amplifier also has a temperature sensor so that the measured temperature is the cold junction temperature plus the temperature at the measurement end . The cold junction needs to be insulated and well connected to the cold junction sensor .
Also you must use the correct compensating lead for the thermocouple or you will make other cold junctions at connections .

All these parts have errors and make the use of thermocouples pretty inaccurate at low temperatures with hobby electronics .
Something like a DS18b20 in a stainless thermowell might do the job .
Have a look at what is available commercially to do this ( eg a heated jacket with built in temp sensor ) for inspiration.
Also is is of course hotter at the top and colder at the bottom .

Thank you guys for all your answers.
I solved the misreading problem using a pull up resistor between MAX6675 miso pin and GND.

Cheers
Gabriele