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 <dht.h> #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); // 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);
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.Settings = "9600,N,8,1".DTREnable = True.RTSEnable = True.RThreshold = 2.SThreshold = 0.PortOpen = True End With 'set serial port yang ingin digunakan 'set baud rate,parity,databits,stopbits 'set DTR and RTS 'aktifkan event oncomm event 'non aktifkan event oncomm 'aktifkan serial port 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 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
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 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 Sub