Monday, June 6, 2011

running TA jilid satu


akhirnya bisa di-running nih projek akhir.
tujuan: mengeringkan pakaian
pakaian: low (sintetis dan sejenisnya), medium (combat dan sejenisnya), high (jeans, wol dan sejenisnya)
suhu pengeringan: 35 celcius (low), 40 celcuis (medium), 45 celcius (high)
dimensi alat: 60*60*165
waktu pengeringan: 1 sampai 2 jam
konsumsi daya ~ 370 watt
fitur: - termometer digital
- 3 mode pengeringan
- alarm notifikasi asumsi pakaian kering
- kaca untuk memantau kondisi pakaian
- mikrokontroller
- pengatur kecepatan blower

hasil running tes (belum sampai pada tahap pengeringan pakaian)





program
'*******************************************************************
$regfile = "m8def.dat"
$crystal = 11059200

'************************ INISIALISASI I/O ***************************

Config Portc = Input
Config Portd = Output
Config Pinb.0 = Output
Config Pinb.1 = Output
Config Pinb.2 = Output
Config Pinb.3 = Input
Config Pinb.4 = Input
Config Pinb.5 = Input
'************************ INISIALISASI LCD **************************
Config Lcd = 16 * 2
Config Lcdpin = Pin , Db4 = Portd.1 , Db5 = Portd.4 , Db6 = Portd.0 , Db7 = Portd.5 , E = Portd.3 , Rs = Portd.2
Cls
Cursor Off
Lcd "DC01"
Lowerline
Lcd "Pilih Mode"
'************************ SELEKTOR MODE *****************************
Mode1 Alias Pinb.3 'pengeringan dengan suhu 35 C
Mode2 Alias Pinb.4 'pengeringan dengan suhu 40 C
Mode3 Alias Pinb.5 'pengeringan dengan suhu 45 C
Heater Alias Pinb.0
Blower Alias Pinb.1
Beeper Alias Pinb.2
Dim Suhu As Word
Dim Suhu_1 As Word
Dim Suhu_2 As Word
Dim A As Integer
A = 7200


If Mode1 = 0 Then
Gosub Pemanas1
Elseif Mode2 = 0 Then
Gosub Pemanas2
Elseif Mode3 = 0 Then
Gosub Pemanas3
End If
Heater = 1
Blower = 1
Beeper = 1
Wait 10
Lcd "Finish"
Wait 1
End


'**************************** Pemanas1 **************************
Pemanas1:
Config Adc = Single , Prescaler = Auto
Start Adc


Do
Suhu_2 = Getadc(0)
Suhu_1 = Suhu_2 * 48
Suhu = Suhu_1 / 100
Gosub Tampilan1

If Suhu < 35 Then
Heater = 0 'heater ON
Blower = 0 'blower ON
Else
Heater = 1 'heater OFF
Blower = 1 'blower OFF
End If
A = A - 1
Loop Until A = 0




Return

Tampilan1:
Cls
Lcd "Low Mode " ; A ;
Lowerline
Lcd "Suhu= " ; Suhu
Lcd Chr(223)
Lcd "celcius"
Waitms 60
Return

'**************************** Pemanas2 **************************
Pemanas2:
Config Adc = Single , Prescaler = Auto
Start Adc



Do
Suhu_2 = Getadc(0)
Suhu_1 = Suhu_2 * 48
Suhu = Suhu_1 / 100
Gosub Tampilan2

If Suhu < 40 Then
Heater = 0
Blower = 0
Else
Heater = 1
Blower = 1
End If
A = A - 1
Loop Until A = 0

Return

Tampilan2:
Cls
Lcd "Medium Mode " ; A
Lowerline
Lcd "Suhu= " ; Suhu
Lcd Chr(223)
Lcd "celcius"
Waitms 60
Return

'**************************** Pemanas3 **************************
Pemanas3:
Config Adc = Single , Prescaler = Auto
Start Adc



Do
Suhu_2 = Getadc(0)
Suhu_1 = Suhu_2 * 48
Suhu = Suhu_1 / 100
Gosub Tampilan3

If Suhu < 45 Then
Heater = 0
Blower = 0
Else
Heater = 1
Blower = 1
End If
A = A - 1
Loop Until A = 0

Return

Tampilan3:
Cls
Lcd "High Mode " ; A
Lowerline
Lcd "Suhu= " ; Suhu
Lcd Chr(223)
Lcd "celcius"
Waitms 60
Return

No comments:

Post a Comment

komen?