logo elektroda
logo elektroda
X
logo elektroda

High temperature measurement - thermocouple with MAX6675 - connection and communication protocol

p.kaczmarek2 2364 6
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • K-type thermocouple with MAX6675 A/D converter module, kit.
    The K-type thermocouple together with the MAX6675 A/D converter module allows you to easily measure high temperatures from 0°C to 800°C with 12-bit resolution. The kit presented here operates on a voltage from 3 V to 5.5 V and uses a simple SPI protocol for communication, which can be equally well implemented on any three GPIOs of the selected microcontroller.

    Let's probably start with the most important thing, i.e. the price - at the moment of writing this topic, the whole kit can be bought with shipping for a few tens of zlotys in our country, and importing from China we can close in the amount of 10 zlotys.
    Offer of type K temperature sensors with MAX6675 module Screenshot of the MAX6675 temperature module offer with a Type K thermocouple.
    It is only important to order the whole set, and not accidentally the module alone with the MAX6675.... and by the way let's have a look at its catalogue note:
    Diagram of applications for MAX6675 chip
    The connection to the MCU seems to be very simple, only three lines are needed
    MISO, SCK, SSB, but let's not forget also the common ground and the power supply.
    The SPI protocol - it sounds scary, but in practice here SPI is used in the simplest possible way. The datasheet note describes how the communication is done:
    Page from the MAX6675 datasheet.
    Visually presented communication:
    Diagrams showing the serial interface protocol and data reading method for the MAX6675 chip.
    So basically we set the CS to a low state, then manipulate the clock and read the next bits from the SO. The whole thing has to be done at the same time respecting the timings, but everything is on the diagram. The meaning of the 16 bits read is also defined in the diagram - we are mainly interested in the 12 bits of measurement, i.e. bits 3 to 14 inclusive.
    Now the question of how to use this with the MCU - well, the best way is to use a ready-made library, there are plenty of these under the Arduino:
    https://www.arduino.cc/reference/en/libraries/max6675/
    It can be added via Library Manager.
    Here's another library:
    https://github.com/adafruit/MAX6675-library
    For most people you could end here, but anyway now we'll take a look at how this communication is implemented internally.
    We don't use hardware SPI here - any digital GPIO will suffice:
    Code: C / C++
    Log in, to see the code

    For reading we have 16 bits, so two bytes. You will need the function that reads the byte:
    Code: C / C++
    Log in, to see the code

    In the loop we set the clock to a low state, wait a moment and then read the data from MISO. Then we set the clock to a high state and wait, after which the loop repeats.
    There is still manipulation of the CS pin missing, but this we have outside this function:
    Code: C / C++
    Log in, to see the code

    Here we also read both bytes and assemble them into a single 16-bit word (although you could just as well read the whole 16 bits at once in spiRead).
    Then we need to interpret the read data. Here we have a bit more than the measurement itself...
    Code: C / C++
    Log in, to see the code

    One of the bits allows us to check if the measurement was successful at all. This can be useful when looking for errors. After checking the error, we simply shift the whole thing by 3 bits (to "cut off" the three youngest bits) and then multiply by 0.25 to get the result in degrees.
    And that's it - we already have the measurement. As you can probably see, this is very easy to implement on practically any MCU and those proud SPI's of the offerings are not at all so terrible in this case.

    What can this be used for? In my case, the kit with the MAX6675 is useful for hot air testing:
    Type K thermocouple with MAX6675 A/D converter module on a breadboard.
    Microcontroller with connected wires on a breadboard Close-up of a type K thermocouple connected to a screw in a workshop setting.
    This is extremely useful for me, because, as I have found out over time, the temperature actually 'seen' by the PCB can differ significantly from the temperature on the display of the hot air station, depending on which station you have and what blowing you set. I document my measurements and put them on interactive graphs ( version 350°C , version 450°C ).

    In summary, the kit with the MAX6675 is very cheap and at the same time easy to run, beginners should have no problem with it, as well as it should run on slightly less familiar MCUs, I even ran it myself on BK7231 , although in principle the same code will run on all platforms supported by OBK .
    I invite you to discuss. Have any of you also used the MAX6675 in your projects? What are your experiences with this chip, or would you prefer an alternative?

    Cool? Ranking DIY
    Helpful post? Buy me a coffee.
    Do you have a problem with Arduino? Ask question. Visit our forum Arduino.
    About Author
    p.kaczmarek2
    Moderator Smart Home
    Offline 
    p.kaczmarek2 wrote 11906 posts with rating 9978, helped 571 times. Been with us since 2014 year.
  • ADVERTISEMENT
  • #2 21070471
    radex324
    Level 24  
    It is better to use the MAX31855 chip, the max6675 at 2 measurements per second above 600* "jams" and the measurements change every 2-3s. I was making a controller for EGT reading in the car and just initially this module was used but on testing errors came out, MAX31855 3 readings per second and zero problems.



    .
  • ADVERTISEMENT
  • #3 21070494
    p.kaczmarek2
    Moderator Smart Home
    That's interesting, I haven't encountered this problem with the MAX6675, only that I only use it up to 500°C. Additionally, according to the datasheet for the MAX6675 it should not take more than 0.22s:
    Table of electrical characteristics for the MAX6675 sensor, including conversion time.
    MAX31855 on the other hand has 0.1s:
    Table with thermal characteristics for the MAX31855 converter.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #4 21071535
    austin007
    Level 17  
    I used to be about to buy this MAX6675 board from majfriends but after my experience with maxim17043 I gave up. I think it's a fake chip. Functionally did you check that it works properly?
  • ADVERTISEMENT
  • #5 21075483
    cukras
    Level 17  
    >>21070471
    I've also been thinking about viewing the EGT temperature in order to make a DPF firing indicator(my car QQ+2, 2.0 dCi in no way signals that the DPF firing procedure has started). I have a problem whether to put a thermocouple on the DPF housing or maybe it is possible to hook up to a temperature sensor.
    Radex324 how did you implement this mate?
  • #6 21075786
    radex324
    Level 24  
    @cukras External EGT probe 3mm.
  • #7 21077058
    cukras
    Level 17  
    Hi, can you elaborate a bit or on PW explain how you fixed it and what the reading was?

Topic summary

The discussion centers around the use of the K-type thermocouple with the MAX6675 A/D converter module for high temperature measurement (0°C to 800°C) using SPI communication. Users share experiences regarding the performance of the MAX6675, with one user recommending the MAX31855 for better reliability and faster readings (3 readings per second) compared to the MAX6675, which reportedly experiences delays at higher temperatures. Concerns about the authenticity of the MAX6675 chip were raised, along with inquiries about practical applications, such as monitoring EGT temperatures for DPF firing indicators in vehicles. The conversation also touches on the installation of thermocouples and the potential for using existing temperature sensors.
Summary generated by the language model.
ADVERTISEMENT