10. MAX6675 Thermocouple
ลักษณะโมดูล Max 6675 และสาย Thermocouple
รายละเอียดของขั้วต่อโมดูล MAX6675
ข้อควรระวังการต่อ
อย่าต่อสาย GND กับ VCC สลับกัน MAX6675 อาจเสียหายได้
ขั้วต่อ Thermocouple สีแดงต่อกับ T+ และสีน้ำเงินต่อกับ T-
ไลบรารี่ของ MAX6675 ดาวน์โหล์ได้จาก http://playground.arduino.cc/Main/MAX6675Library หรือจากด้านล่างของหน้าเว็บนี้
ซึ่งภายในจะมีตัวอย่างโปรแกรม การติดตั้งไลบรารี่และการเปิดตัวอย่างโปรแกรมดูได้จาก https://sites.google.com/site/eplearn/arduino-project/ds1820
การต่อวงจร
ตัวอย่างโปรแกรมจากไลบรารี MAX6675
// this example is public domain. enjoy!
// www.ladyada.net/learn/sensors/thermocouple
#include "max6675.h"
int thermoDO = 3;
int thermoCS = 4;
int thermoCLK = 5;
MAX6675 thermocouple(thermoCLK, thermoCS, thermoDO);
int vccPin = 3;
int gndPin = 2;
void setup() {
Serial.begin(9600);
// use Arduino pins
pinMode(vccPin, OUTPUT); digitalWrite(vccPin, HIGH);
pinMode(gndPin, OUTPUT); digitalWrite(gndPin, LOW);
Serial.println("MAX6675 test");
// wait for MAX chip to stabilize
delay(500);
}
void loop() {
// basic readout test, just print the current temp
Serial.print("C = ");
Serial.println(thermocouple.readCelsius());
Serial.print("F = ");
Serial.println(thermocouple.readFahrenheit());
delay(1000);
}
ลักษณะการต่อ
การเรียกใช้ Serial Monitor
การแสดงผล