Thermostat yaitu alat yang digunakan untuk mempertahankan suhu suatu benda atau ruangan sesuai dengan set point yang telah ditentukan. Suhu akan dibaca oleh sensor thermocouple yang bisa membaca suhu lebih dari 100°C dan hasilnya ditampilkan pada LCD. Sedangkan set point di seting dengan menggunakan 3 tombol. Heater/pemanas di kontrol ON/OFF-nya menggunakan relay yang terhubung dengan pin output Arduino.
Kebutuhan Hardware
- Sensor Thermocouple Tipe K
- Modul MAX6675
- Modul LCD 2x16
- Modul Relay 5Vdc
- Heater
- 3 Tombol Push ON
- Modul Arduino UNO
- Power supply +9Volt
Sensor Thermocouple Tipe K dan Driver MAX6675 | Source
Diagram Blok
Koneksi Arduino UNO dengan LCD
Koneksi Modul MAX6675
Koneksi Tombol
Koneksi Relay
Source Code/Sketch
#include <max6675.h>
#include <Wire.h>
#include <LiquidCrystal.h>
int DO = 8;
int CS = 9;
int CLK = 10;
MAX6675 themp(CLK, CS, DO);
int SET = 11;
int UP = 12;
int DOWN = 13;
int HEATER = A0;
LiquidCrystal lcd(2, 3, 4, 5, 6, 7);
byte derajat[8] = {140,146,146,140,128,128,128,128};
int adc,T,setPoint;
byte setSP, f_awal;
long lastButton = 0;
long delayAntiBouncing = 50;
void setup(){
pinMode(HEATER,OUTPUT);
pinMode(SET,INPUT);
pinMode(UP,INPUT);
pinMode(DOWN,INPUT);
digitalWrite(SET,HIGH);
digitalWrite(UP,HIGH);
digitalWrite(DOWN,HIGH);
lcd.createChar(0, derajat);
lcd.begin(16, 2);
lcd.print(" Thermostat ");
lcd.setCursor(0, 1);
lcd.print(" 0 C s/d 200 C");
lcd.setCursor(2,1);
lcd.write((byte)0);
lcd.setCursor(12,1);
lcd.write((byte)0);
delay(2000);
lcd.clear();
setPoint=100;
}
void loop(){
lcd.setCursor(0,0);
lcd.print("SP=");
lcd.print(setPoint);
lcd.write((byte)0);
lcd.print("C ");
T=themp.readCelsius();
lcd.setCursor(9, 0);
lcd.print("T=");
lcd.print(T);
lcd.write((byte)0);
lcd.print("C ");
if(T<(setPoint-1) || f_awal==0){
lcd.setCursor(0,1);
lcd.print("Heater ON ");
digitalWrite(HEATER,HIGH);
f_awal=1;
}
else if(T>=setPoint){
lcd.setCursor(0,1);
lcd.print("Heater OFF");
digitalWrite(HEATER,LOW);
}
tombol();
delay(1000);
}
void tombol(){
digitalWrite(SET,HIGH);
digitalWrite(UP,HIGH);
digitalWrite(DOWN,HIGH);
if(digitalRead(SET)==0){
lcd.clear();
lcd.print("Seting Set Point");
lcd.setCursor(9,0);
delay(1000);
lcd.clear();
setSP++;
//-----------------program looping seting set point
do{
if(digitalRead(SET)==0){
if ((millis() - lastButton) > delayAntiBouncing){
setSP++;
}
lastButton = millis();
}
else if(digitalRead(UP)==0){
if ((millis() - lastButton) > delayAntiBouncing){
setPoint++;
}
lastButton = millis();
}
else if(digitalRead(DOWN)==0){
if ((millis() - lastButton) > delayAntiBouncing){
if (setPoint>0){
setPoint--;
}
}
lastButton = millis();
}
lcd.setCursor(0,0);
lcd.print("SP=");
lcd.print(setPoint);
lcd.write((byte)0);
lcd.print("C ");
}
while (setSP<2);
setSP=0;
f_awal=0;
lcd.clear();
lcd.print("Set point OK!");
delay(1000);
lcd.clear();
}
}
#include <Wire.h>
#include <LiquidCrystal.h>
int DO = 8;
int CS = 9;
int CLK = 10;
MAX6675 themp(CLK, CS, DO);
int SET = 11;
int UP = 12;
int DOWN = 13;
int HEATER = A0;
LiquidCrystal lcd(2, 3, 4, 5, 6, 7);
byte derajat[8] = {140,146,146,140,128,128,128,128};
int adc,T,setPoint;
byte setSP, f_awal;
long lastButton = 0;
long delayAntiBouncing = 50;
void setup(){
pinMode(HEATER,OUTPUT);
pinMode(SET,INPUT);
pinMode(UP,INPUT);
pinMode(DOWN,INPUT);
digitalWrite(SET,HIGH);
digitalWrite(UP,HIGH);
digitalWrite(DOWN,HIGH);
lcd.createChar(0, derajat);
lcd.begin(16, 2);
lcd.print(" Thermostat ");
lcd.setCursor(0, 1);
lcd.print(" 0 C s/d 200 C");
lcd.setCursor(2,1);
lcd.write((byte)0);
lcd.setCursor(12,1);
lcd.write((byte)0);
delay(2000);
lcd.clear();
setPoint=100;
}
void loop(){
lcd.setCursor(0,0);
lcd.print("SP=");
lcd.print(setPoint);
lcd.write((byte)0);
lcd.print("C ");
T=themp.readCelsius();
lcd.setCursor(9, 0);
lcd.print("T=");
lcd.print(T);
lcd.write((byte)0);
lcd.print("C ");
if(T<(setPoint-1) || f_awal==0){
lcd.setCursor(0,1);
lcd.print("Heater ON ");
digitalWrite(HEATER,HIGH);
f_awal=1;
}
else if(T>=setPoint){
lcd.setCursor(0,1);
lcd.print("Heater OFF");
digitalWrite(HEATER,LOW);
}
tombol();
delay(1000);
}
void tombol(){
digitalWrite(SET,HIGH);
digitalWrite(UP,HIGH);
digitalWrite(DOWN,HIGH);
if(digitalRead(SET)==0){
lcd.clear();
lcd.print("Seting Set Point");
lcd.setCursor(9,0);
delay(1000);
lcd.clear();
setSP++;
//-----------------program looping seting set point
do{
if(digitalRead(SET)==0){
if ((millis() - lastButton) > delayAntiBouncing){
setSP++;
}
lastButton = millis();
}
else if(digitalRead(UP)==0){
if ((millis() - lastButton) > delayAntiBouncing){
setPoint++;
}
lastButton = millis();
}
else if(digitalRead(DOWN)==0){
if ((millis() - lastButton) > delayAntiBouncing){
if (setPoint>0){
setPoint--;
}
}
lastButton = millis();
}
lcd.setCursor(0,0);
lcd.print("SP=");
lcd.print(setPoint);
lcd.write((byte)0);
lcd.print("C ");
}
while (setSP<2);
setSP=0;
f_awal=0;
lcd.clear();
lcd.print("Set point OK!");
delay(1000);
lcd.clear();
}
}
Jalannya Alat
1. Koneksikan antara sistem Arduino dengan peripheral lain seperti pada rangkaian (skematik).
2. Pasang power supply (adaptor 5 V) dan hidupkan (colokkan ke sumber PLN 220V) sehingga
lampu LED indikator nyala, LCD juga akan menyala.
3. Upload program diatas.
4. Tampilan awal
6. Heater akan hidup/ON apabila suhu dibawah set point.
7. Heater OFF pada saat suhu sama dengan set point.
8. Heater akan menyala lagi setelah suhu berkurang 20C dibawah set point.
9. Seting setpoint dengan menekan tombol Set
10. Setelah 1 detik tampil Set point
11. Tekan tombol Up untuk menambah suhu set point atau tekan tombol Down untuk menguranginya.
12. Tekan tombol Set jika setingan sudah selesai.
Video untuk Project III - 10. Thermostat diatas 100 Derajat dengan 3 tombol berbasis Arduino
KONTAK KAMI 085743320570 (adi sanjaya)
Apakah 1 arduino UNO bisa buat 2 set pengukuran? (2 termocouple)
ReplyDeletesangat bisa gan.....
DeleteAda nmr yang bisa si hubungi mas
ReplyDeleteControlnya on off aja ya itu pake relay?
ReplyDelete