1
\$\begingroup\$

I'm currently trying to measure the temperature of an off-the-shelf soldering iron. After realizing that the temperature-sensor in the soldering iron is a thermocouple, i ordered a type-K thermocouple ADC board, more specifically a MAX6675-based breakout board. While I am able to get temperature readings out of the chip, they are way to high in comparison to the real temperature. For example: I'm getting a reading of about 550°C, when in reality the iron has a temperature of slightly under 300°C.

Looking at this chart in the Wikipedia I think that my iron might be a type E thermocouple. https://de.wikipedia.org/wiki/Thermoelement#/media/File:Thermocouple_voltages.PNG

Now for the final question: Is it possible/feasible to convert/calculate the correct temperature (of a type E probe) from the type-K-thermocouple ADC reading? Has anyone done this in the past? I don't really need high absolute accuracy, +-10°C will be present due to the PID regulation anyway.

My last solution would be to order/sample a MAX31855E-chip from maxim and then swap the chip out on the board. I don't really want to do that, because the MAX31855E isn't that easy/cheap to source.

Additional information: I'm using an ATmega328 microcontroller, firmware is written in C, so any example code would be highly appreciated as well.

\$\endgroup\$
  • \$\begingroup\$ the MAX6675 isn't some amplifier, its an ADC \$\endgroup\$ – PlasmaHH Jan 18 '16 at 10:56
  • \$\begingroup\$ @PlasmaHH yep, I edited that \$\endgroup\$ – Tobias Mädel Jan 18 '16 at 10:57
1
\$\begingroup\$

This is how I see it: -

  • You have a K type TC connected to a proper measurement interface
  • The above is telling you 550 degC
  • Your TC in your soldering iron is telling you about 300degC when connected to your "proper measurement interface"
  • You have concluded that the TC in your iron is an E type.

enter image description here

Looking at the graph above you would expect an E TC to produce a bigger voltage than a K TC for the same temperature so, you have to ask yourself if your beliefs are founded.


EDIT section

It now appears that the OP is using the internal TC connected to a K type interface circuit and this does tend to justify that the likely internal device is an E type TC. The graphs are fairly linear and both fall through 0 uV and 0 degC so a first order approximation is to treat the conversion as linear. At 1000 degC a K type produces 41 mV and an E type produces about 76 mV.

If you want a more precise polynomial try THIS data sheet: -

\$\endgroup\$
  • \$\begingroup\$ I'd think that my beliefs are founded. I'm getting a measurement that is too high. Which would exactly respond to the graph. (or am I really mistaken?) \$\endgroup\$ – Tobias Mädel Jan 18 '16 at 12:07
  • \$\begingroup\$ Then one of my bullet points (interpreting what you appear to have said you have done in your question) must be incorrect. Try and specifically state what you have done and measured and what you have used for that measurement. For instance you say "I'm getting a measurement that is too high" - is this a voltage or is it a temperature based on that voltage or, is it something else? \$\endgroup\$ – Andy aka Jan 18 '16 at 12:33
  • \$\begingroup\$ The first bullet point is kinda incorrect. \$\endgroup\$ – Tobias Mädel Jan 18 '16 at 12:34
  • \$\begingroup\$ Then what are you saying? \$\endgroup\$ – Andy aka Jan 18 '16 at 12:34
  • \$\begingroup\$ The chip i'm using isn't only an ADC but also an integrated converter with compensation and everything. It's specificly made for a type-K probe and directly gives out °C readings. My probe doesn't seem to be a type-K probe, but rather a type-E probe. So I'm now trying to convert between those readings \$\endgroup\$ – Tobias Mädel Jan 18 '16 at 12:34
0
\$\begingroup\$

I have now found a solution to the problem.

double TypeEVoltageToTemperature(double voltage)
{
    return
        1.7057035 * pow(10, -2) * voltage +
        -2.3301759 * pow(10,-7) * pow(voltage, 2) +
        6.5435585 * pow(10,-12) * pow(voltage, 3) +
        -7.3562749 * pow(10,-17) * pow(voltage, 4) +
        -1.7896001 * pow(10,-21) * pow(voltage, 5) +
        8.4036165 * pow(10,-26) * pow(voltage, 6) +
        -1.3735879 * pow(10,-30) * pow(voltage, 7) +
        1.0629823 * pow(10,-35) * pow(voltage, 8);
}
double TypeKTemperatureToVoltage(double temperature)
{
    double precal = (1.185976 * pow(10,2)) * pow(2.7182818284590452 ,(-1.183432 * pow(10,-4)) * pow((temperature - 126.9686),2));

    return  (-1.7600413686 * pow(10,1))     * pow(temperature,0.0) + precal +
            ( 3.8921204975 * pow(10,1))     * pow(temperature,1.0) + precal +
            (1.8558770032 * pow(10,-2.0))   * pow(temperature,2.0) + precal +
            (-9.9457592874 * pow(10,-5.0))  * pow(temperature,3.0) + precal +
            (3.1840945719 * pow(10,-7.0))   * pow(temperature,4.0) + precal +
            (-5.6072844889 * pow(10,-10.0)) * pow(temperature,5.0) + precal +
            ( 5.6075059059 * pow(10,-13.0)) * pow(temperature,6.0) + precal +
            (-3.2020720003 * pow(10,-16.0)) * pow(temperature,7.0) + precal +
            ( 9.7151147152 * pow(10,-20.0)) * pow(temperature,8.0) + precal +
            (-1.2104721275 * pow(10,-23.0)) * pow(temperature,9.0) + precal;
}

This solution takes around 80,000 cycles on an ATmega328. (5 milliseconds per both calls).

Thanks to @Toble_Miner and @Andy aka for their help with fixing this problem!

\$\endgroup\$
  • \$\begingroup\$ That's an unusual way to code a polynomial; this might be faster: result = A0 + temperature* (A1 + temperature*(A2+... \$\endgroup\$ – Whit3rd Feb 13 '16 at 22:08
  • \$\begingroup\$ @Whit3rd is correct- not using Horner's rule is grounds for a good dressing down. Worth mentioning that your cold-junction compensation will be in error by about 1 degree for every 3 degrees change from the reference temperature, so probably quite a large error as the cold junctions warm. \$\endgroup\$ – Spehro Pefhany Feb 13 '16 at 22:20
  • \$\begingroup\$ I just want to mention that the Horner form is not only more computationally efficient (in which case one may say: it's fast enough, so who cares) but also more accurate by virtue of not involving high powers of the variable. For example, the maximum temperature for a type K thermocouple is about 1600°C, the 9th power of which is 6.9×10^28. Then you multiply this by something close to 10^-23. I don't know how accurate the floating-point library is on the ATmega328, but I wouldn't count on it to deal with this 52 orders of magnitude difference gracefully. \$\endgroup\$ – Oleksandr R. Feb 13 '16 at 23:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.