Reducing Energy Consumption in Commercial Buildings

                                            1. INTRODUCTION

1.1 Purpose of the system:

The most important factor in today’s world is reduction in the consumption of energy. By doing so we can reduce the our electricity bills as well try to reduce the pollution which is being caused due to gaseous and liquid pollutants. It is always known when one unit of the energy is saved it is always equal to the one unit of energy which is being generated.

The main motto of the project is energy saving in the commercial buildings we generally notice this wastage of the energy in the buildings but could never find a proper a solution .This project entirely deals with how we try to reduce the energy consumption by using the energy parameters like temperature, humidity, light intensity and many more. The application through which we try to operate this building consists of  eco mode, proximity mode, away mode, sleep mode when we use this modes we’ll be able to turn ON/OFF our electrical appliances. This entire data is again stored in the cloud.

1.2 Existing System:

This system deals with operating the devices manually. There is no automatic operation of the devices because of which lots of consumption of energy and wastage of power is taking place.

Disadvantages:

  1. Unwanted usage of power.
  2. Wastage of energy.
  3. Unwanted emission of heat due to over usage of devices.
  4. Emitting gaseous pollutants.

1.3 Proposed System:

The project entirely deals with reduction of power consumption by operating the electronic devices through application. The application receives the details from the cloud and according to which the operations take place. The cloud stores the data which is sent by nodemcu.All the sensors and arduino  to which the current sensor is connected senses various values like temperature ,humidity, current and etc and sends them nodemcu. Based on the values the devices can be operated. So when the motion gets detected the lights will automatically gets switched on and when the person leaves the place these will automatically switched off we can even change the modes accordingly to the modes present in the application.

Advantages:

  1. Under very low cost the power is being consumed.
  2. In off state there’s,low wasteful consumption of energy.
  3. Theres high resolution along with good light sensitivity.
  4. Hale identification andrecongnition of human.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

                                 2. SYSTEM REQUIREMENTS

2.1 Hardware Requirements:

  1. Arduino uno
  2. Temperature and humidity sensor(dht)
  3. Motion detection sensor(pir)
  4. Current sensor.
  5. Light sensor(LDR)

2.2 Software requirements:

  1. Arduino IDE software
  2. Operating system (any version of windows)
  3. ThinkSpeak cloud
  4. Personal system or laptop
  5. Arduino studio.

 

2.3 MODULES OF THE SYSTEM:

  1. User
  1. Cloud
  2. Arduino
  3. Nodemcu

User Module:

The user gets notification in the phone application about the status regarding your devices.The user  can also change the modes according to his convinience . The user also gets to know about the details regarding the temperature , humidity, current.

 

 

 

 

Cloud  Module:

The values obtained from sensors are updated in the cloud thorough nodemcu. The values are shown in the form of graphs.These values are send to phone application when user operates through the application.

Arduino Module:

The  current sensor is connected to arduino it takes the value from the current and sends it.

Nodemcu:

All the sensors are connected to nodemcu it receives the values and sends them to the cloud this device play a very major role.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

3. SYSTEM STUDY

 FEASIBILITY STUDY

The study is all about how well the project is feasible making sure that it does not become a burden to company,through this analysis we will get to no the workability of proposed system.We  also put a business proposal with a normal plan of project and cost stomas.For this kind of analysis ,understanding of few important requirements fot the system is necessary.

The major study involved in workability analysis are:

  1. Economic feasibility.
  2. Technical feasibility.
  3. Social feasibility.

3.1 ECONOMICAL FEASIBILITY

The economic feasibility is study related to the economic blow that the system might have on the company. It make sure that the proposed system which is being developed is affordable by the company which is sponsoring in research and development of the project.We only purchase the personalized products hence we try to make use of the technologies which are freely available.

3.2 TECHNICAL FEASIBILITY

The technical feasibility is the study which is related to the technical requirements of the proposed system. If the technical requirements involved in the project will increase then automatically the demand of the technical resources will also increase which will again increase the demands being placed on the client .Hence, in order to maintain the balance the technical analysis is done. So, the technical requirements  in the developed system must be simple since no changes should take place in implementing the system.

 

 

3.3 SOCIAL FEASIBILITY

The social feasibility is the study on how well the the user accepts the system.It also deal with creating the awareness of system.And makes sure that the user should not be threatened infact consider it as a necessity.The way how the user takes the system depends on the methods which are used to make him familiar about the system.The level of confidence should be raised so that he should feel free to make some productive criticism since he is the final user of the system.

4. INTRODUCTION TO SENSORS

4.1 DHT 11 Sensor:

 

 

 

 

 

 

FIGURE 4.1.1 DHT 11 Humidity & Temperature Sensor

We have many types of dht sensors. The sensor used in the project is dht11 sensor. It senses the humidity and the temperature. It has three pins ground, voltage, and the output pin. This dht11 sensor senses the  values of temperature and humidity of the devices to which it is connected. It confirms high reliability and good  long-term stability by using  digital-signal-acquisition technique and temperature & humidity sensing technology. The dth11 sensor has resistive-type humidity measurement component and NTC temperature measurement component, and the connects to a high-performance 8-bit microcontroller, offering great quality, very quick response, anti-interference ability.

The sensor element  are highly progressive in the laboratory and are specific about the humidity calibration. So,the calibration coefficient is stored               as programmes in the OTP memory, which are then used by the sensor’s internal signal detecting process. The single-wire serial interface makes system alliance very fast and easy.  The sensors are of very small size, they consume very low power and can transmit upto 20 meters which of which this has become a very best choice amongst various application. The component which is available is 4-pin single row pin package.  Therefore it become very easy to connect and special packages can be provided as per users’ request.

 

 

4.2) PIR MOTION SENSOR

 

pir.png                                      FIGURE 4.2.1) PIR MOTION SENSOR

PIR sensors allow you to sense motion, almost always used to detect whether a human has moved in or out of the sensors range.

They are small, inexpensive, low-power, easy to use and don’t wear out. For that reason they are commonly found in appliances and gadgets used in homes or businesses. They are often referred to as PIR, “Passive Infrared”, “Pyroelectric”, or “IR motion” sensors.

PIRs are basically made of pyroelectric which can detect levels of infrared radiation. Everything emits some low level radiation, and the hotter something is, the more radiation is emitted. The sensor in a motion detector is actually split in two halves. The reason for that is that we are looking to detect motion (change) not average IR levels. The two halves are wired up so that they cancel each other out. If one half sees more or less IR radiation than the other, the output will swing high or low.

 

 

 

4.2.1) How PIRs Work

Pir sensor place a major role in the project it basically detects the motion. So, the main motto is when the motion (person) is detected the lights should get switched on as soon as the person leaves the light should get switched off. The pir sensor detects the infrared rays and these are made up of pyroelectric material. The sensors are basically divided into two halves in order to detect the motion on average ir levels. Both the halves are wired. The output changes from high to low. Compared to all other sensors pir sensors very complicated because there are many variables that have effect on the input and output values. Now, lets clearly understand the working of pir sensor.

The sensor have two slots and every slot is made of material which is sensitive to infrared rays. When the sensor is not working both the slots which are present give same result.So,basically when the human pass by the sensor there’s a positive differential change exist between the slot and reverse happen when the person leaves according to these changes detection is made.

outer.png

 

                        FIGURE 4.2.2) OUTER MEMBRANE OF PIR SENSOR

Along with the pyroelectic sensor is a bunch of supporting circuitry, resistors and capacitors. This chip takes the output of the sensor and does some processing on it to emit adigital output pulse from the analog sensor.

4.3LDR SENSOR:

This sensor senses the light intensity based on which we can operate the devices.It contain two cadmium sulphide photoconductive cell with spectral response which is almost same like human eye. So the as light intensity increases the resistance decreases.This might also include controlling of light, some detection and etc.

Applications

Used in many application and circuits.

Analog Applications: 

  1. Camera disclosure control.
  2. Auto slump focus.
  3. Computerized rear.
  4. Prospect mirror.

Digital application:

  1. Mechanized headlight dinner.
  2. Oil heater flame out.
  3. Street ablaze control.
 

ldr.jpg

FIGURE 4.3) LDR SENSOR

 

 

4.4 Current Sensor:

current sensor is an apparatus that determines AC( alternating current) or DC(direct current) in a wire. The output produced is in the form of a signal proportional to it. It could be analog voltage or current or even digital output.  Ammeter is used to display the current that is stored for further analysis in a data acquisition system or can also be utilized for control purpose.

The output in the form of a  signal and the current that is discovered can be either alternating current or direct sensor input. In the case of alternating current input it can be either an analog output or bipolar output or unipolar output. The average or RMS value of the discovered current is proportional to the unipolar output.. Both the analog output and bipolar output correspond the wave shape of the sensed current. The direct current input gives a digital output that is unipolar. Direct current output can be a digital output when the sensed current exceeds certain threshold value.

current1.png

FIGURE 4.4.1) CURRENT SENSOR: It has got 3 pins. They are VCC, Output and GND.

4.5  ESP8266 NODEMCU (Wi-Fi MODULE):

A Wi-Fi interlocking solution that is intact and independent is offered by ESP8266. It allows us to provide the application that can also be unloaded to all functions provided by wifi networking from another application processor as well. When ESP8266 hosts the application, from an external flash it is able to boot up directly. In order to minimize the memory requirements, it cache has been combined to improve the performance of the system.

The computing and storage capabilities allow it to be integrated with the sensors and other application specific devices.

wife.png

FIGURE 4.5.1) ESP8266 NODEMCU ( WIFI MODULE)

It has got three 3V and GND pins. We connect the output terminals of all the different terminals to this module.

 

 

 

4.6  CHANNEL 5V RELAY MODULE

relay.png

FIGURE 4.6.1) CHANNEL 5V 10A RELAY MODULE:

Here it has got 4 pins. One of it is for power and the other one is GND. The other two pins IN1 and IN2 are connected to light and fan.

The relay module acts as a switch that allows you to turn on or off a circuit using voltage and/or current much higher than a microcontroller could handle. The microcontroller operates both the low voltage circuit as well as high power circuit both of which have no connection between them.The relay protects each circuit from each other.

Specifications

  • On-board EL817 photoelectric coupler with photoelectric isolating anti-interference ability strong
  • .On-board 5V, 10A / 250VAC, 10A / 30VDC relays
  • Relay long life can absorb 100000 times in a row
  • Module can be directly and MCU I/O link, with the output signal indicator
  • Module with diode current protection, short response time

PCB Size: 45.8mm x 32.4

                     

                                5. SOFTWARE ENVIRONMENT

5.1 The Arduino IDE

Arduino is open source, easy-to-use hardware and software prototyping platform. Arduino software IDE is a software interface where we write programs, run it and dump it into the arduino chip. Arduino chip has 8-bit microcontroller, programming hardware, USB programming interface and I/O pins( connection to the outside world). Arduino IDE takes arduino sketch and compiles it for the target platform hence known as cross compiler. It is also a debugger, similar and programmer ( allows you to copy your code, copy the executable code into Arduino.  The boards are able to read inputs .We can send a set of instructions to the board using Arduino programming language (based onWiring), and the Arduino Software (IDE).

pcb.png

                    FIGURE 5.1) ARDUINO PCB DESIGN: This is the sketch of arduino uno.

It contains everything needed to support the microcontroller; simply connect it to a computer with a USB cable or power it with a AC-to-DC adapter or battery to get started.

uno.png

                                                   FIGURE 5.2) ARDUINO UNO

The Arduino Uno is a microcontroller board based on the ATmega328 (datasheet). It has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz ceramic resonator, a USB connection, a power jack, an ICSP header, and a reset button.

5.1.1 WHY ARDUINO?

Arduino has a simple and accessible user experience so it is used in thousands of different projects and applications. It is easy-to-use for beginners and very flexible for advanced users.

It runs on Mac, Windows, and Linux.

5.1.2) ARDUINO IDE SOFTWARE

ard.png

 

4.1 WHAT IS ARDUINO IDE SOFTWARE?

The Arduino Integrated Development Environment – or Arduino Software (IDE) – has a toolbar with buttons, a text console and editor that is used for programming in the a message area. It connects to all the other different types of hardware such as Arduino and Genuino as required by the user in order to upload programs.

sketch.png

                        FIGURE 5.3) ARDUINO SKETCH:

This is the dashboard where programming of Arduino is done.

5.1.3  Summary

Microcontroller ATmega328

Operating Voltage                    : 5V

Input Voltage (recommended): 7-12V

Input Voltage (limits)              : 6-20V

Digital I/O Pins                        : 14 (of which 6 provide PWM output)

Analog Input Pins                    : 6 DC Current per I/O Pin 40 mA

DC Current                             : 3.3V Pin 50 mA

Flash Memory                        : 32 KB (ATmega328) of which 0.5 KB used by bootloader

SRAM                                     : 2 KB (ATmega328)

EEPROM                               : 1 KB (ATmega328)

Clock Speed                            : 16 MHz

 

5.1.4  Power

With the help of USB connection or external power supply the Arduino Uno is powered. There is automatic power selection by Arduino. The battery or AC-to-DC adapter( wall-wart) is responsible for the External (non-USB) power . The board’s power jack that has 2.1mm center positive plug is connected by the adapter. The power connector has Gnd and Vin pins to which the leads of the battery are inserted. External supply required by the board to operate is 6 to 20 volts. The 5V pin supplies less than five volts and using 12V damages and overheats the board. It is unstable. Hence it is highly recommended to use in the range of 7 to 12 volts. The power pins are as follows:

 VIN.  The input voltage to the Arduino board (as opposed to 5 volts from the USB connection or other regulated power source) when it’s using an external power source. We are supplying voltage via the power jack, through this pin and can be accessed through this pin itself.

 5V.The regulator on the board regulates the pin outputs  that is 5V. The DC power jack (7 – 12V), the USB connector (5V), or the VIN pin of the board (7-12V) supplies power to the board. Bypasses the regulator by supplying voltage via the 5V or 3.3V pins can damage your board. Hence it I not advised.

  3V3.  The on-board regulator generates 3.3 volt supply Maximum current draw is 50 mA.

 GND. Ground pins.

5.1.5  Memory

The ATmega328 is the processor programmed by the user which is of 32 KB. The ATmega16U2 handles USB communication. It translates into something that the main processor can understand. It also has 2 KB of SRAM and 1 KB of EEPROM (which can be read and written with the EEPROM library). There are two types of code running on ATmega328. They are application code and firmware. Application code executes the system functionality, this is where our code is written. Firmware is the low level code that supports the main function. It is preprogrammed onto Arduino.

5.1.6) Input and Output

There are 14 digital pins on the Uno that can be used as both input or output. The are some of the functions that can be used to achieve the input or output. Each operates at 5 volts. Each pin has an internal pull-up resistor (disconnected by default) of 20-50 kOhms and can provide or receive a maximum of 40 mA . Some pins have specialized functions:

 Serial: 0 (RX) and 1 (TX).  Receiving pin is (RX) and transmiting pin is (TX) TTL serial data.  The corresponding pins of the ATmega8U2 USB-to-TTL Serial chip are connected to RX and TX.

 External Interrupts: 2 and 3. These pins can be configured in sucha a way that they trigger an interrupt on a low value, a rising or falling edge, or a change in value.

 PWM: 3, 5, 6, 9, 10, and 11. With the analogWrite() function these pins provide 8-bit PWM output

 SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI communication using the SPI library.

 LED: 13. The digital pin 13 is connected to the built-in LED. When the pin has HIGH as its value, the LED is on, and when the pin is LOW, it’s off.

The Uno has 6 analog inputs that are labeled as A0 till A5. Each of these provide 10 bits of resolution (i.e. 1024 different values). By default they measure from ground to 5 volts. It is possible to change the upper end of their range using the analogReference() function the AREF pin.

 TWI: A4 or SDA pin and A5 or SCL pin. It supports TWI communication using the Wire library.

There are a couple of other pins on the board:

 AREF.  It acts as a reference voltage for the analog inputs and is used with analogReference() function.

 Reset. This line brings LOW to reset the microcontroller. Reset button is typically added to shields which block the one on the board.

5.1.7 Communication

It has got so many ways with which it can communicate with a computer, another Arduino, or other microcontrollers. The available digital pins 0 (RX) and 1 (TX) are connected to ATmega328 that provides UART TTL (5V) serial communication . This serial communication is channeled on the board ATmega16U2 over USB. On the computer, it appears as a virtual port. The ATmega16U2 firmware uses the USB COM standard drivers, for which no external driver is needed. But, Windows, requires a .inf file. The arduino software provides us with a serial monitor that allows data to be sent to and from the arduino board. When the data is transmitted he RX and TX LEDs on the board will flash via the USB-to-serial chip and USB connection to the computer (but not for serial communication on pins 0 and 1). For serial communication on any of the Uno’s digital pins Software Serial library is provided and also supports I2C (TWI) and SPI communication. The IDE uses a Wire library to simplify use of the I2C bus.

 

5.1.8) Programming

The programming of Arduino IDE is similar to C programming language. IDE was written in Java. First we need to go to the arduino website and download the software. Then we need to go to Open click on new project and and get started with coding. The website of arduino itself provides us with some example sketches that can be as reference to the user. After writing our code the extension that we use .ino. We have these options of file, edit, sketch, tools and help. Under the tools we need to choose the type of board that we will be using. Here we have used Arduino uno. There are options also that have been provided to the user like verify, upload, new, open and save. Verify option is basically used to verify the code. Upload is for dumping the code into the arduino chip.New option enables the user to write their new sketch. Open option enables the user to open other arduino files. Save option helps the user to save their programs. For compiling avr-gcc is used to cross- compile the code. The resulting code executes on the microprocessor. After compiling object file(.o) is generated. We have to assign a jump code for linking it to the libraries. Object file is linked to the arduino linker. The linker generated hexadecimal file the is finally dumped onto the srduino chip.

5.1.9  Serial Monitor:

The  sequential data that is  being sent from the Arduino or Genuino board (USB or serial board) is displayed by serial monitor. Just by clicking n the left hand side search symbol which is nothing but the serial monitor symbol. The Serial.begin is passed a baud rate that has to match with that of a serial monitor. The baud rate is passed by choosing one from the drop down menu. Whenevr the the Arduino or Genuino board is connected to the Windows, Mac or Linux, the Arduino or Genuino board, the serial monitor will reset. It reruns the sketch from the beginning.

serialmon.png

FIGURE 5.4) SERIAL MONITOR: In this screen we can see the output.

5.2) Android Studio

Android Studio is the legitimate Integrated Development Environment (IDE) for Android application programming development .IntelliJ’s is the company that build this software. It was later acquired by Google. It developed impressive code editor and developer tools. Android Studio provides even more characteristics that elevates our understanding when developing Android apps, such as:

  • A ductile Gradle-based build system
  • A quick and characteristic-rich emulator
  • A integrated environment where you can build all Android devices
  • Expeditious Run to push changes to your working app without developinga new APK
  • Code templates and GitHub inclusion to help you develop common app characteristics and implication of  sample code
  • Substantial testing tools and frameworks
  • Lint resources to catch execution, effectiveness, version affinity, and other problems
  • C++ and NDK support
  • Inherent support for Google Cloud Platform , making it uncomplicated to include Google Cloud Messaging and App Engine.

5.2.1) Project Structure:

Untitled.png

        FIGURE 5.5) PROJECT FILES IN ANDROID VIEW

This shows how are the users supposed to access their files.

Every project in Android Studio contains more than one file with source code files and resource files. Types of modules include:

  • User interface modules
  • Java files
  • Connection to the cloud eg, Google App Engine modules

Android Studio shows the project files in the Android project view by default. This view is taken care by all the different sorts modules to ensure quick access to our project’s key source files and other resource files.

All the files built by the developer can be seen at the top most corner under Gradle Scripts and every application file contains the following folders:

  • manifests: Contains the AndroidManifest.xml file.
  • java: Contains the Java source code files
  • res: Contains all non-code resources, such as XML layouts, UI strings, and bitmap images.

The Android project structure on disk varies from this flattened representation. To see the real file organization of the project, select Project from the Project dropdown

We can also arrange the project files to outline the related aspects of our application development. We need to install the android SDK packages so that many other characteristic features can be included while programming our application.

5.2.2) User interface

The Android Studio main window is made up of so many areas that are are completely logical

main.png

Figure 5.6) Android Mainscreen: This is the outlook of android studio.

  1. The toolbar provides us with a wide range of actions, including running your app and  tools.
  2. The navigation bar helps in moving through our project and opening files for developing them. It gives us a more intact view of the organization visible in the Project window.
  3. The editor window is where you develop and manipulate our code. Depending on the current file usage type, the editor can be modified. For example, when viewing a layout file, it can be either relative layout or linearlayout.
  4. The tool window bar does not run inside IDE window and comprises of theicons that make it possible for us to enlarge or delarge individual tool windows.
  5. The tool windows give us permission to perform tasks like project organization, search, version control, and more. You can enlarge them or decremet them.
  6. The status bar displays the update of the application we are working on and the IDE itself, as well as posts warnings or messages.

We can manage the main screen by giving ourselves more screen space by making the toolbars and tool windows hidden .We can also use keyboard shortcuts in order to utilize the most IDE features.

At any instant of time, we can cross our source code, databases, actions, elements of the user interface, and so on, by double-pressing the Shift key, or clicking the magnifying glass in the upper right-hand corner of the Android Studio window.  For example, you have forgotten how to trigger while trying to locate a particular IDE action. In this case it is very useful.

5.2.3) Gradle build System

Gradle is the foundation of the build system in Android Studio, with more Android-specific characteristics provided by the Android plugin for Gradle. This system works as an integrated tool from the systems menu, and is not dependent on the command line. We can use the characteristic features of this system to perform the given below:

  • Personalize, construct, and expand the development process.
  • Develop several APKs for your app, with different sorts of characteristic features using the same project files and calibre.
  • Reiterate the code and resources across different source sets.

By incorporating the agility of Gradle, we can accomplish all of these without changing our app’s core source files. Android Studio has got build files that have been named as build.gradle. These are completely plain text files that use Groovy syntax to build the system elements offered by the Android plugin for Gradle. Every module has one top-level build file for the complete project and separate module-level build files for different sets of module. When we implicate an existing application, the software automatically builds the necessary files.

5.3 ThingSpeak

ThingSpeak is an open source application based on “Internet of Things”. It provides an API (Application programming Interface) to lode and redeem data from things using HTTP over the Local Area Network or via Internet.

Using ThingSpeak , sensor based applications, location trailing applications, and a social grid of things with status rejuvenate.

thing.png

FIGURE 5.7) THINGSPEAK WEBSITE: Here is the website https://thingspeak.com/ .

Features of ThingSpeak:

  • Open sourse Application Programming Interface
  • Actual-time dossier agglomeration
  • Geolocation information
  • Data computing
  • Data resolution
  • Device stature intimation
  • Peripherals

One of the best feature of ThingSpeak is that it can be attuned with, Arduino, Raspberry Pi, ioBridge/ RealTime.io, Electric Imp, Mobile / Web Applications, Social Networks and Data Analytics with MATLAB.

Getting Start with ThingSpeak using Arduino Platform

Step 1: Create your own account.

We need to first create our own account precendently uploading the data to ThingSpeak for dissection and computing.

signup.png

FIGURE 5.8  THINGSPEAK REGISTRATION PAGE: This is how the registration page looks.

login.png

FIGURE 5.9  THINGSPEAK LOGIN PAGE: This is how the login page looks.

Step2: Create a New Channel

add.png

channel.png

FIGURE 5.9  CREATING NEW CHANNEL IN THNIGSPEAK

This is how the channels have to be provided by the user.

We are required to fill in the blanks for the adding channel that we are trying to build. The name given to the channel should mostly be the project that we are building on. We can also leave the choices, such as specification, metadata and tags empty if we are not aware of what has to be kept.

Fields include different forms of data that are to be uploaded. If you are measuring the humidity of the room, you can put field 1 as Humidity of room. After we have done so, we can press on the save channel.  This is how we are ready to uploading the data to the analogous channel.

Step 3: Finding API key for you channel.

api.png

FIGURE 5.10  GENERATING UNIQUE API KEY

This is beneficial for providing security to the user.

Every channel pocesses a single unique API key. This API key makes sure that the information is being transferred to the right place instantaneously. The Write API key is used while writing code in Arduino.

6. CODING

6.1 CONNECTION OF ARDUINO TO CURRENT SENSOR:

#include <SoftwareSerial.h>

SoftwareSerial myserial(8,9);

float Idig, Imax, Ipeak, Irms, Isum;

float Iarray[60];

unsigned long time;

void setup()

{

Serial.begin(115200);

myserial.begin(115200);

}

void loop() {

int i;

for(i=0;i<60;i++){

Idig = analogRead(A0);

if(Idig>511){

Ipeak = ((Idig-511)*5)/(0.185*1023); // Peak value of positive

Iarray[i] = Ipeak;

}

else Iarray[i] = 0;

delay(10);

}

Ipeak = findMax();

Irms = Ipeak*0.707;

Serial.print(“Irms Value =  “);

Serial.println(Irms);

delay(100);

String cmd = (“#”+String(Imax));

myserial.println(cmd);

Serial.println(cmd);

delay(1000);

}

float findMax(){

Imax = Iarray[0];

int j;

for(j=0;j<=60;j++){

if(Iarray[j] > Imax){

Imax = Iarray[j];

}

}

Serial.print(“Imax Value =  “);

Serial.println(Imax);// Imax meeans current value

return Imax;

}

6.2 CONNECTION OF NODEMCU(ESP8266)TO DHT SENSOR, LDR SENSOR, PIR MOTION DETECTION SENSOR AND TO THE CLOUD THINKSPEAK

#include <ESP8266WiFi.h>

#include “DHT.h”

#define DHTPIN D2     // what pin we’re connected to

#define DHTTYPE DHT11   // define type of sensor DHT 11

DHT dht (DHTPIN, DHTTYPE);

#define pirpin D3

#define light D4

#define fan D0

#include<SoftwareSerial.h>

SoftwareSerial myserial(D7,D8);  //(RX,TX)

const char* ssid     = “SmartBridge WIFI”;

const char* password = “SmartBridge”;

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

const char* privateKey = “DCQ6J72V3E1BVJDE”;

const String talkBackAPIKey = “FJH5P24Z3PZC7A2R”;

const String talkBackID = “13914”;

String talkBackCommand,tbRequest;

String  Imax;

void setup() {

Serial.begin(115200);

myserial.begin(115200);

delay(10);

dht.begin();

pinMode(D3,INPUT);

pinMode(D4,OUTPUT);

pinMode(D0,OUTPUT);

// We start by connecting to a WiFi network

Serial.print(“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());

}

void loop() {

if(myserial.available()>0)

{

if(myserial.find(“#”))

Imax = myserial.readStringUntil(‘ ’);  // Imax means current value

Serial.println(Imax);

}

delay(7000);

float h = dht.readHumidity();

float t = dht.readTemperature();

int ldrvalue=analogRead(A0);

//int l = map(ldrvalue,0,1023,0,100);

Serial.println(“ldrvalue”);

Serial.println(ldrvalue);

String i = (Imax);

Serial.print(“connecting to “);

Serial.println(host);

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

if(talkBackCommand == “PROXIMITYMODE”) proximitymode();

if(talkBackCommand == “ECHOMODE”) echomode();

if(talkBackCommand == “AWAYMODE”) awaymode();

if(talkBackCommand == “SLEEPMODE”)sleepmode();

delay(6000);

// Use WiFiClient class to create TCP connections

WiFiClient client;

const int httpPort = 80;

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

Serial.println(“connection failed”);

return;

}

 

 

// We now create a URI for the request

String url = “/update”;

url += “?api_key=”;

url += privateKey;

url += “&field1=”;

url += t;

url += “&field2=”;

url += h;

url += “&field3=”;

url += ldrvalue;

url += “&field4=”;

url += i;

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);

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

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

{

char charIn = client.read();

Serial.print(charIn);

}

Serial.println();

Serial.println(“closing connection”);

client.stop();

}

void getTalkBack()

{

WiFiClient client;

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.readString();

}

Serial.print(“Command -> “);

Serial.println(talkBackCommand);

Serial.println();

}

client.stop();

Serial.flush();

}

}

}

void proximitymode()

{

int pir = digitalRead(pirpin);

if(pir == HIGH)

{

digitalWrite(light,HIGH);

digitalWrite(fan,HIGH);

Serial.println(“Detected”);

}

else

{

digitalWrite(light,LOW);

digitalWrite(fan,LOW);

Serial.println(” not Detected”);

}

}

void echomode()

{

float t = dht.readTemperature();

int ldrvalue=analogRead(A0);

int l = map(ldrvalue,0,1023,0,100);

if (t>30)

{

digitalWrite(fan,HIGH);

}

else

{

digitalWrite(fan,LOW);

}

if(l<30)

{

digitalWrite(light,HIGH);

}

else

{

digitalWrite(light,LOW);

}

}

void awaymode()

{

digitalWrite(light,LOW);

digitalWrite(fan,LOW);

}

void sleepmode()

{

digitalWrite(light,LOW);

digitalWrite(fan,HIGH);

}

6.3 ANDROID APPLICATION CODE

6.3.1) XML FILES-

a)screen1.xml

<?xml version=”1.0″ encoding=”utf-8″?>

<LinearLayout xmlns_android=”http://schemas.android.com/apk/res/android”

android_layout_width=”fill_parent”

xmlns_text=”http://schemas.android.com/apk/res-auto”

android_layout_height=”fill_parent”

android_weightSum=”1″>

<ImageView

android_layout_width=”329dp”

android_layout_height=”382dp”

android_id=”@+id/imageView”

android_layout_gravity=”center”

android_src=”@drawable/yeo”

android_scaleType=”centerCrop”

android_layout_weight=”0.15″ />

</LinearLayout>

 b) activity_main.xml

 

       <?xml version=”1.0″ encoding=”utf-8″?>
<RelativeLayout xmlns_android=”http://schemas.android.com/apk/res/android”
xmlns_tools=”http://schemas.android.com/tools”
android_id=”@+id/activity_main”
android_layout_width=”match_parent”
android_layout_height=”match_parent”
android_paddingBottom=”@dimen/activity_vertical_margin”
android_paddingLeft=”@dimen/activity_horizontal_margin”
android_paddingRight=”@dimen/activity_horizontal_margin”
android_paddingTop=”@dimen/activity_vertical_margin”
tools_context=”com.example.manage.energymanagement.MainActivity”>

<Button
android_text=”ECO MODE”
android_layout_width=”match_parent”
android_layout_height=”wrap_content”
android_layout_marginTop=”37dp”
android_textColor=”#ffffff”
android_textStyle=”bold”
android_background=”@color/colorPrimaryDark”
android_id=”@+id/button”
android_layout_alignParentTop=”true”
android_layout_alignParentStart=”true” />

<Button
android_text=”Proximity MODE”
android_layout_width=”match_parent”
android_layout_height=”wrap_content”
android_layout_below=”@+id/button2″
android_textColor=”#ffffff”
android_textStyle=”bold”
android_background=”@color/colorPrimaryDark”
android_layout_alignParentStart=”true”
android_layout_marginTop=”43dp”
android_id=”@+id/button3″ />

<Button
android_text=”Away MODE”
android_layout_width=”match_parent”
android_layout_height=”wrap_content”
android_layout_marginTop=”49dp”
android_textColor=”#ffffff”
android_textStyle=”bold”
android_background=”@color/colorPrimaryDark”
android_id=”@+id/button2″
android_layout_below=”@+id/button”
android_layout_alignParentStart=”true” />

<Button
android_text=”Sleep Mode”
android_layout_width=”match_parent”
android_layout_height=”wrap_content”
android_textColor=”#ffffff”
android_textStyle=”bold”
android_background=”@color/colorPrimaryDark”
android_layout_below=”@+id/button3″
android_layout_alignParentStart=”true”
android_layout_marginTop=”23dp”
android_id=”@+id/button4″ />

<Button
android_text=”View Sensor Values”
android_layout_width=”match_parent”
android_layout_height=”wrap_content”
android_layout_below=”@+id/button4″
android_textColor=”#ffffff”
android_textStyle=”bold”
android_background=”@color/colorPrimaryDark”
android_layout_marginTop=”36dp”
android_id=”@+id/button5″
android_layout_alignParentStart=”true” />
</RelativeLayout>

c)activity_second.xml

<?xml version=”1.0″ encoding=”utf-8″?>
<RelativeLayout xmlns_android=”http://schemas.android.com/apk/res/android”
xmlns_tools=”http://schemas.android.com/tools”
android_id=”@+id/activity_second”
android_layout_width=”match_parent”
android_layout_height=”match_parent”
android_paddingBottom=”@dimen/activity_vertical_margin”
android_paddingLeft=”@dimen/activity_horizontal_margin”
android_paddingRight=”@dimen/activity_horizontal_margin”
android_paddingTop=”@dimen/activity_vertical_margin”
tools_context=”com.example.manage.energymanagement.Second”>

<TextView
android_text=”Temperature”
android_layout_width=”wrap_content”
android_layout_height=”wrap_content”
android_layout_alignParentTop=”true”
android_layout_alignParentStart=”true”
android_layout_marginTop=”37dp”
android_id=”@+id/textView” />

<TextView
android_text=”Current”
android_layout_width=”wrap_content”
android_layout_height=”wrap_content”
android_layout_marginTop=”31dp”
android_id=”@+id/textView3″
android_layout_below=”@+id/textView2″
android_layout_alignParentStart=”true” />

<TextView
android_text=”Humidity”
android_layout_width=”wrap_content”
android_layout_height=”wrap_content”
android_layout_marginTop=”23dp”
android_id=”@+id/textView2″
android_layout_below=”@+id/textView”
android_layout_alignParentStart=”true” />

<TextView
android_text=”Ldr”
android_layout_width=”wrap_content”
android_layout_height=”wrap_content”
android_id=”@+id/textView4″
android_layout_marginTop=”26dp”
android_layout_below=”@+id/textView3″
android_layout_alignParentStart=”true” />
</RelativeLayout>

6.3.2) Java files:

a)Screen1.java

package com.example.manage.energymanagement;

import android.app.Activity;

import android.content.Intent;

import android.os.Bundle;

import android.os.Handler;

public class Screen1 extends Activity {

// Splash screen timer

private static int SCREEN1_TIME_OUT = 2000;

@Override

public void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.screen1);

new Handler().postDelayed(new Runnable() {

/*

* Showing splash screen with a timer. This will be useful when you

* want to show case your app logo / company

*/

@Override

public void run() {

// This method will be executed once the timer is over

// Start your app main activity

Intent i = new Intent(Screen1.this, MainActivity.class);

startActivity(i);

// close this activity

finish();

}

}, SCREEN1_TIME_OUT);

}

}

b)MainActivity.java

package com.example.manage.energymanagement;
import android.content.Intent;
import android.os.AsyncTask;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.util.EntityUtils;

import java.io.IOException;

public class MainActivity extends AppCompatActivity {

Button b1,b2,b3,b4,b5;
String res;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
b1=(Button)findViewById(R.id.button);
b2=(Button)findViewById(R.id.button2);
b3=(Button)findViewById(R.id.button3);
b4=(Button)findViewById(R.id.button4);
b5=(Button)findViewById(R.id.button5);

b1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
new EcoAsyncTask().execute(“ECOMODE”);
}
});

b2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
new EcoAsyncTask().execute(“AWAYMODE”);
}
});

b3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
new EcoAsyncTask().execute(“PROXIMITYMODE”);
}
});

b4.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
new EcoAsyncTask().execute(“SLEEPMODE”);
}
});

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

Intent i=new Intent(MainActivity.this,Second.class);
startActivity(i);
}
});

}

private class EcoAsyncTask 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);
            Toast.makeText(getApplicationContext(),“Value updated”, Toast.LENGTH_LONG).show();
}
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/14915/commands?apikey=KGW5P4N6MB87T8H5&command_string=”+valueIWantToSend);

try {
// Add your data
                // Execute HTTP Post Request
                HttpResponse response = httpclient.execute(httppost);
res= EntityUtils.toString(response.getEntity());
Log.d(“response”res);

catch (ClientProtocolException e) {
// TODO Auto-generated catch block
            catch (IOException e) {
// TODO Auto-generated catch block
            }
}

}

}

 

b)Second.java

package com.example.manage.energymanagement;

import android.content.Intent;
import android.graphics.Color;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

import com.android.volley.Request;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.JsonObjectRequest;
import com.example.manage.energymanagement.app.AppController;

import org.json.JSONException;
import org.json.JSONObject;

public class Second extends AppCompatActivity {
TextView t1,t2,t3,t4;

private String urlJsonObj “https://api.thingspeak.com/channels/258658/feeds/last.json?api_key=62A2ARRFFK783CXW”;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_second);

t1=(TextView)findViewById(R.id.textView);
t2=(TextView)findViewById(R.id.textView2);
t3=(TextView)findViewById(R.id.textView3);
t4=(TextView)findViewById(R.id.textView4);

Thread thread = new Thread() {
@Override
public void run() {
try {
while(true) {
makeJsonObjectRequest();
sleep(10000);
makeJsonObjectRequest();
}
catch (InterruptedException e) {
e.printStackTrace();
// Toast.makeText(getApplicationContext(),”please turn on internet”,Toast.LENGTH_LONG).show();
                }
}
};

thread.start();

}
/**
     * Method to make json object request where json response starts wtih {
     * */
    private void makeJsonObjectRequest() {

JsonObjectRequest jsonObjReq = new JsonObjectRequest(Request.Method.GETurlJsonObjnullnew 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 temp = response.getString(“field1”);

t1.setText(“Temperature :”+temp);

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

t2.setText(“Humidity :”+hum);

String ldr = response.getString(“field3”);

t3.setText(“LDR :”+ldr);

String current = response.getString(“field4”);

t4.setText(“Current :”+current);

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

}
},        new Response.ErrorListener() {

@Override
public void onErrorResponse(VolleyError error) {
//  VolleyLog.d(TAG, “Error: ” + error.getMessage());
                Toast.makeText(getApplicationContext(),
error.getMessage(), Toast.LENGTH_SHORT).show();

}
});

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

}

}

 

6.3.3 ) Android Manifest File 

 

<?xml version=”1.0″ encoding=”utf-8″?>

<manifest xmlns_android=”http://schemas.android.com/apk/res/android”

package=”com.example.manage.energymanagement”>

<uses-permission android_name=”android.permission.INTERNET” />

<!– To auto-complete the email text field in the login form with the user’s emails –>

<uses-permission android_name=”android.permission.GET_ACCOUNTS” />

<uses-permission android_name=”android.permission.READ_PROFILE” />

<uses-permission android_name=”android.permission.READ_CONTACTS” />

<application

android_name=”.app.AppController”

android_allowBackup=”true”

android_icon=”@mipmap/ic_launcher”

android_label=”@string/app_name”

android_supportsRtl=”true”

android_theme=”@style/AppTheme”>

<activity

android_name=”.Screen1″

android_label=”@string/app_name”

android_theme=”@style/AppTheme.NoActionBar”>

<intent-filter>

<action android_name=”android.intent.action.MAIN” />

<category android_name=”android.intent.category.LAUNCHER” />

</intent-filter>

</activity>

<activity

android_name=”.MainActivity”

android_label=”@string/app_name”

android_theme=”@style/AppTheme.NoActionBar”>

<intent-filter>

<action android_name=”android.intent.action.MAIN” />

<category android_name=”android.intent.category.DEFAULT” />

</intent-filter>

</activity>

<activity android_name=”.Second” />

</application>

</manifest>

 

 

 

 

 

7. SYSTEM DESIGN

7.1 INPUT DESIGN

 

The link between the information system and the user is called as input design. It consists  of developing specification and procedures for data preparation and those steps are essential  to put transaction data in to a usable form for processing can be achieved by inspecting the computer to read data from a printed document or it can occur by having people keying the data directly into the system. Controlling the amount of input required, controlling the errors, avoiding delay, avoiding extra steps and keeping the process simple should be focused for the design of input.  It provides security and ease of use with retaining the privacy.

Input Design considered the following things:

  • What data should be given as input?
  • How the data should be coded?
  • The dialog to guide the operating personnel in providing input.
  • Methods for preparing input validations and steps to follow when error occur.

OBJECTIVES

1. Input Design is the process of converting a user-oriented description of the input into a computer-based system. Through this design we can able to avoid errors in the data input process and it shows the correct direction to the management for getting correct information from the computerized system.

2. User-friendly screens are created for the data entry to handle large volume of data. The main  aim  of designing input is to make data entry very easy and it should be be free from errors. It  is designed in such a way that all the data manipulations can be performed, and also provides record viewing facilities.

3.The validity is checked when the data is entered . Screens can be used for entering data. User will be provided with appropriate messages  as when needed so that the user will not be in maize of instant. Thus the objective of input designcreates an input layout which is easy to follow

7.2 OUTPUT DESIGN

The output which meets the requirements of the end user and  the information should be  clearly presented is called as quality output. The users from one system through the other can be communicated  through outputs. In output design it assertined how the information is to be displaced for immediate need and also for  the hard copy output.

1. Designing computer output should proceed in an organized, well thought out manner; the right output must be developed while ensuring that each output element can be used easily and effectively.

2. Methods  must be selected for presenting information.

3. Create document, report, or other formats that contain information produced by the system.

The output form of an information system should consists  one or more of the following objectives.

  • Convey information about past and recent  activities, current status or projections of the
  • Future.
  • Signal important events, opportunities, problems, or warnings.
  • Trigger an action.
  • Confirm an action.

7.3 SYSTEM ARCHITECTURE

BLOCK DIAGRAM:

Sensors:

LDR

PIR Sensor

DHT11

Current Sensor

Arduino UNO+Ethernet Shield

Cloud/Web server

Actuators

Mobile App

Dashboards

 

 

FIGURE 7.3.1 ARCHITECTURE OF SYSTEM: It shows how our system is designed and shows the flow among various elements throughout the system in an abstract view. Here we have our sensors like DHT11, PIR sensor, LDR sensor connected to nodumcu. Arduino uno is connected to current sensor and also to the nodemcu. Nodemcu is connected to the cloud. The cloud is connected to the android application.

7.4 UML Concepts

The Unified Modelling Language (UML) is a standard language for writing software blue prints. The UML is a language for

  • Visualizing
  • Specifying
  • Constructing
  • Documenting the artefacts of a software intensive system.

The UML is a language which provides vocabulary and the rules for combining words in that vocabulary for the purpose of communication. A  UML is a modelling language whose vocabulary and its main  focus is on the conceptual and physical representation of a system. Modelling yields an understanding of a system.

7.4.1 Building Blocks of the UML

The vocabulary of the UML encompasses three kinds of building blocks:

  • Things
  • Relationships
  • Diagrams

Things are the abstractions that are first-class citizens in a model; relationships tie these things together; diagrams group interesting collections of things.

1. Things in the UML

There are four kinds of things in the UML:

  • Structural things
  • Behavioral things
  • Grouping things
  • Annotational things

 

Structural things are the nouns of UML models. The structural things used in the project design are

Aclass is a set of objects that share the same attributes, operations, relationships and semantics.

Window
Origin 

Size

open() 

close()

move()

display()

 

 

 

 

 

Fig: Classes

use case is called as set of sequence of actions that a system performs to get an observable result of value to particular actor.

Fig: Use Cases

A node is a runtime computational resource that is physical  in nature that  has processing capability and memory as well.

Fig: Nodes

Behavioral things are the dynamic parts of UML models. The behavioral thing used is:

 

Interaction:

An interaction is a behaviour that comprises among a set of objects within a particular context to accomplish a specific purpose and that comprises a set of messages. An interaction involves a number of other elements, including messages and action sequences (the behaviour invoked by a message, and links (the connection between objects).

Fig: Messages

2. Relationships in the UML:

There are four kinds of relationships in the UML:

  • Dependency
  • Association
  • Generalization
  • Realization

dependency is a semantic relationship between two things in which a change to independent thing may affect the semantics of the dependent thing.

Fig: Dependencies

An association is a structural relationship that describes a set of links, a link being connected among objects. It is a special kind of association, which  represents  a structural relationship between a whole and its  sub parts.

Fig: Association

generalization is a specialization/ generalization relationship in which objects of the child are substitutable for objects of the parent.

Fig: Generalization

realization is a semantic relationship between classifiers, where in one classifier specifies a contract that another classifier guarantees to carry out.

Fig: Realization

7.4.2 UML DIAGRAMS:

7.4.2.1. USE CASE Diagram

 

                                            FIGURE 7.4.2.1 USE CASE DIAGRAM

The above diagram is Use Case diagram of our system. It shows the set of actions performed by various users. In our system we have 3 types of Actors and also called as Users. They are 1) Administrator 2) Registered User and 3) Arduino. As described earlier, the content in the Ovals are actions performed in the system and those actors are like symbols represent users in system. Those dashed lines from user to action means users are performing those actions respectively.

 

7.4.2.2. Sequence Diagram

 

C:UsersNAyeemDownloadssequence.png 

           Figure7.4.2.2 SEQUENCE DIAGRAM

 The above diagram shows  sequence diagram. It represents sequence or flow of messages in system having  among various objects of the system. The rectangle boxes at top represent objects that are appealed  and the dashed lines dropping from those boxes are life lines which shows existence of the object up to what time. The boxes on the dashed lines are events and the lines connecting them represent messages and their flow.

7.4.2.3 CLASS DIAGRAM

C:UsersNAyeemDownloadsclass.png

 

FIGURE 7.4.2.3 CLASS DIAGRAM:

The above diagram represents class diagram of our system i.e., it shows various classes used in our system and the relationship with one class to other in the system. Each rectangle box represents a class and the upper portion of it represents class name and middle portion represents attributes of the class and the lower represents the functions performed by that class.

 

 

 

7.4.2.4COMPONENT DIAGRAM

C:UsersNAyeemDownloadscomponent.png

FIGURE 7.4.2.4 COMPONENT DIAGRAM

A component diagram shows various components raised in system at time of execution of various functions in the system.

 

 

7.4.2.5 ACTIVITY DIAGRAM

C:UsersNAyeemDownloadsactivity1.png

FIGURE 7.4.2.5 ACTIVITY DIAGRAM

The above diagram represents activity diagram of the system i.e., it represents the flow of activities from one activity to the another.  Dot at the start represents starting and dot with circle represents ending and an activity is represented as curve sided rectangle. On seeing it we can understand the flow activities that has to be gone from beginning  to ending.

 

 

 

  8. SYSTEM TESTING

To discover errors, testing is used and that is the main purpose of it. The process of trying to discover every conceivable fault or weakness in a work product is known as Testing. To check the functionality of components, sub-assemblies, assemblies and/or a finished product, the testing is used. It is the process of exercising software with the intent of ensuring that the software system meets its requirements and user expectations and does not fail in an unacceptable manner. There are various types of test. Every test type addresses a specific testing requirement.

8.1 TYPES OF TESTS

1. Unit testing

Unit testing includes the design of test cases that validate the internal program logic is functioning properly or not and that program inputs produce valid outputs or not. Validate the all decision branches and internal code flow. Unit testing tests individual software units of the application . It is done after the completion of an individual unit before integration. This is a structural testing, that relies on knowledge of its construction and is invasive. Unit tests perform basic tests at component level and tests a specific business process, application, and/or system configuration. Unit tests ensure that each unique path of a business process performs accurately to the documented specifications and contains clearly defined inputs and expected results

2Integration testing

Integration tests are designed to test integrated software components to determine if they actually run as one program or not .Testing is more concerned with the basic outcome of screens or fields. Integration tests demonstrate that although the components were individually satisfied, as shown by successfully unit testing, the combination of components is correct and consistent. Integration testing is specifically aimed at exposing the problems that arise from the combination of components.

3Functional test

Functional tests provide systematic demonstrations that functions tested are available as specified by the business and technical requirements, system documentation, and user manuals.

Functional testing is centered on the following items:

  • Valid Input               :  identified classes of valid input must be accepted.
  • Invalid Input             : identified classes of invalid input must be rejected.
  • Functions                  : identified functions must be exercised.
  • Output                      : identified classes of application outputs must be exercised.
  • Systems/Procedures: interfacing systems or procedures must be invoked.

Organization and preparation of functional tests is focused on requirements, key functions, or special test cases. In addition, systematic coverage pertaining to identify Business process flows; data fields, predefined processes, and successive processes must be considered for testing. Before functional testing is complete, additional tests are identified and the effective value of current tests is determined.

4. System Test

System testing ensures that the entire integrated software system meets requirements and gives predictable results. System testing is based on process descriptions and flows, emphasizing pre-driven process links and integration points.

5. White Box Testing

White Box Testing is a testing in which in which the software tester has knowledge of the inner workings, structure and language of the software, or at least its purpose.  It is used to test areas that cannot be reached from a black box level.

6. Black Box Testing

Black Box Testing is testing the software without any knowledge of the inner workings, structure or language of the module being tested. Black box tests, as most other kinds of tests, must be written from a definitive source document, such as specification or requirements document, such as specification or requirements document. It is a testing in which the software under test is treated, as a black box .you cannot “see” into it. The test provides inputs and responds to outputs without considering how the software works.

 

 

 

8.2 Unit Testing:

Unit testing is regularly directed as part of a combined code and unit test phase of the software lifecycle, even if it is not unusual for coding and unit testing to be accompanied as two distinct phases.

Test strategy and methodology

Field testing will be achieved manually and functional tests will be written in detail.

Test objectives

• All field records must work properly.

• Pages must be activated from the recognized link.

• The entry screen, messages and responses must not be delayed

Features to be tested

• Entries should be of the correct format.

• Duplicate entries should not  be allowed

• All links should point  the user to the correct page.

8.3 Integration Testing

Software integration testing is the incremental integration testing of two or more assimilated software components on a particular platform to produce failures caused by interface defects. The main aim of the integration test is to check that components or software applications, e.g. components in a software system or – one step up – software applications at the company level – interact without error.

Test Results: All the test cases mentioned above passed successfully. No defects encountered.

8.4 Acceptance Testing

User Acceptance Testing is a precarious phase of any project and needssubstantialinvolvement by the end user. It also ensures that the system meets the functional requirements.

Test Results: All the test cases mentioned above passed successfully. No defects encountered

                            9. RESULT AND ANALYSIS

IMG-20170425-WA0001.jpg

FIGURE 9.1 HARDARE REQUIREMENTS: Here we have connected arduino, nodemcu and all the other sensors like DHT, LDR sensor, PIR motion detection sensor and current sensor.

arduinop.png

FIGURE 9.2 CURRENT BEING SENSED BY ARDUINO: After uploading the code on the Arduino serial monitor displays us the current value

nodemcu.png

FIGURE 9.3 LIGHT, MOTION,TEMPERATURE AND HUMIDITY BEING SENSED BY NODEMCU: After uploading the code on the nodemcu( wifi module), the serial monitor displays us the respective temperature, light humidity and motion detection at that particular point of time.

graph.png

FIGURE 9.4 DATA BEING TRASFERRED TO THE CLOUD PLATFORM THINGSPEAK AND THE RESULTS ARE SHOWN IN THE FORM OF GRAPH: The above gives a brief description of the data being transferred to the cloud platform.

Main screen.png

 

FIGURE 9.5 FIRST SCREEN IN ANDROID APP NAMED AS YOUR ENERGY OPTIMIZER.This is the first screen of the android application.

modes.png

FIGURE 9.6 SECOND SCREEN SHOWING ALL THE DIFFERNET MODES

This screen displays the different modes that can be used by the user. The lights get ON/OFF depending upon the temperature conditions as given by the user. In the case of proximity mode depending upon the motion the lights get ON/OFF. In sleep mode only one devise gets off as required by the user. In away modes all the lights get turned off.

view sensor values.png

FIGURE 9.7 SCREEN SHOWING ALL THE SENSOR VALUES

It shows the latest sensor values.

IMG_20170419_172400785_HDR.jpg

FIGURE 9.8 AFTER CHECKING ALL THE CONDITIONS AS PER THE USER THE BULB GLOWS

10. CONCLUSION AND FUTURE SCOPE

It has been such an exciting, challenging project for me to work on that has given me immense pleasure. This project has given me a lot of practical knowledge about how to develop an IoT (Internet of Things) application. It was fun working with android app, cloud and different types of sensors like current sensor, PIR sensor, LDR sensor, DHT sensor. This project has helped me realize the potential which is present in developing an IoT ( Internet of Things) application like this. The future scope of this project is immense. It is highly useful for senior citizens and disabled people in many ways.

BENEFITS:

The outline of this project is as follows: –

  • Your Energy Optimizer is the name given to the android app that can be easily downloaded by the any person who wishes to reduce energy.
  • When proximity mode is clanked by the user in the android application, the movement is detected
  • Sometimes the user might over consume the electricity without being aware of it.  This project aims to save energy resources especially in buildings.
  • It will become speedy and uncomplicated to maintain the data and redeem it from the cloud.
  • The computing of information would greatly enhance the decision making process. The manual system is time consuming as the data collection from information available on cloud takes much less time.
  • The user’s information stored in the cloud is completely safe.
  • Every user can easily turn on/off the lights by just logging in and making the reforms they want.

 

 

 

 

 

11. BIBLIOGRAPHY

 References Made From:

  1.  Hong W H, Kim J Y, Lee C M, Jeon G Y. Energy consumption and the power saving potential of a University in Korea: using a field survey. Journal of Asian Architecture and Building Engineering, 2011, 10(2): 445–452
  2. Pavlas M, Stehlik P, Oral J, Sikula J. Integrating renewable sources of energy into an existing combined heat and power system. Energy, 2006, 31(13): 2499–2511
  3. Kalkan N, Bercin K, Cangul O, Morales M G, Saleem M M K M, Marji I, Metaxa A, Tsigkogianni E. A renewable energy solution for highfield campus of University of Southampton. Renewable & Sustainable Energy Reviews, 2011, 15(6): 2940–2959
  4. Koester R J, Eflin J, Vann J. Greening of the campus: a wholesystems approach. Journal of Cleaner Production, 2006, 14(9–11): 769–779
  5.  Gao B, Tan H W, Song Y C. Campus building energy consumption: taking one comprehensive university as example. Building Energy Efficiency, 2011, 39(2): 41–44 (in Chinese)
  6. Martani C, Lee D, Robinson P, Britter R, Ratti C. ENERNET: Studying the dynamic relationship between building occupancy and energy consumption. Energy and Building, 2012, 47: 584–591

Sites Referred:

http://www.sunrom.com/

http://www.everlight.com/

https://www.arduino.cc/

http://bbs.espressif.com/

Professor

You must be logged in to post a comment