BAB V KESIMPULAN DAN SARAN
5.2 Saran
1. Penggunaan sensor suhu yang ditempelkan pada benda hitam perlu dikembangkan lagi dengan menggunakan sensor suhu tipe lain, seperti termokepel.
2. Alat pengukur radiasi matahari akan lebih baik lagi hasil pengukurannya, jika dipasang alat yang dapat memutar sensor mengikuti gerak matahari. 3. Pengukuran radiasi matahari sebaiknya dilakukan setiap 15 menit dan
DAFTAR PUSTAKA
Agustinus Nalwan. 2004. Membuat Program Profesional Secara Cepat Dengan VB.PT. Elex Media Komputindo. Jakarta
Budianto Bregas dan C.Setiawan Arif. 2003. Komputer Untuk Pengamatan Cuaca dan Pengembangannya. Pelatihan Dosen. Departemen Geofisika dan Meteorologi IPB. Bogor.
Handoko, A. C. Setiawan dan B. Budianto. 1998. Otomatisasi Sistem Pengukuran Cuaca pada Stasiun Klimatologi untuk Menunjang Perencanaan Pertanian di Indonesia. Usul Penelitian. Lembaga Penelitian Institut Pertanian Bogor bekerja sama dengan Badan Penelitian dan Pengembangan Pertanian
Agricultural Research Management (ARM) Project. Bogor.
Hari Wibawanto.2008. Elektronika Dasar : Pengenalan PraktisPT. Elex Media Komputindo.Jakarta.
Ishadamy.1994.Otomatisasi Sistem Instrumentasi Meteorologi. Skripsi. Jurusan Geofisika dan Meteorologi FMIPA IPB, Bogor.
Manan, ME, Nursiwan, MA, dan Sudarsono. 1986. Alat Pengukur Cuaca di Stasiun Klimatologi. Institut Pertanian Bogor. Bogor.
Mike Tooley.2003. Rangkaian Elektronik Prinsip Dan Aplikasi Edisi Kedua. Erlangga. Jakarta.
Prasetia Retna. 2004.Interfacing Port Pararel dan Serial Komputer dengan Visual basic 6.0. PT. Elex Media Komputindo. Jakarta.
CODE PROGRAM
Form1 - 1
'Fungsi Explicit menggunakan lybrary yang telah tersedia Option Explicit
Private Declare Function joyGetDevCaps Lib "winmm.dll" Alias "joyGetDevCapsA" (ByVal id As Long, By
Val uSize As Long) As Long
Private Declare Function joyGetPos Lib "winmm.dll" (ByVal uJoyID As Long, pji As Sinyal) As Long
'Inisialiasi Sinyal Masukan Private Type Sinyal
wXpos As Long wYpos As Long wZpos As Long indikator As Long End Type
'Pengenalan Antarmuka USB Const antarmuka As Long = &H0 'Bagian pengakhir Program Dim WaktuBerakhir As Boolean 'pengaman Dim toggle1 Dim toggle2 Dim toggle3 Dim toggle4 Dim toggle5 Dim togelsave Dim ekstrim Dim matikan 'universal Dim FrekuensiAnalog 'unsur cuaca Dim suhuPutih Dim suhuHitam Dim Radiasi Dim selisihSuhu 'lama penyinaran Dim lama Dim lamamnt Dim lamajam Dim lamagraf Dim lamasave 'Counter Dim Csuhu Dim Crad
Dim grafsuhu(50) 'Dim grafRad(50) Dim grafRad(28) Dim SS, pos1a, pos2a Dim S, pos1, pos2 Dim GT, GRad Dim OYP&, OXP& 'Pengatur Tanggal dan Jam Dim menit As String Dim jam
Dim sev Dim bulan
Dim waktumin1 As Date Dim waktumin2 As Date Dim waktumin3 As Date Dim waktumin4 As Date Dim wktmin1 As Date Dim wktmin2 As Date Dim wktmin3 As Date Form1 - 2
Dim wktmin4 As Date Dim wktmin5 As Date Dim wktmin6 As Date Dim wktmin7 As Date Dim wktmin8 As Date Dim wktmin9 As Date Dim wktmin10 As Date Dim wktmin11 As Date Dim wktmin12 As Date 'pengaturan tabel Dim tbl
'pengaturan penyimpanan Dim tims1 As String Dim tims2 As String Dim tanggal As Date Dim anibaner As Integer
Dim J1, J2, J3, J4, J5, J6, J7, J8, J9, J10, J11, J12, J13, J14, J15, J16, J17, J18, J19, J20, J21,
J22, J23, J24 As String
'inti proses pengembalilan dan pengolahan data Private Sub Proses()
'menjalankan program inti On Error Resume Next
Dim sinyalmasukan As Sinyal Me.Show
DoEvents
'berhubungan dengan perangkat dengan antar muka usb joyGetPos antarmuka, sinyalmasukan
'===== PEMBACAAN DATA ======= '--- Suhu Referensi (Benda Warna Putih) If sinyalmasukan.indikator And 256 Then Shapea(0).Visible = True
Else
Shapea(0).Visible = False End If
If Shapea(0).Visible = True And toggle2 = 0 Then Csuhu = FrekuensiAnalog suhuPutih = ((2 ^ 14) / Csuhu) / 10 'txtputih.Text = Format(suhuPutih, "##.#") FrekuensiAnalog = 0 toggle2 = 1 End If
If Shapea(0).Visible = False Then toggle2 = 0
End If
'--- Suhu Plat Hitam
'If sinyalmasukan.indikator And 64 Then If sinyalmasukan.indikator And 64 Then Shapea(2).Visible = True
Else
Shapea(2).Visible = False End If
If Shapea(2).Visible = True And toggle4 = 0 Then Crad = FrekuensiAnalog
suhuHitam = (((2 ^ 14) / Crad) / 10) 'txthitam.Text = Format(suhuHitam, "##") selisihSuhu = suhuHitam - suhuPutih Radiasi = selisihSuhu * 34.2
If Radiasi > 1300 Then Radiasi = 1300 If Radiasi < 0 Then Radiasi = 0
'txtselisih.Text = Format(selisihSuhu, "##") Label2.Caption = Format(Radiasi, "000") Form1 - 3 FrekuensiAnalog = 0 toggle4 = 1 End If
If Shapea(2).Visible = False Then toggle4 = 0
End If
Loop Until WaktuBerakhir Quit:
DoEvents Unload Me End Sub
Private Sub Command2_Click() Frame1.Visible = False
End Sub
Private Sub Command3_Click() Frame1.Visible = True
End Sub
Private Sub Form_Load() 'cerah.Visible = True togelsave = 0
'Menampilkan Tanggal dan jam terkini Label5.Caption = Format(Now, "hh:mm:ss") Label6.Caption = Format(Now, "dd-MM-yyyy") Label7.Caption = Format(Now, "dddd") Frame1.Visible = False 'pembuatan tabel tbl = 1 With tabel1 .Rows = 24 .Cols = 4 .Row = 0:
.Col = 0: .Clip = "Tanggal": .ColWidth(0) = 1200 .Col = 1: .Clip = " Jam ": .ColWidth(1) = 1000 .Col = 2: .Clip = "Lama Hari": .ColWidth(2) = 1800 .Col = 3: .Clip = "Radiasi Matahari": .ColWidth(3) = 1900 End With
'eksekusi program Proses
End Sub
Private Sub Timer1_Timer()
FrekuensiAnalog = FrekuensiAnalog + 1 anibaner = anibaner + 1
If anibaner = 2 Then lblhead.ForeColor = vbRed If anibaner = 4 Then lblhead.ForeColor = &H80FF80 If anibaner = 6 Then lblhead.ForeColor = &HFF8080 If anibaner = 8 Then lblhead.ForeColor = &H80FF80 If anibaner = 8 Then anibaner = 0
Label5.Caption = Format(Now, "hh:mm:ss") Label6.Caption = Format(Now, "dd-MM-yyyy") Label7.Caption = Format(Now, "dddd")
'mematikan mesin 'J2 = Format(Now, "hh")
'matikan = Val(J2) 'If matikan > 18 Then
'If Label5.Caption = "18:30:00" Then Form1 - 4
'Shell "cmd.exe /k shutdown -s -t 01" 'End If
'If matikan < 6 Then
'If Label5.Caption = "18:30:00" Then 'Shell "cmd.exe /k shutdown -s -t 01" 'End If If Val(Label2.Caption) > 210 Then Timer3.Enabled = True cerah.Visible = True berawan.Visible = False End If If Val(Label2.Caption) < 210 Then Timer3.Enabled = False cerah.Visible = False berawan.Visible = True End If menit = Format(Now, "nn") 'menyimpan tiap 1 jam
If menit = "00" And togelsave = 0 Then On Error Resume Next
tims2 = Format(Now, "MMddyyyy")
Open "D:\DATA\" + tims2 + ".csv" For Append As #2
Write #2, Label6.Caption, Label5.Caption, Format(Radiasi, "000"), Format(lamasave, "00")
Close #2
'Grafik Lama Harila On Error Resume Next Picture1.Cls lamagraf = (lamasave * 100) / 60 grafRad(28) = lamagraf For SS = 2 To 28 grafRad(SS) = grafRad(SS + 2) 'pos1a = grafRad(SS - 2) 'pos2a = grafRad(SS)
Picture1.Line (((SS * 1.9) - 1.2), 0)-((SS * 1.9) + 1.2, grafRad(SS)), vbRed, BF 'picch.Line (((s * 2) - 1.5), 0)-((s * 2) + 1.5, &HFFFF&, BF
Next SS lamasave = 0
'pengaturan label waktu grafik lama hari 'waktu now
'waktu min-1
wktmin2 = DateAdd("h", -2, Time)
lbltm1(10).Caption = Format(wktmin2, "hh") & "-" & Format(wktmin1, "hh") 'waktu min-2
wktmin3 = DateAdd("h", -3, Time)
lbltm1(9).Caption = Format(wktmin3, "hh") & "-" & Format(wktmin2, "hh") 'waktu min-3
wktmin4 = DateAdd("h", -4, Time)
lbltm1(3).Caption = Format(wktmin4, "hh") & "-" & Format(wktmin3, "hh") 'waktu min-4
wktmin5 = DateAdd("h", -5, Time)
lbltm1(4).Caption = Format(wktmin5, "hh") & "-" & Format(wktmin4, "hh") 'waktu min-5
wktmin6 = DateAdd("h", -6, Time)
lbltm1(5).Caption = Format(wktmin6, "hh") & "-" & Format(wktmin5, "hh") 'waktu min-6
wktmin7 = DateAdd("h", -7, Time)
lbltm1(6).Caption = Format(wktmin7, "hh") & "-" & Format(wktmin6, "hh") Form1 - 5
'waktu min-7
wktmin8 = DateAdd("h", -8, Time)
lbltm1(7).Caption = Format(wktmin8, "hh") & "-" & Format(wktmin7, "hh") 'waktu min-8
wktmin9 = DateAdd("h", -9, Time)
lbltm1(8).Caption = Format(wktmin9, "hh") & "-" & Format(wktmin8, "hh") 'waktu min-9
wktmin10 = DateAdd("h", -10, Time)
lbltm1(12).Caption = Format(wktmin10, "hh") & "-" & Format(wktmin9, "hh") 'waktu min-10
wktmin11 = DateAdd("h", -11, Time)
lbltm1(13).Caption = Format(wktmin11, "hh") & "-" & Format(wktmin10, "hh") 'waktu min-11
wktmin12 = DateAdd("h", -12, Time)
lbltm1(14).Caption = Format(wktmin12, "hh") & "-" & Format(wktmin11, "hh") togelsave = 1 End If If menit <> "00" Then togelsave = 0 End If End Sub
Private Sub Form_Unload(Cancel As Integer) WaktuBerakhir = True
End End Sub
Private Sub Timer2_Timer() 'Grafik Suhu Udara
On Error Resume Next GT = Radiasi / 10 pict1.Cls grafsuhu(50) = GT For S = 2 To 50 grafsuhu(S) = grafsuhu(S + 2) pos1 = grafsuhu(S - 2) pos2 = grafsuhu(S)
pict1.Line ((S - 2) * 2, pos1)-((S) * 2, pos2), &HFF0000 Next S
'Menampilkan label Jam J1 = Now
'menulis data ke tabel tbl = tbl + 1
With tabel1 .Rows = tbl .Row = tbl - 1
.Col = 0: .Clip = Label6.Caption .Col = 1: .Clip = Label5.Caption .Col = 2: .Clip = lamasave
.Col = 3: .Clip = Format(Radiasi, "000") End With
If tbl = 25 Then tbl = 0 Form1 - 6
'penyimpanan data ke dalam hardisk On Error Resume Next
tims1 = Format(Now, "ddMMyyyy")
Open "c:\data\" + tims1 + ".csv" For Append As #1
Write #1, Label6.Caption, Label5.Caption, Format(suhuHitam, "##.#"), Format(suhuPutih, "##.#"), For
mat(selisihSuhu, "##.#") Close #1
'waktu - 1
waktumin1 = DateAdd("n", -3, Time)
lbltm1(0).Caption = Format(waktumin1, "hh:nn") 'waktu - 2
waktumin2 = DateAdd("n", -9, Time)
lbltm1(1).Caption = Format(waktumin2, "hh:nn") 'waktu - 3
waktumin3 = DateAdd("n", -15, Time)
lbltm1(2).Caption = Format(waktumin3, "hh:nn") 'waktu - 4
waktumin4 = DateAdd("n", -21, Time)
lbltm1(15).Caption = Format(waktumin4, "hh:nn") 'lamasave = 0
Private Sub Timer3_Timer() lama = lama + 1 Label12.Caption = Format(lama, "00") 'lamasave = lamasave + 1 If lama = 60 Then lamamnt = lamamnt + 1 lamasave = lamasave + 1 Label4.Caption = Format(lamamnt, "00") lama = 0 End If If lamamnt = 60 Then lamajam = lamajam + 1 Label3.Caption = Format(lamajam, "00") lamamnt = 0 End If End Sub