Pages

Monday 17 June 2019

Automated Machine Fault Alerting System



The prime functionality of alerting system is monitoring and quick detection of issues. Downtime is one of the dreaded terms and it occurs when the system is subjected to partial or full loss of availability thereby resulting in a loss. Loss could be in any form, revenue, time, output.
A comprehensive monitoring system that allows timely identification of issues proves to be indispensable. Also, it is important that a monitoring system allows operators to drill down from high level to granular level information so that those specific points can be used for root cause analysis
  1. Step 1 , Copy the code and configure the parameter as required by you 



Step 2 - Execute the code

sample SMS Alert Code for your Reference
  
/*
Pin Mapping :
* PLC output1 ---------> Indino IN0
* PLC output2 ---------> Indino IN1
* PLC output3 ---------> Indino IN2
* PLC output4 ---------> Indino IN3
*/
#include <IndinoDI.h>  
char number[]= "94xxxxxxxx"; //Number to which message to be sent
char message1[]= "Zone 1 temperature is High,required attention"; //Alert Message1
char message2[]= "Pressure level dropped below the average,need attention"; //Alert Message2
char message3[]= "Oil level low,need attention "; //Alert Message3
char flag1=0;
char flag2=0;
char flag3=0;
const int SensorPin_1= 33; //The number of the Sensor pin 1
const int SensorPin_2= 34; //The number of the Sensor pin 2
const int SensorPin_3= 35; //The number of the Sensor pin 3
const int ResetPin= 32; //The number of the ResetPin  
void setup()
{  
/*   initialisation IO as an input:     */
pinMode(SensorPin_1,INPUT); 
pinMode(SensorPin_2,INPUT); 
pinMode(SensorPin_3,INPUT); 
pinMode(ResetPin,INPUT); 
Serial.begin(9600);
}
void loop()
{
if (digitalRead(SensorPin_1)==HIGH) //Check for alert input high
{
if(flag1==0) //Send the message only if flag is reset
{
Indino_GSM_Send_SMS(number, message1); //Command to send SMS
Serial.print(message1);
flag1=1; //Flag set to send the message  
delay(5000); //Delay call 5sec to send message only once
}
}
if (digitalRead(SensorPin_2)==HIGH) sample SMS Alert Code for your Reference
{
if(flag2==0) 
{
Indino_GSM_Send_SMS(number, message2); 
Serial.print(message2);
flag2=1;
delay(5000);
}
}
if (digitalRead(SensorPin_3)==HIGH)
{  
if(flag3==0)
{
Indino_GSM_Send_SMS(number, message3);
Serial.print(message3);
flag3=1;
delay(5000);
}
}
if (digitalRead(ResetPin)==HIGH) //Check for Reset to reset the device
{
flag1=0;  
flag2=0;  
flag3=0; 
}
}

Accessing VFD through MODBUS and updating clouds Via MQTT GPRS

Accessing VFD through MODBUS and updating clouds  Via MQTT GPRS
Accessing VFD through MODBUS and updating clouds Via MQTT GPRS

   Functional Block Diagram


   Step 1 Make the connection as shown in the above diagram

   Step 2 copy the code and change the required parameter.


  Step 3 Execute code  
  Step 4  watch the expected result at Cloud MQTT server.



     Test Setup 


Accessing VFD through MODBUS and updating clouds  Via MQTT GPRS code for your reference 
#include <IndinoDI.h>  // Indino Library 
/*     Cloud initialisation      */
char data1[20];
char* host = "m16.cloudmqtt.com";
//char* host = "52.3.184.147";
char* port = "16997";
char* username = "eoszmzsz";
char* password = "at1yeUD1pERj";
char* topic = "VFD";
char *APN = "www"; //bsnl
/*    Modbus initialisation       */
uint8_t funCode = 0x04; //Read holding register
uint8_t slave_id = 1; //Set the slave id
uint16_t start_addr = 16130; //Address to read frequency of the VFD    
uint16_t len = 2; //Datatype is 32-bit Float for MFR 2810
uint16_t data[2] = {0};
uint8_t freq_hex_bytes[4] = {0};
float frequency = 0;
uint32_t VALUE;
void setup()
{
Serial.begin(9600);
Serial3.begin(9600);
Indino_Modbus_Master_Init(); //Modbus initialisation
delay(2000);
pinMode(41, OUTPUT);
delay(2000);
Serial.println("Start..");
power_on(APN); //Switch on the modem
delay(1000);
}
/* Main Loop */
void loop()
{
start_addr=start_addr-1;
Indino_Modbus_Master_Read_Raw(funCode, slave_id, start_addr, len, data); //Modbus reading
Serial.print(data[0]);
Serial.println(" Hz");
sprintf(data1,"Frequency=%iHz",data[0]);
Indino_GPRS_Upload_MQTT(data1, APN, host, port, username, password, topic); //Uploading data to cloud using MQTT
delay(3000); // Delay
}

Modbus Energy Meter Reading using GPRS MQTT Protocol - Indino 4.0


Energy meters with an integrated Serial RS485 Modbus interface allow direct reading of all relevant data, such as energy , current and voltage , frequency and form factor for every phase and active and reactive power for every phase and for the three phases


step 1- Select the required parameter and register address of the modbus energy Meter as shown in the below given image .


Step 2- Copy the code and change the required parameter 

Step 3 - Execute the code 

Step 4 Watch the expected result at cloud MQQT Server








Test Setup

/*
* The example file shows making a phone call
*  
* Pin Connection :  
*  
*/
#include <IndinoDI.h>  
String data1;
/*    Cloud initialisation         */
char* host = "m16.cloudmqtt.com";
//char* host = "52.3.184.147";
char* port = "16997";
char* username = "eoszmzsz";
char* password = "at1yeUD1pERj";
char* topic = "meter";
char *APN = "INTERNET"; //Vodafone
uint8_t funCode = 0x04; //Read holding register
uint8_t slave_id = 1;
uint16_t start_addr = 3854; //Address to read frequency=3854
uint16_t start_addr1 = 3850; //Line to Neutral Voltage=3850
uint16_t start_addr2 = 3846; //Avg PF=3846
uint16_t len = 2; //Datatype is 32-bit Float for MFR 2810
uint16_t data[2] = {0};
uint8_t freq_hex_bytes[4] = {0};
float frequency = 0;
float voltage = 0;
float power = 0;
uint32_t VALUE;
char data2[80];
void setup()
{
Serial.begin(9600);
Serial3.begin(9600);
Indino_Modbus_Master_Init();
delay(2000);
pinMode(41, OUTPUT);
delay(2000);
Serial.println("Start..");
power_on(APN);
delay(1000);
}
void loop()
{
Indino_Modbus_Master_Read_Raw(funCode, slave_id, start_addr, len, data);
/*     place register values in byte array, lsb in position 0      */
freq_hex_bytes[3] = (data[1] & 0xFF00) >> 8;  
freq_hex_bytes[2] = (data[1] & 0x00FF);
freq_hex_bytes[1] = (data[0] & 0xFF00) >> 8;  
freq_hex_bytes[0] = (data[0] & 0x00FF);
/*    Convert to Float         */
memcpy(&frequency, freq_hex_bytes , 4);
Serial.print("Frequency =");
Serial.print(frequency,2);
Serial.println(" Hz");
delay(300);
Indino_Modbus_Master_Read_Raw(funCode, slave_id, start_addr1, len, data);
/*    place register values in byte array, lsb in position 0        */
freq_hex_bytes[3] = (data[1] & 0xFF00) >> 8;  
freq_hex_bytes[2] = (data[1] & 0x00FF);
freq_hex_bytes[1] = (data[0] & 0xFF00) >> 8;  
freq_hex_bytes[0] = (data[0] & 0x00FF);
/*      Convert to Float          */
memcpy(&voltage, freq_hex_bytes , 4);
Serial.print("Line to Neutral Voltage =");
Serial.print(voltage,2);
Serial.println(" volts");
delay(300);
Indino_Modbus_Master_Read_Raw(funCode, slave_id, start_addr2, len, data);
/*     place register values in byte array, lsb in position 0      */
freq_hex_bytes[3] = (data[1] & 0xFF00) >> 8;  
freq_hex_bytes[2] = (data[1] & 0x00FF);
freq_hex_bytes[1] = (data[0] & 0xFF00) >> 8;  
freq_hex_bytes[0] = (data[0] & 0x00FF);
/*     Convert to Float         */
memcpy(&power, freq_hex_bytes , 4);
Serial.print("Power factor =");
Serial.print(power,2);
Serial.println(" PF");
data1 ="Frequency=";
data1 +=frequency;
data1 +=",Voltage=";
data1 +=voltage;
data1 +=",Powerfactor=";
data1 +=power;
for(int i=0;i<data1.length();i++)
data2[i]=data1[i];
Serial.println(data2);
Indino_GPRS_Upload_MQTT(data2, APN, host, port, username, password, topic);
delay(3000);
}

For more details visit www.rdltech.in