Simulasi Autoclave Arduino
Pada kesempatan kali ini saya akan menjelaskan mengenai bagaimana cara membuat sebuah alat yang dapat melakukan sterilisasi benda berbasis panas, jadi seperti halnya autoclave yang dapat melakukan sterilisasi, alat ini merupakan simulasi dari autioclave yang terdapat beberapa modifikasi yaitu terdapat timer dan juga terdapat saluran untuk pembuangan udara panas. untuk lebih jelasnya berikut adalah skema dan kodingnya
a. Arduino
b. Sensor thermocouple tipe K
c. Solid state relay
d. Program Arduino IDE
#include <max6675.h>
#include <LiquidCrystal_I2C.h>
#include <Wire.h>
#include <Servo.h>
#include <DS3231.h>
LiquidCrystal_I2C lcd(0x27,16,2);
int thermoDO = 4; //bisa juga S0
int thermoCS = 5;
int thermoCLK = 6; //bisa juga SCK
int dataku;
MAX6675 thermocouple(thermoCLK, thermoCS, thermoDO);
int kipas = 2;
int solenoid = 3;
int heater = 7;
int fanac = 8;
int btset = 9;
int btup = 10;
int btdown = 12;
int btsetx;
int btupx;
int btdownx;
int sp = 110;
int mark;
Servo myservo;
DS3231 rtc(SDA, SCL);
Time t;
void setup() {
lcd.begin();
lcd.noCursor();
lcd.clear();
Serial.begin(9600);
myservo.attach(11);
myservo.write(100);
rtc.begin();
rtc.setDOW(FRIDAY); // Set Day-of-Week to SUNDAY
rtc.setTime(0, 0, 0); // Set the time to 12:00:00 (24hr format)
rtc.setDate(13, 5, 2022); // Set the date to January 1st, 2014
pinMode(btset,INPUT_PULLUP);
pinMode(btup,INPUT_PULLUP);
pinMode(btdown,INPUT_PULLUP);
pinMode(kipas,OUTPUT);
pinMode(solenoid,OUTPUT);
pinMode(heater,OUTPUT);
pinMode(fanac,OUTPUT);
digitalWrite(kipas,HIGH);
digitalWrite(solenoid,LOW);
digitalWrite(fanac,HIGH);
digitalWrite(heater,LOW);
delay(500);
}
void loop() {
dataku = thermocouple.readCelsius();
btsetx = digitalRead(btset);
btupx = digitalRead(btup);
btdownx = digitalRead(btdown);
if(btsetx == 0){
lcd.clear();
delay(2000);
setsuhu();
}
lcd.setCursor(0, 0);
lcd.print("SUHU= ");
lcd.print(dataku);
lcd.print(" ");
lcd.setCursor(0, 1);
lcd.print("SP= ");
lcd.print(sp);
lcd.print(" ");
if((dataku < sp)&&(mark == 1)){
digitalWrite(heater,HIGH);
}
if((dataku >= sp)&&(mark == 1)){
lcd.clear();
delay(2000);
rtc.setTime(0, 59, 0);
mulai();
pendinginan();
}
delay(200);
}
void pendinginan(){
myservo.write(150);
digitalWrite(kipas,LOW);
digitalWrite(fanac,HIGH);
digitalWrite(heater,LOW);
dataku = thermocouple.readCelsius();
lcd.setCursor(0, 0);
lcd.print("Pendinginan");
lcd.setCursor(0, 1);
lcd.print("Suhu= ");
lcd.print(dataku);
lcd.print(" ");
if(dataku < 30){
digitalWrite(solenoid,HIGH); //buka solenoid
lcd.clear();
delay(2000);
myservo.write(100);
digitalWrite(kipas,HIGH);
digitalWrite(fanac,HIGH);
digitalWrite(heater,LOW);
mark = 0;
return;
}
delay(200);
pendinginan();
}
void setsuhu(){
btsetx = digitalRead(btset);
btupx = digitalRead(btup);
btdownx = digitalRead(btdown);
lcd.setCursor(0, 0);
lcd.print("SET SP= ");
lcd.print(sp);
lcd.print(" ");
if(btupx == 0){
delay(200);
sp = sp + 10;
}
if(btdownx == 0){
delay(200);
sp = sp - 10;
}
if(sp > 130){
sp = 130;
}
if(sp < 110){
sp = 110;
}
if(btsetx == 0){
lcd.clear();
delay(2000);
mark = 1;
return;
}
setsuhu();
}
void mulai(){
digitalWrite(fanac,LOW);
t = rtc.getTime();
dataku = thermocouple.readCelsius();
btsetx = digitalRead(btset);
btupx = digitalRead(btup);
btdownx = digitalRead(btdown);
if(btsetx == 0){
lcd.clear();
delay(2000);
setsuhu();
}
lcd.setCursor(0, 0);
lcd.print("SUHU= ");
lcd.print(dataku);
lcd.print(" ");
lcd.setCursor(0, 1);
lcd.print("SP= ");
lcd.print(sp);
lcd.print(" ");
lcd.print(t.hour);
lcd.print(":");
lcd.print(t.min);
lcd.print(":");
lcd.print(t.sec);
lcd.print(" ");
if(dataku < sp){
digitalWrite(heater,HIGH);
}
if(dataku >= sp){
digitalWrite(heater,LOW);
}
if(t.hour == 1){
lcd.clear();
delay(1000);
return;
}
delay(200);
mulai();
}
e. VIDEO HASILNYA
No comments:
Post a Comment