Sunteți pe pagina 1din 5

15th international conference on Sciences and Techniques of Automatic control

& computer engineering - STA'2014, Hammamet, Tunisia, December 21-23, 2014 STA'2014-PID3423-CEM

Design and implementation of Single Phase Intelligent Energy


Meter using a microcontroller interfaced to PC
Ayari Ahlem1, Mechergui Hfaiedh1 and Haddouk Amira1
1
Laboratory & Research groups: C3S, Ecole Nationale Suprieure des ingnieurs de Tunis, University
of Tunis, Tunisia
E-mail: ayariahlem82@gmail.com, hafidmecher@yahoo.com, haddoukamira@yahoo.com

Abstract The aim of this paper is to describe the


II. PRINCIPLE OF OPERATION
implementation of a single-phase intelligent Energy meter
(IEM) for measuring of the active power, reactive power, In the present work, we study the control of the electrical
apparent power, the deformation factor and the energy. energy consumed by residences and industrial environments
In the designed circuit, these quantities are measured using where power consumption is not large enough.
PIC16F877. The measurement values are displayed on the LCD
screen. Then a MAX232 IC is interfaced between the
Indeed for a non linear load the voltage and current are not
Microcontroller and the PC. sinusoidal:
Hall Effect Sensor current LA55-P is used to measure the
current signal and Hall Effect Voltage Sensor CYHVS025A is v(t ) = VMj sin( j t + vj ) and i (t ) = I Mj sin( j t + ij )
used to measure the voltage. j =0 j =0
Keywordscomponent: Hall Effect Sensor, Microcontroller, The average power involved can be written as follows:
Intelligent Energy meter (IEM), PIC16F877, MAX232, LCD T
(key words) 1
I. INTRODUCTION
Pt =
T
v(t ).i (t )dt
0
Electrical energy is one of the most widely used energy T n
1

sources; it is a product which must be consumed while it is Pt = ( V Mj cos( j t + jv ) I M j cos( j t + ji ))dt (1)
being produced. The importance of electrical energy is T
0 j =1
increasing every day with the impact of the technological
The no isochronous harmonics do not produce power
advancements.
between them, as the product of their average value is zero
The cost of the investments made for generation,
and the equation (1) is reduced to:
transmission and distribution of the electrical energy is quite
V I
high. For this reason, it has gained significant importance to

Mj Mj
Pt = V1 .I1 . cos 1 + cos( vj ij ) (2)
use the electrical energy efficiently, to minimize the exiting 2
j =2
losses, to reduce the generation costs and to protect the
environment by reducing the consumption [1]. We set j = vj ij
One way of reducing these costs is to monitor, in real time, The equation (2) can be written in a more simplified form:
how much power is being consumed and from these data Pt = P f + P j (3)
make informed decisions about how to manage the electrical
devices being powered. A system that can give users an P f : Power due to the fundamental
estimate of how much energy is being, and might be P j : Power due to the harmonic j ( (( j 2 ) N ) .
consumed, will allow them to adjust their habits and lower
the costs [2]. The [3] has presented an intelligent meter to The energy measurement is a particular case of the power
measure the energy in case of linear load. The [3] also has measurement that means:
treated the case of non linear load. But the problem is to We = Pt t (4)
identify the nature of the load, its non linearity and the To measure the consumed energy an electromechanical
deformation factor which is the power due to the first energy meter is generally used. For a sine wave, it fits
harmonic and the total consumed power by the load. This perfectly in terms of metrology and robustness, but the
paper describes the design and implementation of an problem appears when the load is no linear.
Intelligent Energy Meter (IEM) using PIC16F877 micro- The paper [3] shows that the average power consumption
controlling chip which calculates the total active power, the depends on the following effects:
reactive power, the apparent power, the power due to the first - The coil inductive nature of the electromechanical energy
harmonic, the deformation factor and the consumed energy meter introduces a phase angle and the power can be written
of a single phase non linear load. The measurement values as:
are displayed on the LCD screen and then transmitted via V .I

Mj Mj
serial port RS232 to a PC. Pt = P f + cos( j j ) (5)
j =1
2

978-1-4799-5907-5/14/$31.00 2014 IEEE


191
l j
With: j = N L
Rvcompt 230 / AC
i
- At high frequency, the electromechanical energy meter is
no longer sensitive to the measure of the total consumed
Si vi
energy and the result will be wrong.
In this work, we make recourse to a smart energy meter
which measures the active and reactive power, the power Rp

Load
v
deformation and the energy. It records any changes in
consumption.
The principle is based on the acquisition of the current and rv vv
voltage, and the digital processing of all measured variables.
Voltage and load current will be sampled and acquired
during a period of time. Thus we can write:
v n = k v v(nTe ) and i n = k i v i (nTe ) . Figure 1. Analog part of the IEM
With k v : Scaling factor for voltage
k i : Scaling factor for current. Pf
To determine the distortion power factor : D = , the
Having acquired over one period the N samples of v n and Ps
in , we calculate, respectively, the effective value of the voltage v v (t ) and the current vi (t ) are filtered at the first
voltage and the current. harmonics then, they are applied to the AD734 analog
N N
multiplier of Analog Devices [4]. At the output of this last

1
v 2 (n) 1
k i 2 ( n) we have: v vi (t ) = v v1 (t ).v i 1 (t )
n =1 n =1
V= and I =
kv N ki N v vi (t ) = k v .k i. k x .V M 1 cos(1t ) I M 1 cos(1t + ) (8)

v(n) : Voltage sample at a sample instant n . v(t )


vv1 (t )
i (n) : Current sample at a sample instant n . v ADC (t )
vvi (t )
N : is the number of the samples to be acquired during one
period of time in 20 ms.
i (t )
For digital measurement of active power, expression (2) is vi1 (t )
rewritten as:
N

1
v ( n) i ( n) Figure 2. System to extract the power due to the first harmonic
n =1
Pt = (6)
kp N The voltage vadc (n) contains the power information p f
k P : Scaling factor for power dependant on the conversion due to the first harmonic.
The voltage v vi (t ) is applied to a third acquisition channel
of the sensors, the conditioners and the ADC.
then it is filtered by a digital filter to extract the power p f
Pt : Average power measured over a period.
due to the first harmonic, as:
Two Hall Effect sensors are used to adapt the network
1 1 m 1 N
voltage and the load current. In fact, they ensure the galvanic
insulation between the network and the electronic circuits.
Pf = vv (n) = V1 .I1 . cos
k p m e=1 N i =1 i
(9)

The Hall sensors are followed, each, by a conditioning circuit


for amplifying the signal at the sensor output. III. HARDWARE IMPLEMENTATION
To increase the accuracy of the used method, the The schematic diagram of the intelligent energy meter (IEM)
measurement operations are performed over a time noted Tm is given by figure.3.
such as : Tm = mTs ; m : Integer. In the designed Intelligent Energy meter (IEM) circuit, the
Then, we calculate a rated power Ps , and the expression (6) voltage line and the current load are respectively obtained
using voltage Hall Effect transducers CYHVS025A and
1 k current Hall effect transducers LEM LA55-P[5]-[6]. They are
can be written as follows Ps = Pt
m i =1 i
(7)
Hall Effect closed cycle transducers which need a power
The consumed energy is then calculated based on the active supply of 12V and they are used to adapt the measuring
power value for each frame of one second, that means power.
We = Ps t (during 1s).

192
For measuring the power due to the first harmonic, we use a N
230 / AC
L

two low pass filter and a multiplier model of AD734 from i


RS 232
Analog Device.
Si
The IEM is build around a microcontroller PIC16F877 [7].
Its a low cost microcontroller which has 8 analog inputs. Its Rp

Load
v
interfaced to communicate with a PC via an RS232
connector. rv

Microcontroller is programmed to calculate the active power,


for linear or non linear load, the reactive power, the apparent
power, the power due to the first harmonic, the deformation
factor, the energy and to display it on the screen of the LCD.
Figure 3. Intelligent Energy Meter (IEM) system Block Diagram

The implemented circuit and the schematic of the


microcontroller are shown in Figure 4.

Figure 4. Hardware implementation

The flow chart of the IEM written in Hex programme is shown in Figure.5.

Vn

In

V pf
Vrms , I rms , Ps , Pf , S , Q, D

We

We

Figure 5. General Flow Chart of main operation

193
If we set V = k HV .GV and I = k I .G I . Then the variance
IV. METROLOGICAL ANALYSIS AND SOURCES OF ERRORS
of the error can be written as [8]:
ASSOCIATED TO IEM
1 2 2 2 1 2 2 2
To evaluate the measurement error, we determine the 2M VM V n acqii + 2M VM V n condii +
conversion function at the output of the ADC, which
1 2 2 2 1 2 2 2
2 I + I +
represents the function of the following input variables: 1 2M M I n acqv i 2 M M I n condvi (14)
V {P} =
v acqv (t ) = VM k HV GV cos(t ) + ncondv (t ) + nacqv (t )
V I 1 2 2 1
+ 2 2 +
v acqi (t ) = I M S .k H I G I cos(t + ) + ncondi (t ) + nacqi (t ) M n acqvi n acqii M n acqvi ncondii
1 1
With : k H V : Scale factor of the voltage sensor, k H I : Scale n2 2 + 2 2
M condvi n acqii M n condvi n condii
factor of the current sensor, If we set: n cond i = n cond i = n j and
v i
GV : Gain of voltage conditioner.
n acq i = n acq i = ni , we can estimate the standard
G I : Gain of current conditioner. v i

we set also: k I = S .k H I and = t deviation of the active power as:

The signals v acqv and v acqi are sampled and digitized and 12
2 1 2 2 1 2 2
multiplied between them to get: ni VM V + I M I +
1 1 2 2 (15)
v np = v acqvi v acqii P =
V I M 2 1 2 2 1 2 2
(
v np = V M k HV GV cos(i ) + n condvi + n acqvi )

j 2
n

VM V +
2
I M I

(I M k I G I cos(i + ) + ncond i + nacq i )
i i
(10)
ni =
q
= 1.4[mV ] is the quantification error and
The average power is derived from the average of the vector 12
v np divided by the term k H V k I GV G I . n j = e n B is the noise due to the conditioner amplifier :
With en = 55 nV Hz and B = 10 kHz .
M
1 1
P=
k HV k I GV G I M v acq i v acq i
v i
(11) We obtained the
9
result
n j = 55.10 .100 = 55.10 7
it is negligible.
equal to:
i =1

The substitution of expression (10) into (11) gives (12): Finally the standard deviation of the estimation active power
is just:
1 1
P=
k H V k I GV GI 2 VM I M k H V k I GV GI cos( ) + P =
1 1 1
ni VM2 V2 +
1 2 2
IM I (16)

V I M 2 2
1 M

M
VM k H V GV cos(i ) nacq i + i


The numerical estimated standard deviation of the power is:
i =1
1 1
1 M P = 1.4 10 3

M
VM k H V GV cos(i ) ncond i i +

3.072 0.141 100
12
i =1 1 2 2 1 2 2
M 325 3.072 + 14.14 0.141
1 (12) 2 2
M I M k I GI cos(i + ) nacqv i +
1 i =1 P = 0.228 [W]
k H V k I GV GI 1 M

M
I M k I GI cos(i + ) ncond v i +

This result shows that the standard deviation can not affect
the precision of the IEM.
i =1
M M If the power range is P = 3000 [W] than the relative error
1 1
M nacqv i nacqi i +
M nacqv i ncond i i +
p =
P
is less than 0.008% . To obtain this accuracy, we
i =1 i =1 P
1 M
1
M

M
ncond v i nacqi i +
M ncond v i ncond i i

need to make a system auto-calibration each beginning of
acquisition data operations.
i =1 i =1
From the probability density we can mathematically
V. CONCLUSION
calculated the expectancy (noted E ) related to the power.
1 The proposed I.E.M has the advantages to measure the
E{P} = VM I M cos( ) = VI cos = P (13) energy consumed by a single phase linear and non linear load
2
The estimator of the variance is obtained from equation (12). and to control the power factor in order to reduce the effect
Note that the terms due to noise are independent of signals of the load in the residence. The IEM was designed and
carrying information. tested using a PIC 16F877 which is interfaced to a PC via an

194
RS232. The measurement results were treated using CONTROL AT HOME , International Journal of Embedded Systems
and Applications (IJESA) Vol.3, No.1, March 2013.
LABVIEW.
[3] A. Ayari, H. Mechergui, A.Haddouk, ACTIVE POWER
A detailed metrological analysis was developed to estimate
MEASUREMENT COMPARISON BETWEEN ANALOG AND
the error introduced by all the system. We derived analytical DIGITAL METHODS International Conference on Electrical
expressions for standard deviation of the active power Engineering and Software Applications (ICEESA) Hammamet -
estimation. In the end we conclude that he IEM has a Tunisia, 21 23 March 2013, ISBN : 978-1-4673-6302-0, doi :
10.1109/ICEESA.2013.6578416 (2013) IEEE publisher.
flexibility to measure the power and energy and to control
[4] AD734 Data Sheet, Analog Devices, revision E, 2011.
the quality of the consumed energy. [5] CY Hall Effect Voltage Sensors, Datasheet, Copyright 2012,
ChenYang Technologies GmbH & Co. KG, http://www.chenyang.de.
[6] LEM Current Transducer LA 55-P/SP1, Datasheet,
ttp://www.lem.com.
REFERENCES [7] Microchip, PIC 16F87X Data Sheet, USA, 1998-2013 Microchip
[1] Demirkol (2006). Measurement and Compensation in with Technology Inc.
Harmonic and Unbalanced Network. Master thesis, Graduate School of [8] F. Corra Alegria, A. Cruz Serra, Gaussian Jitter-Induced Bias of
Natural and Applied Sciences, Sakarya. Turkey, 2006. Sine Wave Amplitude Estimation Using Three-Parameter Sine Fitting
, IEEE Transactions on Instrumentation and Measurement, vol.59,
No. 9 pp.2328 - 2333,September 2010.

[2] Edwin Chobot, Daniel Newby, Renee Chandler, Nusaybah Abu-


Mulaweh, Chao Chen, Carlos Pomalaza-Rez, DESIGN AND
IMPLEMENTATION OF A WIRELESS SENSOR AND
ACTUATOR NETWORK FOR ENERGY MEASUREMENT AND

195

S-ar putea să vă placă și