Hardware | MAX31855 + K-type 온도센서 조합

|

1. 또 온도센서야?


지금까지 시험해본 온도센서들 입니다. 5개나 있네요.


* Hardware | AM2322 Temperature & Humidity Sensor

http://chocoball.tistory.com/entry/Hardware-AM2322-Temperature-Humidity-Sensor


* Hardware | Arduino 비접촉 온도센서 GY-906 MLX90614

http://chocoball.tistory.com/entry/HardwareArduinoMLX90614


* Hardware | Arduino BMP280 고도/온도/기압 센서

http://chocoball.tistory.com/entry/HardwareArduinoBMP280


* Hardware | BME280 sensor

http://chocoball.tistory.com/entry/HardwareBME280


* Hardware | DS18B20 온도센서

http://chocoball.tistory.com/entry/Hardware-DS18B20-temperature-sensor



* Hardware | AM2322 Temperature & Humidity Sensor

http://chocoball.tistory.com/entry/Hardware-AM2322-Temperature-Humidity-Sensor


* Hardware | Arduino 비접촉 온도센서 GY-906 MLX90614

http://chocoball.tistory.com/entry/HardwareArduinoMLX90614


* Hardware | Arduino BMP280 고도/온도/기압 센서

- http://chocoball.tistory.com/entry/HardwareArduinoBMP280


* Hardware | BME280 sensor

- http://chocoball.tistory.com/entry/HardwareBME280



출처: http://chocoball.tistory.com/entry/Hardware-DS18B20-temperature-sensor [초코볼의 inside Tech]


* Hardware | AM2322 Temperature & Humidity Sensor

http://chocoball.tistory.com/entry/Hardware-AM2322-Temperature-Humidity-Sensor


* Hardware | Arduino 비접촉 온도센서 GY-906 MLX90614

http://chocoball.tistory.com/entry/HardwareArduinoMLX90614


* Hardware | Arduino BMP280 고도/온도/기압 센서

- http://chocoball.tistory.com/entry/HardwareArduinoBMP280


* Hardware | BME280 sensor

- http://chocoball.tistory.com/entry/HardwareBME280



출처: http://chocoball.tistory.com/entry/Hardware-DS18B20-temperature-sensor [초코볼의 inside Tech]

* Hardware | AM2322 Temperature & Humidity Sensor

http://chocoball.tistory.com/entry/Hardware-AM2322-Temperature-Humidity-Sensor


* Hardware | Arduino 비접촉 온도센서 GY-906 MLX90614

http://chocoball.tistory.com/entry/HardwareArduinoMLX90614


* Hardware | Arduino BMP280 고도/온도/기압 센서

- http://chocoball.tistory.com/entry/HardwareArduinoBMP280


* Hardware | BME280 sensor

- http://chocoball.tistory.com/entry/HardwareBME280



출처: http://chocoball.tistory.com/entry/Hardware-DS18B20-temperature-sensor [초코볼의 inside Tech]


* Hardware | AM2322 Temperature & Humidity Sensor

http://chocoball.tistory.com/entry/Hardware-AM2322-Temperature-Humidity-Sensor


* Hardware | Arduino 비접촉 온도센서 GY-906 MLX90614

http://chocoball.tistory.com/entry/HardwareArduinoMLX90614


* Hardware | Arduino BMP280 고도/온도/기압 센서

- http://chocoball.tistory.com/entry/HardwareArduinoBMP280


* Hardware | BME280 sensor

- http://chocoball.tistory.com/entry/HardwareBME280



출처: http://chocoball.tistory.com/entry/Hardware-DS18B20-temperature-sensor [초코볼의 inside Tech]

네 그렇습니다.

온도 센서에는 기존에 확인했던 위의 센서들 말고, 준비하고 있는게 아래 3가지가 있습니다.


- K-type

- PT100 / PT100

- Cu50


이 포스트에서는 K-Type 에 대해 알아보려 합니다.





2. K-type


이번에는 K-type 온도센서 이므로, 해당의 제품을 구매합니다.


* Thermocouple K-Type Thermocouple Thermometer Probe WRNT-03 200mm*1000mm

https://www.aliexpress.com/item/Thermocouple-K-Type-Thermocouple-Thermometer-Probe-WRNT-03-200mm-1000mm/32615649856.html



일반적으로 Thermocouple K-type 은 선이 두가닥인데, 도착한 놈은 세가닥 입니다.

거기에 더해서 "Cu50" 이라는 라벨도 붙어 있습니다...


분명 난, K-Type 을 보고 주문한건데 말입니다.

사양서도 확인해 보면 WRNT-03 이라서 Probe type 의 thermocouple 이라고 생각했습니다만, 도착한건 그냥 Cu50 인듯 합니다..



세가닥 단자들 사이는 55 Ohm / 0 Ohm 의 차이를 보입니다.

100 Ohm 정도면 PT100 인데, 55 Ohm 이면 좀 애매하네요.



확실히 잘 사용되지 않는 Cu50 이 맞는 듯 합니다.

이놈은 이놈 나름대로 사용될 수 있는 방법을 찾아봐야겠습니다.



음?

테스터기로 측정하고 있을 때 눈에 들어오는 테스터용 온도 probe !!!



위 사진의 오른쪽 다발로 보이는 것이 테스터용 온도 센서 입니다.



혹시나? 하고 메뉴얼을 찾아 보니 "K-type" 이라고 적혀 있네요!



우연히 K-Type 온도센서를 구할 수 있게 되었습니다.

역시 K-Type 은 단자가 2개인게 확실합니다.





3. MAX31855


보통 온도 센서들은 아날로그 값으로 표현하므로, digital 로 변환해주는 converter 가 필요합니다.

K-Type 온도센서용으로는 MAX31855 라고 하는군요.


Arduino 용 K-Type 모듈인 MAX31855 를 구입합니다.


* MAX31855 MAX6675 SPI Type K Thermocouple Temperature Sensor Board Module For Arduino

https://ko.aliexpress.com/item/MAX31855-K-Type-Thermocouple-Breakout-Board-Temperature-200C-to-1350-Celsius-for-Arduino/32746337946.html



아래는 도착 사진 입니다.



친절하게 알아서 사용하라는 중국 생산자의 배려 입니다.



기록을 위해 뒷면도 찰칵.






4. sketch


Arduino IDE 에서 Library Manger 를 열고 max 라는 키워드로 검색하면, MAX31855 가 나옵니다.

인스톨 하세요.



패키지 인스톨 후, "File > Examples > Adafruit MAX31855 library > serialthermocouple" 을 선택합니다.



Sketch 는 다음과 같아요.


/*************************************************** 
  This is an example for the Adafruit Thermocouple Sensor w/MAX31855K

  Designed specifically to work with the Adafruit Thermocouple Sensor
  ----> https://www.adafruit.com/products/269

  These displays use SPI to communicate, 3 pins are required to  
  interface
  Adafruit invests time and resources providing this open source code, 
  please support Adafruit and open-source hardware by purchasing 
  products from Adafruit!

  Written by Limor Fried/Ladyada for Adafruit Industries.  
  BSD license, all text above must be included in any redistribution
 ****************************************************/

#include "SPI.h"
#include "Adafruit_MAX31855.h"

// Default connection is using software SPI, but comment and uncomment one of
// the two examples below to switch between software SPI and hardware SPI:

// Example creating a thermocouple instance with software SPI on any three
// digital IO pins.
#define MAXDO   3
#define MAXCS   4
#define MAXCLK  5

// initialize the Thermocouple
Adafruit_MAX31855 thermocouple(MAXCLK, MAXCS, MAXDO);

// Example creating a thermocouple instance with hardware SPI
// on a given CS pin.
//#define MAXCS   10
//Adafruit_MAX31855 thermocouple(MAXCS);

void setup() {
  while (!Serial); // wait for Serial on Leonardo/Zero, etc
  
  Serial.begin(9600);
  
  Serial.println("MAX31855 test");
  // wait for MAX chip to stabilize
  delay(500);
}

void loop() {
  // basic readout test, just print the current temp
   Serial.print("Internal Temp = ");
   Serial.println(thermocouple.readInternal());

   double c = thermocouple.readCelsius();
   if (isnan(c)) {
     Serial.println("Something wrong with thermocouple!");
   } else {
     Serial.print("C = "); 
     Serial.println(c);
   }
   //Serial.print("F = ");
   //Serial.println(thermocouple.readFarenheit());
 
   delay(1000);
}



음? 정상적으로 동작하지 않는군요.

혹시 몰라 MAX31855 의 전 버전인 MAX6675 라이브러리를 설치하고 sketch 를 실행시켜 봅니다.



음... 안되는군요.

뭐가 문제일까요?





5. 중국 공장의 나쁜 버릇


폭풍 검색을 해도 문제를 해결한 케이스를 볼 수 없다가,

우연히 Youtube 의 댓글에서 힌트를 찾았습니다.


MAX6675 와 MAX31855 breakout 보드의 차이점은 1번과 2번 pin 이 연결되어 있느냐 없느냐의 차이라고 합니다.



제가 구입한 MAX31855 breakout 보드의 1번과 2번을 보니 붙어 있네요.



위는 MAX6675 의 breakout board 의 layout 입니다.

1번과 2번이 연결되어 있네요.



MAX31855 의 breakout board 의 1번 / 2번 pin 은 서로 붙어있지 않습니다.



Adafruit 의 정식 판매용 MAX31855 breakout board 도 1번 / 2번 pin 도 떨어져 있습니다.



위의 사진은 중국 AliExpress 제품의 소개 사진입니다.

Chip 은 MAX31855 지만, breakout board 는 전압 regulator 도 없는 MAX6675 용 breakout board 와 비슷합니다.


즉, 중국 업자들은 기존 MAX6675 breakout board 에,

스펙이 비슷한 MAX31855 chip 을 얹은게 아닌가 하는게 internet 친구들의 예상입니다.


MAX31855 는 minus 온도까지 측정할 수 있는 등 upgrade 되었으나,

MAX6675 breakout board 를 사용하면서 기능 확장도 안되고, pinout spec. 에 맞지 않게 된거죠.


쉽게 말하면,

upgrade 제품이니까 맞겠지 하고 MAX6675 breakout board 에 MAX31855 를 얹으면서 정상작동하지 않는 것이였습니다.

(이거 팔아도 되는거야? 구매한 다른사람들은 어떻게 사용한거지?)



결국 위의 사진처럼 1번/2번 pin 사이의 연결을 완전히 긁어 내어 단락시키니 정상 작동하였습니다.

아놔....





6. K-Type +/- 단자 사이에 capacitor


해결점을 찾아서 정상 작동까지는 왔으나,

값이 널을 뛰어 안정적으로 측정하지 못했습니다.



위에서 보듯이 많은 사람들이 단자에 capacitor 를 사용했더랬습니다.


* Hardware | AliExpress 에서 Ceramic Condenser 를 구입해 보자

http://chocoball.tistory.com/entry/Hardware-AliExpress-Ceramic-Condenser-buying


뭘 하려면 여러가지가 구비되어야 하는군요.

다행이 ceramic capacitor (condenser) 가 있었습니다.



사용된 것은 10nF = 0.01uF 입니다.



Capacitor 를 연결하고서야 안정적으로 값을 확인할 수 있었습니다.





7. Pinout / Layout


Pinout 은 다음과 같습니다.


 MAX31855  | Arduino Micro
---------------------------
    Vin    |      5V
    GND    |      GND
    DO     |      D3
    CS     |      D4
    CLK    |      D5
---------------------------



구성도는 다음과 같습니다.



실제 사진입니다.






8. 결과


이제서야 제대로 측정이 되었습니다.

chip 자체적으로 Internal Temp 를 측정 가능한게 신시합니다.



여름 저녁이라 거실 실내 온도가 31도군요.

올해는 더워도 너무 덥습니다. 1994년도 5월에 입대하고 기초훈련 받던 때가 생각나네요.

그때도 이만큼 더웠던것 같습니다. 유격훈련 한번 하고 나면 동기들이 탈진해서 쓰러지곤 했더랬습니다.


우리 기수, 다른 중대 훈련병 중에 행군중 탈진으로 죽은 전우가 있어,

저의 다음 기수부터는 행군을 생략했다는 이야기를 들었습니다.

저의 행군 중에도, 옆에서 쓰러진 동기는 흰자위를 보이며 땅바닥에서 경련을 일으킬 정도로 극한의 날씨였습니다.



위는 K-type thermocouple 에 라이터 불로 온도를 높혔을 때를 동영상으로 찍어 봤습니다.



EXCEL 의 그래프 작업으로 internal / sensor 의 온도변화를 그래프로 표현해 봤습니다.

흠흠, 잘 변화를 감지했군요.





FIN


제대로 함정을 밟았지만, 잘 헤쳐나온것 같습니다.

Breakout board 는 되도록 reference (Adafruit / Sparkfun) 과 잘 비교해 본 다음, 문제가 없어보이면 구입하는게 좋을것 같습니다.


And