DAFTAR PUSTAKA [1.] Bengkel dan Laboratorium Elektronik PLN Pusat Pengatur Beban Sistem Tenaga Listrik Se Jawa da Bali ; “ Jaringan Informasi PLN – P2B “, Jakarta, 1990. [2.] http://arduino.cc, di akses pada tanggal 6 Oktober 2012 [3.] http://blog.famosastudio.com/2011/06/tutorial/tutorial-singkat-bahasapemrograman-arduino/82, di akses pada tanggal 6 Oktober 2012 [4.] http://www.geraicerdas.com/index.php?page=shop.product_details&flypag e=flypage_images.tpl&product_id=172&category_id=16&option=com_virt uemart&Itemid=30, di akses pada tanggal 13 Oktober 2012 [5.] http://marsyah.blogdetik.com/files/2009/04/diktat.pdf [6.] http://www.micropik.com/PDF/dht11.pdf [7.] http://www.programmingtutorials.com/tutorial.asp?id=vb [8.] http://famosastudio.com/download/datasheet/IComSatV1.2-Datasheet.pdf [9.] http://www.open-electronics.org/arduino/
LAMPIRAN
LAMPIRAN 1 LISTING PROGRAM SECARA KESELURUHAN PADA ARDUINO #include "EmonLib.h" Library EnergyMonitor emon1;
// Include Emon // Create an instance
#include
#define dht_dpin A0 //no ; here. Set equal to channel sensor is on dht DHT; #include "LiquidCrystal.h"; // Inisialisasi LCD dan menentukan pin yang dipakai LiquidCrystal lcd(12, 11, 5, 4, 3, 2); // deklarasi variabel float bacaTemperatur, nilaiTemperatur; float bacaAmpere, nilaiAmpere; float bacaTegangan, nilaiTegangan; int tempPin = 0; int AmpPin = 1; int TegPin = 2; void setup() { pinMode(13,OUTPUT); Serial.begin(9600); // Set jumlah kolom dan baris LCD emon1.current(1, 111.1); // Current: input pin, calibration. lcd.begin(16, 2); // Tulis Temperatur di LCD } void loop() { double Irms = emon1.calcIrms(1480); // Calculate Irms only //baca data dari dht11 DHT.read11(dht_dpin); // Set cursor ke kolom 0 dan baris 1 // Catatan: Baris dan kolom diawali dengan 0 // baca data dari sensor Suhu-LM35 Di PIN A0 bacaTemperatur = analogRead(tempPin); // konversi analog ke suhu nilaiTemperatur = (5.0 * bacaTemperatur * 100.0)/1024.0;
//baca sensor tegangan di PIN -2 bacaTegangan = analogRead(TegPin); // konversi analog ke tegangan nilaiTegangan = (5.0 * bacaTegangan * 80.0)/1024; lcd.clear(); lcd.setCursor(0,0); lcd.print("Tegangan :"); lcd.setCursor(11,1); lcd.print(nilaiTegangan); //lcd.setCursor(9,1); //lcd.print("60"); delay (2000); lcd.clear(); lcd.setCursor(0,0); lcd.print("Arus (A):"); lcd.setCursor(11,1); lcd.print(Irms); delay (2000); lcd.clear(); lcd.setCursor(0,0); lcd.print("Temperatur (C):"); lcd.setCursor(10,1); lcd.print(DHT.temperature); lcd.println((char)223); //lcd.clear (); delay (2000);
//kirim data Serial ARUS Serial.print("Arus (A): "); Serial.print( Irms); //kirim data Serial TEMPERATUR Serial.print(" Temperatur = "); Serial.print(DHT.temperature); Serial.print(" C "); //kirim data Serial TEGANGAN Serial.print(" Tegangan = "); Serial.print(nilaiTegangan); Serial.println ( " V"); delay(1000);
// Irms
LAMPIRAN 2 LISTING PROGRAM SECARA KESELURUHAN PADA VISUAL BASIC Private Sub Command1_Click() With MSComm1 'non aktifkan dulu serial port If .PortOpen Then .PortOpen = False
.CommPort = 1
'set serial port yang ingin digunakan
.Settings = "9600,N,8,1"
'set baud rate,parity,databits,stopbits
.DTREnable = True
'set DTR and RTS
.RTSEnable = True .RThreshold = 2
'aktifkan event oncomm event
.SThreshold = 0
'non aktifkan event oncomm
.PortOpen = True
'aktifkan serial port
End With
Label2.Caption = "V" Label4.Caption = "A" Label6.Caption = "°C"
End Sub
Private Sub Command2_Click() If MSComm1.PortOpen = True Then MSComm1.PortOpen = False Text1.Text = " " Label1.Caption = " " Label2.Caption = " " Label3.Caption = " " Label4.Caption = " " Label5.Caption = " "
Label6.Caption = " " Label7.Caption = " " Label8.Caption = " " Label9.Caption = " " End If End Sub
Private Sub MSComm1_OnComm() Dim strInput, strHsl() As String Dim strFilter() As String Dim I As Integer Dim hsl, temp, angka As String Dim arus, tegangan, suhu As Double Dim arus_, tegangan_, suhu_ As String
With MSComm1 Select Case .CommEvent Case comEvReceive strInput = .Input temp = temp + strInput End Select Text1.Text = Text1.Text & temp Text1.SelStart = Len(Text1.Text)
strHsl = Split((Text1.Text), vbCrLf) For I = 0 To UBound(strHsl) hsl = strHsl(I) Next
strFilter = Filter(strHsl, "V", True, vbTextCompare) For I = 0 To UBound(strFilter) arus_ = Mid(strFilter(I), 11, 5) suhu_ = Mid(strFilter(I), 29, 5) tegangan_ = Mid(strFilter(I), 50, 4) Next
Label5.Caption = suhu_ Label3.Caption = arus_ Label1.Caption = tegangan_
End With tegangan = Val(Label1.Caption) arus = Val(Label3.Caption) suhu = Val(Label5.Caption)
If tegangan < 200 Then Label7.Caption = " LOW VOLTAGE " Label7.ForeColor = vbRed Label1.ForeColor = vbRed Else If tegangan < 239 Then Label7.Caption = " VOLTAGE OK " Label7.ForeColor = vbGreen Label1.ForeColor = vbGreen Else If tegangan >= 240 Then Label7.Caption = " HIGH VOLTAGE " Label7.ForeColor = vbRed Label1.ForeColor = vbRed
End If
If arus > 3 Then Label8.Caption = " OVER CURRENT " Label8.ForeColor = vbRed Label3.ForeColor = vbRed Else If arus <= 2 Then Label8.Caption = " CURRENT OK " Label8.ForeColor = vbGreen Label5.ForeColor = vbGreen End If
If suhu > 40 Then Label9.Caption = " HIGH TEMPERATURE " Label9.ForeColor = vbRed Label5.ForeColor = vbRed Else If suhu <= 39 Then Label9.Caption = " TEMPERATURE OK " Label5.ForeColor = vbGreen End If
End If End If End If End If
End Sub