Essay Writing Service

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...

Internet of Things Technology for Electricity Waste

                                              1. INTRODUCTION

1.1 Purpose of the system:

Electricity is as important to modern world as oxygen to a living being. The total percentage of electricity generated using the non renewable resources is highest among other methods. Hence it should be used wisely. However, the wastage of electricity is very high and no effective solution is existing at the moment. Using Internet of Things technology and starting from domestic level is the best way to deal with this problem. This project will be able to monitor each appliances in domestic houses and hence an over all control will be established on consumption and minimization of wastage is achieved.

1.2 Existing System: 

In present scenario, the power consumption is calculated based on all equipments consumption and have no idea about which device is consuming more. And no smartness i.e. these equipments are no way connected to Internet and communicating with humans is not possible. User doesn’t know anything about each device’s power consumption and hence, have no idea about how to minimize the consumption in a smart way. Equipments are manually controlled i.e. mechanically on/off.

1.2.1 Disadvantages:

  1. No interface to monitor power consumption.
  2. Cannot control the system manually when the user is at remote place.
  3. Increased power bills.

1.3 Proposed system:

This project Smart Power Consumption Monitoring System will calculate the power consumption of all electronic devices accurately and gives the information about each device power consumption through an Android application. If the power consumption of a particular device exceeds certain threshold limit, this system cautions the user by notifying him on his/her smart phone. By this way the user will be able to track which appliances is consuming more and will be able to take appropriate action to reduce its usage. Ultimately reduces over all energy consumption. And all devices which are connected to internet through this system can be controlled i.e. On/Off through android application from anywhere in the world.

2. SYSTEM REQUIREMENTS

2.1 HADWARE REQUIREMENTS:

  1. Node MCU
  2. Current Sensor
  3. Relay

2.2 SOFTWARE REQUIREMENTS:

  1. Embedded C
  2. Arduino IDE
  3. JAVA
  4. XML

2.3 MODULE DESCRIPTION:

     2.3.1 User module:

In this module, the user interacts with the devices through an android application. The user can execute various operations like selecting a device, to turn ON/OFF devices, view the consumption details and reset the usage details.

2.3.2 Cloud Module:

In this module, the cloud is an open source platform called Thingspeak. All the devices which are connect to node mcu are connected to this cloud and all the details are sent to this cloud. The data which is received from node mcu is stored in cloud and sent to the user when ever requested for the data. It also sends the command from the application to node mcu. Calculates the total power and time of a device and stores the information in its data base.

   2.3.3 Node MCU Module:

In this module, the Node MCU coordinaes the sensor and relay attached to it. It connects with the internet and interacts with host cloud i.e. Thingspeak and uploads the data received from the current sensor and relay. And also get the on/off command from the thingspeak and executes it

3. SYSTEM ANALYSIS

3.1 FEASIBILITY STUDY:

Feasiblity checks how tough the proposed task to do. It normally deals with the technology development and project execution. It also means analsyis of the possible effect of the proposed system or project

3.2 TYPES OF FEASIBILITY

It generally targets the rational and accurately discover the strengths and drawbacks of a present work or a proposed idea.

  3.2.1 TECHNOLOGY AND SYSTEM FEASIBILITY

The examination is based on the number of terms like input, output, programs etc. This helps to determine whether the proposed administration, in all terms i.e in hardware, software, experience persons, etc, will be able to successfully complete the project.

The study may include factors such as.

The sector of the system being tested.

The financial and human aspect.

Expected answers for the questions.

3.2.2 ECONOMIC FEASIBILITY: Monetary analysis is the must and most regular procedure to evaluvate the success of the new software. This method is mainly used to compare the client expected system and the estimated costs. Depending on the results, the system is executed when there is more profit then the cost.

COST-BASED STUDY: It is necessary to identify the price and profit aspects, which further can be classified as i. Development Coats and ii. Operating costs. It is used to obtain the profit obtain from system.

TIME-BASED STUDY: This is a study of the time needed to obtain a profit.

      3.2.3 LEGAL FEASIBILITY: It tells about the acceptance of the system with legal necessary.

      3.2.4 OPERATIONAL FEASIBILITY: It talks about how perfect will the proposed system will get the solution to the problems, and how well it is taking benieft of the raised chances during the scope and also how well it meets the requriments of a system development.

     3.2.5 SCHEDULE FEASIBILITY:  It talks about the duration required to complete the system. If it is taking very long time to produce, then the system is a failure. The time requreied to successfully complete the system by any know method is decided by this method.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

4. SOFTWARE ENVIRONMENT

4.1 ARDUINO IDE:

Arduino is free source platform which helps in prototyping the hardware and also software.The Arduino Integrated Development Environment – or Arduino Software (IDE) has a text editor which is used for code writing, toolbar, message place, with clickable buttons for menus. It connects to hardware such as Arduino, etc, uploads the programs and ultimately communicate.

Programs which are written in this software are known as sketches. The files which are written in this software are stored with an extension (.ino). It has all features like copy, paste, cut, delete, etc. The message place has the replies while saving. The console has the output of the program and also shows the errors. Toolbar as options like upload, compile, open, new, save, serial monitor etc.

It is used by people of all fields and it is very easy to do experiment with the design and electronics. Lot of IOT inventions are possible with this open source software. Now communicating with the devices and even trees is possible with this open source.

All IOT project needs a microcontroller to control all the sensors or other things attached to it. It is manufactured by different companies and distributed by many vendors. There are many types of microcontrollers. The programming language supported are C and C++. Arduino’s language is same as C. It has many libraries which helps a lot in programming the IOT projects.

4.2 EMBEDDED C

Embedded C is same like C programming but a little difference. The draw backs which are present in C programming and issues regarding the named address spaces, I/O hardware addressing, etc are resolved in the embedded C by the C standards board in 2008. All most all the syntax are same as C with small variation in the embedded C. This language is very use full in programming the electronic equipment.

4.3 JAVA

Java is an object oriented language developed by James Goslings in Sun Microsystem which is now owned by Oracle cooperation. Unlike other programming languages java is platform free, in this the code is written once and can be executed many times, there is no need of recompilation. In java when the code is converted into byte code which is compiled by java virtual machine without the need of computer architecture. Due to many striking features, java is used by many leading companies to develop new softwares. Java is mainly used in client server based web application, android application etc. Latest version of java is java 8.

4.5 ANDROID

Android is the most popular operating system for smartphones, tabs. It is developed using Linux Kernel. It was initially introduced by google. Android is an open source system which means any one view the code, access it and also manipulate, because of this feature there are many number of applications in Google play store. According to research there are nearly 2.7 million application in play store. To develop an Android application knowledge of XML and java coding is required. XML coding is done to design the look of the application i.e. pages and java is to make the application live by adding activity code, functions, button triggers etc. Open Handset Alliance reveled android in 2007, it is an association of   48 software, hardware companies with vision to build greater open standards to mobile devices. Latest version of android is 7.0 Naugat.

 

4.6 XML

(EXTENSIBLE MARKUP LANGUAGE)

The extensible markup language is used as a semantic management of the data. It is used to define markup language. It has mainly two important things, first, content and next is the markup. Here content is real information like 10.  Markup language is used to design or describe about how the information is displayed. Markup language has tags which represents the start and end of the content. Tag has various information associate with it like name and extra information. The start tag is represented by the < and the end tag is represented by />.

XML files are generally in a text format files and is easily editable by any text editing software. XML is very easy to understand and learn as it has very few rules to remember. It can only have the structural rules of tags. It has very basic syntax which helps in communication between various types of computers and applications. Incompatible systems can also access and understand the xml as it has special feature which helps to share the data easily. It has all the representation like tree, list, etc.  It is very useful in designing a page for android application.

5 HARDWARE EQUIPMENTS

5.1 NODE MCU-ESP8266

Node MCU is a microcontroller unit which is very fast, high performance, and has an ability to connect with the Wifi. It can be integrated with other devices or can be standalone system. It costs very less and occupies very less space. It is easily connects with the wifi and uploads the data collected from various devices like sensors, etc. It has internal cache which helps it to perform any task with high efficiency. ESP8266 has integrated wifi chip which has the antenna switches, power amplifer, filter, low noise receive amplifier. Generally, node mcu is integrated with other devices and sensors and sample code for these sensors are included in sdk.

Other then wifi functionalities, it has 32-bit processor and SRAM. The RAM size is about 36kb and has no ROM in it, so the programs has to be stored in external SPI flash. It has 17 GPIO pins which can be used for various functionality of the firmware. It has only one analog pin A0 which is used as the input pin to connect from analog sensors like current sensor, etc. it has 9 digital pins from D0 to D8 which used as I/O pins for digital sensors like relay, etc. It has other pins like Vin, ground pin, 3V3, TX, RX pins which are used for various purposes. It takes upto 5 volts for the node mcu to work.

C:UserssaiDownloadsIMG_20170428_072023.jpg

Fig 5.1 NODE MCU-ESP8266

5.2 CURRENT SENSOR- ACS712

The Current Sensor- ACS712 is used for sensing AC or DC current accurately. The sensor consists of a linear hall circuit with a copper conduction present at the upper portion. The current which flows through this sensor goes through copper conduction and a magnetic field is generated which is converted to propostional voltage by a Hall IC. It has 3 pins, one for VCC which is power input of range 3.3 to 5 volts, ground pin and OUT pin which gives the analog output values from sensor. Other end the actual power supply as to be given for which the current should be measured. There are various ranges of current sensor like 5A, 20A, 30A depending upon the requirement.

C:UserssaiDownloadsIMG_20170428_071857.jpg

Fig 5.2 CURRENT SENSOR ACS712 -5 amps

 

5.3 RELAY

Relay is just like a swtich but unlike typical switch, it is operated electrically. It is used to control the on/off of a device remotely. It consists of electromagnet and has two different circuits in it. When relay is on the electromagnet helps to connect the two circuits to each other and hence the circuit is closed and device is turned on. Similarly, when the relay is off the electromagnet now acts as a normal wire and because of the spring action it gets back to its normal position and breaks the circuit and so, the device is turned off. It consist of three pins, one VCC  which is for giving 3.3 volts – 5 volts to relay  to work., two ground pin and three In pin which is used to give on/off instruction to the relay.

C:UserssaiDownloadsIMG_20170428_071732.jpg

Fig 5.3 RELAY

                                                 6 SYSTEM DESIGN

6.1 INPUT DESIGN

The input design is the design where the user requirements are transformed into a software system. The design should contain the methods which are used for the development of a software system and the necessary steps required to transform from requirements specified in a functional form for processing which can be accomplished by verifying the computer to read the data in written or document form which is printed or directly by typing using keyboard into the system. The input design mainly concentrates on how to avoid delay in loading system, how to decrease the errors and to identify the newly found errors, also to improve the security of the system.

Input Design views the following situations:

• What data or details should be allowed as input?

• How should the data be organised or encoded?

• When an error occurs, the techniques written for input validation must be applied.

OBJECTIVES

1. Input Design is the design used to convert requirements provided by the user into a software system. It is significant because it helps avoid various bugs and also shows the concerned administration how to get the accurate output from the software system.

2. User-friendly screens should be made in order to help the users to use the system in an easy way and also to make entry of a large amount of data into the system easily. It is achieved by creating user-friendly screens for the data entry to handle large volume of data.

3. The data is entered with the help of computer system to verify the information provided by the user. Thus the main objective is to help in the design layout of the system.

6.2 OUTPUT DESIGN

A quality output has an impact in meeting the requirements of the user at the end because it is the result which communicates with the user whether it is meeting the requirements of the user .It must be easy to understand without too many complications to operate or understand so a good quality output helps in decision making for the user.

1. Design of a computer output must be in an organized and well thought manner where it should be easy to understandable as well as flexible to use for the user without any additional knowledge. It should be efficient by meeting the requirements of the user in time as well as easier to interact

2. Select methods for presenting information.

3. Create a d0cument, rep0rt, or 0ther formats that contain information pr0duced by the system

6.3 SYSTEM ARCHITECTURE

The smart power consumption monitoring system has three main blocks. First is NodeMCU ESP8266 block, second is Cloud/Thingspeak block and third is Android application.

NodeMCU ESP8266 is a microcontroller unit which will coordinate the current sensor and the relay, upload the data receiving from sensor and relay to cloud continuously for every 15 seconds. It also takes the commands from cloud to control the relay i.e. on/off the device attach to it.

Cloud/Thingspeak is an open source platform which helps the beginners to learn about the IOT. It has an account which we need to login and create a particular channels as per our requirement and it will create unique ids for each channel we create. These channels have fields in which the data coming from the nodemcu is stored. The channels ids are used to connect to the cloud from nodemcu. To retrieve, the channels ids are used to get the values and using any platform like website or android app we can show the values obtain. It has a matlab which will help to calculate or manuplate the values which we are getting from nodemcu. Talkback is another feature where we can send commands to sensor, here in this project, we used it to send on/off command to the nodemcu

Android application is used as a platform or interface between the nodemcc or in general IOT concept and user. The app will connect to the thingspeak and gets the values of a particular channel and displays it to the user. We can control the nodemcu by using talkback feature in the cloud.

C:UserssaiDesktopfinal proj docarchitecure.JPG

Fig 6.3 ARCHITECTURAL DESIGN

6.4 UML DIAGRAMS

Graphical representation of a software and how it works is widely know as a diagram or connected graph of the software. UML is one of such methods which represents the software graphically. It has total 9 such graphical representation or diagrams. UML stands for Unified Modeling Language

The UML is used to represent the end user’s needs and construct the artifacts. It is a language which is used for representing a system according to a end users wants by using certain rules and predefined physical representation objects. The important part should be done before the coding is modeling. It is a blue print or design of a software. It is very important as it serves as a base to build the software. Most important is to check whether the user’s needs are met or not.

The UML diagrams are as follows:

D:New folder (2)usecase.PNG

FIG 6.4.1 USE CASE DIAGRAM

Use Case Diagram represents how each entity interacts with the application and its functionality. Entities might be a person, cloud, hardware, etc.., it has use cases which represents an action performed by the entity. It also has the relationship represented by different options between the use case and entity, sometimes between use cases.

Here in this use case diagram, the User is the actor who uses the android application and operates the devices, he has the functionality such as on/off devices, get the report and reset the data. Cloud is another actor with the ThingSpeak where all the data is collected. It helps to store the data and retrieve when ever required. Node MCU is a actor which has the functionality such as to connect to the internet and upload the data to cloud. Also controls the sensors and relay by getting command from the cloud.

CLASS DIAGRAM:

D:New folder (2)classdiagram.PNG

 

Fig 6.4.2 CLASS DIAGRAM

Class Diagram: the class diagram helps in explaining the system design. Here the actors are differentiated into classes. The link between the classes is represented by a predefined set of links. Each class has functionalities which are performed by the actors.

Here in this class diagaram User, Node MCU and Cloud is represented as the classes and each has its own functions.

 

 

 

 

 

 

 

 

OBJECT DIAGRAM:

D:New folder (2)objectdiagram.PNG

Fig 6.4.3 OBJECT DIAGRAM

 

Object Diagaram: This is obtained from class diagram. All the instances which are described in the classes are needed to be initialized in this diagram. For example: login details, phone numbers, etc.

Here the object diagram is initialization for the class diagram and every class i.e. User, Node MCU, Cloud is initialized in this diagram.

 

 

SEQUENCE DIAGRAM:

D:New folder (2)sequencediagram.PNG

Fig 6.4.4 SEQUENCE DIAGRAM

Sequence Diagram: This diagram is used to represent the sequence of the actions performed in the system. It represents the work flow i.e which action is perforemed after what in the life span of the system.

Here, the user, cloud and nodemcu is represented as the lifelines and the actions performed by each is represented by the messages.

 

 

 

 

 

 

 

 

COMMUNICATION DIAGRAM:

 

D:New folder (2)collaborationdiagram.PNG

Fig 6.4.5 COMMUNICATION DIAGRAM

Communication Diagram: It is obtained from the sequence diagaram and has similar representation and working.

Here, user, cloud and ndemcu is represented as the lifelines and the lines or interactions between is represent by the messages between the lifelines.

 

 

 

 

 

5. SAMPLE CODE

Light.java

package com.example.manage.spcmonitoring;

public class HallLight extends AppCompatActivity {

Button b1,b2,b3,b4;
ToggleButton togglebutton;
private String urlJsonObj “https://api.thingspeak.com/channels/258289/feeds/last.json?api_key=5ZTEFIAYJ4IZMKJQ”;
private String urlJsonObj2 “https://api.thingspeak.com/channels/258298/feeds/last.json?api_key=MTT9JG00C7H2H4QL”;
private String urlJsonObj3 “https://api.thingspeak.com/channels/260951/feeds/last.json?api_key=HK59ASIWSVLYQB1U”;
private String urlJsonObj4 “https://api.thingspeak.com/channels/261299/fields/1/last_data_age.json?api_key=JAASOUKOLAY35EHI”;
private String urlJsonObj5 “https://api.thingspeak.com/channels/258289/feeds/1.json?api_key=5ZTEFIAYJ4IZMKJQ”;
TextView t1,t2,t3,t4,t5,t6,t7;
int ck;
double f1,rs,lu,cs,hrs;
double uu,hh,bb;
String res,res1,res2,res3,enest;
SQLiteDatabase data,data1;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_hall_light);

t1 = (TextView) findViewById(R.id.textView5);
t2 = (TextView) findViewById(R.id.textView6);
t3 = (TextView) findViewById(R.id.textView7);
t4 = (TextView) findViewById(R.id.textView8);
t5 = (TextView) findViewById(R.id.textView9);
t6 = (TextView) findViewById(R.id.textView10);
t7 = (TextView) findViewById(R.id.textView11);

b1 = (Button) findViewById(R.id.button14);
b2 = (Button) findViewById(R.id.button15);
b3 = (Button) findViewById(R.id.button13);
b4 = (Button) findViewById(R.id.button);
togglebutton = (ToggleButton) findViewById(R.id.toggleButton);
ConnectivityManager conMgr = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo netInfo = conMgr.getActiveNetworkInfo();
if (netInfo == null) {
//Animation.Description.setVisibility(View.INVISIBLE);
            new AlertDialog.Builder(HallLight.this)
.setTitle(getResources().getString(R.string.app_name))
.setMessage(“please turn on WIFI or Mobile data”)
.setPositiveButton(“OK”null).show();
else {

getunitsvalue();//to set units and cost
            gethoursvalue();// to set hours
            checkforonline();
settogglebutton();

}
data1 = openOrCreateDatabase(“CostDB”, 0, null);
String where4 = “Mid=1”;
String[] columns4 = {“Mid”“Price”};
Cursor c4 = data1.query(“CostTable”, columns4, where4, nullnullnullnull);
c4.moveToFirst();
rs = c4.getDouble(1);
data1.close();
data = openOrCreateDatabase(“LightDB”, 0, null);
String table = “CREATE TABLE IF NOT EXISTS LightTable(Mid number(5) primary key,Units double(10),Hours double(10),Bill double(10))”;
data.execSQL(table);
String[] columns1 = {“Mid”“Units”“Hours”“Bill”};
Cursor c1 = data.query(“LightTable”, columns1, nullnullnullnullnull);
c1.moveToFirst();
int total = c1.getCount();
if (total == 0) {
// <—- run your one time code here
            Toast.makeText(getApplicationContext(), “Plz set limits in settings”, Toast.LENGTH_LONG).show();
t4.setText(“Units Limit: No Value”);
t5.setText(“Hours Limit: No Value”);
t6.setText(“Cost Limit: No Value”);
// mark first time has runned.

        else {
data = openOrCreateDatabase(“LightDB”, 0, null);
String where = “Mid=1”;
String[] columns = {“Mid”“Units”“Hours”“Bill”};
Cursor c = data.query(“LightTable”, columns, where, nullnullnullnull);
c.moveToFirst();
uu = c.getDouble(1);
hh = c.getDouble(2);
bb = c.getDouble(3);
String fv1 = String.format(“%.5f”uu);
String fv2 = String.format(“%.5f”hh);
String fv3 = String.format(“%.5f”bb);
t4.setText(“Units Limit: ” + fv1);
t5.setText(“Hours Limit: ” + fv2);
t6.setText(“Cost Limit: ” + fv3);

data.close();

}
b1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {

Intent i = new Intent(HallLight.this, HallLightSetting.class);
startActivity(i);
}
});

b2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = getIntent();
finish();
startActivity(intent);
}
});

b3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
try {

getenergystdate();
togglebutton.setEnabled(false);
new Thread(new Runnable() {

@Override
public void run() {
try {
Thread.sleep(1000);
new HallLight.ResettbTask().execute(“go”);
catch (InterruptedException e) {
// TODO Auto-generated catch block
                                e.printStackTrace();
}

}
}).start();
waittoload();
catch (Exception e) {

}

}
});

b4.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
data = openOrCreateDatabase(“HystLightDB”, 0, null);
String table = “CREATE TABLE IF NOT EXISTS HystLightTable(Mid number(5) primary key,Strt varchar(20), End varchar(20), Units varchar(5),Hours varchar(5),Bill varchar(5))”;
data.execSQL(table);
String[] columns1 = {“Mid”“Strt”“End”“Units”“Hours”“Bill”};
Cursor c1 = data.query(“HystLightTable”, columns1, nullnullnullnullnull);
c1.moveToFirst();
int total = c1.getCount();
data.close();
if (total != 0) {

Intent i = new Intent(HallLight.this, HistoryLight.class);
startActivity(i);

else {
Toast.makeText(HallLight.this“No History is registered !!”, Toast.LENGTH_SHORT).show();
}

}
});
togglebutton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
checkforonline();
if (ck == 1) {
if (togglebutton.isChecked()) {
new HallLight.OnofftbTask().execute(“ON”);
b3.setEnabled(false);
waittoonoff(“Turning ON. please wait…”, 3000);
Toast.makeText(HallLight.this“ON”, Toast.LENGTH_SHORT).show();
else {
new HallLight.OnofftbTask().execute(“OFF”);
waittoonoff(“Turning OFF. please wait…”, 7000);
b3.setEnabled(true);
Toast.makeText(HallLight.this“OFF”, Toast.LENGTH_SHORT).show();
}
else if (ck == 0) {
togglebutton.toggle();
Toast.makeText(HallLight.this“Device is Offline….!!”, Toast.LENGTH_SHORT).show();
else {
Toast.makeText(HallLight.this“loading….!!”, Toast.LENGTH_SHORT).show();

}

}
});

}

private void getunitsvalue() {

JsonObjectRequest jsonObjReq = new JsonObjectRequest(Request.Method.GET, urlJsonObjnullnew Response.Listener<JSONObject>() {

@Override
public void onResponse(JSONObject response) {

try {

String hum = response.getString(“field1”);
if(!hum.equals(“null”)) {
f1 = Double.parseDouble(hum);

double a = (0.0001) * 0.0058333333333;
lu f1 * (a);

cs lu rs;
String formattedValue = String.format(“%.5f”lu);
String formattedValue1 = String.format(“%.5f”cs);

t1.setText(“Units :” + formattedValue);
t3.setText(“Cost :” + formattedValue1);
if(lu uu)
{

alertlimits(“Units consumption has crossed your prefer Limit”,1);
}
if(cs bb)
{
alertlimits(“Cost of Bill has crossed your prefer Limit”,3);
}

}
else
                    {
t1.setText(“Units : No value”);
t3.setText(“Cost : No value”);
}

catch (JSONException e) {
e.printStackTrace();
                }

}
},        new Response.ErrorListener() {

@Override
public void onErrorResponse(VolleyError error) {
                Toast.makeText(HallLight.this“Weak Internet Connection!!”, Toast.LENGTH_SHORT).show();

}
});

// Adding request to request queue
        AppController.getInstance().addToRequestQueue(jsonObjReq);

}

private void gethoursvalue() {

JsonObjectRequest jsonObjReq = new JsonObjectRequest(Request.Method.GET, urlJsonObj2, nullnew Response.Listener<JSONObject>() {

@Override
public void onResponse(JSONObject response) {

try {

String hum = response.getString(“field1”);
if(!hum.equals(“null”)) {
double f2 = Double.parseDouble(hum);
hrs = ((f2 + 1) * 21 * 0.000277778);
double mins = (hrs – (int) hrs) * 60;
double secs = (mins – (int) mins) * 60;
t2.setText((int) hrs + “H ” + (int) mins + “M ” + (int) secs + “S”);

if(hrs > hh)
{

alertlimits(“Run Hours has crossed your prefer Limit”,2);
}
}
else
                    {
t2.setText(“Hours : No Value”);

}
catch (JSONException e) {
e.printStackTrace();
                }

}
},        new Response.ErrorListener() {

@Override
public void onErrorResponse(VolleyError error) {

                Toast.makeText(HallLight.this“Weak Internet Connection!!”, Toast.LENGTH_SHORT).show();

}
});

// Adding request to request queue
        AppController.getInstance().addToRequestQueue(jsonObjReq);

}

private void settogglebutton() {

JsonObjectRequest jsonObjReq = new JsonObjectRequest(Request.Method.GET, urlJsonObj3, nullnew Response.Listener<JSONObject>() {

@Override
public void onResponse(JSONObject response) {

                try {
                    String hum = response.getString(“field1”);
int k=Integer.parseInt(hum);
if(k==0)
{

togglebutton.setChecked(true);
b3.setEnabled(false);
}
else {
togglebutton.setChecked(false);
b3.setEnabled(true);
}

catch (JSONException e) {
e.printStackTrace();
                }

}
},        new Response.ErrorListener() {

@Override
public void onErrorResponse(VolleyError error) {
                Toast.makeText(HallLight.this“Weak Internet Connection!!”, Toast.LENGTH_SHORT).show();

}
});

// Adding request to request queue
        AppController.getInstance().addToRequestQueue(jsonObjReq);

}

private int checkforonline() {
JsonObjectRequest  jsonObjReq = new JsonObjectRequest(Request.Method.GET, urlJsonObj4, nullnew Response.Listener< JSONObject>() {

@Override
public void onResponse(JSONObject response) {

                try {
String hum = response.getString(“last_data_age”);
int k=Integer.parseInt(hum);
if(k<=23)
{
ck=1;
togglebutton.setEnabled(true);

}
else
                    {
ck=0;
togglebutton.setEnabled(false);
t7.setText(“Light is OFFLINE!!”);
}

catch (JSONException e) {
e.printStackTrace();

                }

}
},        new Response.ErrorListener() {

@Override
public void onErrorResponse(VolleyError error) {
                Toast.makeText(HallLight.this“Weak Internet Connection!!”, Toast.LENGTH_SHORT).show();

}
});

// Adding request to request queue
        AppController.getInstance().addToRequestQueue(jsonObjReq);
return 0;

}

private int getenergystdate() {
JsonObjectRequest  jsonObjReq = new JsonObjectRequest(Request.Method.GET, urlJsonObj5, nullnew Response.Listener< JSONObject>() {

@Override
public void onResponse(JSONObject response) {

                try {
enest = response.getString(“created_at”);
createhystable(enest);

catch (JSONException e) {
e.printStackTrace();

                }

}
},        new Response.ErrorListener() {

@Override
public void onErrorResponse(VolleyError error) {
                Toast.makeText(HallLight.this“Weak Internet Connection!!”, Toast.LENGTH_SHORT).show();

}
});

        AppController.getInstance().addToRequestQueue(jsonObjReq);
return 0;

}

@SuppressWarnings(“deprecation”)

private class OnofftbTask  extends AsyncTask<String, Integer, Double> {

@Override
protected Double doInBackground(String… params) {
        postData(params[0]);
return null;
}

protected void onPostExecute(Double result){

    }
protected void onProgressUpdate(Integer… progress){
    }

public void postData(String valueIWantToSend) {
        HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost(“https://api.thingspeak.com/talkbacks/14901/commands?apikey=5OKHVNFXSOAQ391W&command_string=”+valueIWantToSend);

try {
            HttpResponse response = httpclient.execute(httppost);
res= EntityUtils.toString(response.getEntity());
Log.d(“response”, res);

catch (ClientProtocolException e) {

            Toast.makeText(HallLight.this“Weak Internet Connection!!”, Toast.LENGTH_SHORT).show();
catch (IOException e) {
            Toast.makeText(HallLight.this“Weak Internet Connection!!”, Toast.LENGTH_SHORT).show();
}
}

}

public void alertlimits(String s, int jo)
{
NotificationCompat.Builder builder =
new NotificationCompat.Builder(this)
.setSmallIcon(R.drawable.ic_launcher)
.setContentTitle(“ALERT !!!”)
.setContentText(s);

Intent notificationIntent = new Intent(this, HallLight.class);

PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent,
PendingIntent.FLAG_UPDATE_CURRENT);

builder.setContentIntent(contentIntent);
builder.setAutoCancel(true);
builder.setLights(Color.WHITE, 500, 500);
long[] pattern = {500,500,500,500,500,500,500,500,500};
builder.setVibrate(pattern);
builder.setStyle(new NotificationCompat.InboxStyle());

        NotificationManager manager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
manager.notify(jo, builder.build());
}

private class ResettbTask extends AsyncTask<String, Integer, Double> {

@Override
protected Double doInBackground(String… params) {
            postData(params[0]);
return null;
}

protected void onPostExecute(Double result){
//pb.setVisibility(View.GONE);

        }
protected void onProgressUpdate(Integer… progress){
//pb.setProgress(progress[0]);
        }

public void postData(String valueIWantToSend) {
// Create a new HttpClient and Post Header
            HttpClient httpclient = new DefaultHttpClient();
HttpDelete httpdelete = new HttpDelete(“https://api.thingspeak.com/channels/258289/feeds?apikey=HGW3GO2QP5KXPSTH”);
HttpClient httpclient1 = new DefaultHttpClient();
HttpDelete httpdelete1 = new HttpDelete(“https://api.thingspeak.com/channels/258298/feeds?apikey=HGW3GO2QP5KXPSTH”);
HttpClient httpclient2 = new DefaultHttpClient();
HttpPost httppost = new HttpPost(“https://api.thingspeak.com/update?api_key=7LD4DA42D0TX3JTG&field1=0”);
HttpClient httpclient3 = new DefaultHttpClient();
HttpPost httppost1 = new HttpPost(“https://api.thingspeak.com/update?api_key=ZQE75AYKKV8O73UQ&field1=0”);

try {
// Add your data
                // Execute HTTP Post Request
                HttpResponse response = httpclient.execute(httpdelete);
res= EntityUtils.toString(response.getEntity());
HttpResponse response1 = httpclient1.execute(httpdelete1);
res1= EntityUtils.toString(response1.getEntity());

HttpResponse response2 = httpclient2.execute(httppost);
res2= EntityUtils.toString(response2.getEntity());
HttpResponse response3 = httpclient3.execute(httppost1);
res3= EntityUtils.toString(response3.getEntity());

Log.d(“response”, res);
Log.d(“response1”, res1);
Log.d(“response2”, res2);
Log.d(“response3”, res3);

catch (ClientProtocolException e) {
// TODO Auto-generated catch block
                Toast.makeText(HallLight.this“Weak Internet Connection!!”, Toast.LENGTH_SHORT).show();
catch (IOException e) {
// TODO Auto-generated catch block
                Toast.makeText(HallLight.this“Weak Internet Connection!!”, Toast.LENGTH_SHORT).show();
}
}

}

public void createhystable(String enest)
{
data = openOrCreateDatabase(“HystLightDB”, 0, null);
String table = “CREATE TABLE IF NOT EXISTS HystLightTable(Mid number(5) primary key,Strt varchar(20), End varchar(20), Units varchar(5),Hours varchar(5),Bill varchar(5))”;
data.execSQL(table);
String[] columns1= {“Mid”,“Strt”,“End”,“Units”,“Hours”,“Bill”};
Cursor c1 = data.query(“HystLightTable”,columns1,null,null,null,nullnull );
c1.moveToFirst();
int total=c1.getCount();

DateFormat df = new SimpleDateFormat(“yyyy-MM-dd’T’HH:mm:ss”);
String date = df.format(Calendar.getInstance().getTime());
ContentValues values = new ContentValues();
values.put(“Mid”, total+1);
values.put(“Strt”, enest);
values.put(“End”, date);
values.put(“Units”, t1.getText().toString());
values.put(“Hours”, t2.getText().toString());
values.put(“Bill”, t3.getText().toString());
data.insert(“HystLightTable”null, values);
data.close();

}
public void waittoload() {

try {

final ProgressDialog dialog = new ProgressDialog(HallLight.this); // this = YourActivity
            dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
dialog.setMessage(“Resetting. Please wait…”);
dialog.setIndeterminate(true);
dialog.setCanceledOnTouchOutside(false);
dialog.show();
new Thread() {
public void run() {
try {
// sleep the thread, whatever time you want.
                        sleep(15000);
catch (Exception e) {
}
dialog.dismiss();
HallLight.this.runOnUiThread(new Runnable() {

@Override
public void run() {
Intent intent = getIntent();
finish();
startActivity(intent);

}
});
}
}.start();

catch (Exception e) {
Log.e(“error loading”, e.getMessage());

}
}
public void waittoonoff(String mesg,int gf) {
final int mj=gf;
try {

final ProgressDialog dialog = new ProgressDialog(HallLight.this); // this = YourActivity
            dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
dialog.setMessage(mesg);
dialog.setIndeterminate(true);
dialog.setCanceledOnTouchOutside(false);
dialog.show();
new Thread() {
public void run() {
try {
// sleep the thread, whatever time you want.
                        sleep(mj);
catch (Exception e) {
}
dialog.dismiss();

}
}.start();

catch (Exception e) {
Log.e(“error loading”, e.getMessage());

}
}

}

Socket.java

package com.example.manage.spcmonitoring;

public class HallSocket extends AppCompatActivity {

Button b1,b2,b3,b4;
ToggleButton togglebutton;
private String urlJsonObj “https://api.thingspeak.com/channels/261492/feeds/last.json?api_key=09966Y0B5YHMC3MD”;
private String urlJsonObj2 “https://api.thingspeak.com/channels/261493/feeds/last.json?api_key=MITFJ7CDJW7QWHJE”;
private String urlJsonObj3 “https://api.thingspeak.com/channels/261494/feeds/last.json?api_key=3CFF1H614DJV1BLL”;
private String urlJsonObj4 “https://api.thingspeak.com/channels/261496/fields/1/last_data_age.json?api_key=Y91DG25SDC88UH55”;
private String urlJsonObj5 “https://api.thingspeak.com/channels/261492/feeds/1.json?api_key=09966Y0B5YHMC3MD”;
TextView t1,t2,t3,t4,t5,t6,t7;
int ck;
double rs,f1;
double uu,hh,bb;
String res,res1,res2,res3,enest;
SQLiteDatabase data,data1;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_hall_socket);

t1=(TextView)findViewById(R.id.textView5);
t2=(TextView)findViewById(R.id.textView6);
t3=(TextView)findViewById(R.id.textView7);
t4=(TextView)findViewById(R.id.textView8);
t5=(TextView)findViewById(R.id.textView9);
t6=(TextView)findViewById(R.id.textView10);
t7=(TextView)findViewById(R.id.textView11);

b1=(Button)findViewById(R.id.button14);
b2=(Button)findViewById(R.id.button15);
b3=(Button)findViewById(R.id.button13);
b4=(Button)findViewById(R.id.button);
togglebutton = (ToggleButton) findViewById(R.id.toggleButton);
ConnectivityManager conMgr =  (ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo netInfo = conMgr.getActiveNetworkInfo();
if (netInfo == null){
//Animation.Description.setVisibility(View.INVISIBLE);
            new AlertDialog.Builder(HallSocket.this)
.setTitle(getResources().getString(R.string.app_name))
.setMessage(“please turn on WIFI or Mobile data”)
.setPositiveButton(“OK”null).show();
}else {

getunitsvalue();//to set units and cost
            gethoursvalue();// to set hours
            checkforonline();
settogglebutton();
}
data1=openOrCreateDatabase(“CostDB”,0,null);
String where4 =“Mid=1”;
String[] columns4= {“Mid”,“Price”};
Cursor c4 = data1.query(“CostTable”,columns4,where4,null,null,null,null);
c4.moveToFirst();
rs=c4.getDouble(1);
data1.close();
data = openOrCreateDatabase(“SocketDB”, 0, null);
String table = “CREATE TABLE IF NOT EXISTS SocketTable(Mid number(5) primary key,Units double(10),Hours double(10),Bill double(10))”;
data.execSQL(table);
String[] columns1= {“Mid”,“Units”,“Hours”,“Bill”};
Cursor c1 = data.query(“SocketTable”,columns1,null,null,null,nullnull );
c1.moveToFirst();
int total=c1.getCount();
if (total==0) {
// <—- run your one time code here
            Toast.makeText(getApplicationContext(), “Plz set limits in settings”, Toast.LENGTH_LONG).show();
t4.setText(“Units Limit: No Value”);
t5.setText(“Hours Limit: No Value”);
t6.setText(“Cost Limit: No Value”);
// mark first time has runned.

        }
else
        {
data=openOrCreateDatabase(“SocketDB”,0,null);
String where =“Mid=1”;
String[] columns= {“Mid”,“Units”,“Hours”,“Bill”};
Cursor c = data.query(“SocketTable”,columns,where,null,null,null,null);
c.moveToFirst();
uu=c.getDouble(1);
hh=c.getDouble(2);
bb=c.getDouble(3);

String fv1 = String.format(“%.5f”,uu);
String fv2 = String.format(“%.5f”,hh);
String fv3 = String.format(“%.5f”,bb);
t4.setText(“Units Limit: “+fv1);
t5.setText(“Hours Limit: “+fv2);
t6.setText(“Cost Limit: “+fv3);
//Toast.makeText(getApplicationContext(), “”+uu+hh+bb, Toast.LENGTH_SHORT).show();
            data.close();

}

b1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {

Intent i=new Intent(HallSocket.this,HallSocketSetting.class);
startActivity(i);

}
});

b2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = getIntent();
finish();
startActivity(intent);
}
});
b3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {

try {

getenergystdate();
togglebutton.setEnabled(false);
new Thread(new Runnable() {

@Override
public void run() {
try {
Thread.sleep(1000);
new HallSocket.ResettbTask().execute(“go”);
catch (InterruptedException e) {
// TODO Auto-generated catch block
                                e.printStackTrace();
}

}
}).start();
waittoload();
}catch(Exception e)
{

}

}
});
b4.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
data = openOrCreateDatabase(“HystSocketDB”, 0, null);
String table = “CREATE TABLE IF NOT EXISTS HystSocketTable(Mid number(5) primary key,Strt varchar(20), End varchar(20), Units varchar(5),Hours varchar(5),Bill varchar(5))”;
data.execSQL(table);
String[] columns1= {“Mid”,“Strt”,“End”,“Units”,“Hours”,“Bill”};
Cursor c1 = data.query(“HystSocketTable”,columns1,null,null,null,nullnull );
c1.moveToFirst();
int total=c1.getCount();

data.close();
if(total!=0) {
Intent i = new Intent(HallSocket.this, HistorySocket.class);
startActivity(i);
}
else
                {

Toast.makeText(HallSocket.this“No History is registered !!”, Toast.LENGTH_SHORT).show();
}
}
});

togglebutton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
checkforonline();
if (ck == 1) {
if (togglebutton.isChecked()) {
new HallSocket.OnofftbTask().execute(“ON”);
b3.setEnabled(false);
waittoonoff(“Turning ON. please wait…”,3000);
Toast.makeText(HallSocket.this“ON”, Toast.LENGTH_SHORT).show();
}
else
                    {
new HallSocket.OnofftbTask().execute(“OFF”);
waittoonoff(“Turning OFF. please wait…”,7000);
b3.setEnabled(true);
Toast.makeText(HallSocket.this“OFF”, Toast.LENGTH_SHORT).show();
}}

else if (ck == 0){
togglebutton.toggle();
Toast.makeText(HallSocket.this“Device is Offline….!!”, Toast.LENGTH_SHORT).show();
}
else
                {
Toast.makeText(HallSocket.this“loading….!!”, Toast.LENGTH_SHORT).show();

}
}
});

}

private void getunitsvalue() {

JsonObjectRequest jsonObjReq = new JsonObjectRequest(Request.Method.GETurlJsonObjnullnew Response.Listener<JSONObject>() {

@Override
public void onResponse(JSONObject response) {

try {

String hum = response.getString(“field1”);

if (!hum.equals(“null”)) {
f1 = Double.parseDouble(hum);

double a = (0.0001) * 0.0058333333333;
double lu = f1 * (a);
double cs = lu * rs;
String formattedValue = String.format(“%.5f”, lu);
String formattedValue1 = String.format(“%.5f”, cs);

t1.setText(“Units :” + formattedValue);
t3.setText(“Cost :” + formattedValue1);

if (lu > uu) {

alertlimits(“Units consumption has crossed your prefer Limit”,1);
}
if (cs > bb) {

alertlimits(“Cost of Bill has crossed your prefer Limit”,2);
}
}
else
                    {
t1.setText(“Units : No value”);
t3.setText(“Cost : No value”);
}

catch (JSONException e) {
e.printStackTrace();
                }

}
},        new Response.ErrorListener() {

@Override
public void onErrorResponse(VolleyError error) {

                Toast.makeText(HallSocket.this“Weak Internet Connection!!”, Toast.LENGTH_SHORT).show();

}
});

// Adding request to request queue
        AppController.getInstance().addToRequestQueue(jsonObjReq);

}

private void gethoursvalue() {

JsonObjectRequest jsonObjReq = new JsonObjectRequest(Request.Method.GETurlJsonObj2nullnew Response.Listener<JSONObject>() {

@Override
public void onResponse(JSONObject response) {
//  Log.d(TAG, response.toString());
                try {
// Parsing json array response
                    // loop through each json object
                    String hum = response.getString(“field1”);
if(!hum.equals(“null”)) {
double f2 = Double.parseDouble(hum);
double hrs = ((f2 + 1) * 21 * 0.000277778);
double mins = (hrs – (int) hrs) * 60;
double secs = (mins – (int) mins) * 60;
t2.setText((int) hrs + “H ” + (int) mins + “M ” + (int) secs + “S”);
if (hrs > hh) {

alertlimits(“Run Hours has crossed your prefer Limit”,3);
}
}
else
                    {
t2.setText(“Hours : No Value”);

}

catch (JSONException e) {
e.printStackTrace();
                }

}
},        new Response.ErrorListener() {

@Override
public void onErrorResponse(VolleyError error) {
                Toast.makeText(HallSocket.this“Weak Internet Connection!!”, Toast.LENGTH_SHORT).show();

}
});

// Adding request to request queue
        AppController.getInstance().addToRequestQueue(jsonObjReq);

}

private void settogglebutton() {

JsonObjectRequest jsonObjReq = new JsonObjectRequest(Request.Method.GETurlJsonObj3nullnew Response.Listener<JSONObject>() {

@Override
public void onResponse(JSONObject response) {
                try {

                    String hum = response.getString(“field1”);
int k=Integer.parseInt(hum);
if(k==0)
{
togglebutton.setChecked(true);
b3.setEnabled(false);
}
else {
togglebutton.setChecked(false);
b3.setEnabled(true);
}

catch (JSONException e) {
e.printStackTrace();
                }

}
},        new Response.ErrorListener() {

@Override
public void onErrorResponse(VolleyError error) {

                Toast.makeText(HallSocket.this“Weak Internet Connection!!”, Toast.LENGTH_SHORT).show();

}
});

        AppController.getInstance().addToRequestQueue(jsonObjReq);

}

private int checkforonline() {
JsonObjectRequest  jsonObjReq = new JsonObjectRequest(Request.Method.GETurlJsonObj4nullnew Response.Listener< JSONObject>() {

@Override
public void onResponse(JSONObject response) {
//  Log.d(TAG, response.toString());

                try {
String hum = response.getString(“last_data_age”);
int k=Integer.parseInt(hum);
if(k<=23)
{
ck=1;
togglebutton.setEnabled(true);

}
else
                    {
ck=0;
togglebutton.setEnabled(false);
t7.setText(“Socket is OFFLINE!!”);
}

catch (JSONException e) {
e.printStackTrace();
                }

}
},        new Response.ErrorListener() {

@Override
public void onErrorResponse(VolleyError error) {

                Toast.makeText(HallSocket.this“Weak Internet Connection!!”, Toast.LENGTH_SHORT).show();

}
});

// Adding request to request queue
        AppController.getInstance().addToRequestQueue(jsonObjReq);
return 0;

}

private int getenergystdate() {
JsonObjectRequest  jsonObjReq = new JsonObjectRequest(Request.Method.GETurlJsonObj5nullnew Response.Listener< JSONObject>() {

@Override
public void onResponse(JSONObject response) {
//  Log.d(TAG, response.toString());

                try {
enest = response.getString(“created_at”);
createhystable(enest);
Toast.makeText(HallSocket.this“Reset is successful.. please allow 15 secs to use reset again”, Toast.LENGTH_SHORT).show();

catch (JSONException e) {
e.printStackTrace();
/*Toast.makeText(getApplicationContext(),
                            “Error: ” + e.getMessage(),
                            Toast.LENGTH_LONG).show();*/

                }

}
},        new Response.ErrorListener() {

@Override
public void onErrorResponse(VolleyError error) {
                Toast.makeText(HallSocket.this“Weak Internet Connection!!”, Toast.LENGTH_SHORT).show();

}
});

        AppController.getInstance().addToRequestQueue(jsonObjReq);
return 0;

}

@SuppressWarnings(“deprecation”)

private class OnofftbTask extends AsyncTask<String, Integer, Double> {

@Override
protected Double doInBackground(String… params) {
// TODO Auto-generated method stub
            postData(params[0]);
return null;
}

protected void onPostExecute(Double result){
//pb.setVisibility(View.GONE);

        }
protected void onProgressUpdate(Integer… progress){
//pb.setProgress(progress[0]);
        }

public void postData(String valueIWantToSend) {
// Create a new HttpClient and Post Header
            HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost(“https://api.thingspeak.com/talkbacks/15054/commands?apikey=024DFHZ8RS60OTEN&command_string=”+valueIWantToSend);

try {
                HttpResponse response = httpclient.execute(httppost);
res= EntityUtils.toString(response.getEntity());
Log.d(“response”res);

catch (ClientProtocolException e) {
// TODO Auto-generated catch block
                Toast.makeText(HallSocket.this“Weak Internet Connection!!”, Toast.LENGTH_SHORT).show();
catch (IOException e) {
// TODO Auto-generated catch block
                Toast.makeText(HallSocket.this“Weak Internet Connection!!”, Toast.LENGTH_SHORT).show();
}
}

}

public void alertlimits(String s, int jo)
{
NotificationCompat.Builder builder =
new NotificationCompat.Builder(this)
.setSmallIcon(R.drawable.ic_launcher)
.setContentTitle(“ALERT!!!”)
.setContentText(s);

Intent notificationIntent = new Intent(this, HallSocket.class);

PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent,
PendingIntent.FLAG_UPDATE_CURRENT);

builder.setContentIntent(contentIntent);
builder.setAutoCancel(true);
builder.setLights(Color.WHITE, 500, 500);
long[] pattern = {500,500,500,500,500,500,500,500,500};
builder.setVibrate(pattern);
builder.setStyle(new NotificationCompat.InboxStyle());
// Add as notification
        NotificationManager manager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
manager.notify(jo, builder.build());

}
@SuppressWarnings(“deprecation”)
private class ResettbTask extends AsyncTask<String, Integer, Double> {

@Override
protected Double doInBackground(String… params) {
// TODO Auto-generated method stub
            postData(params[0]);
return null;
}

protected void onPostExecute(Double result){
//pb.setVisibility(View.GONE);

        }
protected void onProgressUpdate(Integer… progress){
//pb.setProgress(progress[0]);
        }

public void postData(String valueIWantToSend) {
// Create a new HttpClient and Post Header
            HttpClient httpclient = new DefaultHttpClient();
HttpDelete httpdelete = new HttpDelete(“https://api.thingspeak.com/channels/261492/feeds?apikey=BZH4DZVBFY17AQCA”);
HttpClient httpclient1 = new DefaultHttpClient();
HttpDelete httpdelete1 = new HttpDelete(“https://api.thingspeak.com/channels/261493/feeds?apikey=BZH4DZVBFY17AQCA”);
HttpClient httpclient2 = new DefaultHttpClient();
HttpPost httppost = new HttpPost(“https://api.thingspeak.com/update?api_key=4CHG4LXDM4K4F917&field1=0”);
HttpClient httpclient3 = new DefaultHttpClient();
HttpPost httppost1 = new HttpPost(“https://api.thingspeak.com/update?api_key=1RW81I3KD1B6J865&field1=0”);

try {
// Add your data
                // Execute HTTP Post Request
                HttpResponse response = httpclient.execute(httpdelete);
res= EntityUtils.toString(response.getEntity());
HttpResponse response1 = httpclient1.execute(httpdelete1);
res1= EntityUtils.toString(response1.getEntity());

HttpResponse response2 = httpclient2.execute(httppost);
res2= EntityUtils.toString(response2.getEntity());
HttpResponse response3 = httpclient3.execute(httppost1);
res3= EntityUtils.toString(response3.getEntity());

Log.d(“response”res);
Log.d(“response1”res1);
Log.d(“response2”res2);
Log.d(“response3”res3);

catch (ClientProtocolException e) {
// TODO Auto-generated catch block
                Toast.makeText(HallSocket.this“Weak Internet Connection!!”, Toast.LENGTH_SHORT).show();
catch (IOException e) {
// TODO Auto-generated catch block
                Toast.makeText(HallSocket.this“Weak Internet Connection!!”, Toast.LENGTH_SHORT).show();
}
}

}

public void createhystable(String enest)
{
data = openOrCreateDatabase(“HystSocketDB”, 0, null);
String table = “CREATE TABLE IF NOT EXISTS HystSocketTable(Mid number(5) primary key,Strt varchar(20), End varchar(20), Units varchar(5),Hours varchar(5),Bill varchar(5))”;
data.execSQL(table);
String[] columns1= {“Mid”,“Strt”,“End”,“Units”,“Hours”,“Bill”};
Cursor c1 = data.query(“HystSocketTable”,columns1,null,null,null,nullnull );
c1.moveToFirst();
int total=c1.getCount();

DateFormat df = new SimpleDateFormat(“yyyy-MM-dd’T’HH:mm:ss”);
String date = df.format(Calendar.getInstance().getTime());
ContentValues values = new ContentValues();
values.put(“Mid”, total+1);
values.put(“Strt”, enest);
values.put(“End”, date);
values.put(“Units”t1.getText().toString());
values.put(“Hours”t2.getText().toString());
values.put(“Bill”t3.getText().toString());
data.insert(“HystSocketTable”null, values);
data.close();

}

public void waittoload() {

try {

final ProgressDialog dialog = new ProgressDialog(HallSocket.this); // this = YourActivity
            dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
dialog.setMessage(“Resetting. Please wait…”);
dialog.setIndeterminate(true);
dialog.setCanceledOnTouchOutside(false);
dialog.show();
new Thread() {
public void run() {
try {
// sleep the thread, whatever time you want.
                        sleep(15000);
catch (Exception e) {
}
dialog.dismiss();
HallSocket.this.runOnUiThread(new Runnable() {

@Override
public void run() {
Intent intent = getIntent();
finish();
startActivity(intent);

}
});
}
}.start();

catch (Exception e) {
Log.e(“error loading”, e.getMessage());

}
}
public void waittoonoff(String mesg,int gf) {
final int mj=gf;
try {

final ProgressDialog dialog = new ProgressDialog(HallSocket.this); // this = YourActivity
            dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
dialog.setMessage(mesg);
dialog.setIndeterminate(true);
dialog.setCanceledOnTouchOutside(false);
dialog.show();
new Thread() {
public void run() {
try {
// sleep the thread, whatever time you want.
                        sleep(mj);
catch (Exception e) {
}
dialog.dismiss();

}
}.start();

catch (Exception e) {
Log.e(“error loading”, e.getMessage());

}
}

}

Light.xml

 

 

<?xml version=”1.0″ encoding=”utf-8″?>
<RelativeLayout (“Requesting URL: “);

Serial.println(url);

// This will send the request to the server

client.print(String(“GET “) + url + ” HTTP/1.1 ” +

“Host: ” + host + “ ” +

“Connection: close ”);

delay(10);

getTalkBack(); // Get the command issued from mobile app/web app

updateChannels();

delay(4000);

}

else

{

delay(2000);

}

}

void getTalkBack()

{

tbRequest=”GET /talkbacks/”+ talkBackID + “/commands/execute?api_key=” + talkBackAPIKey;

Serial.println(tbRequest);

if(!client.connected())

{

if (client.connect(“api.thingspeak.com”, 80))

{

client.println(tbRequest);

if (client.connected())

{

talkBackCommand=””;

while(client.connected() && !client.available()) delay(10); //waits for data

while (client.connected() || client.available())

{

talkBackCommand = client.readStringUntil(‘ ’);

}

Serial.print(“Command -> “);

Serial.println(talkBackCommand);

Serial.println();

}

client.stop();

Serial.flush();

}

if(talkBackCommand == “ON”) digitalWrite(D4, LOW);

if(talkBackCommand == “OFF”) digitalWrite(D4, HIGH);

}

}

void startWiFi()

{

client.stop();

Serial.println();

Serial.println(“Connecting to”);

Serial.println(ssid);

WiFi.begin(ssid, password);

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

delay(500);

Serial.print(“.”);

}

Serial.println(“”);

Serial.println(“WiFi connected”);

Serial.println(“IP address: “);

Serial.println(WiFi.localIP());

delay(1000);

}

void updateChannels()

{

Serial.println(url);

if (client.connect(“api.thingspeak.com”, 80))

{

client.print(“POST /update HTTP/1.1 ”);

client.print(“Host: api.thingspeak.com ”);

client.print(“Connection: close ”);

client.print(“X-THINGSPEAKAPIKEY: “+privateKey+” ”);

client.print(“Content-Type: application/x-www-form-urlencoded ”);

client.print(“Content-Length: “);

client.print(url.length());

client.print(“ ”);

client.print(url);

if (client.connected())

{

Serial.println(“****************************************”);

Serial.println();

Serial.println(“Connecting to ThingSpeak…”);

while(client.connected() && !client.available()) delay(10); //waits for data

while (client.connected() || client.available())

{

char charIn = client.read();

Serial.print(charIn);

}

Serial.println();

Serial.println();

Serial.println(“…disconnected”);

Serial.println();

}

}

client.stop();

Serial.flush();

}

void Sstatus()

{

Serial.print(“connecting to “);

Serial.println(host);

// Use WiFiClient class to create TCP connections

WiFiClient client;

const int httpPort = 80;

if (!client.connect(host, httpPort)) {

Serial.println(“connection failed”);

return;

}

String url = “/update”;

url += “?api_key=8JQ1A2R31WKR5A1E”;

url += “&field1=”;

url += digitalRead(D4);

Serial.print(“Requesting URL: “);

Serial.println(url);

// This will send the request to the server

client.print(String(“GET “) + url + ” HTTP/1.1 ” +

“Host: ” + host + “ ” +

“Connection: close ”);

Serial.println();

Serial.println(“closing connection”);

}

void online()

{

Serial.print(“connecting to “);

Serial.println(host);

// Use WiFiClient class to create TCP connections

WiFiClient client;

const int httpPort = 80;

if (!client.connect(host, httpPort)) {

Serial.println(“connection failed”);

return;

}

String url = “/update”;

url += “?api_key=JAASOUKOLAY35EHI”;

url += “&field1=1”;

Serial.print(“Requesting URL: “);

Serial.println(url);

// This will send the request to the server

client.print(String(“GET “) + url + ” HTTP/1.1 ” +

“Host: ” + host + “ ” +

“Connection: close ”);

Serial.println();

Serial.println(“closing connection”);

}

float getCPP()

{

float result;

int readValue;             //value read from the sensor

int maxValue = 0;          // store max value here

int minValue = 1023;          // store min value here

uint32_t start_time = millis();

while((millis()-start_time) < 1000) //sample for 1 Sec

{

readValue = analogRead(A0);

// see if you have a new maxValue

if (readValue > maxValue)

{

/*record the maximum sensor value*/

maxValue = readValue;

}

if (readValue < minValue)

{

/*record the maximum sensor value*/

minValue = readValue;

}

}

// Subtract min from max

result = ((maxValue – minValue) * 5)/1023.0;

return result;

}

 

 

 

Socket –Node MCU Code

 

#include <ESP8266WiFi.h>

/* Provide Wi-Fi credentials */

const char* ssid     = “SNIST-DEPT”;

const char* password = “snist@1234”;

/* Provide TalkBack App credentials */

const char* host = “api.thingspeak.com”;

const String privateKey=”DHVXGZ913195RRSE”;

const String talkBackAPIKey = “7W14O7Z0IFDEQ5PS”;

const String talkBackID = “14990”;

String talkBackCommand,tbRequest;

#define RELAY1 D4

double Idig, Imax, Ipeak, Irms, Isum;

double Iarray[60];

//unsigned long time;

double voltage=230;

String url=””;

int cont=0;

double current = 0;

double CRMS = 0;

double AmpsRMS = 0;

int mCperAmp = 185;

WiFiClient client; // Initialize a Wi-Fi client

void setup() {

Serial.begin(115200);

pinMode(RELAY1, OUTPUT);

digitalWrite(RELAY1,1);

delay(10);

startWiFi(); // Connect to Wi-Fi network with SSID and PASSWORD

}

void loop()

{

Serial.print(“connecting to “);

Serial.println(host);

getTalkBack();

Sstatus();

online();

int state =digitalRead(D4);

if (state==0)

{

current = getCPP();

CRMS = (current/2.0) *0.707;

AmpsRMS = (CRMS * 1000)/mCperAmp;

Serial.print(“Irms Value =  “);

Serial.println(AmpsRMS);

delay(100);

Serial.print(“voltage :”);

Serial.println(voltage);

double energy = AmpsRMS*voltage;

int timee=1;

Serial.print(“Energy :”);

Serial.println(energy);

// We now create a URI for the request

url = “/update”;

url += “?api_key=”;

url += privateKey;

url += “&field1=”;

url += AmpsRMS;

url += “&field2=”;

url += voltage;

url += “&field3=”;

url += energy;

url += “&field4=”;

url += timee;

Serial.print(“Requesting URL: “);

Serial.println(url);

// This will send the request to the server

client.print(String(“GET “) + url + ” HTTP/1.1 ” +

“Host: ” + host + “ ” +

“Connection: close ”);

delay(10);

getTalkBack(); // Get the command issued from mobile app/web app

updateChannels();

delay(4000);

}

else

{

delay(2000);

}

}

void getTalkBack()

{

tbRequest=”GET /talkbacks/”+ talkBackID + “/commands/execute?api_key=” + talkBackAPIKey;

Serial.println(tbRequest);

if(!client.connected())

{

if (client.connect(“api.thingspeak.com”, 80))

{

client.println(tbRequest);

if (client.connected())

{

talkBackCommand=””;

while(client.connected() && !client.available()) delay(10); //waits for data

while (client.connected() || client.available())

{

talkBackCommand = client.readStringUntil(‘ ’);

}

Serial.print(“Command -> “);

Serial.println(talkBackCommand);

Serial.println();

}

client.stop();

Serial.flush();

}

if(talkBackCommand == “ON”) digitalWrite(D4, LOW);

if(talkBackCommand == “OFF”) digitalWrite(D4, HIGH);

}

}

void startWiFi()

{

client.stop();

Serial.println();

Serial.println(“Connecting to”);

Serial.println(ssid);

WiFi.begin(ssid, password);

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

delay(500);

Serial.print(“.”);

}

Serial.println(“”);

Serial.println(“WiFi connected”);

Serial.println(“IP address: “);

Serial.println(WiFi.localIP());

delay(1000);

}

void updateChannels()

{

Serial.println(url);

if (client.connect(“api.thingspeak.com”, 80))

{

client.print(“POST /update HTTP/1.1 ”);

client.print(“Host: api.thingspeak.com ”);

client.print(“Connection: close ”);

client.print(“X-THINGSPEAKAPIKEY: “+privateKey+” ”);

client.print(“Content-Type: application/x-www-form-urlencoded ”);

client.print(“Content-Length: “);

client.print(url.length());

client.print(“ ”);

client.print(url);

if (client.connected())

{

Serial.println(“****************************************”);

Serial.println();

Serial.println(“Connecting to ThingSpeak…”);

while(client.connected() && !client.available()) delay(10); //waits for data

while (client.connected() || client.available())

{

char charIn = client.read();

Serial.print(charIn);

}

Serial.println();

Serial.println();

Serial.println(“…disconnected”);

Serial.println();

}

}

client.stop();

Serial.flush();

}

void Sstatus()

{

Serial.print(“connecting to “);

Serial.println(host);

// Use WiFiClient class to create TCP connections

WiFiClient client;

const int httpPort = 80;

if (!client.connect(host, httpPort)) {

Serial.println(“connection failed”);

return;

}

String url = “/update”;

url += “?api_key=69SI81GPETM91FWE”;

url += “&field1=”;

url += digitalRead(D4);

Serial.print(“Requesting URL: “);

Serial.println(url);

// This will send the request to the server

client.print(String(“GET “) + url + ” HTTP/1.1 ” +

“Host: ” + host + “ ” +

“Connection: close ”);

Serial.println();

Serial.println(“closing connection”);

}

void online()

{

Serial.print(“connecting to “);

Serial.println(host);

// Use WiFiClient class to create TCP connections

WiFiClient client;

const int httpPort = 80;

if (!client.connect(host, httpPort)) {

Serial.println(“connection failed”);

return;

}

String url = “/update”;

url += “?api_key=OVIMS70X26JYYIP7”;

url += “&field1=1”;

Serial.print(“Requesting URL: “);

Serial.println(url);

// This will send the request to the server

client.print(String(“GET “) + url + ” HTTP/1.1 ” +

“Host: ” + host + “ ” +

“Connection: close ”);

Serial.println();

Serial.println(“closing connection”);

}

float getCPP()

{

float result;

int readValue;             //value read from the sensor

int maxValue = 0;          // store max value here

int minValue = 1023;          // store min value here

uint32_t start_time = millis();

while((millis()-start_time) < 1000) //sample for 1 Sec

{

readValue = analogRead(A0);

// see if you have a new maxValue

if (readValue > maxValue)

{

/*record the maximum sensor value*/

maxValue = readValue;

}

if (readValue < minValue)

{

/*record the maximum sensor value*/

minValue = readValue;

}

}

result = ((maxValue – minValue) * 5)/1023.0;

return result;

}

                                              7. SYSTEM TESTING

 

INTRODUCTION

The purpose of testing is to discover errors. Testing is the process of executing a program or application to locate every conceivable fault or bugs. It allows a way to check the usage of components, sub-assemblies, assemblies and/or a finished product. It is the method of exerting software with the intent of ensuring that the product meets its requirements and user expectations and does not fail in an unsatisfactory manner. There are various types of test. Each test type addresses a specific testing requirement.

7.2.1 TYPES OF TESTS

1. Unit testing

Unit testing is the testing of individual modules of a software product where the test cases formed  by testers not only used to verify and validate the program output but also the verifies the internal functional  logic. This is the structural testing where the product testers should have in depth knowledge on the process and verify the logic. It comes under white box testing where the tester should understand the code. Unit test is performed at individual module level where it is ensured that process provides outcome accurately and also according to the specifications with defined inputs and expected results.

2Integration testing

Integration testing is the testing performed after the unit testing of different modules of a software product where we integrate the different modules .Then theses modules are verified and validated to check whether any problem arises from combination of modules or any changes occurred in the functional logic.

3Functional test

Functional testing is the testing performed to verify and validate the features of the software product ,whether they are according to the design ,specifications provided.

  • Valid Input      : valid input helps in identifying classes those classes must be accepted.
  • Invalid Input     : invalid input helps in identifying classes those classes must be rejected.
  • Functions     : functions which are identified must be utilized.
  • Output      : outputs which are identified in application must be utilized.
  • Systems/Procedures : linking systems or procedures must be called.

Functional testing is mainly focused on the system requirements, problems that occur rarely in the form of test cases. Before performing the functional testing ,other test are detected and current result are resolved and decided.

4System Test

System test is the test which is performed on the whole software system where it is ensured that the system meets the requirements or not. It mainly depends on integration testing where we consider integration points.

5White Box Testing

White Box Testing is also known as code based testing. In this type of testing ,the tester has the in-depth knowledge of what implementation is performed ,what are the method used, what is the design ,what are the specifications of software system.

7.2.2 Unit Testing:

Unit testing is the testing which is performed on a unit module and it is said to be part of a whole code of a software system. Unit testing is performed as two  phases.

Test strategy and approach

Unit testing will be performed manually using field testing where we test in which environment it is used and the output is determined. Functional tests will be prescribed.

Test objectives

• All fields must work properly.

• Pages must be activated only through the identified link.

• There must be no delay in the responses, messages.

Features to be tested

• All the entries must be verified to be in the incorrect format.

• Duplicate values shouldn’t be allowed

• Links in the system must be directed to expected destination in the system.

7.2.3 INTEGRATION TESTING:

An application can have many modules built in and these modules needs to be integrated at some point to derive the complete functionality.  There can be an aberration (or deviation) from the actual functionality in real time and causes production issues. To avoid such situations/scenario modules, need to be integrated and tested methodically.

In general, this can be performed based on the criticality of a module i.e. this can be either done this can be done by breadth first top down model integration which helps to detect the unexpected behavior at the earliest or by depth first.

Top down integration model is implemented by making use of some development tools with graphical interface for the tester.  This type of model is not as successful as depth first.

Bottom up integration model is another integration testing technique which make use of automated tools (Like selenium). Since processing is performed from bottom to top this becomes much easier process and removes the use of stub in the testing environment.

 

 

TOP-DOWN INTEGRATION:

Top Down integration testing is a technique of testing the application with main module in place. Testing revolves around the main module and which is supported by stub.

Stub are nothing but replacement/sample to actual real time module which may not be currently available.

Later during the testing phase based on this integration approach, stubs are replaced with real time/actual components. Test will be carried on each and every component as and when the integration is completed.

Once a set of testings’ is completed, another stub Is replaced with the real-time component. After all the modules (or components) are fully integrated, regression test needs to be completed to ensure that no new bugs are introduced into the system.

Bottom Up Integration:

Bottom up integration is technique/method which clearly suggest from the name that testing is done from bottom to Up.

First step for this type of model/process is to select a bottom component which eventually eliminates the use of a stub. To achieve this some of the automated tools are required.

Basically, there are four steps invoked in this.

  1. Low level component is selected and these are put together into clusters which mimics the stub functionality.
  2. Second steps is to coordinate between test case input and ouput, this can be achieved by a driver.
  3. The individual cluster are tested.
  4. All the individual clusters are combined together to move forward with the application testing and drivers are eliminated.

7.2.4 VALIDATION TESTING

Validation testing involves testing of visual interface to check if the controls are behaving as expected. For examples, there are certain required fields like ‘Phone Number’. Validation test needs to be performed to check if the system throws an error message/warning if this field is left empty.

This is carried out be series of black box testing.

 

7.2.5 SYSTEM TESTING

System testing is performed by a software engineer once the software is ready and deployed on the user environment. Software engineer needs to make sure that the software developed is compatible with the user machine/environment and in case there are any problems that needs to be sorted out.

For example, an application developed may work on certain browser version and there is a chance that it may fails in certain versions. Fix needs to be introduced so that the application can run smoothly on any given platform to help further in system testing.

So, the test carried to ensure software is working as desired at user place is ‘System Testing’

7.2.6 RECOVERY TESTING

There can be certain scenarios/cases/setup where a software errors may corrupt the system to not work properly or as desired for some time or permanently.

So, Recovery becomes crucial in this case. So, recovery testing can be done in 2 ways.

  1. Automated

Here Automated denotes that the software works/performs correctly after certain time out which initializes the server again. Or there can be a problem with a server load or database time out.

  1. Manual (human Intervention)

There are certain scenario where manual intervention is required which requires change in code, time to repair is calculated to ensure the software/application is up and ready for use.

7.2.7 SECURITY TESTING

Security testing plays a vital role in the software business. A software can comprise very sensitive and highly secured information which needs to be protected otherwise leads to serious cybercrime. For a software to be successful, it must ensure that is hack proof.

For testing the security aspect of a software, a tester needs to think like a hacker and find all the possible loop holes in a software and break the system.

This can ensure the software to be reliable and safe.

 

7.2.8 STRESS TESTING

Stress testing is perfumed to check the limits of the system which it can tolerate and resist the abnormal conditions. This is performed by providing abnormal inputs under abnormal conditions.

This can be performed by providing excess values in the system, to check if the database can be broken.

As part of stress testing Load is gradually increased in the system which increase the traffic flow in the system and breaks if the system is substandard. This can lead up to maximum utilization of the memory resources. Providing too many interrupts during the testing process.

 

7.2.9 PERFORMANCE TESTING

Performance testing plays a vital role especially when the system deals with thousands of users at a time. This will not only dependent on software but hardware as well.

Performance testing is a combination of Stress testing, which ultimately test the resources utilization in the server.

The time taken to respond for a request is the vital parameter for this kind of testing.

8. RESULTS AND ANALYSIS

C:UserssaiDesktopfinal proj doccloud.JPG

Fig 8.1.1 THINGSPEAK CLOUD

This is the thingspeak cloud channel page. There are four fields in this channel which is used to collect the data from the nodemcu and stores the values in the database.

C:UserssaiDesktopfinal proj docApp Screen shotsHome Page.png

Fig 8.1.2 HOME PAGE

First page displayed when user opens the app. Each device is represented by a button as shown in the figure. The user must set the cost per unit before he/she proceeds to the devices.

C:UserssaiDesktopfinal proj docApp Screen shotsCost Settings.png

Fig 8.1.3 COST PER UNIT SETTING PAGE

This screen is reached when the app user clicks on the setting button in home page. Here the cost per unit is entered and saved by pressing save button.

 

 

C:UserssaiDesktopfinal proj docApp Screen shotsLight page.png

Fig 8.1.4 LIGHT PAGE

This page is reached when the user clicks on the Light device button under the hall. In ths page, the units, hours and cost of the device is displayed and there are number of buttons by which the user can get his/her desire output or operation.

C:UserssaiDesktopfinal proj docApp Screen shotsLight Settings.png

Fig 8.1.5 LIGHT SETTING PAGE

This page is reached when the user clicks on setting in the light page. Here, the desire limits on units, hours, cost is entered and saved.

 

C:UserssaiDesktopfinal proj docApp Screen shotsSocket Page.png

Fig 8.1.6 SOCKET PAGE

This page is reached when the user clicks on the Socket device button under the hall. In ths page, the units, hours and cost of the device is displayed and there are number of buttons by which the user can get his/her desire output or operation.

 

C:UserssaiDesktopfinal proj docApp Screen shotsSocket settings.png

Fig 8.1.7 SOCKET SETTING PAGE

This page is reached when the user clicks on setting in the socket page. Here, the desire limits on units, hours, cost is entered and saved.

C:UserssaiDesktopfinal proj docApp Screen shotsAlert Notification.png

Fig 8.1.8 ALERT NOTIFICATION

This is the notification of the alert when the device reaches the user define limits.

9. CONCLUSION

The Smart Power Consumption Monitoring System helps to minimize the wastage by having control over the power usage of each appliances in a domestic house. Though there are other renewable sources for generating electricity, they are not fully functional and not yet in a position to replace the non-renewable methods of producing electicity. Preventing wastage or by control usage of the electricity is the only way to continue supply of the electicity in the world. Developing countries like India, still today has some villages and remote areas, where the electricity has never seen. The power consumption is more in big cities, which, at any cost should be minimized, so that electricity can be reached through out the India. The Smart Power Consumption Monitoring System enables to have a watch on our usage and helps to identify which equipment we are using for more hours in our houses. By having an idea about the power consumption of devices according our usage, it will help in minimizing the wastage and ultimately the power consumption and wastage will be at lower level.

10. REFERENCES

[1] Enevo(2016) ONe Waste Collection for Smart Cities.

[2] Sensor, S. (2014). Dumpster Smart lling level monitoring.

[3] Libelium. (2015b). Smart Metering 2.0 Technical Guide, 4.9. Retrieved from http://www.gedigitalenergy.com/smartmetering/catalog/SGM3000_Residential.htm#sgm300 0tab5

[4] Portal Rasmi Majlis Perbandaran Sepang; (n.d.-b). Retrieved May 7, 2015, from http://www.mpsepang.gov.my/peta-daerah-sepang

[5] Portal Rasmi Pejabat Daerah / Tanah Kuala Langat Peta – Peta Daerah Kuala Langat. (n.d.). Retrieved May 7, 2015, from http://www.selangor.gov.my/kualalangat.php/pages/view/186

[6] LEA-6/NEO-6/MAX-6 Hardware Integration Manual, Docu. GPS.G6-HW-09007

[7] u-blox 6 Receiver Description Including Protocol Specification (Public version), Docu. No. GPS.G6-SW-10018

[8] u-blox 6 Receiver Description Including Protocol Specification (Confidential version), Docu. No. GPS.G6-SW-10019

[9] u-blox Package Information Guide, Docu. No GPS-X-11004

.



Recommendation
EssayHub’s Community of Professional Tutors & Editors
Tutoring Service, EssayHub
Professional Essay Writers for Hire
Essay Writing Service, EssayPro
Professional Custom
Professional Custom Essay Writing Services
In need of qualified essay help online or professional assistance with your research paper?
Browsing the web for a reliable custom writing service to give you a hand with college assignment?
Out of time and require quick and moreover effective support with your term paper or dissertation?
Did you find someone who can help?

Fast, Quality and Secure Essay Writing Help 24/7!