Download as pdf or txt
Download as pdf or txt
You are on page 1of 60

K.L.E.

SOCIETY’S
P.C.JABIN SCIENCE COLLEGE,
AUTONOMUS,
(Affiliated to KARNATAK UNIVERSITY, DHARWAD)
HUBBALLI -580031

Bachelor of Computer Application


2021-22
PROJECT REPORT
On

Electric Consumption Measuring

Submitted in partial fulfillment of the requirement for the award


of the degree

BACHELOR OF COMPUTER APPLICATION


Submitted By

Karthik Kalburgi Vikas Chavadi


219015 219052

Under The Guidance Of


Prof Vishwanath Patil

Affiliated to
Karnataka University, Dharwad.
K.L.E. SOCIETY’S
P.C.JABIN SCIENCE COLLEGE,
AUTONOMUS,
(Affiliated to KARNATAK UNIVERSITY, DHARWAD)
HUBBALLI -580031

Bachelor of Computer Application


e-mail:klesbca@gmail.com Ph: 0836-2372298
K.L.E. SOCIETY’S
P.C.JABIN SCIENCE COLLEGE CAMPUS,
AUTONOMUS,
(Affiliated to KARNATAK UNIVERSITY, DHARWAD)
HUBBALLI -580031
BCA DEPARTMENT

2021-22

CERTIFICATE

This is to certify that the project entitled Electric Consumption Measuring is a bonified work carried
out by the student team Mr.Karthik Kalburgi - Reg No 219015 and Mr.Vikas Chavadi - Reg No 219052,
in partial fulfillment of the award of degree of Bachelor of Computer Application during the year 2021
– 2022. The project report has been approved as it satisfies the academic requirement with respect to
the project work prescribed for the award of BCA Degree.

Prof Vishwanath Patil Prof Sunil Vernekar

Guide Principal

External Examination:

Name of the Examiners Signature with date


1.

2.
DECLARATION

We here by declared that the project report entitled Electric Consumption Measuring, submitted in

fulfillment of requirement of BCA VI Sem Project work for the award of Degree in Bachelor of

Computer Application of KARNATAK UNIVERSITY, Dharwad during the academic year 2021-22.

We further declare that this project report is the result of our original work and has not been submitted

to any other organization or institute for the award of any degree or diploma.

Date:

Place: Hubballi

Sign

Vikas Chavadi

Karthik Kalburgi
ACKNOWLEDGEMENT

It’s our pleasure to thank all the individuals who have directly or indirectly helped and motivated

us in the fulfilment of completion of the project work.

We thank Prof Sunil Vernekar (Principal), KLE Society’s BCA, P C Jabin Science

College, HUBBALLI for having given us all encouragement and motivation for making this

project work successful.

We thank our guide Prof Your Vishwanath Patil, KLE Society’s BCA, P C Jabin

Science College, HUBBALLI for giving us valuable suggestions and guidance for our project

work, which are the background of the project.

Our gratitude also goes to all Teaching and Non-Teaching staff of KLE Society’s

BCA, P C Jabin Science College, HUBBALLI who have helped us in completing this project

work.

Finally, we would like to thank our family and friends for their constant motivation and

inspiration that kept us going.

Sign

Vikas Chavadi

Karthik Kalburgi
ABSTRACT
A framework is developed which enables the consumers to monitor and know how much
power and current is consumed by devices in order to carryout efficient power usage. It shows
the power consumption of individual devices so that the user may keep track of how much
energy is being used. The user can better monitor it with the help of automation. The user is
merely a click away from acquiring the required information without having to physically
visit the area. By conserving time and energy, this helps to reduce the user’s workload.

In this project , we have created effectively and efficiently software application which makes
easy to operate for users of “Electric Consumption Measuring”.
Dedicated

To

Society
CONTENTS

Slno Topic Page


No
1 Introduction 1
2 Literature Survey (Objective and Feasibility study) 3
3 Technical Requirements (Hardware and Software) 6
4 Project Description 24
5 System Design (Flow Charts / DFD / ER Diagrams 27
…)
6 Source Code 32
7 UI Design And Outputs 38
8 Implementation (Deployment) 41
9 Testing Methods with Test Case 47
10 Advantages of Project 49
Conclusion 50
Future Enhancement 51
Bibliography 52
Electric Consumption Measuring

1. Introduction

The Electric Consumption Measuring model is about measuring the amount of current
and power consumed by an appliance or a node .Node can be a room, home, apartment,
office or an institute .Current consumption is measured using a current sensor .While
to calculate power, the output of sensor has to undergo various processes, Once the
current and power consumed values are known, then the respective values will be
communicated to cloud using Wi-Fi module with the help of updated values, one can
ensure the power consumption values which measures as it is potable and can be viewed
using the graphs at the front end display of the cloud. The benefits of this proposed
model is emphasizing smart viewing of the power consumption of a particular appliance
or a certain node. At a personal level, the installation of security is impossible hence
this proposed model can be implemented to avoid illegal activities. The important
aspect of this model is to ensure accuracy so as to maintain the data set generated and
to store in the cloud as it involves the calibration One can easily understand the
fluctuations occurring in the power consumption using the graphs

Limitations of existing system:

In the existing system all the readings work was done manually. The manual work
processes were time consuming where the results were not accurate.

Following are the main drawbacks of the existing system:

 The existing system is fully manual which may result to human errors.
 The basic or major drawbacks in the existing system could handle by experts.
 The existing system couldn’t handle high-voltages.
 The existing system produces unclassified data.
 The existing system totally typical and untidy.

KLES BCA, P C JABIN SCIENCE COLLEGE, HUBBALLI 1


Electric Consumption Measuring

Proposed system

The project proposes the use of sensors and analytics to design power monitoring
system. To this end, the proposed design will be implemented at the university. This
project proposes an IoT based solution for monitoring power consumed by individual
devices using sensors, sending it via ESP32 to a centralized server, visualizing data via
a web interface and also using cloud.

1) The main purpose of this system is that it provides us with the accurate results
2) This system provides real time readings (ampere)
3) It provides us with the appropriate Voltage readings
4) It provides us the platform where it provides us the access to the graph which
can be easily understandable by the User
5) It provides us the accurate results in the form of MS-Excel format
6) It provides proper details to the User at the single click
7) No need of maintain Bills (Receipt) because it can store the data for a long
period of time
8) The data of the power supply will be generated every 10 seconds

KLES BCA, P C JABIN SCIENCE COLLEGE, HUBBALLI 2


Electric Consumption Measuring

II Literature Survey (Objective and Feasibility study):

OBJECTIVE :

The objectives of proposed design are as follows:

1) To implement a system that ensures efficient and regular


notification of power consumed by individual devices.

2) To design a system with an effective sensor so, that accurate value


is obtained at regular intervals of time.

3) To design a system That sends obtained values to the user and


also to the cloud and stored there for future reference.

KLES BCA, P C JABIN SCIENCE COLLEGE, HUBBALLI 3


Electric Consumption Measuring

FEASIBILITY:
The feasibility study of any application is mainly intended to study and analyze the
proposed system and to decide whether the application under consideration will be
viable or not after implementation. That is, it determines the usability of the project
after deployment. To come to result a set of queries is answered keeping the efficiency
of the software and its impact on the domain for which it was developed. Feasibility
study includes consideration of all the possible ways to provide a solution to the given
problem. The proposed solution should satisfy all the user requirements and should be
flexible enough so that future changes can be easily done based on the future upcoming
requirements.

Technical Feasibility:
According to feasibility analysis procedure the technical feasibility of the system is
analyzed and the technical requirements such as software, facilities, procedure, inputs
are identified. The hardware and software needed are all available, it not difficult to get
them. Brief we can say the necessary resources needed for the development and
maintenance of the application are available. It is also one of the important phases of
the system development activities. The application offers greater levels of user
friendliness combined with greater processing speed. Therefore, the cost of
maintenance can be reduced. Since, processing speed is very high and the work is
reduced in the maintenance point of view management convince. As per the feasibility
study, all our software resources are open and free, and hardware requirements like ESP
32 Wi-fi Module, Hall effect sensor, MCP 3008, Bridge rectifier are easily available
and affordable.

KLES BCA, P C JABIN SCIENCE COLLEGE, HUBBALLI 4


Electric Consumption Measuring

Organizational Feasibility:
objective of the organization and its strategic plan for an information system. This may
include information about the Organizational feasibility focuses on how well a
proposed information system supposes the founders, their professional background and
the skills they possess necessary to get the company off the ground and keep it
operational. It also determines whether the new system will have enough support from
participants to be successfully implemented and whether participants can operate the
system

KLES BCA, P C JABIN SCIENCE COLLEGE, HUBBALLI 5


Electric Consumption Measuring

III Technical Requirements (Hardware and Software):

Hardware Requirements:

 Hall effect sensor

 Bridge rectifier

 MCP 3008

 ESP 32

Software Requirements:
 ThingsSpeak Website
 Arduino IDE

KLES BCA, P C JABIN SCIENCE COLLEGE, HUBBALLI 6


Electric Consumption Measuring

 Hall effect Sensor:

Hall effect Sensor Diagram

Hall effect sensor:


Hall effect is used to determine if a substance is a semi-conductor or an insulator. The
nature of the charge carriers can be measured.

While the true power measuring is a common approach in the field of tool monitoring.
Evaluation of the true power values which are acting in the axis motors helps to obtain
detailed knowledge of the characteristics of a machining process. Hall sensors vary their
output voltage in response to a magnetic field. The power measurement technology in
connection with an amplifier and a measuring unit is able to detect very small values of
different cutting processes.

True power monitoring via hall effect sensors is an easy to implement method for
achieving reliable, high sensitivity monitoring of small tools and adaptive cycle. True
power control is the solution for those machines without digital data signals or in
addition for dedicated spindle and motor axis values.

KLES BCA, P C JABIN SCIENCE COLLEGE, HUBBALLI 7


Electric Consumption Measuring

Bridge rectifier:

Bridge rectifier diagram:

Bridge rectifier:

Bridge rectifier: The rectifier circuit is used to convert the AC (Alternating Current)
into DC (Direct Current). Rectifiers are mainly classified into three types namely half-
wave, full-wave, and bridge rectifier. The main function of all these rectifiers is the
same as the conversion of current but they not efficiently convert the current from AC
to DC. The center tapped full wave rectifier as well as bridge rectifier converts
efficiently. A bridge rectifier circuit is a common part of the electronic power supplies.
Many electronic circuits require a rectified DC power supply for powering the various
electronic basic components from available AC mains supply. We can find this rectifier
in a wide variety of electronic AC power devices like home appliances, motor
controllers, modulation process, welding applications, etc. This article discusses an
overview of a bridge rectifier and its working.

KLES BCA, P C JABIN SCIENCE COLLEGE, HUBBALLI 8


Electric Consumption Measuring

Bridge rectifier construction:


The construction diagram of a bridge rectifier is shown in the below figure. The bridge
rectifier is made up of four diodes namely D1, D2, D3, D4 and load resistor RL. The four
diodes are connected in a closed loop (Bridge) configuration to efficiently convert the
Alternating Current (AC) into Direct Current (DC). The main advantage of this bridge
circuit configuration is that we do not require an expensive center tapped transformer,
thereby reducing its cost and size.

The input AC signal is applied across two terminals A and B and the output DC signal
is obtained across the load resistor RL which is connected between the terminals C and
D.

The four diodes D1, D2, D3, D4 are arranged in series with only two diodes
allowing electric current during each half cycle. For example, diodes D1 and D3 are
considered as one pair which allows electric current during the positive half cycle
whereas diodes D2 and D4 are considered as another pair which allows electric current
during the negative half cycle of the input AC signal.

KLES BCA, P C JABIN SCIENCE COLLEGE, HUBBALLI 9


Electric Consumption Measuring

Working of bridge rectifier:

When input AC signal is applied across the bridge rectifier, during the positive half
cycle diodes D1 and D3 are forward biased and allows electric current while the diodes
D2 and D4 are reverse biased and blocks electric current. On the other hand, during the
negative half cycle diodes D2 and D4 are forward biased and allows electric current
while diodes D1 and D3 are reverse biased and blocks electric current.

During the positive half cycle, the terminal A becomes positive while the terminal B
becomes negative. This causes the diodes D1 and D3 forward biased and at the same
time, it causes the diodes D2 and D4 reverse biased.

The current flow direction during the positive half cycle is shown in the figure A (I.e.
A to D to C to B).

Advantages of bridge rectifier

 Low ripples in the output DC signal:

The DC output signal of the bridge rectifier is smoother than the half wave rectifier. In
other words, the bridge rectifier has fewer ripples as compared to the half wave rectifier.
However, the ripple factor of the bridge rectifier is same as the center tapped full wave
rectifier.

 High rectifier efficiency:

The rectifier efficiency of the bridge rectifier is very high as compared to the half wave
rectifier. However, the rectifier efficiency of bridge rectifier and center tapped full wave
rectifier is same.

KLES BCA, P C JABIN SCIENCE COLLEGE, HUBBALLI 10


Electric Consumption Measuring

 Low power loss:


In half wave rectifier only one-half cycle of the input AC signal is allowed and
the remaining half cycle of the input AC signal is blocked. As a result, nearly
half of the applied input power is wasted.

However, in the bridge rectifier, the electric current is allowed during both
positive and negative half cycles of the input AC signal. So, the output DC power is
almost equal to the input AC power.

KLES BCA, P C JABIN SCIENCE COLLEGE, HUBBALLI 11


Electric Consumption Measuring

MCP 3008:

MCP 3008 circuit diagram:

MCP 3008:

KLES BCA, P C JABIN SCIENCE COLLEGE, HUBBALLI 12


Electric Consumption Measuring

MCP 3008:

The MCP3008 is a low cost 8-channel 10-bit analog to digital converter. The precision
of this ADC is similar to that of an Arduino Uno, and with 8 channels you can read
quite a few analog signals from the Pi. This chip is a great option if you just need to
read simple analog signals, like from a temperature or light sensor.

MCP3008 ADC Features:


The main features are:

 8-channel ADC IC with 10-bit resolution and serial SPI interface


communication protocol.

 It has programmable analog inputs which can be configured in either single-


ended or pseudo-differential modes.

 Operate over a range of 2.7V to 5V.

 The chip employs Successive Approximation (SAR) architecture for ADC


conversion.

 The sampling rate is 200ksps for 5V and 75ksps for 2.7V respectively.

 It is based on low power CMOS technology

 The industrial temperature range for this chip is -40°C to +85°C.

 It has a standby current of 5 na and typical active currents of 320 µA.

KLES BCA, P C JABIN SCIENCE COLLEGE, HUBBALLI 13


Electric Consumption Measuring

How to use MCP3008?

It consists of a famous SAR ADC architecture technology that contains a built-in


sample and holds a capacitor. This architecture performs sampling with a sample/hold
capacitor for 1.5 clock cycles on the first rising edge of the clock cycle. After that
ADC produces 10-bit digital output depending on the charge value on S/H capacitor

The communication is initiated with the MCP3008 device is accomplished by bringing


the CS line low. On the first clock signal (when CS is low and DIN is high), the first
bit received will constitute a start bit. This start bit is followed by the SGL/DIFF bit
which determines the mode of conversion either single-ended or differential. After that,
the next three bits which are D0, D1, and D2 are used to select the channel. On the
fourth rising edge of the clock, after the start bit has been received, the sampling of
analog inputs will be started.

Applications of MCP3008:

 Data acquisition

 Robotics

 Multi-channel data loggers

 instrumentation and measurement

 Controlling servo motors

 Smart sensors

 Sensor Interface

 Process Control

 Data Acquisition

 Battery Operated Systems

KLES BCA, P C JABIN SCIENCE COLLEGE, HUBBALLI 14


Electric Consumption Measuring

ESP 32:

Working of ESP-32 Model

KLES BCA, P C JABIN SCIENCE COLLEGE, HUBBALLI 15


Electric Consumption Measuring

ESP 32:

ESP32-DevKit-Board-Layout

ESP32-Block-Diagram
KLES BCA, P C JABIN SCIENCE COLLEGE, HUBBALLI 16
Electric Consumption Measuring

ESP32:

ESP32 is the name of the chip that was developed by Espresso if Systems. This provides
Wi-Fi (and in some models) dual-mode Bluetooth connectivity to embedded devices.
While ESP32 is technically just the chip, modules and development boards that contain
this chip are often also referred to as “ESP32” by the manufacturer.

The ESP32 is designed for data collection and communication. This internet of things-
based unit consists of many components for better performance of the system. The
ground level most components are sensors for sensing the current and sends it to next
levels for processing. The power tracking system is well managed and functioned by
using internet of things. The current sensed is processed in such a way that
representation of it becomes much easier in the higher levels. This is achieved by the
optimization of the respective programming languages by Arduino and MCP3008 and
communication takes at different set of intervals by ESP32. This is much simplest way
of storing and processing of information. The storage and representation of information
is done in free source. The IOT based power tracking system using ESP32: The project
possesses a system that senses current and calculates power in kW. Sensors like current
sensors are used to monitor power and it is sent to cloud data using ESP32 and it will
be monitored by the end user.

ESP32 can perform as a complete standalone system or as a slave device to a host MCU,
reducing communication stack overhead on the main application processor. ESP32 can
interface with other systems to provide Wi-Fi and Bluetooth functionality through its
interfaces.

The differences between these are explained further on in the article.

The ESP32 chip has a Ten silica xtensa LX6 microprocessor in both dual-core and
single-core variations, with a clock rate of over 240 MHz There are now several
different chip models available.

KLES BCA, P C JABIN SCIENCE COLLEGE, HUBBALLI 17


Electric Consumption Measuring

The different chip models are as follows:

 ESP32-D0WDQ6 (and ESP32D0WD)

 ESP32-D2WD

 ESP32-S0WD

The system in package (Sip) – ESP32-PICO-D4

Models are available with combined Wi-Fi and Bluetooth connectivity, or just Wi-Fi
connectivity.

While this reputation is not unmerited, the low-cost device can also be used in a number
of different production systems, and its capabilities and resources have grown
impressively over the past four years.

The features of ESP-32 are as follows: -

 Memory: 320 KiB RAM, 448 KiB ROM.

 Wireless connectivity: Wi-Fi: 802.11 b/g/n.

 Peripheral interfaces: 34 × programmable GPIOs.

 Security.

 Power management.

For many of those years the ESP32 seemed to have the reputation that it was a low-cost
maker module for hobbyist and developers interested in one-off projects

There is no doubt that the ESP32 is a worthy competitor to many Wi-Fi/MCU, often
beating it both on performance as well as in price segment. But, depending on what
mode it is in, the ESP32 can be a relatively power-hungry device.

KLES BCA, P C JABIN SCIENCE COLLEGE, HUBBALLI 18


Electric Consumption Measuring

When your Electric consumption measuring project is powered by a plug in the switch,
you don’t care too much about power consumption. But if you’re going to power your
project from a battery, every mA counts.

The solution here is to take advantage of one of its sleep modes to reduce the ESP32’s
power usage. This is actually a great strategy for dramatically increasing the battery life
of a project that doesn’t need to be active all the time.

ESP32 sleep mode is defined as a power-saving mode that the ESP32 can enter when
not in use, saving all data in RAM. At this time, power to any unnecessary peripherals
is cut off while the RAM receives enough power to be able to retain its data.

Memory:
 Internal memory:

 ROM: 448 KiB

 For booting and core functions.

 SRAM: 520 KiB

 For data and instruction.

 RTC fast SRAM: 8 KiB

 For data storage and main CPU during RTC Boot from the deep-sleep mode.

 RTC slow SRAM: 8 KiB

 For co-processor accessing during deep-sleep mode.

 Effuse: 1 Kibit

 Of which 256 bits are used for the system (MAC address and chip configuration)
and the remaining 768 bits are reserved for customer applications, including
Flash-Encryption and Chip-ID.

 Embedded flash:

KLES BCA, P C JABIN SCIENCE COLLEGE, HUBBALLI 19


Electric Consumption Measuring

 Flash connected internally via IO16, IO17, SD_CMD, SD_CLK, SD_DATA_0


and SD_DATA_1 on ESP32-D2WD and ESP32-PICO-D4.

 0 MIB (ESP32-D0WDQ6, ESP32-D0WD, and ESP32-S0WD chips)

 2 MIB (ESP32-D2WD chip)

 4 MIB (ESP32-PICO-D4 Sip module)

 External flash & SRAM: ESP32 supports up to four 16 MIB external QSPI
flashes and SRAMs with hardware encryption based on AES to protect
developers' programs and data. ESP32 can access the external QSPI flash and
SRAM through high-speed caches.

 Up to 16 MIB of external flash are memory-mapped onto the CPU code space,
supporting 8-bit, 16-bit and 32-bit access. Code execution is supported.

 Up to 8 MIB of external flash/SRAM memory are mapped onto the CPU data
space, supporting 8-bit, 16-bit and 32-bit access. Data-read is supported on the
flash and SRAM. Data-write is supported on the SRAM.

Security:

 IEEE 802.11 standard security features all supported, including WFA,


WPA/WPA2 and WAPI
 Secure boot
 Flash encryption
 1024-bit OTP, up to 768-bit for customers
 Cryptographic hardware acceleration: AES, SHA-2, RSA, elliptic curve
cryptography (ECC), random number generator (RNG).

KLES BCA, P C JABIN SCIENCE COLLEGE, HUBBALLI 20


Electric Consumption Measuring

Processors:

o Main processor: Ten silica xtensa 32-bit LX6 microprocessor


o Cores: 2 or 1 (depending on variation)
o All chips in the ESP32 series are dual-core except for ESP32-S0WD,
which is single-core.
o Clock frequency: up to 240 MHz
o Performance: up to 600 DMIPS

Software Requirements:

Thing speak website:-

Thing speak website Diagram

KLES BCA, P C JABIN SCIENCE COLLEGE, HUBBALLI 21


Electric Consumption Measuring

Thing Speak is IoT Cloud platform where you can send sensor data to the cloud. You
can also analyse and visualize your data with MATLAB or other software, including
making your own applications.
The Thing Speak service is operated by MathWorks. In order to sign up for Thing
Speak, you must create a new MathWorks Account or log in to your existing
MathWorks Account.
Thing Speak is free for small non-commercial projects.
Thing Speak includes a Web Service (REST API) that lets you collect and store
sensor data in the cloud and develop Internet of Things applications. It works with
Arduino, Raspberry Pi and MATLAB (premade libraries and APIs exists) But it
should work with all kind of Programming Languages, since it uses a REST API and
HTTP.
Thing Speak is often used for prototyping and proof of concept IoT systems that require
analytics.

Thing Speak Key Features:

Thing Speak allows you to aggregate, visualize and analyse live data streams in the cloud.
Some of the key capabilities of Thing Speak include the ability to:

 Easily configure devices to send data to Thing Speak using popular IoT protocols.
 Visualize your sensor data in real-time.
 Aggregate data on-demand from third-party sources.
 Use the power of MATLAB to make sense of your IoT data.
 Run your IoT analytics automatically based on schedules or events.
 Prototype and build IoT systems without setting up servers or developing web
software.
 Automatically act on your data and communicate using third-party services like
Twilio or Twitter.
 Thing Speak is an open-source software which allows users to communicate with
internet enabled devices. It facilitates data access, retrieval and logging of data by
providing an API to both the devices and social network websites

Reason of Use:

As we will be able to monitor the power usage in real time which reduces the problem of
over usage.

KLES BCA, P C JABIN SCIENCE COLLEGE, HUBBALLI 22


Electric Consumption Measuring

IDE: Arduino ide

The Arduino Integrated Development Environment - or Arduino Software (IDE) - contains


a text editor for writing code, a message area, a text console, a toolbar with buttons for
common functions and a series of menus. It connects to the Arduino hardware to upload
programs and communicate with them.

Reason of Use

The system is very easy to install anywhere, all it needs is to plug the device that needs to be
monitored.

KLES BCA, P C JABIN SCIENCE COLLEGE, HUBBALLI 23


Electric Consumption Measuring

IV Project Description

A Power Monitoring Device measures a power consumption in order to support energy-


saving activities. While the project consists of a current sensor, bridge rectifier, MCP
3008 and Wi-Fi module. Current sensor is used to sense current. We have used ESP32
which contains inbuilt Wi-Fi module and current sensors to sense the data. We have
also used linear MCP 3008 so as to eliminate errors that may occur due to nonlinearity.
The output of current sensor is analog ac current; the output of current sensor is given
to bridge rectifier. Bridge rectifier converts analog AC to analog DC. The output of
bridge rectifier is given to MCP 3008, MCP 3008 converts analog DC component to
digital DC. The output of mcp3008 is used to calculate power consumption hence both
current and power values are communicated to thing speak cloud which provides us
with the accurate results. In the front-end display of thing speak cloud, the values can
be viewed. The data is stored in thing speak cloud which can be checked at desired
times and we can get the accurate results in the MS-Excel format. While Thing speak is
used both to display and store the data in the cloud.

KLES BCA, P C JABIN SCIENCE COLLEGE, HUBBALLI 24


Electric Consumption Measuring

Literature Survey details :


Vasudev Tadvarthy et proposed “Smart Power Monitoring System” It live in a world
where almost everything runs on electricity. 67% of the resources used to produce
electricity are non-renewable sources of energy. And yet we do not comprehend the
seriousness to conserve our resources as the rate at which are using them, it is estimated
that all of earth’s nonrenewable sources of energy will get exhausted by 2100. The aim
of this paper is to develop a power consumption monitor for domestic use. It uses an
Arduino, current sensor, esp32 and cloud platform as a service to store and analyze
data. Our solution aims at saving power by constantly notifying the power consumed
by the appliances & providing better insights to user.

Arati Kurde et al Defined “IOT Based Smart Power Metering” In India, plug load
devices in building sectors are consuming close to 40 percent of the total electricity
consumption. Though the share of plug load in building energy is increasing, very few
studies exist on the plug level energy usage and consumption. In order to address the
growing energy use of miscellaneous and electronic load (e.g. water heater), some
measures need to be taken. Hence identifying needs, this project focuses on designing
the devices that have built-in capability to measure and report the energy use or receive
control input over the network. This study will help in creating energy awareness
devices. Current sensor measures the current flowing through device then controller
performs necessary calculations on the data and puts that data on the internet. By
measuring current and voltage, it can analyze energy consumption, make the world
smarter place and make better decisions using Internet of Things.

KLES BCA, P C JABIN SCIENCE COLLEGE, HUBBALLI 25


Electric Consumption Measuring

Sumit Mohanty; M. Mohamed Iqbal Parvathy Thampi M.S. [10] Proposed


“Controlling and Monitoring of Power Theft using Internet of Things” The demand for
electricity increases at a rapid pace as a country modernizes and its economy grows.
The demand-supply gap in power in India has been increasing steadily in recent years.
Smart grid is a recent development that improves the quality of power delivery to
consumers by allowing two-way communication and the distribution of smart devices.
Though reliable, it does have defects like Power Quality issues such as harmonics,
voltage and frequency fluctuations, Storage, Protection issues and Islanding. Power
theft is one of the most serious problems. Stealing of electrical power is referred to as
electricity theft. This paper proposes an Internet of Things (IoT) based Power theft
monitoring &control system which can monitor the real time current through all the
constituent network as well as the source. So that in case of any power theft the power
cut can occur automatically or manually based upon this real time data

Authors:

(1)Dita Anggraini Universitas Gadjah Mada

(2)Nazrul Effendy Universitas Gadjah Mada , Faculty of Engineering

(3)Muhammad ihsan al hafiz Universitas Gadjah Mada [3]Design of Power


Monitoring Application A Surriani1, A B Pradana1, M Arrofiq1, J T Putra1, M
Budiyanto1 and L Subekti

KLES BCA, P C JABIN SCIENCE COLLEGE, HUBBALLI 26


Electric Consumption Measuring

V. System Design (Flow Charts/DFD/ ER Diagrams …)

This is a way to collect and analyze data, define problems, and decompose system
functionality. Its role in that component. System analysis is performed to analyze the
system or its components Determine your goals

Functional block diagram

The project proposes the use of sensors and analytics to design power monitoring
system. To this end, the proposed design will be implemented at the university. This
project proposes an IoT based solution for monitoring power consumed by individual
devices using sensors, sending it via ESP32 to a centralized server, visualizing data via
a web interface and also using cloud.

Functional block diagram of power monitoring system

KLES BCA, P C JABIN SCIENCE COLLEGE, HUBBALLI 27


Electric Consumption Measuring

Final design

Block diagram of power monitoring system

Final design
Since we wanted to have a system which is compatible, so we have used ESP32
which has in-built Wi-Fi. Hence our final project contains ESP32, along with current
sensors, and linear ADC to eliminate the error due to non-linearity. Thingspeak is
used for front end demonstration and cloud storage.

KLES BCA, P C JABIN SCIENCE COLLEGE, HUBBALLI 28


Electric Consumption Measuring

Algorithm

Step 1: Start

Step 2: If the appliances are connected then current sensor senses the current.

Step 3: The sensed input is given to bridge rectifier to convert the ac component Tod
component. current=(Val*3.3)/511; power=current*230;

Step 4: As the dc component is analog, it is converted to digital form using MCP3008


and as to sent the data to ESP32 then end to the thingspeak cloud via WIFI module.

Step 5: The data stored can be expressed using various mathematical modules by the
user.

Step 6: The data stored in thingspeak can be viewed by the user which is in excel.csv

Step 7: Stop;

KLES BCA, P C JABIN SCIENCE COLLEGE, HUBBALLI 29


Electric Consumption Measuring

Flowchart
A Power Monitoring System is a network of meters connected to internet to provide
real time data on the Power system. The meters feed an on line software system that
allows the owners and the service providers to identify electrical equipment is hooked
to meter. The meter is essentially a monitoring tool that is connected to internet. Like a
computer the tool monitors the power, even events up to one millisecond can be
captured.

From the load, the AC signal is sent to current sensor which senses the current .The
sensed input is given to bridge rectifier to convert AC component to DC component As
the DC component is analog , it is converted to digital form using MCP3008 and as to
sent the datatoESP32 then end to the things peak cloud via Wi-Fi module .

The data stored can be expressed using various mathematical modules by the user. The
data stored in thingspeak can be viewed by the user which is excel.csv

KLES BCA, P C JABIN SCIENCE COLLEGE, HUBBALLI 30


Electric Consumption Measuring

Flowchart:

Flowchart of power monitoring system


KLES BCA, P C JABIN SCIENCE COLLEGE, HUBBALLI 31
Electric Consumption Measuring

VI . Source Code

#include <WiFi.h>

#include <mcp3008.h>

String apiKey = "Q2GFCZL51RK1SY29"; // Enter your Write API key


from ThingSpeak

const char *ssid = "Oneplus 7T"; // replace with your wifi ssid
and wpa2 key

const char *pass = "1234567890";

const char* server = "api.thingspeak.com";

WiFiClient client;

long val1 , val2 , val3, val4, val5;

const uint8_t _SS = 15; // Pins for SPI interface

const uint8_t _MISO = 12;

const uint8_t _MOSI = 13; // example shows HSPI defaults

const uint8_t _SCLK = 14;

mcp3008 mcp = mcp3008();

#define uS_TO_S_FACTOR 1000000ULL

#define TIME_TO_SLEEP 5

RTC_DATA_ATTR int bootCount = 0;

void setup()

Serial.begin(115200);

delay(10);
KLES BCA, P C JABIN SCIENCE COLLEGE, HUBBALLI 32
Electric Consumption Measuring

Serial.println("Connecting to ");

Serial.println(ssid);

WiFi.begin(ssid, pass);

while (WiFi.status() != WL_CONNECTED)

delay(500);

Serial.print(".");

Serial.println("");

Serial.println("WiFi connected");

mcp.begin(_SCLK, _MISO, _MOSI, _SS);

void loop()

float Current_1 = 0, Current_2 = 0, Current_3 = 0;

val1 = val2 = val3 = val4 = val5 = 0;

for (int i = 0; i < 10 ; i++)

val1 += mcp.analogRead(0);

delay(1);

val1 /= 10;

Current_1 = (val1 * 3.3f) / 1023.0f;

float Power_1 = Current_1 * 230.0f;

KLES BCA, P C JABIN SCIENCE COLLEGE, HUBBALLI 33


Electric Consumption Measuring

Serial.println("Load 1: " + String(Current_1) + "mAmp Power: " +


String(Power_1) + "W");

delay(1000);

for (int i = 0; i < 10 ; i++)

val2 += mcp.analogRead(1);

delay(1);

val2 /= 10;

Current_2 = (val2 * 3.3f) / 1023.0f;

float Power_2 = Current_2 * 230.0f;

Serial.println("Load 2: " + String(Current_2) + "mAmp Power: " +


String(Power_2) + "W");

delay(1000);

for (int i = 0; i < 10 ; i++)

val3 += mcp.analogRead(2);

delay(1);

val3 /= 10;

Current_3 = (val3 * 3.3f) / 1023.0f;

float Power_3 = Current_3 * 230.0f;

Serial.println("Load 3: " + String(Current_3) + "mAmp Power: " +


String(Power_3) + "W");

KLES BCA, P C JABIN SCIENCE COLLEGE, HUBBALLI 34


Electric Consumption Measuring

delay(1000);

for (int i = 0; i < 10 ; i++)

val4 += mcp.analogRead(3);

delay(1);

val4 /= 10;

Serial.println(val4);

float Cel = val4 * 0.323;

Serial.println("Temperature: "+String(Cel));

for (int i = 0; i < 10 ; i++)

val5 += mcp.analogRead(4);

delay(1);

val5 /= 10;

Serial.println(val5);

int LDR_val = (val5 / 10.23);

Serial.println("LDR: "+String(LDR_val));

if (client.connect(server, 80)) // "184.106.153.149" or


api.thingspeak.com

String postStr = apiKey;

postStr += "&field1=";
KLES BCA, P C JABIN SCIENCE COLLEGE, HUBBALLI 35
Electric Consumption Measuring

postStr += String(Current_1);

postStr += "&field2=";

postStr += String(Power_1);

postStr += "&field3=";

postStr += String(Current_2);

postStr += "&field4=";

postStr += String(Power_2);

postStr += "&field5=";

postStr += String(Current_3);

postStr += "&field6=";

postStr += String(Power_3);

postStr += "&field7=";

postStr += String(Cel);

postStr += "&field8=";

postStr += String(LDR_val);

postStr += "\r\n\r\n";

client.print("POST /update HTTP/1.1\n");

client.print("Host: api.thingspeak.com\n");

client.print("Connection: close\n");

client.print("X-THINGSPEAKAPIKEY: " + apiKey + "\n");

client.print("Content-Type: application/x-www-form-urlencoded\n");

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

client.print(postStr.length());

client.print("\n\n");

KLES BCA, P C JABIN SCIENCE COLLEGE, HUBBALLI 36


Electric Consumption Measuring

client.print(postStr);

Serial.println(postStr);

Serial.println("%. Send to Thingspeak.");

Serial.println(client.readStringUntil('\n'));

client.stop();

Serial.println("Waiting...");

delay(5000);

//ESP goes to sleep mode

esp_sleep_enable_timer_wakeup(TIME_TO_SLEEP * uS_TO_S_FACTOR);

Serial.println("Setup ESP32 to sleep for every " + String(TIME_TO_SLEEP) +

" Seconds");

Serial.println("Going to sleep now");

Serial.flush();

esp_deep_sleep_start();

KLES BCA, P C JABIN SCIENCE COLLEGE, HUBBALLI 37


Electric Consumption Measuring

VII. UI Design And Outputs

Result in Excel of Power Monitoring System(Current).

KLES BCA, P C JABIN SCIENCE COLLEGE, HUBBALLI 38


Electric Consumption Measuring

Result in Excel of Power Monitoring System(Power).

KLES BCA, P C JABIN SCIENCE COLLEGE, HUBBALLI 39


Electric Consumption Measuring

ThingsSpeak Website:

Result in ThingSpeak of Power Monitoring System

KLES BCA, P C JABIN SCIENCE COLLEGE, HUBBALLI 40


Electric Consumption Measuring

VIII. Implementation (Deployment)

1) The bottom floor contains number of devices such as current sensors and sockets for
AC supply for the appliances.

2) It contains the bridge rectifier which helps in taking out DC component of

current sensed from AC current and an integrated chip to convert analog components
to digital.

3) It contains wireless communication device to transmit the information gathered

by objects at lower tiers.

4) The top layer contains information stored which is shared and accessible for
knowledge.

Specifications and final system architecture: -

KLES BCA, P C JABIN SCIENCE COLLEGE, HUBBALLI 41


Electric Consumption Measuring

To make sure the system was working properly before being implemented into the real-
life situations, some of the test performed as follows:

1.In the first step we will use Arduino IDE where the code will be written in the Arduino
IDE and then we will save the code when the process is finished

Arduino IDE

KLES BCA, P C JABIN SCIENCE COLLEGE, HUBBALLI 42


Electric Consumption Measuring

2. In the next step we will upload the saved code in the ESP-32 Wi-fi module The ESP-
32 provides platform for wireless connectivity while it can store the memory up to
320KIB RAM and 448 KIB ROM. The ESP-32 wi-fi module will be connected to one
working device

The ESP-32 has another component attached to it which is called as Bridge Rectifier
The main purpose of Bridge Rectifier is to convert Alternative current to Direct current
(AC to DC).

ESP-32 Module

KLES BCA, P C JABIN SCIENCE COLLEGE, HUBBALLI 43


Electric Consumption Measuring

3. In the next step using Hall Effect Sensor (Energy Meter Sensor) while the
work of Hall Effect Sensor is to sense the current and fetch the data .

Hall Effect Sensor

KLES BCA, P C JABIN SCIENCE COLLEGE, HUBBALLI 44


Electric Consumption Measuring

4. In the next step we will be using Thingspeak website where all the data which is
stored in the ESP-32 wi-fi module will be sent to the Thingspeak cloud where the power
consumed by an particular device will be represented in the graphical format and the
Thingspeak website will provide us the readings in the MS-Excel format.

Thingspeak Website

KLES BCA, P C JABIN SCIENCE COLLEGE, HUBBALLI 45


Electric Consumption Measuring

MS-Excel Format

KLES BCA, P C JABIN SCIENCE COLLEGE, HUBBALLI 46


Electric Consumption Measuring

XI. Testing Methods with Test Case: -

Test Case 1:

Checking ESP-32 to the Monitoring graph.

Expected Result:-

Data should be shown in the form of graphical representation.

Actual Results:-

The data is shown in the form of graphical representation

Stress Test:-

Continuously data is shown in the form of graph

Expected Results:-

The system should show data without being exhausted.

Error Result:-

No Errors found

Accuracy :-

The working is accurate it is working properly under extreme stress.

KLES BCA, P C JABIN SCIENCE COLLEGE, HUBBALLI 47


Electric Consumption Measuring

Test Case-2:

This test will check for the conversion of AC to DC

Expected Result:

The alternative current should be converted to direct current .

Actual Result:

Information will be converted inside the device itself.

Stress Test:

Continuously current is converted from AC to DC.

Expected Result:

The system should allow continuous data entries without being exhausted.

Error Result:

No errors found.

Accuracy:

The working is accurate. It is working properly under extreme stress.

KLES BCA, P C JABIN SCIENCE COLLEGE, HUBBALLI 48


Electric Consumption Measuring

X. Advantages of Project

It saves cost:

The benefits of the power monitoring system have a deep impact on the bottom line of
your business. By reducing energy consumption and monitoring the equipment of your
facility, it saves huge costs. It notifies you about the impending.

Maintenance:

The data gathered from the power monitoring system can be used to notify you when
face any machinery breakdown or shutdown. Scope of wastage of electricity.

Conservation of power:

Using power management system, we will be able to overcome the scope of wastage
of electricity.

User friendly:
Power management system is user-friendly which is very important. so that any
individual can make use of this technology.

Ease of installation:
The system is very easy to install anywhere, all it needs is to plug the device that needs
to be monitored.

KLES BCA, P C JABIN SCIENCE COLLEGE, HUBBALLI 49


Electric Consumption Measuring

Conclusion

The proposed model is implemented in order to understand the power consumption of


a appliance or a node. One can understand the wastage of power as unnecessarily the
appliances are turned on most of the times. In order to produce the electricity, lot of
non-renewable resources are used. Hence to save those resources for the future
generation it is necessary to save them so as to avoid unnecessary usage of current.

KLES BCA, P C JABIN SCIENCE COLLEGE, HUBBALLI 50


Electric Consumption Measuring

Future Enhancement
An important research problem is the selection of a relevant subset of test cases from
the initial test suite that would minimize both the regression testing time and effort
without loss the thoroughness of regression testing An important research problem is
the selection of a relevant subset of test cases from the initial test suite that would
minimize both the regression testing time and effort without loss the thoroughness of
regression testing minimize both the regression testing time and effort without loss the
thoroughness of regression testing.
• The implementation is done for three devices and in future it can be extended to further

• The same system can be used in different other fields like

agriculture, school, colleges, industry, etc.

• The approach that is used in optimizing this system can be used for other products too
to

increase the number of options for the end user.

• This can be scaled up to any place which uses electricity and electricity-based devices

KLES BCA, P C JABIN SCIENCE COLLEGE, HUBBALLI 51


Electric Consumption Measuring

Bibliography:
[1] G. Eason, B. Noble, and I.N. Sneddon, “On certain integrals of Lipschitz-Hankel
type involving products of Bessel functions,” Phil. Trans. Roy. Soc. London, vol.
A247, pp. 529-551, April 1955. (references)
[2] J. Clerk Maxwell, A Treatise on Electricity and Magnetism, 3rd ed., vol. 2.
Oxford: Clarendon, 1892, pp.68-73.
[3] I.S. Jacobs and C.P. Bean, “Fine particles, thin films and exchange anisotropy,”
in Magnetism, vol. III, G.T. Rado and H. Suhl, Eds. New York: Academic, 1963,
pp. 271-350.
[4] K. Elissa, “Title of paper if known,” unpublished.
[5] R. Nicole, “Title of paper with only first word capitalized,” J. Name Stand.
Abbrev., in press.
[6] Y. Yorozu, M. Hirano, K. Oka, and Y. Tagawa, “Electron spectroscopy studies
on magneto-optical media and plastic substrate interface,” IEEE Transl. J. Magn.
Japan, vol. 2, pp. 740-741, August 1987 [Digests 9th Annual Conf. Magnetics
Japan, p. 301, 1982].
[7] M. Young, The Technical Writer’s Handbook. Mill Valley, CA: University
Science, 1989.

KLES BCA, P C JABIN SCIENCE COLLEGE, HUBBALLI 52

You might also like