0% found this document useful (0 votes)
508 views48 pages

Smart Energy Meter and Power Factor Correction

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 48

Bi-directional Energy Meter with Automatic Power

Factor Correction
A
Project Report

Submitted by
RITIK SINGH
(BT16EEE001)
BHUMIKA MEENA
(BT16EEE003)
ANUJ KUMAR
(BT16EEE004)
JUNAID ALAM
(BT16EEE005)

in partial fulfillment
for
the award of the degree
of
BACHELOR OF TECHNOLOGY
In
ELECTRICAL AND ELECTRONICS ENGINEERING

DEPARTMENT OF ELECTRICAL ENGINEERING


NATIONAL INSTITUTE OF TECHNOLOGY, UTTARAKHAND
APRIL 2019
Bi-directional Energy Meter with Automatic Power
Factor Correction
A
Project Report
Submitted by
RITIK SINGH
(BT16EEE001)
BHUMIKA MEENA
(BT16EEE003)
ANUJ KUMAR
(BT16EEE004)
JUNAID ALAM
(BT16EEE005)

Under the guidance


of
MR. HIMESH KUMAR
Trainee Teacher, Electrical Engineering Department
in partial fulfillment
for
the award of the degree
of
BACHELOR OF TECHNOLOGY
In
ELECTRICAL AND ELECTRONICS ENGINEERING

DEPARTMENT OF ELECTRICAL ENGINEERING


NATIONAL INSTITUTE OF TECHNOLOGY, UTTARAKHAND
APRIL 2019
2
DEPARTMENT OF ELECTRICAL ENGINEERING
NATIONAL INSTITUTE OF TECHNOLOGY
UTTARAKHAND
UTTARKHAND – 246174, INDIA

Candidate’s Declaration

This is to certify that the work which is being presented in this project report entitled
“BI-DIRECTIONAL ENERGY METER WITH AUTOMATIC POWER FACTOR
CORRECTION” in fulfillment of the requirement for the award of the degree of BACHELOR
OF TECHNOLOGY in Electrical and Electronics Engineering and submitted in the
Department of Electrical Engineering of National Institute of Technology Uttarakhand is an
authentic record of my own work under the supervision of Mr. Himesh Kumar,Trainee
Teacher, Electrical Engineering Department.
The matter presented in this thesis has not been submitted by me for the award of any
degree of this or any University/Institute. I have followed the guidelines provided by the
Institute in preparing the project report. Whenever I have used the material (data, theoretical
analysis, figures and text) from other sources, I have given due credits by citing in the text of
thesis with details in the references.

Date: RITIK SINGH


Place: (BT16EEE001)
BHUMIKA MEENA
(BT16EEE003)
ANUJ KUMAR
(BT16EEE004)
JUNAID ALAM
(BT16EEE005)
This is to certify that above statement made by the candidate is correct to the best of
my knowledge.

Date: Mr. Himesh Kumar


Place: Srinagar (Garhwal) Trainee Teacher
Department of Electrical Engineering
National Institute of Technology Uttarakhand
Uttarakhand, India

3
Acknowledgements

Firstly, we would like to express our sincere and deepest gratitude to our project
supervisor Mr. Himesh Kumar for his unwavering support during our project work.
We would like to thank him for the patience and motivation. His valuable suggestions
have brought us out of the toughest time during our research and his guidance has
helped us in shaping the thesis in the current form. We could not have imagined having
a better supervisor and mentor for our project work, for which we are very grateful.
We thank the Head of the Department Dr. Prakash Dwivedi for his timely
support for providing the facilities and working environment in the department which
helped in timely completion of this thesis work. We are truly grateful to him for the
cooperation extended in the hour of need. We take this opportunity to especially thank
our friends and colleagues for their constant support and encouragement in both
happy and tough times.
Last but not the least, we would like to thank our family members. We can’t
thank them enough for their unconditional love, patience and sacrifices they have
made to make us reach this stage of life.

Date: Ritik Singh


Place: Srinagar (Garhwal) Bhumika Meena
Anuj Kumar
Junaid Alam
(Project members)

4
Abstract

The Report in its present form gives the idea of Bi-directional metering and control of
power factor automatically using capacitor bank. There undoubtedly exists energy
meters for calculate the consumption of energy- but such meter are neither efficient
nor economical when viewed from the large scale perspective. The sole idea behind
this project is to present a model or idea that can demonstrate an efficient way of
metering the energy consumption with an objective to minimize the reactive power
consumption as much as possible. Surely the cost factor may seem to be higher when
working on the small models , but then the tremendous decrease in the reactive power
consumption and the electricity cost using the same model justifies the idea used.
Here, instead of using the fixed rate for billing purpose, we have implemented the idea
of Wi-fi module technique, to fetch the instant electricity rate from vidyut pravah site.To
provide an interface between our hardware and Wi-fi module, we are using Arduino
Mega as the development board. Finally the 16*2 LCD display facilitates the user to
look on to the energy consumption and electricity bill.

Nomenclature
5
A - Amper
V - Volt
R - RealPower
Q - ReactivePower
S - Apparent Power
PCB - Printed Circuit Board
PIC - Peripheral Interface Controller
IEEE - Institution of Electrical and Electronics Engineering
IC - Integrated Circuit
SPI - Serial Peripheral Interface
R - Resistor orresistance
L - Inductor
C - Capacitor
X - Reactance
Z - Impedance
kW - kilo-Watt
kVa - kilo-volt-ampere
kVar - kilo-volt-ampere-reactive
P.F - PowerFactor
I - Current

6
Contents

Declaration 3
Acknowledgements 4
Abstract 5
Nomenclature 6
Contents 7
List of Figures 9

1 Introduction 100
1.1 Introduction to Bi-dirctional metering with smart featuresError! Bookmark not
defined.1

2 Review of literature
2.1 Bi-directional meter 12
2.2 Requirements for bi-directional metering 12
2.3 Power Factor 12
2.4 Power factor correction 13
2.5 Disadvantage of a low power factor 14
2.6 Advantage of power factor correction 14
2,7 Electrical loads 14
2.7.1 Inductive 15
2.7.2 Capacitive 15
2.7.3 Resistive 16
2.8 Power pricing 17

3 Design and Development 19


3.1 Principle 19
3.2 Circuit Diagram 19
3.3 Zero crossing detector 20

4 Modules 22
4.1 Components and their description 22
4.1.1 Potential transformer 22

7
4.1.2 Current Transformer 23
4.1.3 Current Sensor 23
4.1.4 Capacitor bank 24
4.1.5 X-OR gate 24
4.1.6 Relay 26
4.1.7 Wi-fi Module 27
4.1.8 LCD 29
4.1.9 Arduino Mega 30

5 Software Development 32
5.1 Programming development environment 32
5.2 pulseIn() 33
5.3 Programme 33

6 Results and Conclusion 45

References 48

8
List of Figures
Fig no. Title Name Pg. no.

1 Power Triangle 13
2 Waveform and phasor diagram of V and I 15
across inductor
3 Waveform and phasor diagram 16
4 Waveform and phasor 17
5 Electricity rate from vidyut pravah site 18
6 Block diagram of bi-directional metering 19
7 ZCD 20
8 Voltage Transformer 22
9 Current Transformer 23
10 Current Sensor 24
11 X-OR gate 25
12 Current and voltage input to the X-Or 25
gate and output on purely resistive load
13 Current and voltage input to the X-Or 26
gate and output on purely inductive load
14 Relay 27
15 Wi-Fi Module 27
16 LCD 29
17 Arduino Mega Board 30
18 Energy meter showing power factor 45
correction
19 Wi-fi module fetch data from vidyut 46
pravah site
20 SMS to customer for controlling reactive 46
power

9
Chapter 1
Introduction

1.1 Introduction to Bi-directional metering with smart features


In the present innovative unrest, control is exceptionally valuable and the power
framework is ending up increasingly more intricate with each passing day. An energy
meter is a gadget which screens our power usage or at the end of the day vitality
utilization. It shows the units in types of digits that assistance the eyewitness to
compute the power bill as far as cash. all things considered, it winds up important to
transmit every unit of intensity created over expanding separations with least loss of
intensity on the grounds that the consumer needs to pay for every one of the factor.
Not withstanding with expanding the number of inductive burdens vast variety in
burden and so forth the misfortunes have additionally expanded complex.
Consequently, it has turned out to be judicious to discover the reasons for power
misfortune and improve the influence framework. Because of expanding utilization of
inductive burdens the control factor diminishes extensively which builds the
misfortunes in the framework and consequently influence framework misfortunes its
efficiency. Also, there is soo much issue in executes charging methodology as
pursues: an approved individual comes to take readings. At that point, he gathers
every one of the information and submits it to the workplace. Presently there are so
many factors that could cause the mistake, for example, human blunder while taking
the readings. So the fact is that the framework is less viable or less proficient and
loaded up with bunches of influencing factors. So we structure such a meter that
makes it simple for the consumer to trust that 'he is paying for what he will utilize' and
furthermore with the assistance of APFC reduces the utilization of reactive power
utilization.
A bidirectional meter with automatic power factor amendment gadget peruses active
and reactive power and furthermore the power factor from line voltage and line current
sense by voltage and current sensor.It decides the stage edge slack between the
voltage and current flags and after that decides the comparing power factor at that
point the microcontroller figures the pay necessity and likewise switches on the
required number of capacitors from the capacitor bank until the power factor is
standardized to about solidarity and charging with the assistance of information
brought utilizing wi-fi module from the power board site.
The automatic power factor redress strategies that we use in this meter can be
connected to modern units control frameworks and furthermore families to make them
stable. Therefore the framework ends up stable and proficiency of the framework just
as of the mechanical assembly increments. This corrector results in diminished
generally speaking expenses for both the customers and the providers of electrical
vitality.
Power factor revision utilizing capacitor banks diminishes receptive power utilization
which will prompt minimization of misfortunes and in the meantime builds the electrical
10
framework's proficiency. Power sparing issues and responsive power the executives
has prompted the advancement of single stage capacitor banks for household and
mechanical applications. The improvement of this task is to make wise framework
power compose in mastermind to supply profitability with a viable supply of intensity
inexpensiveness and security.

11
Chapter 2
Review of Literature

2.1 Bidirectional Meter:


The bidirectional meter will gauge the stream of power in two ways. It gauges what
quantity vitality originates from your electrical organization kWh sent. It likewise
measures the distinction between the generators creation. The meters nowadays
doesn't quantify the generators in power generation.
2.2 Requirements for Bi-Directional Metering:
1. An application for age interconnection must be submitted to your electric
organization preceding age association.
2. Age must meet the details of the net energy meter rider which indicates generator
limit what's more sustainable generator source.
3· Generation hardware must meet utility item security and network interconnection
details. for a model, an outside separate is required inside 10 feet of the meter area.
4· An electrical review is required before empowering an age interconnection.
5·After the electrical review another bi-directional meter will be introduced by your
electric organization.
2.3 Power Factor:
Power factor is a vitality idea that is identified with power stream in electrical
frameworks. To comprehend the control factor, it is useful to comprehend three distinct
sorts of intensity in electrical frameworks.
Genuine Power is the power that is really changed over into valuable work for making
warmth, light, and movement. Genuine power is estimated in kilowatts (kW) and is
totalized by the electric charging meter in kilowatt-hours (kWh). A case of genuine
power is the helpful work that straightforwardly turns the pole of an engine Reactive
Power is the power used to continue the electromagnetic field in inductive and
capacitive gear. It is the non-working force part. Responsive power is estimated in
kilovolt-amperes receptive (kVAR). Responsive power does not show up on the client
charging explanation.
Complete Power or Apparent power is the mix of genuine power and receptive power.
All out power is estimated in kilovolt-amperes (kVA) and is totalized by the electric
charging meter in kilovolt-ampere-hours (kVAh). Power factor (PF) is characterized as
the proportion of genuine capacity to add up to power and is communicated as a rate
(%).
12
Real Power (kWH)
Power factor *100
= Total Power (kVAH)

Fig. 1: Power Triangle

2.4 Power Factor Correction:


Power issue rectification is the method toward adjusting for the lagging current by
creating a main current by associating capacitors to the availability. Associate
adequate capacitance is related to the goal that the ability issue is acclimated to be as
close to commonality as can be expected underneath the circumstances. Power issue
adjustment PFC is a rendezvous of equalization the nettlesome impacts of electrical
masses that build an influence factor that's in need of what one 1 power issue
rectification could be connected either by associate electric power transmission utility
to enhance the stability and proficiency of the gear or modification could be introduced
by individual electrical shoppers to minimize the prices charged to them by their power
specialist organization. an electrical burden that works on workflow needs evident
power that contains real power and responsive power. the distance of receptive power
makes the real power be not precisely the evident power that the electrical burden
incorporates a power issue of in need of what one. the responsive power expands this
streaming between the ability supply and also the heap that builds the ability
misfortunes through transmission and conveyance lines. this outcome in operational
and cash connected misfortunes for influence organizations. on these lines,
management organizations need their shoppers significantly those with expansive
burdens to stay up their capacity factors over a predefined add significantly around
partner zero.90 or higher or be liable to additional charges. electrical architects needed
with the transmission dissemination .utilization of electric power have an enthusiasm
for the ability issue of burdens since power factors influence efficiencies and expenses
for each the electrical power trade and also the customers. even so the swollen
operating prices receptive power will need the use of wiring switches circuit breakers
transformers and transmission lines with higher current limits.

2.5 Disadvantages of a Low PowerFactor:

13
1. The limit of intensity plant transmission and circulation hardware must be more
than that which would be fundamental if the heap was requested at solidarity control
factor.
2. For a similar dynamic power .Operation of a current power framework at a low
power factor implies over-burdening the hardware now and again of full burden.
3. Low power factor implies a more noteworthy current and henceforth higher vitality
misfortunes.
4. The voltage guideline to be poor.

2.6 Advantages of Power FactorCorrection:


There are a few favourable circumstances in using power factor remedy capacitors.
these include
1.Reduction in circuit current
2. Increased in voltage level at the burden
3.Reduction in copper misfortunes in the framework because of the decrease
in current
4.Reduction in interest in the framework offices per kW
5.Reduction in the kVA stacking of the circuits.
6.Reduction in kVA request charges for vast purchasers
.
2.7 Electrical Loads:
In general, electrical systems are created of three components: resistors, inductors,
and capacitors. Inductive instrumentality needs associate magnetic attraction field to
work. Due to this, the inductive load needs each real and reactive power to work. The
ability issue of inductive loads is mentioned as insulation, or but a thousandth, primarily
based upon our power issue quantitative relation.
In most business and industrial facilities, a majority of the electrical instrumentality
acts as resistance or associate electrical device. Resistive loads embrace
incandescent lights, molding heaters, and cookery ovens. Inductive hundreds
embrace fluorescent lights, AC induction motors, arc welders and transformers.
Typical average power issue values for a few inductive loads:

Load PF %
Induction Motor 70-90
Small Adjustable Speed Drive 90-98

14
Fluorescent Lights
Magnetic Ballast & Electronic 70-80 & 90-95resp.
Ballast
Arc Welders 35-80

2.7.1.Inductive:
An inductor with AC supply is appeared in the figure beneath alongside its Phasor
graph, which demonstrates the stage edge among current and voltage. In the event
of an inductor, voltage drives current by 90⁰. The voltage over an inductor drives the
current in light of the fact that the Lenz' law conduct stands up to the development of
the current and it requires a limited investment for a forced voltage to compel the
development of current to its most extreme.

Fig. 2: Waveform and Phasor Diagram of V and I across the Inductor

2.7.2 Capacitive:

15
A capacitor with AC supply is appeared in the figure beneath alongside the waveform
and Phasor graph, which demonstrates that the stage point among current and
voltage. If there should arise an occurrence of a capacitor, voltage falls behind the
current by 90⁰. The voltage over a capacitor slacks the current in light of the fact that
the current must stream to develop charge and the voltage is corresponding to that
energize which is based on the capacitor plates.

Fig. 3: Waveform and Phasor diagram

2.7.3 Resistive
A capacitor with AC supply is appeared in the figure beneath alongside the waveform
and Phasor outline, which demonstrates that the stage point among current and
voltage. If there should be an occurrence of a capacitor, the stage point among current
and voltage is 0⁰. For customary flows and frequencies, the conduct of a resistor is
that of a dissipative component which changes over electrical vitality into warmth. It is
free of the course of current stream and the recurrence. So we state that the AC
impedance of a resistor is equivalent to its DC obstruction.

16
Fig. 4: Waveform and Phasor diagram

2.8 Power Pricing


Wi-Fi module is associated with the web through a versatile hotspot or can be
associated with any close by accessible Wi-Fi. It interfaces with the API of the site
""for fetching the live value informationand update itself after at regular intervals. The
value esteem is passed to Arduino Mega through Serial Communication
betweenArduino Mega and Wi-Fi module. Energy cost is determined by utilizing the
vitality devoured by burdenand value information brought by Wi-Fi Module.

17
Fig. 5: Electricity Rate from Vidyut Pravah

Chapter 3
18
Design and Development

3.1 Principle:

Fig 6. Block Diagram Bi-directional meter


The given circuit for Bi-directional energy meter with automatic power issue discovery
and change works on the chief of continually checking the power and billing on the
basis of consumption including all factors.Also it monitor the ability factor
of the framework and to start out the specified adjustment on the off probability that
the power factor isn't precisely the set estimation of intensity factor

3.2 Circuit Diagram:


The voltage signal obtained is converted into the digital by comparator circuit since
the small controller accepts the digitized format solely. This can be given to the
microcontroller joined input. Similarly, for the current signal, from the present electrical
device is converted into a voltage signal by rectification.As antecedently digitized the
voltage signal, this current signal within the sort of voltage is additionally digitized by
the comparator circuit.

19
Fig 7.ZCD
These 2 digitized signals i.e. voltage and currents are sent to the microcontroller
because of the inputs. In keeping with the program written microcontroller calculates
the time distinction between the zero crossings of those 2 signals. This point distinction
is indirectly proportional to the system power factor. The knowledge concerning this
power factor and therefore the power loss is displayed on the alphanumeric display.
And in keeping with the range calculated by the microcontroller program; this drives
the relays that switch the shunt capacitors across the load. While increasing of the
inductive load by connecting the opposite loads like motors to the current circuit leads
to reduced power factor. This may build the microcontroller to drive the additional
variety of relays leading to more shunt capacitors to be connected. In this project, the
easy technique of capacitance demand calculation used supported the time delay
between the voltage and current to bring the power factor as regards to unity.
However, in real-time applications, it'll not be therefore. It needs the calculations like
load current magnitude and KVAR demand etc. Variety of capacitors needs depends
on the load on the actual system. These parameters should be thought of whereas
handling the industrial power factor improvement or compensating products.
3.3 Zero crossingdetector:
A zero intersection is wherever the indication of a scientific capability changes (for
example from positive to negative), spoken to by the intersection of the hub (zero
esteem) within the chart of the capability. it's an ordinarily utilized term in gadgets,
arithmetic, sound, and picture making ready. In exchanging current, the zero-
intersection is that the immediate time once there's no voltage present. In a wave, this
condition normally happens double during a cycle. A zero intersection finder may be
a vital utilization of operation amp comparator circuit. It will likewise be alluded to as a
sin to square wave converter. Anybody of the displeasing or the non-modifying
comparators are often utilized as a zero intersection symbol. The reference voltage

20
for this case is about to zero. The yield voltage waveform demonstrates once and in
7 what heading a data flag crosses zero volts. Whenever input voltage may be a low
repeat flag, at that time yield voltage can rush to alter beginning with one
immersionpoint then onto the subsequent. What's additional, if there's commotion
within the middle of the 2 data hubs, the yield might amendment among positive and
negative immersion voltage ‗Vsat'. .Here IC LM358 is employed as a zero intersection
finder.

21
Chapter 4
Modules

4.1 Components and theirDescription


4.1.1 PotentialTransformer
A potential transformer, a voltage transformer or a covered center transformer is the
most well-known sort of transformer broadly utilized in electrical power transmission
and apparatuses to change over mains voltage to low voltage so as to control low
power electronic gadgets. They are accessible in power evaluations going from mW
to MW. The Insulated overlays limit swirl current misfortunes in the iron center.

Fig8: Potential transformer used as an Instrument Transformer

A potential transformer is commonly portrayed by its voltage proportion from essential


to optional. A 600:12 0 potential transformer would give a yield voltage of 120V when
a voltage of 600V is awed over the essential winding. The potential transformer here
has a voltage proportion of 230:24 i.e., when the information voltage is the single stage
voltage 230V,the yield is 24V. .

The potential transformer here is being utilized for voltage detecting in the line. They
are intended to display an insignificant burden to the supply being estimated and have
an exact voltage proportion and stage relationship to empower precise optional
associated metering. The potential transformer is utilized to supply a voltage of about
12V to the Zero Crossing Detectors for zero intersection location. The yields of the
potential the transformer is taken from one of the fringe terminals and the focal terminal
as just a voltage of about 12V is adequate for the task of Zero intersection locator
circuit.

22
4.1.2. CurrentTransformer:
The current transformer is an instrument transformer used to venture down the current
in the circuit to quantifiable qualities and is consequently utilized for estimating
exchanging flows. At the point when the current in a circuit is too high to even
think about applying legitimately to an estimating instrument,
a present transformer delivers a diminished current precisely relative to the current in
the circuit which can thus be helpfully associated with estimating and recording
instruments. A current transformer confines the estimating instrument from what
might be an extremely high voltage in the checker circuit. Current transformers
are ordinarily utilized in metering and defensive transfers.
Like some other transformer, a current transformer has a solitary turn wire of an
exceptionally extensive cross-area as its essential winding and the auxiliary winding
has a substantial number of turns along these lines diminishing the current in
the optional to a small amount of that in the essential. Consequently, it has
an essential winding an attractive center and an optional winding.
The substituting current in the essential creates a rotating attractive field in
the attractive center which at that point incites an exchanging current inthe auxiliary
winding circuit.

Fig 9. Current Transformer

4.1.3 Current Sensor:

This present sensor board depends on the Allegro ACS712ELCTR-30A bi-directional


Hall effect current sensor chip that identifies positive and negative streaming ebbs and
flows in the scope of less 30 Amps to positive 30 Amps. The board works at 5V DC
and the present move through the sensor is changed over to a yield voltage beginning
at 1/2Vcc (or 2.5V) for no present stream and climbs 66mV per amp for positive
23
present or down - 66mV per amp for negative current. For instance: The yield voltage
at +2 amps would be (2.5V + (0.066 * 2)) = 2.632 V The yield voltage at - 5 amps
would be (2.5V - (0.066 * 5)) = 2.170 V

Fig10: Current Sensor


4.1.4 Capacitor Bank:
A capacitor bank is a gathering of a few indistinguishable or non-indistinguishable
capacitors interconnected in parallel or an arrangement with each other. These
gatherings of capacitors are normally used to address or balance bothersome
qualities, for example, control factor slack or stage shifts inalienable in substituting
flow electrical power supplies. Capacitor banks may likewise be utilized in direct
current power supplies to increment put away vitality and improve the swell current
limit of the power supply. The capacitor bank comprises of a gathering of eight (8) a.c.
capacitors, all evaluated at 230V, 50 Hz i.e., the supply voltage and recurrence. The
estimation of capacitors is extraordinary and it comprises of four capacitors of
2.5µfarad, two capacitors of 4.5 farads and two residual capacitors are appraised at
10µfarads each. Every one of the capacitors is associated in parallel to each other and
the heap. The capacitor bank is constrained by the hand-off module and is associated
over the line. The activity of a hand-off interfaces the related capacitor over the line in
parallel with the heap and another capacitor.

4.1.5 Summer/Adder (X-OR) gate:


They give the framework planner methods for usage of the exclusive OR capacity
rationale entryways use silicon door cmos innovation to accomplish working rates
like LSTTL entryways with the low power utilization of standard
cmos coordinated circuits. All gadgets can drive STTL loads. The HCT rationale
family is practically stick perfect with the standard LS rationale family.

24
Fig11: X-OR gate

Fig12: Current and Voltage inputs to the X-OR gate and the output on purely
Resistive load

25
Fig13: Current and Voltage inputs to the X-OR gate and the output on Resistive and
Inductive Load.

4.1.6 Relay:
The relays utilized in the control circuit are top notch Single Pole-Double Throw
(SPDT), fixed 6V Sugar Cube Relays. These relays work by uprightness of an
electromagnetic field produced in a solenoid as current is made to stream in its
winding. The control circuit of the hand-off is normally low power (here, a 6V supply is
utilized) and the controlled circuit is a power circuit with a voltage around 230V air
conditioning.

The relays are separately determined by the hand-off driver through a 6V control
supply. At first, the transfer contacts are in the Normally Open 'state. At the point when
a relay works, the electromagnetic field powers the solenoid to climb and hence the
contacts of the outside power circuit are made. As the contact is made, the related
capacitor is associated in parallel with the heap and over the line. The hand-off curl is
evaluated up to 8V, with a base exchanging voltage of 5V. The contacts of the hand-
off are evaluated up to 7A @ 270C AC and 7A @ 24V DC.

26
Fig.14: Relay

4.1.7 Wi-fi Module:


As ESP8266 needed 3.3 potential unit to control that’s why you'll need a separate
transformer for the Wi-Fi module. There are 2 push buttons present here. These push
buttons are helpful in longterm application. If you don’t wish to attach these buttons
then it's your alternative. RST electrical switch is for hardware Reset of ESP8266. On
the opposite hand, FLASH electrical switch is to update the package of the Wi-fi
module.

Fig.15:Wi-Fi Module

The fastest and most straightforward approach to begin with an ESP8266 is to get to
it by means of the AT direction interface. Wi-Fi module ESP8266 has a worked in
UART (Serial) association. This implies it can both send and get information utilizing
the UART convention.

27
Imagine a scenario in which we had an application that kept running on the ESP8266
which took "directions" got over the sequential connection, executed them and after
that restored a reaction. This would then enable us to utilize the ESP8266 while never
knowing the programming dialects that arelocal to the gadget.

This is actually what a program that has so far been observed to be re-introduced on
the ESP8266. The program is known as the "AT direction processor" named after the
configuration of the directions sent through the sequential connection. These
directions are altogether prefixed with "AT".

These AT Commands will control every one of the information that ought to be sent or
got through the Wi-Fi module.

How to use ThingSpeak with Energy Meter:


We have utilized an officially accessible IOT stage called "ThingSpeak" to store the
readings.
The total technique is partitioned into two areas:
Agreeing to accept ThingSpeak and interfacing esp8266 Wi-Fi module with Wi-Fi
2 . Sending meter readings to ThingSpeak.

Creating account on ThingSpeak and connecting esp8266 Wi-Fi module with Wi-
Fi:
Step 1
The first step is to create an account on ThingSpeak. Visit ThingSpeak and create
your account.
After signing up, create a channel as shown in figure below: Arduino will send the data.
After clicking on Green New Channel button, they will ask about the requirements. Fill
the fields as you want.
After that open API Keys tab and save your write keys to use later in the Arduino Code.
Arduino will send measured readings to the ThingSpeak using this API write key.
Step 2
Now the second step is to connect ESP8266 with Wi-Fi router. ESP8266, in its default
configuration, boots up into the serial modem mode. In this mode you can
communicate with it using a set of AT commands. These AT commands are then used

28
to transfer data to the ThingSpeak channel. Below are the Arduino commands used
to connect esp8266 with Wi-Fi.
In second step we will also include a Softwarserial library in Arduino code. This library
is to use Arduino pins as RX and TX other than the default RX, TX pins (pin 0 and 1).
Step 3
Next step is to declare your Wi-Fi router related information like ssid, password and
ThingSpeak’s ip address
#define SSID "your Wi-Fi ssid" #define PASS "your Wi-Fi password" #define IP
"184.106.153.149"
Step 4
In the next step create a serial port for communicating with esp8266.Here 9600 is the
baud rate choose for esp8266 module.
Step 5
In next step, use AT commands to connect esp8266 module with Wi-Fi.
After establishing a connection as client, ESP8266 module is ready to send data to
ThingSpeak.

4.1.8 LCD (Liquid CrystalDisplay):


LCD panel consist two patterned glass panels in which crystal is filled under vacuum.
The thickness of glass varies according to end use. Most of the LCD modules have
glass thickness in the range of 0.70 to 1.1mm.
Normally these liquid crystal molecules are placed between glass plates to form a
spiral staircase twist the light. This LCD cannot display any information directly. These
act as an interface between electronics and electronics circuit to give a visual output.
The values are displayed in the 2x16 LCD modules after converting suitably. The liquid
crystal display (LCD), as the name suggests is a technology based on the use of liquid
crystal. It is a transparent material but after applying voltage it becomes opaque. This
property is the fundamental operating principle of LCD

29
Fig.16: Liquid Crystal Display
4.1.9 Arduino Mega:

Arduino mega 2560 is a microcontroller board dependent on atmega2560.


It accompanies more memory space and I/O pins when contrasted with different
sheets accessible in the market. There are 54 advanced I/O pins and 16 simple pins
joined on the board that make this gadget interesting and emerge from others. Out of
54 computerized i/o 15 is utilized for PWM beat width adjustment a precious stone
oscillator of 16mhz recurrence is included the board. This board accompanies USB
link port that is utilized to associate and exchange code from pc to the board. DC
control jack is combined with the board that is utilized to control the board. Some
variant of Arduino board comes up short on this component like Arduino pro mini
doesn't accompany dc control jack. ICSP header is a remarkable expansion
to Arduino mega which is utilized for programming the Arduino and transferring the
code from the pc.

Fig.17: Arduino Mega Board

This board accompanies two voltage controller as an example 5V and 3V which


provides the ability to regulate the voltage in step with wants once contrasted with
Arduino professional mini that accompanies simply one voltage controller. There is no
a lot of distinction between Arduino Uno and Arduino Mega except for later
accompanies a lot of memory house, larger size and a lot of I/O pins. Arduino
programming known as Arduino IDE is employed to program the board that could be
typical programming utilized for all sheets had an area with Arduino family.
Accessibility of Atmega16 on the board makes it distinctive in reference to Arduino
professional mini that utilizes USB to the consecutive converter to program the board.
There are a reset catch and four instrumentation consecutive port known as USART
that delivers most extreme speed for fitting correspondence.
30
Arduino Mega Specification:

Microcontroller Atmega 2560


Operating Voltage 5V
Input Voltage 7V-12V
USB Port Yes
DC Power Jack Yes
Current rating Per I/O Pin 20mA
Current Drawn from Chip 50mA
Digital I/O Pins 54
PWM 15
Analog Pins(Can be used as digital pins) 16(out of digital I/O pins)
Flash Memory 256KB
SRAM 8KB
EEPROM 4KB
Crystal Oscillator 16 MHz
LED Yes/Attached with digital pin 13
Wi-Fi No
Shield Compatibility Yes

Chapter 5
Software Development

5.1 Programming Development Environment:


The Arduino is a solitary board microcontroller, proposed to make the use of intuitive
articles or situations progressively available. The equipment comprises of an open-
source equipment board planned around an 8-bit Atmel AVR microcontroller or a 32-

31
bit Atmel ARM. Current models highlight a USB interface, 6 simple information pins,
just as 14 advanced I/O pins which enable the client to connect different expansion
sheets.

Presented in 2005, at the Interaction Design Institute Ivrea, in Ivrea, Italy, it was
intended to give understudies a cheap and simple approach to program intelligent
items. It accompanies a straightforward Integrated Development Environment (IDE)
that keeps running on standard PCs and permits composing programs for Arduino
utilizing a mix of basic Java and C or C++.

The Arduino Integrated Development Environment (IDE) is a cross stage application


written in Java and is gotten from the IDE for the handling programming language and
the wiring ventures. It is intended to acquaint programming with craftsmen and
different newcomers new to programming advancement. It incorporates a coding
supervisor with highlights, for example, Syntax featuring, Brace coordinating and
Automatic Indentation, and is likewise fit for gathering and transferring projects to the
board with a solitary snap. A program or code composed for the Arduino is known as
a ―Sketch‖. The Arduino IDE additionally accompanies a product library called
―Wiring‖ from the first Wiring Project, which makes numerous basic info/yield tasks
a lot simpler. Clients need just characterize two capacities to make a run able cyclic
official program:

• setup(): a capacity run once toward the beginning of a program that can introduce
settings.

• loop(): a capacity called over and again until the board controls off.

The past code won't be seen by a standard C++ compiler as a legitimate program,
so when the client taps the "Transfer to I/O Board" catch in the IDE, a duplicate of
the code is kept in touch with an impermanent record with an additional incorporate
header at the top and an exceptionally basic „main()‟ work at the base to make it a
substantial C++ program.
The Arduino IDE utilizes the GNU tool chain and AVR Libc to incorporate projects
and uses AVR dude to transfer projects to the board As the Arduino stage utilizes
Atmel microcontrollers, Atmel's improvement condition AVR Studio or the more up to
date Atmel Studio, may likewise be utilized to create programming for the Arduino.

32
5.2pulseIn():

•Description:

The work peruses a heartbeat (either HIGH or LOW) on a stick. For instance, if esteem
is HIGH, pulseIn() trusts that the stick will go HIGH, begins timing, at that point trusts
that the stick will go LOW and quits planning. Returns the length of the beat in
microseconds. Surrenders and returns 0 if no heartbeat begins inside a predetermined
time out.
The planning of this capacity has been resolved experimentally and will most likely
show mistakes in longer heartbeats. Takes a shot at heartbeats from 10 microseconds
to 3 minutes long.

•Syntax:

pulseIn(pin, esteem) pulseIn(pin, esteem, timeout)

•Parameters:

stick: the quantity of the stick on which you need to peruse the beat. (int) esteem: kind
of heartbeat to peruse: either HIGH or LOW. (int)
timeout (discretionary): the number of microseconds to trust that the beat will begin;
default is one moment (unsigned long), restores the length of the beat (in
microseconds) or 0 if no heartbeat began before the timeout (unsigned long)

5.3 Program:
Arduino Code-
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int pin = 13;
int re1=6;
int re2=7;
int re3=8;
int re4=9;
float time;
float rads = 57.29577951; // 1 radian = approx 57 deg.

33
float degree = 360;
float frequency = 50;
float nano = 1 * pow (10,-6); // Multiplication factor to convert nano seconds into
seconds
// Define floats to contain calculations
float pf;
float angle;
float pf_max = 0;
float angle_max = 0;
int ctr;
const int sensorIn=A0;
int mVperAmp=66;
double Voltage=0;
double VRMS=0;
double AmpsRMS=0;
void setup()
{
pinMode(pin, INPUT);
pinMode(6,OUTPUT);
pinMode(7,OUTPUT);
pinMode(8,OUTPUT);
pinMode(9,OUTPUT);
Serial.begin(9600);
Serial2.begin(4800);
lcd.begin(16, 2);
lcd.print("ANUJ KUMAR");
lcd.setCursor(0, 1);
lcd.print("BT16EEE004");

34
delay(2000);
lcd.clear();
lcd.print("JUNAID ALAM");
lcd.setCursor(0, 1);
lcd.print("BT16EEE005");
delay(2000);
lcd.clear();
lcd.print("BHUMIKA MEENA");
lcd.setCursor(0, 1);
lcd.print("BT16EEE003");
delay(2000);
lcd.clear();
lcd.print("RITIK SINGH");
lcd.setCursor(0, 1);
lcd.print("BT16EEE001");
delay(2000);
lcd.clear();
lcd.print("GUIDED BY");
lcd.setCursor(0, 1);
lcd.print("MR HIMESH KUMAR");
delay(2000);
lcd.clear();
}
void loop()
{
float price=wifi();
Serial.print("price=");
Serial.println(price);

35
lcd.print("CURNT PRC=");
lcd.setCursor(11, 0);
lcd.print(price);
lcd.setCursor(0, 1);
lcd.print("VidyutPravah.in");
delay(3000);
lcd.clear();
Voltage=getVPP();
VRMS=(Voltage/2.0)*0.707;
AmpsRMS=(VRMS*1000)/mVperAmp;
Serial.print("current=");
Serial.println(AmpsRMS);
lcd.setCursor(0,0);
lcd.print("CURRENT");
lcd.setCursor(9,0);
lcd.print(AmpsRMS);
lcd.setCursor(0,1);
Serial.println("VOLTAGE=230.00");
lcd.print("VOLTAGE 230.00");
delay(3000);
lcd.clear();
for (ctr = 0; ctr <= 4; ctr++) // Perform 4 measurements then reset
{
// 1st line calculates the phase angle in degrees from differentiated time pulse
// Function COS uses radians not Degree's hence conversion made by dividing
angle / 57.2958
angle = ((((pulseIn(pin, HIGH)) * nano)* degree)* frequency);
// pf = cos(angle / rads);

36
if (angle > angle_max) // Test if the angle is maximum angle
{
angle_max = angle; // If maximum record in variable "angle_max"
pf_max = cos(angle_max / rads); // Calc PF from "angle_max"
}
}
if (angle_max > 360) // If the calculation is higher than 360 do following...
{
angle_max = 0; // assign the 0 to "angle_max"
pf_max = 1; // Assign the Unity PF to "pf_max"
}
if (angle_max == 0) // If the calculation is higher than 360 do following...
{
angle_max = 0; // assign the 0 to "angle_max"
pf_max = 1; // Assign the Unity PF to "pf_max"
}
//Serial.print(angle_max, 2); // Print the result
//Serial.print(",");
// Serial.println(pf_max, 2);
float m=fabsf(pf_max);
Serial.print("powerfactor=");
Serial.println(m);
lcd.setCursor(0,0);
lcd.print("PF=");
lcd.setCursor(4,0);
lcd.print(m);
lcd.print(" ");
lcd.setCursor(0,1);

37
lcd.print("Ph-Shift=");
lcd.setCursor(10,1);
lcd.print(angle_max);
lcd.print(" ");
delay(3000);
lcd.clear();
float z=m*m;
float p=1-z;
float q=AmpsRMS*230*sqrt(p);
lcd.setCursor(0,0);
lcd.print("ACT PWR");
lcd.setCursor(9,0);
float power=AmpsRMS*230*m;
int powerint=power;
Serial2.write(powerint);
lcd.print(power);
Serial.print("Act power=");
Serial.println(power);
lcd.setCursor(0,1);
lcd.print("RACT PWR");
lcd.setCursor(9,1);
lcd.print(q);
//Serial.println(AmpsRMS*230*sqrt(p));
Serial.print("React pwr=");
Serial.println(q);
delay(3000);
lcd.clear();

38
time = millis();
float wh=time/3600000;
float kwhPower=power/1000;
float energy=kwhPower*wh;
lcd.setCursor(0, 0);
lcd.print("ENERGY");
lcd.setCursor(8, 0);
lcd.print(energy);
Serial.print("energy=");
Serial.println(energy);
//Serial.print("time ");
//Serial.println(wh);
//lcd.setCursor(12, 0);
//lcd.print("kwh");

lcd.setCursor(0, 1);
lcd.print("COST=");
lcd.setCursor(6, 1);
float cost=energy*price;
lcd.print(cost);
Serial.print("cost=");
Serial.println(cost);
//lcd.setCursor(10, 1);
//lcd.print("rps");
delay(3000);
lcd.clear();

angle = 0; // Reset variables for next test

39
angle_max = 0;
//relay

if (m < 0.98)
{
digitalWrite(re1,HIGH);
if (m < 0.98)
{
digitalWrite(re2,HIGH);
if (m < 0.98)
{
digitalWrite(re3,HIGH);
if (m < 0.98)
{
digitalWrite(re4,HIGH);
}
}
}
}
else if(m >= 0.98)
{
Serial.print("\tThe circuit has a resistive load, hence the normal power factor is:\t\t\t");
Serial.println(m);
}
Serial.println("--------------XXXXXXXXXXXXXXXXXXXXXxXXXXXX--------------");
}
float getVPP()
{

40
float result;
int readValue;
int maxValue=0;
int minValue=1024;
uint32_t start_time=millis();
while((millis()-start_time)<1000)
{
readValue=analogRead(sensorIn);
if(readValue>maxValue)
{
maxValue=readValue;
}
if(readValue<minValue)
{
minValue=readValue;
}
}
result=((maxValue-minValue)*5.0)/1024.0;
return result;
}
float wifi(){
while(Serial2.available()>0){
String payload = Serial2.readString();
Serial.print("payload ");
Serial.println(payload);
float val=payload.toFloat();
return val;
}

41
delay(1000);
}

Wi-Fi Code-
#include <SoftwareSerial.h>
#include <WiFiClientSecure.h>
SoftwareSerial NODEMCU(D2,D3);
int data;
#include "ThingSpeak.h"
#include <ESP8266WiFi.h>
const char* host = "api.thingspeak.com";
const int httpsPort = 443;
const char fingerprint[] PROGMEM = "F9 C2 65 6C F9 EF 7F 66 8B F7 35 FE 15 EA
82 9F 5F 55 54 3E";
//---------------- Fill in your credentails ---------------------
char ssid[] = "anuj"; // your network SSID (name)
char pass[] = "anujanuj"; // your network password
unsigned long myChannelNumber = 749923; // Replace the 0 with your channel
number
const char * myWriteAPIKey = "8CR1CVEK34KO0QEC"; // Paste your ThingSpeak
Write API Key between the quotes
//------------------------------------------------------------------
WiFiClient client;
void setup() {
NODEMCU.begin(4800);
Serial.begin(9600);
WiFi.mode(WIFI_STA);
ThingSpeak.begin(client);
if(WiFi.status() != WL_CONNECTED){

42
while(WiFi.status() != WL_CONNECTED){
WiFi.begin(ssid, pass);
delay(5000);
}

}
WiFiClientSecure client;
client.setFingerprint(fingerprint);
if (!client.connect(host, httpsPort)) {
NODEMCU.println("connection failed");
return;
}
String url = "/apps/thinghttp/send_request?api_key=PGDLA4VOV1ZTHURL";
client.print(String("GET ") + url + " HTTP/1.1\r\n" +
"Host: " + host + "\r\n" +
"User-Agent: BuildFailureDetectorESP8266\r\n" +
"Connection: close\r\n\r\n");
while (client.connected()) {
String line = client.readStringUntil('\n');
if (line == "\r") {

break;
}
}
String line = client.readStringUntil('\n');
NODEMCU.print(line);
}
void loop() {

43
if (NODEMCU.available()>0)
{
data=NODEMCU.read();
}
// Connect or reconnect to WiFi
// Write to ThingSpeak. There are up to 8 fields in a channel, allowing you to store up
to 8 different
// pieces of information in a channel. Here, we write to field 1.
int x = ThingSpeak.writeField(myChannelNumber, 1, data, myWriteAPIKey);
// Check the return code
if(x == 200){
Serial.println("Channel update successful.");
}
else{
Serial.println("Problem updating channel. HTTP error code " + String(x));
}
Serial.println(data);
delay(20000); // Wait 20 seconds before sending a new value
}

Chapter 6
Results and Conclusion

6.1Results

44
Following fig. shows the assembled circuit of energy meter

Fig 18 Energy meter showing power factor after correction

45
.
Fig.19 Wi-fi Module fetch active power data from vidyut pravah site

Fig. 20 SMS to consumer for controlling reactive power

46
Conclusion:
The Bi-directional meter with Automatic Power Factor Detection and Correction gives
a precise estimation of power use without the requirement for an evaluated month to
month bills or visits from meter per users likewise improve the power factor of a power
framework by an efficient way. It Eliminate the manual meter reading, Monitoring the
electric framework all the more quickly, Making it conceivable to utilize control assets
all the more efficiently, Providing ongoing information valuable for adjusting electric
burdens ,Enabling powerful estimating (raising or bringing down the expense of power
dependent on interest) ,Offering increasingly itemized input on vitality use to client
which causes them to alter their propensities to bring down electric bills

47
References

 P. N. Enjeti and R Martinez, ―A high performance single phase rectifier with


input power factor correction,‖ IEEE Trans. Power Electron.vol.11, No. 2,
Mar.2003.pp 311- 317
 International Journal of Engineering and Innovative Technology (IJEIT) Volume
3, Issue 4, October 2013 272 Power Factor Correction Using
PICMicrocontroller
 Zhang Li, Bai Lianping, "Research about Bi-directional Electronic Energy Meter
and Power Quality Analyzers", International Conference on Instrumentation
Measurement Computer Communication and Control (IMCCC), pp. 1323-1327,
September 2013.
 Paverd, A. Martin, I. Brown, "Privacy-enhanced bi-directional communication in
the Smart Grid using trusted computing", IEEE International Conference on
Smart Grid Communications (SmartGridComm), pp. 872-877, November 2014.

48

You might also like