Smart Energy Meter Monitoring System (S.E.M.MS)

Introduction

          Nowadays, energy management is one of most important things in today’s technology. A lot of people tend to work faster to get optimum results upon their career. We are doing project based on UTM Energy Management problem. From interview and all the questionnaire, we have decided on what project should we propose to fulfill end user requirement. We are proposing a device called ‘Smart Energy Meter Monitoring System’ (S.E.M.M.S). This device will monitor energy meter reading remotely.

          In term of Social aspect, system can still operate which mean it can provide real time data even the admin is busy working and data will be recorded in the application.

          Then, for Technology aspect, the use of NodeMCU as microcontroller and IoT device provide useful technology in our product. This can be deduced that the microcontroller can connect through internet via Wi-Fi and send the data to cloud database.

         Moreover, in Economy aspect, our S.E.M.M.S device can reduce manpower and also affordable with optimum outcomes. This is because firstly, our device can operate remotely without any meter readers. It also cost efficient as it is small in price and using cheap but quality materials.

        Furthermore, for Environment aspect, our project product is compact in size and adjustable to different types of meters. Meters come in any types of sizes and body. Our sensors enclosure can easily mount to any surface of meters based on its specifications. Lastly, in term of Political aspect, our system is absolutely legal to use and bring no harm to society.

 

Conceiving

          During our interview with Engineer at PHB (‘Pejabat Harta Bina’), most common problem occurs in UTM Skudai is about meter reading. As far as we know, TNB (‘Tenaga Nasional Berhad’) our energy provider, will charge us for energy mothly usage. So, PHB will need to take reading monthly around UTM for about up to 1000 meters at one time. But only approximately 700 meters to be taken as 1000 meters will take forever. We also distribute questionnaire to meter readers as to know what is the main problem regarding this conventional meter reading method.

          Based on the interview with an electrical engineer from PHB UTM, he said that all of the meters in UTM will be organize by meter readers with their assigned zone and they will record the reading in their phone. Besides, all of the energy meter installed in UTM have LED pulse which mean the LED pulse act as energy consumption in that region. All of the data can access by admin and they will monitor the data pattern according to the monthly usage in that specific building.

          The design is based on a device that can monitor power consumption and can be placed strategically and easily seen while being able to have access to the internet under a simple cost-effective design.

Implementing

NodeMCU

          NodeMCU is an open source IoT platform. It includes firmware which runs on the ESP8266 Wi-Fi SoC from Espressif Systems, and hardware which is based on the ESP-12 module.The term "NodeMCU" by default refers to the firmware rather than the development kits. The firmware uses the Lua scripting language. It is based on the eLua project, and built on the Espressif Non-OS SDK for ESP8266. It uses many open source projects, such as lua-cjson and SPIFFS.

Picture8.png

Figure 3: ModeMCU 

LDR Module

          The Light sensor module come with the basic components for light detection. It is used to detect the light intensity in the environment and provide and output of HIGH or LOW depending on the programming. It can also be used to adjust the brightness of an LED as well. This is done by adjusting the threshold (sensitivity) of digital output by tuning the on board variable resistor (potentiometer). Simple usage as it is digital output, so you will know is the light is present and decide what to do with it. It is installed with a M3 mounting hole for ease of attachment to any object. On board it provides a LDR of high sensitivity and commonly being used for light detection. The module comes with power LED and status LED as indicator. It can be interfaced with any microcontroller with digital input such as PICSK40CSK28ASKds40AArduino series for light brightness detection.

Picture9.png

Figure 4: LDR Module

Grafana

          Grafana is an open source metric analytics & visualization suite. It is most commonly used for visualizing time series data for infrastructure and application analytics but many use it in other domains including industrial sensors, home automation, weather, and process control. This is the software chosen by authors to collect data on the prototype.

Picture10.png

Figure 5: Grafana interface

 

 

 

 

Operating

          As mention earlier, this product aims to monitor and display the consumer’s energy used. The main advantage is it use IoT applications whereas this device can work remotely and it has simple control. It sent and store all of the data to the server through Wi-Fi and will be presented via user’s interface for further analysis. This chapter will explain about the working principle of the device which are currently divided into two part, installation and calibration.

          For installation process, the device has two unit which are sensor unit and controller unit. Sensor unit consist of LDR sensor used to detect light pulse from the energy meter while controller unit consists of microcontroller, LED and several switches. The controller unit is specified for DIN rail installation so it would be a universal design and can be installed anywhere within the distribution box.

Picture11.png

Figure 6: Mounted sensor unit on an energy meter

Picture12.png

Figure 7: Actual controller unit mounted on DIN rail

LED indicator

  • If LED is blue in colour, the device is in calibration mode.
  • If the LED’s colour is green, the device is in normal mode and connected to Wi-Fi.
  • If the LED’s colour is red, the device is in normal mode but not connected to the Wi-Fi.

 

          For calibration mode, this is to ensure that the device can working well with optimum performance. This process including the sensor calibration to make sure it can work perfectly with good sensitivity. The calibration also needed to be carry out during daylight with high light intensity (under sunlight or directly exposed with light). It is to make sure the sensor will work normally so the system will not affect. 

          The user’s interface used in this project is called Grafana. It can display the data stored from the server for user analysis. The interface is simple and easy to understand. It can show the daily usage of the energy consumption, different energy meter reading and total for all of the energy meters integrated with this system.

Picture13.png

Figure 8: The user interface used in this project

 

 

Designing

          Based on the proposed conceptual solution which is in Figure 1, we need to come out a device that can captured the led pulses on meter that are commonly used for PHB in UTM Skudai. We come out with a small device that can fit into distribution box and can transmit data captured wirelessly without having any man power to take the meter reading. As for conceptual prototype in Figure 2, the product is quite good in operations and the data transmission but there is a little problem. The enclosure seems cannot fit enough the box that we build so we come out with another final product that actually fit and compact.

                Picture1.png

Figure 1: Concept sketch

Picture2.png

Figure 2: Conceptual prototype

Aspect

Discussion

Sociological

·       System can still operate which mean it can provide real time data even the admin is busy working and data will be recorder in the application.

Technological

·       Use of NodeMCU as microcontroller and IoT device provide useful technology in our product.

Economic

·       Our S.E.M.M.S device can reduce manpower and also affordable with optimum outcomes.

Environmental

·       Our sensor enclosure and NodeMCU enclosure can easily mount to any surface of meters based on its specifications.

Political

·       Our system is absolutely legal to use and bring no harm to society.

Details on STEEP analysis

          In terms of mechanical design, listed below is the design specification for the casing which would be 3D printed later on. The electronic components consist of the NodeMCU microcontroller and the Light Dependent Resistor (LDR). The microcontroller serves to transmit data over Wi-Fi while the sensor serves to detect the pulses generated from the Light Emitting Diode (LED) of the existing power meters. The user interface utilized for this project is known as Grafana, a freeware application that can be used for graphically displaying information catered to our needs.

Picture7.png

Flow chart for this project

          Based on our Bill of Materials (BOM) the pricing accumulated to RM60 which is attached in the Appendix. The total costing is cheaper than the overall budget as it only comprises of the casing and the crucial components such as the NodeMCU and the Light Dependent Resistor (LDR), while the rest of the costing that added up to RM300 was due to the demonstration essentials such as the board, the distribution board and others.

Result and Analysis

          As stated, before in the STEEP analysis, all given attributes were taken into consideration pre prototyping of the project. Safety of the users were at highest priority and the ease of access of data acquisition as well. With the implementation of thee User Interface Grafana, users can access the data from any compatible device at any time of their choosing so long as the SEMMS prototypes were receiving and transmitting data through internet connection. The use of LDR sensor is to act as a middle gate between the controller and the installed pulse from the distribution board, this serves as a cost effective alternative than the ones already available in the industry.

          The advantages of this prototype is that it addresses the problem at hand methodologically. In a sense, the benefits presented were that it provided ease of data collection through the implementation of IOT in the devices. Hence, end users can access the data from a cloud server. Another benefit is that the devices now can cover a large area with the help of the NodeMCU installed as well. Finally, the lack of manpower can be addressed as it does not require an individual with a specific technical curve to implement this concept. With the manual instructions provided a simple inspection can reduce the time taken to acquire data from the physical location at half the required time than before.

Conclusion

          In conclusion the prototype functioned as according to specifications. All objectives were satisfied in tandem to the design statement. The prototype was able to be seen visibly from a distance, can be placed as a universal design, able to transmit data over Wi-Fi, can be monitored on compatible devices and provide less effort for meter readers. For future projects, the prototype could be integrated with a server that can store the details of power consumption through the use of the existing QR codes that we have placed on each meter. The design can also be made to be as approximate to a universal design for easy installation on any meters in the future.

Appendix

GANTT Chart for this project

gantt chart capstone.PNG.1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Bill of Material (BOM)

bom capstone.PNG

3D printing sketch for controller unit

Picture3.png

Front view of the controller unit

Picture4.png

Bottom view of the controller unit

Picture5.png

Top view of the controller unit

Picture6.png

Side view of the controller unit

Programming code

 

//////////////////Set up DEVICE semms02 configuration///////////////////////

 

const char* ssid          = "User_X";   //Wifi ssid

const char* password      = "SEMMS_trial";  //Wifi Password

String      DEVICE        = "semms02";       //Device Name

String      ZONE          = "SKE";           //Zone Name

String      BUILDING      = "P19a";          //Building Name

long        PULSE         = 1000;             //Energy Meter pulse rate imp/KWh

//const char  *host = "http://165.22.251.4:8086/write?db=SEMMS"; //IP database

 

/////////////////////////////////////////////////////////////////////////////

 

#include <ESP8266WiFi.h>

//#include <ESP8266HTTPClient.h>

 

#include <WiFiUdp.h>

IPAddress ip(165,22,251,4);

const int port = 8086;

 

int lasthigh = 0;

int lastval = 0;

int pin_switch = D1;

int MODE;

int CurrentState_Sensor = 0;

int LastState_Sensor = 0;

 

void setup()

{

  pinMode(D2, OUTPUT);   

  pinMode(D5, OUTPUT);  

  pinMode(D0, OUTPUT);  

  pinMode(D3, OUTPUT);  

  pinMode(pin_switch, INPUT);  

  pinMode(D4, INPUT);

  Serial.begin(115200);

}

 

void loop()

{

  MODE = digitalRead(pin_switch);

  if(MODE==HIGH)

  {

      //Serial.println("Normal Mode");

      NormalMODE();

  }

  else if(MODE==LOW)

  {

      //Serial.println("Setting Mode");

      SettingMODE();

  }

    

   delay(10);

}

 

void NormalMODE()

{

  WifiConnect();

  CurrentState_Sensor = digitalRead(D4);

 

   if(CurrentState_Sensor!=LastState_Sensor)

   {

    if(CurrentState_Sensor==HIGH)

    {

      Serial.println("1");

      digitalWrite(D2,LOW);

      SEND_DATA_UDP();

    }

    else

      digitalWrite(D2, HIGH);

   }

   LastState_Sensor=CurrentState_Sensor;

}

 

void SettingMODE()

{

  digitalWrite(D0, HIGH);

  digitalWrite(D5, HIGH);

  digitalWrite(D3,LOW);

 

  int Sensor = digitalRead(D4);

 

  if(Sensor==HIGH)

    {

      digitalWrite(D2, LOW);Serial.println('1');

    }

   else

      digitalWrite(D2, HIGH);Serial.println('0');

}

 

void WifiConnect()

{

  if(WiFi.status() == WL_CONNECTED)

  {

    digitalWrite(D0, HIGH);   //led indicator turn GREEN when Wifi CONNECT

    digitalWrite(D5, LOW);

    return;

  }

 

 

  delay(10);

  Serial.println('\n');

 

  WiFi.begin(ssid, password);             // Connect to the network

  Serial.print("Connecting to ");

  Serial.print(ssid); Serial.println(" ...");

 

  int i = 0;

  while (WiFi.status() != WL_CONNECTED) { // Wait for the Wi-Fi to connect

    delay(1000);

    Serial.print(++i); Serial.print(' ');

  }

 

  Serial.println('\n');

  Serial.println("Connection established!"); 

  Serial.print("IP address:\t");

  Serial.println(WiFi.localIP());         // Send the IP address of the ESP8266 to the computer

 

/*

  int count = 0;

 

  WiFi.mode(WIFI_OFF);        //Prevents reconnection issue (taking too long to connect)

  delay(1000);

  WiFi.mode(WIFI_STA);        //This line hides the viewing of ESP as wifi hotspot

  WiFi.begin(ssid, password);

 

  Serial.println("Reconnecting to wifi");

 

  while (WiFi.status() != WL_CONNECTED) {

    digitalWrite(D5, HIGH);   //led indicator turn RED when Wifi NOT CONNECT

    digitalWrite(D0, LOW);

    delay(500);

    count++;

    if(count>10){

      Serial.println("tried 10 times to connect.. restarting");

      WiFi.disconnect();

      ESP.restart();

      return;

    }

  }

  Serial.println("");

  Serial.println("WiFi connected");

  Serial.println(WiFi.localIP());

  delay(500); */

}

 

 

/*//HTTP data SEND

void SEND_DATA()

{

   WifiConnect();

   HTTPClient http;    //Declare object of class HTTPClient 

   //Post Data

   String postData = "pulse,DEVICE=" + DEVICE + ",energy=count value=" + value*X_PULSE; 

   http.begin("http://165.22.251.4:8086/write?db=SEMMS");              //Specify request destination

   http.addHeader("Content-Type", "application/json");

   //Specify content-type header

   int httpCode = http.POST(postData);   //Send the request

   String payload = http.getString();    //Get the response payload

   Serial.println(httpCode);   //Print HTTP return code

   Serial.println(payload);    //Print request response payload

   http.end();  //Close connection

 

   value = 0;

}*/

 

//udp data

void SEND_DATA_UDP(){

  //---------------SENDING TO CLOUD !-----------

     

      WifiConnect();

      WiFiUDP Udp;

     

      int packetSize = Udp.parsePacket(); 

      char ReplyBuffer[100];

  

      String postData = "pulse,DEVICE=" + DEVICE + ",ZONE=" + ZONE + ",BUILDING=" + BUILDING + " value=" + 1000.0/PULSE;

     

      postData.toCharArray(ReplyBuffer, 100);

    

      //Serial.println();

      //Serial.println("This is cloud string :" + String(cloud_command_ec));

      //Serial.println();

      Serial.println("Sending UDP packet...");

      Serial.print(Udp.beginPacket(ip,port));

    

      Serial.println(Udp.write(ReplyBuffer));

      Serial.println(Udp.endPacket());

    

//------------- END SEND TO CLOUD !------------

}