Arduino, Thermocouples, MAX31855K (vs MAX6675) and SPI – The Fine Points

preview_player
Показать описание
It can’t be that hard to get a MAX31855K up and running …
↓↓↓ Complete description, time index and links below ↓↓↓

Or so you might think. But if you have one of those simpler Chinese modules you’re facing a challenge right out of the gate: it won’t work without modification. And if you have to 5V MCU, you’ll need some level shifting down to 3.3V.

There’s a nice MAX31855 library available for Arduino, but you can also bit bang the SPI bus directly. Multiple slaves on the SPI bus are a must of course. But do you really need a MAX31855K or will a MAX6675 just do fine.

00:00 Intro – Arduino, MAX31855K and past MAX6675 videos
01:04 MAX31855K vs MAX6675 – datasheets, differences, similarities
07:53 Input filtering – strongly recommended, in fact required
09:33 5V operation – connecting the 3.3V MAX31855 to a 5V MCU
12:49 MAX31855 library – by Rob Tillaart, easy and lean
17:57 Bit banging – code for the MAX31855K with just the SPI library
29:08 Multiple MAX31855Ks – on the same SPI bus
31:47 Mixing 5V and 3.3V – devices on a SPI bus is complicated
32:58 5V compliant modules – they are not, at least not fully
35:06 Shorting things – and destroying MAX31855s
36:22 Wrap-up – verdict, link to code and bye

#thermocouple #MAX31855 #Arduino #SPI #tutorials #tutorial #how-to #robertssmorgasbord
Рекомендации по теме
Комментарии
Автор

Thank you so much! I spent 6+ hours trying to troubleshoot why my boards wouldn't work. Just like you described, the manufacturer said the boards were good with 5v. I even looked at the data sheet and saw 4v max but decided the amazon seller was more reliable. That was a mistake. Your video went over everything in perfect detail, thank you!

thomasrimer
Автор

Just amazing video. I’m stunned !! Thank you for your time to create it !!

bartek
Автор

After digging a bit more into temperature measurement and control, Ii was surprised to find out that popular and cheap PID controllers such as the REX-C100 don't use such fancy chips but just simple a OPAMP and even no galvanic isolation.

de-bugger
Автор

Thanks so much for your great videos Robert. Very informative and helpful.
I'm just wondering if you know what would be the maximum amount of thermocouple readings you could do at the one time with say a Arduino mega and some expansion? I would like to setup a K-type thermocouple data logger running a chart like the Arduino serial monitor function. I would only want the thermocouple reading though. Not the board reading.
Thanks in advance.
James

dutchman
Автор

This is the definitive work on these chips and I find it invaluable, thanks !..oh yeah, Dangermouse and CB radio are responsible for my nick name 'Mousey' so I do remember !...cheers.

andymouse
Автор

Excellent video Robert! Thank you for this very detailed review and analysis of both chips. I have both of them (31855 is already in a project and 6675 is on a breakout board). I will take this video as my reference when doing the experiments. I still get dizzy from your waving hands though 🤢😉

MarcelHuguenin
Автор

Hi Robert, I have a question regarding the breakout board you made for the max31855. I know that it is necessary to use compensated cable (same metals as the K thermocouple) to connect the thermocouple to the MAX3185 module. I understand that this done so that he cables don't act as a different type of thermocouple themselves introducing an error to the measurement. My question is: if the small breakout board has copper leads to the terminals where the compensated wire is connected, couldn't this cause the previously described problem, or is the introduced error small enough to be ignored dur to the length of this connectors?

ivanadiego
Автор

Hello sir, I want to ask. is the max31855k pin connected randomly and not according to spi? because I use a raspberry pi pico but I didn't install the pin according to the spi pinout

syaifulannam
Автор

Hi Robert, thank you for the in-depth review and explanations. I will add the noice reduction to my "rig". I have a question/problem though. I have a set-up with 5 MAX31855 sensors. It works fine when the thermocouples are separated from eachother. However, if I put one thermocouple in contact with another thermocouple I get an error in the output. You mentioned that the 31855 can detect if its connected to ground. Is that whats happening when I connect two thermocouples? That I get some kind of short circiut? (I'm on a quite beginner level on this stuff :) ). Is it possible to mitigate the reading error when thermocouples are connected to eachother? When in use on my charcoal kiln, at least 3 thermocouples will be electrically in contact.

BTW, I have been running the sensors on 5V x) As you and someone already mentioned in the comments, they are claimed to be working on 5V in some specs.

andreaslundback
Автор

Hi Robert, thank you for teaching us! I'm working with MAX31865. Is there a way to contact you for the technical questions?

jamesmac
Автор

When i use it for oven in analog thermometer show 130c in max31855 shows 93c i thank you very much for your this research because you helped me to show the 100% temperature degree in this chip now analog thermometer and this shows same degree

ولدزايد-ذغ
Автор

why don't you do a demonstration on Adafruit Thermocouple Amplifier MAX31850 breakout board(one wire)..I want to use it for various temperature logging.

patrickmutai
Автор

thank goodness I found your videos. I'm just wondering if the thermocouple's need to be on the SPI bus, or can they be connected to any digital pins?

Gocast
Автор

Hi Robert, what is the Ferrite spec/model you used for the RTD input?

jamesmac
Автор

This is really an excellent comparison video, Robert. At first glance you would think that the 31855 is a superior chip, but you demonstrated that it is not. It is essentially for the 3.3V application. Thank you very much for this exhaustive démonstration. Will you put your library available some where ? Regards, RJM

rene-jeanmercier
Автор

hello, Do you can write the tip of capacitor, please.

dseletrica
Автор

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."

johnfrancis
Автор

Hello, It is possible to use a max31855 without arduino ?

antonymorvan
Автор

When I used 4 relays to control heating elements i2c LCD received reverse power affects on LCD and show wrong letters and numbers and symbols so one of people say put 0.1uF capacitor and 100ohm rissistor between relays current contacts so if this true can you test this problem

ولدزايد-ذغ
Автор

Hi Robert, Long time no talk ! I hope I find you well. I have a question for you. If I have 1 MAX6675 and 1 MAX31855 in the same working environment, is there a way, software wise, to identify which is which ? This is a design problem I am faced with. Thank you for your help. ...This would make great video as well since even chatGPT does not have the answer to this problem :-). Regards RJM.

rene-jeanmercier