Jumat, 31 Agustus 2018

Wiring simor wemos


mySCADA for android (mymobile) with wemos d1 mini



cara menggunakan MySCADA versi android:
instal aplikasi myscada di Hp  (download di playstore)
instal software myDesigner
 run mydesaigner -> new project-> buat HMI -> project -> project -> download to device
run myscada di HP -> klik pojok atas -> pilihproject -> klik add


saat download project dari pc to hp posisi layar hp seperti di bawah ini




bila belum jelas bisa kontak : 081555305255

Rabu, 29 Agustus 2018

SIMOR WEMOS kontrol lampu

alat yang dibutuhkan:
  • wemos d1 mini
  • modul relay
  • supply 220 to 5v
  • switch hotel
library yang dibutuhkan:
modbusTCPslave

taruh library di folder libraries

sketch:

#include <ESP8266WiFi.h>
#include <ModbusTCPSlave.h>
#include <Ticker.h>

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

ModbusTCPSlave Mb;
Ticker Stop;


const int ledPin =  5; //D1



void monitoring() {


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


  }

void setup()
{
 pinMode(ledPin, OUTPUT);

 digitalWrite(ledPin, LOW);
 Serial.begin(115200);
 Mb.begin("SIMOR", "SIMOR2017", ip, gateway, subnet);
 delay(100);

}

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

setelah sukses upload,

instal aplikasi iPLC d hp android anda.


masukkan ip wemos tadi
masukkan addres kontrol (2) holding register, bit 0


Selasa, 07 Agustus 2018

simor for substation Gunung sari






monitoring beban dengan sensor arus non invasive

#include <SPI.h>
#include <Ethernet.h>

#include "Mudbus.h"

#include "EmonLib.h"                   // Include Emon Library
EnergyMonitor emon1;                   // Create an instance
EnergyMonitor emon2;
EnergyMonitor emon3;


Mudbus Mb;
//Function codes 1(read coils), 3(read registers), 5(write coil), 6(write register)
//signed int Mb.R[0 to 125] and bool Mb.C[0 to 128] MB_N_R MB_N_C
//Port 502 (defined in Mudbus.h) MB_PORT

void setup()
{
  uint8_t mac[]     = { 0x90, 0xA2, 0xDA, 0x00, 0x51, 0x06 };
  uint8_t ip[]      = { 192, 168, 0, 10 };
  uint8_t gateway[] = { 192, 168, 0, 254 };
  uint8_t subnet[]  = { 255, 255, 255, 0 };
  Ethernet.begin(mac, ip, gateway, subnet);
  //Avoid pins 4,10,11,12,13 when using ethernet shield
  emon1.current(0, 70);            
  emon2.current(1, 68);
  emon3.current(2, 68);
  delay(3000);
  Serial.begin(9600);
 
}

void loop()
{
  Mb.Run();
  double IrmsR = emon1.calcIrms(1480);  // Calculate Irms only
  double IrmsS = emon2.calcIrms(1480);
  double IrmsT = emon3.calcIrms(1480);
  int IR;
  int IRt;
  IR = IrmsR *80;
  if(IR<18){
    IRt = IR * 0;
  }
  else {
    IRt = IR * 1;
  }
 
  int IS;
  int ISt;
  IS = IrmsS *80;
   if(IS<18){
    ISt = IS * 0;
  }
  else {
    ISt = IS * 1;
  }
 
  int IT;
  int ITt;
  IT = IrmsT *80;
 
  if(IT<18){
    ITt = IT * 0;
  }
  else {
    ITt = IT * 1;
  }

  Mb.R[0] = IRt;
  Mb.R[1] = ISt;
  Mb.R[2] = ITt;
  Mb.R[3] = 87;
  Mb.R[4] = 7818;
 


}


Jumat, 03 Agustus 2018

membuat nodemcu sebagai AP

share artikel kali ini tentang koneksi modbus nodemcu, kondisi sebelumnya nodemcu modbus hanya sebagai slave aja koneksinya.
kali ini nodemcunya sebagai Acces point,

jadi ketika ingin koneksi dengan alat yang mau di monitor maupun di kontrol d modbusnya harus koneksi ke wifi dulu

kali ini bisa  konek langsung k alat tersebut
syaratnya:
segmen ip di nodemcu ketika sebagai AP 192.168.1.1
maka di nodemcunya harus sama 192.168,1,1

signal gsm sim800l

Value RSSI dBm Condition 2 -109 Marginal 3 -107 Marginal 4 -105 Marginal 5 -103 Marginal 6 -101 Marginal 7 -99 Marginal 8 -97 Marginal 9 -95...