Jumat, 31 Mei 2019

cara membuat monitoring RTU Remote station berbasis IoT




Assalamu'alaikum

karena ada waktu kosong saat piket. saya lanjutkan share experimen ini.
experimen ini yaitu tentang bagaimana membuat monitoring status scada remote station berbasis IoT,
karena jamannya sudah industri 4.0.  jadi enggineer scada harus bisa memonitor peralatannya langsung dari handphone.  tidak perlu lagi menanyakan ke dispatcer.

aplikasi yang saya gunakan kali ini adalah Blynk. aplikasi ini langsung aja download di playstore.
aplikasi ini sangat mudah penggunaannya. tinggal drag and drop. kalo energy kurang bisa beli, atau membangun server sendiri.



material yang dibutuhkan:
1. arduino mega
2. ethernet shield
3. ttl to rs485
4. usb to rs485
5. kabel data arduino
6. kabel awg 18 merah dan hitam 1meter (untuk penghubung ttl to rs485 dengan usb to rs485)
7. router yang sudah ada koneksi internet
8. kabel lan secukupnya




langkah-langkah membuat monitoring status scada remote station:
1. membuat database uplink dari server scada menggunakan protocol modbus rtu. di kantor saya ini menggunakan software scada survalent.
2. mapping database di arduino dan upload (jangan lupa token saat membuat project blynk dimasukkan ke koding)
3. pasang ttl to rs485 dan ethernet shield pada arduino mega.
4. sambungkan usb to rs485 dengan ttl to rs485 menggunakan kabel awg 18.
5. tancapkan kabel lan ke router dan ethernet shield
6. membuat dashboard di aplikasi blynk di handphone
7. run



pada experiment ini gak hanya berupa tampilan aja. saat terjadi perubahan status failed aplikasi ini juga mengirimkan notifikasi di handphone. kayak whatsapp muncul gitu. selain itu juga kirim email.
notifikasi dan email ini bisa diaktifkan dengan memanfaatkan widget eventor


jadi saat notifikasi hilang. eventlog bisa kita cek di email.

sekian ilmu hasil experiment yang bisa saya share. semoga bermanfaat.


wassalam



Fuad Hasan
SIMOR

Kamis, 30 Mei 2019

cara integrasi vamp40 dengan modem robustel R-3000 L3P


share tentang cara integrasi modem robustel ke Vamp40. adapun yang dibutuhkan:

  • modem robustel
  • vamp40
  • kabel serial to serial bawaan modem
  • db9 male / gender male
  • solder
  • timah

1. kabel serial to serial (male to female) bawaan modem lepas db9 yang female. ganti db9 male. sambung kabel biru ke pin 7, kabel 2 dan 3 di switch (cross)
2. kali ini saya memanfaatkan 2 kabel serial to serial bawaan modem. saya potong.
3. jadi 2 kabel serial tadi diambil male aja. jadinya male to male
4. cara nyambungnya.
modem robustel (male)                                             vamp40 (male)
kuning------------------------------------------------------orange
orange------------------------------------------------------kuning
biru---------------------------------------------------------abu-abu



selamat berkarya

SIMOR
(Fuad Hasan)

Kamis, 23 Mei 2019

Integrasi vamp40 to scada



Assalamu'alaikum

puaks kali ini akan share bagaimana cara integrasi vamp40 to scada
yang pertama harus setting komunikasinya
adapun kabel setting vamp40 yang digunakan adalah
1. kabel usb to serial
2. serial to serial (PC female DB9 -------- vamp40 male DB9)
susunan kabel serial to serial:
PC ---------------vamp40
2-------------------3
3-------------------2
5-------------------5
6-------------------4 jumper 6



trus kabel yang digunakan untuk ke modem atau RTU

tx pin 2
rx pin 3
gnd pin 7 
sesuai gambar di atas.
port ini sangat berbeda dengan yang lainnya.


sekian share cara integrasi scada vamp40


wassalam
SIMOR

Rabu, 22 Mei 2019

Jumat, 17 Mei 2019

login dan logout windows pakai Id Card

Assalamu'alaikum

beberapa hari ini banyak posting tentang arduino + rfid + ektp buat login pc. tapi kali saya memanfaatkan idcard tempat saya bekerja untuk login dan logout windows.

langsung saja, kumpulkan material yang digunakan:
1. arduino pro micro
2. rfid RC522
3. id card yang ada chipnya. bisa pkai ektp atau emoney
4. kabel jumper
5. resistor 10k = 3 buah

wiring seperti dibawah ini:
sumber: https://create.arduino.cc/projecthub/kksjunior/windows-pc-lock-unlock-using-rfid-5021a6

wiring diatas saya modif dikit, 3,3v saya ganti vcc di pro micro





masukin library:
library

cek id number card dulu dengan upload sket dibawah ini:
#include <MFRC522.h>
#include <SPI.h>

#define SAD 10
#define RST 5

MFRC522 nfc(SAD, RST);

void setup() {
  SPI.begin();
  // Read a fast as possible. There is a limit for how long we are
  // allowed to read from the tags.
  Serial.begin(115200);

  Serial.println("Looking for MFRC522.");
  nfc.begin();

  // Get the firmware version of the RFID chip
  byte version = nfc.getFirmwareVersion();
  if (! version) {
    Serial.print("Didn't find MFRC522 board.");
    while(1); //halt
  }

  Serial.print("Found chip MFRC522 ");
  Serial.print("Firmware ver. 0x");
  Serial.print(version, HEX);
  Serial.println(".");
}

byte keyA[6] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, };
byte keyB[6] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, };

void loop() {
  byte status;
  byte data[MAX_LEN];
  byte serial[5];
  int i, j, pos;

  // Send a general request out into the aether. If there is a tag in
  // the area it will respond and the status will be MI_OK.
  status = nfc.requestTag(MF1_REQIDL, data);

  if (status == MI_OK) {
    Serial.println("Tag detected.");
    Serial.print("Type: ");
    Serial.print(data[0], HEX);
    Serial.print(", ");
    Serial.println(data[1], HEX);

    // calculate the anti-collision value for the currently detected
    // tag and write the serial into the data array.
    status = nfc.antiCollision(data);
    memcpy(serial, data, 5);

    Serial.println("The serial nb of the tag is:");
    for (i = 0; i < 3; i++) {
      Serial.print(serial[i], HEX);
      Serial.print(", ");
    }
    Serial.println(serial[3], HEX);

    // Select the tag that we want to talk to. If we don't do this the
    // chip does not know which tag it should talk if there should be
    // any other tags in the area..
    nfc.selectTag(serial);

    // Assuming that there are only 64 blocks of memory in this chip.
    for (i = 0; i < 64; i++) {
      // Try to authenticate each block first with the A key.
      status = nfc.authenticate(MF1_AUTHENT1A, i, keyA, serial);
      if (status == MI_OK) {
        Serial.print("Authenticated block nb. 0x");
        Serial.print(i, HEX);
        Serial.println(" with key A.");
        // Reading block i from the tag into data.
        status = nfc.readFromTag(i, data);
        if (status == MI_OK) {
          // If there was no error when reading; print all the hex
          // values in the data.
          for (j = 0; j < 15; j++) {
            Serial.print(data[j], HEX);
            Serial.print(", ");
          }
          Serial.println(data[15], HEX);
        } else {
          Serial.println("Read failed.");
        }
      } else {
        // If we could not authenticate with the A key, we will try
        // the B key.
        status = nfc.authenticate(MF1_AUTHENT1B, i, keyB, serial);
        if (status == MI_OK) {
          Serial.print("Authenticated block nb. 0x");
          Serial.print(i, HEX);
          Serial.println(" with key B.");
          status = nfc.readFromTag(i, data);
          if (status == MI_OK) {
            for (j = 0; j < 15; j++) {
              Serial.print(data[j], HEX);
              Serial.print(", ");
            }
            Serial.println(data[15], HEX);
          } else {
            Serial.println("Read failed.");
          }
        } else {
          Serial.print("Access denied at block nb. 0x");
          Serial.println(i, HEX);
        }
      }
    }

    // Stop the tag and get ready for reading a new tag.
    nfc.haltTag();
  }
  delay(2000);
}

setelah sukses upload, jalankan serial monitor baudrate 9600
tap id cardnya
akan muncul sperti bawah ini:
Tag detected.
Type: 4, 0
The serial nb of the tag is:
84, ED, DE, 1E
Authenticated block nb. 0x0 with key A.
84, ED, DE, 1E, A9, 8, 4, 0, 62, 63, 64, 65, 66, 67, 68, 69
Authenticated block nb. 0x1 with key A.
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Authenticated block nb. 0x2 with key A.
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Authenticated block nb. 0x3 with key A.
0, 0, 0, 0, 0, 0, FF, 7, 80, 69, FF, FF, FF, FF, FF, FF
Authenticated block nb. 0x4 with key A.
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Authenticated block nb. 0x5 with key A.
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Authenticated block nb. 0x6 with key A.
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Authenticated block nb. 0x7 with key A.
0, 0, 0, 0, 0, 0, FF, 7, 80, 69, FF, FF, FF, FF, FF, FF
Authenticated block nb. 0x8 with key A.
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Authenticated block nb. 0x9 with key A.
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Authenticated block nb. 0xA with key A.
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Authenticated block nb. 0xB with key A.
0, 0, 0, 0, 0, 0, FF, 7, 80, 69, FF, FF, FF, FF, FF, FF
Authenticated block nb. 0xC with key A.
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Authenticated block nb. 0xD with key A.
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Authenticated block nb. 0xE with key A.
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Authenticated block nb. 0xF with key A.
0, 0, 0, 0, 0, 0, FF, 7, 80, 69, FF, FF, FF, FF, FF, FF
Authenticated block nb. 0x10 with key A.
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Authenticated block nb. 0x11 with key A.
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Authenticated block nb. 0x12 with key A.
Read failed.
Access denied at block nb. 0x13
Access denied at block nb. 0x14
Access denied at block nb. 0x15
Access denied at block nb. 0x16
Access denied at block nb. 0x17
Access denied at block nb. 0x18
Access denied at block nb. 0x19
Access denied at block nb. 0x1A
Access denied at block nb. 0x1B
Access denied at block nb. 0x1C
Access denied at block nb. 0x1D
Access denied at block nb. 0x1E
Access denied at block nb. 0x1F
Access denied at block nb. 0x20
Access denied at block nb. 0x21
Access denied at block nb. 0x22
Access denied at block nb. 0x23
Access denied at block nb. 0x24
Access denied at block nb. 0x25
Access denied at block nb. 0x26
Access denied at block nb. 0x27
Access denied at block nb. 0x28
Access denied at block nb. 0x29
Access denied at block nb. 0x2A
Access denied at block nb. 0x2B
Access denied at block nb. 0x2C
Access denied at block nb. 0x2D
Access denied at block nb. 0x2E
Access denied at block nb. 0x2F
Access denied at block nb. 0x30
Access denied at block nb. 0x31
Access denied at block nb. 0x32
Access denied at block nb. 0x33
Access denied at block nb. 0x34
Access denied at block nb. 0x35
Access denied at block nb. 0x36
Access denied at block nb. 0x37
Access denied at block nb. 0x38
Access denied at block nb. 0x39
Access denied at block nb. 0x3A
Access denied at block nb. 0x3B
Access denied at block nb. 0x3C
Access denied at block nb. 0x3D
Access denied at block nb. 0x3E
Access denied at block nb. 0x3F


berarti idcard anda terdetek idnumbernya:
84, ED, DE, 1E

masukkan id number di atas di koding dibawah ini

source code:
sketch arduino


jangan lupa ganti id card







Selasa, 14 Mei 2019

modbus tcp esp8266

#include <ESP8266WiFi.h>
#include <ModbusTCPSlave.h>
#include <Ticker.h>
#include "EmonLib.h"                   // Include Emon Library
EnergyMonitor emon1;                   // Create an instance


//Settings IP Nodemcu
byte ip[]      = { 192, 168, 43, 187};
byte gateway[] = { 192, 168, 43, 1 };
byte subnet[]  = { 255, 255, 255, 0 };

ModbusTCPSlave Mb;
Ticker Stop;

const int ledPin =  4; 
const int inputPin =  12; 
//const int analogInPin = A0;


void monitoring() {
 double Irms = emon1.calcIrms(1480);

///Digital Inputs
Mb.MBHoldingRegister[0]=digitalRead(inputPin);

///Digital Outputs
digitalWrite(ledPin,Mb.MBHoldingRegister[1] );

////Analog Input
Mb.MBHoldingRegister[2] = Irms *100;//scaling 0.01
 
  }

void setup()
{
 emon1.current(0, 65.1); 
 pinMode(ledPin, OUTPUT);
 pinMode(inputPin, INPUT);
 Serial.begin(115200);
 Mb.begin("puaks.blogspot.com", "puakpipop", ip, gateway, subnet);
 delay(100);

}

void loop()
{
 
  Mb.Run();
 Stop.attach_ms(25,monitoring);
 
}

Uji sensor ultrasonic waterproof A01NYUB dengan ESP32

  apa itu sensor ultrasonic ?? Sensor jarak ultrasonik menentukan jarak ke target dengan mengukur selang waktu antara pengiriman dan penerim...