http://www.www.datasheet4u.com

900,000+ Datasheet PDF Search and Download

Datasheet4U offers most rated semiconductors datasheets pdf




  Microchip Technology Semiconductor Electronic Components Datasheet  

AN939 Datasheet

Designing Energy Meters with the PIC16F873A

No Preview Available !

AN939 pdf
www.DataSheet4U.com
AN939
Designing Energy Meters with the PIC16F873A
Author: Sandip Chattopadhyay
PRINCIPLES OF MEASUREMENT
Microchip Technology Inc.
Basically, a watthour meter is designed to measure
energy or power consumed over time. In simple terms,
INTRODUCTION
electrical power is the product of voltage and current. If
we make repeated measurements of both instanta-
The deployment of electronic energy meters has
gained a great deal of momentum over the past several
neous voltage and current, or Vi and Ii, we can keep a
running total of their products over time. By dividing the
years. This is due to their two main advantages over
total accumulated energy over the number of samples,
the traditional electromechanical designs: improved
we have the average power (the first expression in
accuracy and an expanded set of features. Current
Equation 1). Multiplying the average power by time
microcontroller technology allows designers to build
gives the total energy consumed.
meters that are competitive in price with traditional
devices, while maintaining the required IEC 1036
EQUATION 1: CALCULATING AVERAGE
Class 1 accuracy of ±1% for domestic applications.
ENERGY AND CONSUMED
Microcontrollers also allow the easy incorporation of
added features, such as rms voltage and current and
POWER
peak demand metering, as local electric utility
companies desire to implement them.
In this application note, we will discuss the implementa-
tion of a basic watthour meter using PICmicroD®aFtalaSshheet4U.com
microcontrollers. In the process, we will show how one
ΣN
Average Power
(watts)
=
k
=
1Vik
Ii
k
N
ADC with a single sample-and-hold circuit can effectively
measure both voltage and load current and maintain
Class 1 accuracy. The firmware discussed measures and
displays rms voltage and current, as well as kWh,
presented in a clear digital format on an LCD.
ΣN
Energy Consumed
(wattseconds) =
k
=
1Vik
Ii
k
Fs
Besides basic energy measurement, this design also
includes features that many electric utilities are very
interested in rolling out on a wider basis. Dual-channel
measurement provides a simple method for monitoring
for tamper conditions. An on-board RTC provides a
time source for calculating and tracking current and his-
torical peak demand. All metered data is securely
stored as it is updated in nonvolatile memory.
The design discussed here uses the PIC16F873A and
two Current Transformers (CTs) for current sensing. It
can be implemented just as easily with the pin compati-
ble PIC18F2320. Current measurement using a shunt
may also be used in this design, with little or no change
to the current amplifier design.
For alternating current, such as that from the mains,
average power also must account for power factor,
which is the phase relationship between voltage and
current. In simple terms, average AC power is V I cosθ,
where V and I are average rms voltage and current,
and θ is the phase angle between the two. Instanta-
neous sampling does not directly use power factor; the
value of the phase angle is essentially embedded in the
instantaneous current measurement. Recovering the
actual phase angle for the purpose of calculating and
displaying the power factor can be done separately and
is very calculation intensive. If we are just measuring
energy consumption, it is not necessary.
DataShee
DataSheet4U.com
© 2005 Microchip Technology Inc.
DataSheet4 U .com
DS00939A-page 1


  Microchip Technology Semiconductor Electronic Components Datasheet  

AN939 Datasheet

Designing Energy Meters with the PIC16F873A

No Preview Available !

AN939 pdf
www.DataSheet4U.com
AN939
et4U.com
To get an accurate picture of power consumption for an
AC system, we need to make frequent measurements,
preferably many times that of the supply frequency. In
this application, we use a sampling rate of 400 Hz,
which provides 8 samples per full cycle of the line
frequency (for AC supply frequency of 50 Hz). For a
sampling rate Fs, we get N samples in N/Fs seconds. By
multiplying this expression for time by average power,
we obtain an expression for energy consumed in terms
of wattseconds (the second expression in Equation 1).
From here, we can use simple math to calculate
kilowatthours.
Of course, it is difficult for a microcontroller to make
direct measurements when the supply voltage is
coming straight off the mains: say, 230V at up to 50A.
This makes it necessary to indirectly measure line
voltage and current at a level consistent with a micro-
controller, then rescale these measurements to arrive
at the original value. The best way to do this is to
reduce the voltage to a level and dynamic range that is
compatible with digital circuitry. (Measuring current
here is essentially the same as measuring voltage, in
that we will use a transducer that generates a voltage
proportional to the load current.) The actual voltage
and current readings can then be derived.
EQUATION 2:
CALCULATING CONSUMED
ENERGY FROM INDIRECT
MEASUREMENTS
ΣN
Energy Consumed
(wattseconds) =
k
=
1Vdk
Idk⎟⎠
(Kv
Ki)
Fs • Kd2
We could accumulate a running total indefinitely and
directly interpret it for energy consumed over time. How-
ever, it’s more practical to accumulate up to some fixed
amount, then increment a counter to indicate energy
consumption. For our application, we will accumulate
10 Wh (0.01 kWh) before incrementing the counter. This
value represents the resolution limit of the meter. It is
equivalent to 36,000 wattseconds (10 Wh x 60 x 60); this
means that we increment the counter every time that the
right side of Equation 2 reaches 36,000.
We can also rearrange Equation 2 to define the power
consumed entirely in terms of Vd and Id. Since we have
already defined Fs, Kv, Ki and Kd in constant terms, we
can give the whole quotient on the right side of the
equation a constant value, D (Equation 3).
For this application, the derived voltage reading, Vd, is
related to the actual instantaneous line voltage Vi by
EQUATION 3: REDEFINING POWER IN
the expression, Vd = Vi Kd/Kv or Vi = Vd Kv/Kd, where Kd
TERMS OF Vd AND Id ONLY
is the digitization constant
tion and Kv is the voltage
for the ADC in
proportionality
tchoisnsatapnptliDcfaoa-rtaSheet4U.com
When 0.01 kWh is consumed:
the circuit design. For this particular application, Kd is
204.6, the digital value from the ADC that represents
1V. Kv is the factor by which the input line voltage is
reduced by a voltage divider; in our design, it is 300.
ΣN
k = 1Vdk • Idk
=
3600 • Fs Kd2
Kv • Ki
=D
Similarly, the derived current reading, Id, is related to Ii
by the expression, Id = Ii Kd/Ki or Ii = Id Ki/Kd, where Ki
is the current proportionality constant specific to this
design; it is calculated by dividing the CT turn ratio by
the product of the current amplifier gain and the input
burden resistance. For this application, based on a
5000-turn CT, the value of Ki works out to be
approximately 8.7. Kd is the same as before.
Note:
The calculation of Ki when using a shunt is
somewhat different. The actual circuit
design for current measurement, and the
design considerations for using a shunt,
are discussed in more detail in “Hardware
Design”, starting on page 10.
In simple terms, any time that the accumulated sum of
the voltage and current products equals or exceeds D,
we increment the kWh counter. We also save any
remainder in excess of D to be used in the next round
of accumulation.
Note that anything which might influence the value of
the constants may also affect the value of D and
requires changes to the amplifier design. This includes
the use of a shunt instead of a CT, or even changing the
CT turn ratio, both of which may change Ki.
By substituting the attenuated values of Vd and Id for
the Vi and Ii in the original power measurement
equation, we get an expression that relates the con-
sumed power directly to the indirect voltage and current
measurements, as shown in Equation 2.
DataShee
DataSheet4U.com
DS00939A-page 2
DataSheet4 U .com
© 2005 Microchip Technology Inc.


Part Number AN939
Description Designing Energy Meters with the PIC16F873A
Maker Microchip Technology
Total Page 18 Pages
PDF Download
AN939 pdf
Download PDF File


Buy Electronic Components




Related Datasheet

1 AN938 Designing ST Microelectronics
ST Microelectronics
AN938 pdf
2 AN939 Designing Energy Meters with the PIC16F873A Microchip Technology
Microchip Technology
AN939 pdf
3 AN93B06SCR BROAD BAND VIDEO AMPLIFIER IC FOR CRT MONITOR Panasonic Semiconductor
Panasonic Semiconductor
AN93B06SCR pdf






Part Number Start With

0    1    2    3    4    5    6    7    8    9    A    B    C    D    E    F    G    H    I    J    K    L    M    N    O    P    Q    R    S    T    U    V    W    X    Y    Z

site map

webmaste! click here

contact us

Buy Components