MAX31855 - A better thermocouple module

Поделиться
HTML-код
  • Опубликовано: 25 июл 2024
  • In this video I show you how the MAX31855 thermocouple module works. I talk about the connections, the wiring and of course the coding. I also show some tricks and tips about the bit shifting and bitwise operations which can become handy when you need to work with large amount of bits or you want to read a specific part from your binary number. This module is really nice because it supports negative temperatures and its measurement range is also really broad.
    If the module gives weird readings, put a 10 nF capacitor between the input pins of the thermocouple!
    Link for the MAX6675 video: • MAX6675 - K-type therm...
    Please don't forget to subscribe!
    Schematics and code: curiousscientist.tech/blog/ma...
    If you want to support my work, please consider buying the parts using my affiliate links:
    curiousscientist.tech/tools
  • НаукаНаука

Комментарии • 43

  • @isidoromaich7226
    @isidoromaich7226 3 года назад +2

    Great project. Since a while I was needing for a quad thermometer and I was searching some off the shelf cheap solution, maybe I will be considering build something between these lines

    • @CuriousScientist
      @CuriousScientist  3 года назад +1

      Thanks! I think this thermometer module is excellent, maybe one of the best for k-type thermocouples. You can hook up as much as you want thank to the SPI, and it is really flexible with its wide temperature range and different fault detection options. If you don't need extreme precision, it is a great solution. Otherwise, PT100 thermometers are the real deal when high precision is required. But they are expensive.

  • @user-xk2ee8cr7p
    @user-xk2ee8cr7p 2 года назад +2

    Great video, your discussion of the coding was excellent!
    I have a question - Can you confirm whether an ungrounded thermocouple is essential for use with the max31855 breakout board? Alternately, can a grounded thermocouple be used with the max31855 breakout board?

    • @CuriousScientist
      @CuriousScientist  2 года назад +1

      Thank you! As far as I know, grounded thermocouples do not work well with this module. I could be wrong of course, but I have never seen it in an application with grounded TCs.

  • @jean-yvesorssaud8512
    @jean-yvesorssaud8512 Год назад

    Good job! Juste one point: what if the internal temp gets negative? You take care of this for the outside temp, not for the internal one.

    • @CuriousScientist
      @CuriousScientist  Год назад

      Thanks! What do you mean by negative internal temperature? The chip has its own internal cold junction compensation, so it doesn't matter what's the temperature around the circuit, the readings from the thermocouple will be always correct.

  • @dargindarginec9561
    @dargindarginec9561 9 месяцев назад +1

    hi how to measure negative temperature on these microcircuits?

    • @CuriousScientist
      @CuriousScientist  9 месяцев назад

      In the same way as you would measure positive, I guess. I don't really understand the question.

    • @dargindarginec9561
      @dargindarginec9561 9 месяцев назад

      @@CuriousScientist I want to make a thermostat that measures down to -200° degrees 😀

    • @CuriousScientist
      @CuriousScientist  9 месяцев назад

      Yep, this can do it. If you read the datasheet, it is written in the 3rd sentence right in the beginning...

  • @Krystian1711100
    @Krystian1711100 3 года назад

    Can I swap pins on 3, 4 and 5?

    • @CuriousScientist
      @CuriousScientist  3 года назад

      Sorry but I do not exactly understand what you want. Pin 4 and 5 are the i2c pins for the display, so you cannot really change them. Pin 3 is not assigned to anything if I remember correctly.

    • @Krystian1711100
      @Krystian1711100 3 года назад

      @@CuriousScientist Jak sterować triakiem? To nie działa:
      if(ADC_HA >= TCCelsius) //termopara
      {
      digitalWrite(8, HIGH);
      lcd.setCursor(9,0); //strzalki w gore dla hota
      lcd.write(4);
      }

      if(ADC_HA + 1

    • @CuriousScientist
      @CuriousScientist  3 года назад

      Sorry, but I cannot speak Polish(?).

    • @Krystian1711100
      @Krystian1711100 3 года назад

      @@CuriousScientist I used your library for the MAX module. I would like to control the power triac with a potentiometer as the set point, and the temperature value from the MAX transducer as the offset value. is the following excerpt from the program good? Is the correct declaration TCCelsius in my fragment program?

    • @CuriousScientist
      @CuriousScientist  3 года назад

      If it is not a secret, send me the full code to my mail. My mail address is on my website. I will check it in the evening.

  • @hardikshah1792
    @hardikshah1792 3 года назад

    Can you please make 4 channel pt100 data logger?

    • @CuriousScientist
      @CuriousScientist  3 года назад +1

      If you buy me all the components, I am glad to make one and present it.

    • @hardikshah1792
      @hardikshah1792 3 года назад +1

      @@CuriousScientist I would be happpy to do that. can you please give me list of components you need. I will supply it to you.

    • @CuriousScientist
      @CuriousScientist  3 года назад

      4x Adafruit Pt100 module (MAX31865), a microcontroller (preferably STM32F103C8T6 aka "blue pill", but Arduino Uno or Nano would work too). If you want a display, then a 20x4 LCD would be nice, the one with the i2C circuit. If you want logging to an SD card, then an additional SD card module and rotary encoder with a build-in switch. A plastic enclosure that can accommodate all the hardware, a USB cable for the microcontroller, 4x screw terminal or equivalent, a perfboard to mount everything (must fit in the enclosure and of course all the parts). And of course I have to build everything, program it and test it. That also needs to be compensated somehow. :)

    • @hardikshah1792
      @hardikshah1792 3 года назад

      @@CuriousScientist done. can you please buy all of these? I will pay for the same. So total how much will be cost for all including coding testing for you? and can't we do it by only one PT100 module? and can we take its output in excel using plx-daq?

    • @hardikshah1792
      @hardikshah1792 3 года назад

      @@CuriousScientist why we will need rotary encoder with a build-in switch? for SD writting start stop?

  • @johnfrancis923
    @johnfrancis923 6 месяцев назад

    I am using the STM32C011F6U6 controller, MAX31855 chip and I am facing issues with the clock and data signals not being received correctly. Upon examining Adafruit's schematics, I noticed they have pull-up resistors on the SO (Slave Out) and clock pins. Should I include pull-up resistors to ensure proper reception of data and clock signals?
    My SPI Configuration

    PA5 ------> SPI1_SCK
    PA6 ------> SPI1_MISO
    PB7 ------> SPI1_Chip_Select
    /**SPI1 GPIO Configuration
    GPIO_InitStruct.Pin = GPIO_PIN_5 | GPIO_PIN_6;
    GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
    GPIO_InitStruct.Pull = GPIO_NOPULL;
    GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
    GPIO_InitStruct.Alternate = GPIO_AF0_SPI1;
    HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
    /*Configure GPIO pin : CHIP_SELECT_Pin */
    GPIO_InitStruct.Pin = CHIP_SELECT_Pin;
    GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
    GPIO_InitStruct.Pull = GPIO_PULLUP;
    GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
    HAL_GPIO_Init(CHIP_SELECT_GPIO_Port, &GPIO_InitStruct);
    /* SPI1 parameter configuration*/
    hspi1.Instance = SPI1;
    hspi1.Init.Mode = SPI_MODE_MASTER;
    hspi1.Init.Direction = SPI_DIRECTION_2LINES_RXONLY;
    hspi1.Init.DataSize = SPI_DATASIZE_8BIT;
    hspi1.Init.CLKPolarity = SPI_POLARITY_LOW;
    hspi1.Init.CLKPhase = SPI_PHASE_1EDGE;
    hspi1.Init.NSS = SPI_NSS_SOFT;
    hspi1.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_32;
    hspi1.Init.FirstBit = SPI_FIRSTBIT_MSB;
    hspi1.Init.TIMode = SPI_TIMODE_DISABLE;
    hspi1.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;
    hspi1.Init.CRCPolynomial = 7;
    hspi1.Init.CRCLength = SPI_CRC_LENGTH_DATASIZE;
    hspi1.Init.NSSPMode = SPI_NSS_PULSE_ENABLE;
    // Main Logic
    while (1)
    {
    // Read temperature data from the slave MAX31855KASA Thermocouple Chip

    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_7, GPIO_PIN_RESET);
    ret = HAL_SPI_Receive(&hspi1, buf, 4, 1000);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_7, GPIO_PIN_SET);
    HAL_Delay(1000);
    }
    I am consistently receiving a buffer value of 1, except in cases of error status(short circuit, open circuit and so on...) where it is always 0."

    • @CuriousScientist
      @CuriousScientist  6 месяцев назад

      Do you receive garbage data, for example, wrong temperature values, or you actually checked the SO and SCK pins with an oscilloscope and saw funny signals? Have you tried the suggestion that I wrote in the video description?

    • @johnfrancis923
      @johnfrancis923 6 месяцев назад

      ​@@CuriousScientistI am analyzing the SCK and chip select using a logic analyzer. When the chip select becomes low, I only get 13 to 15 clocks instead of 32 clocks. Additionally, the MISO pin is consistently high, but it eventually goes low just before the chip select becomes high.

    • @CuriousScientist
      @CuriousScientist  6 месяцев назад

      I don't know what the issue can be. It works perfectly for me. Maybe you have a faulty module!?

    • @johnfrancis923
      @johnfrancis923 6 месяцев назад

      @@CuriousScientist When I review the Adafruit datasheet, they pull up the SO and SCK lines. Should I follow the same approach?

    • @CuriousScientist
      @CuriousScientist  6 месяцев назад

      If your board doesn't have pull-up resistors, you might try it, yes.