AC Power Meter Design Based On Arduino: Multichannel Single-Phase Approach
AC Power Meter Design Based On Arduino: Multichannel Single-Phase Approach
AC Power Meter Design Based On Arduino: Multichannel Single-Phase Approach
Abstract—Monitoring power consumption of electrical appli- accurate real power for all types of load but do not support
ances is a step towards energy efficiency and saving management. reconfiguration for variable sensors.
This paper proposes an Arduino multichannel power meter de-
sign with the aim at improving real power accuracy by sampling One of the factor addressed by the design in this paper
voltage and current simultaneously. Moreover, it adds the ability is the sampling time difference between voltage and current.
for users to choose current sensors for suitable use regarding to OpenEnergyMonitor [5] and [11] sample voltage and current
appliances. As a consequence, calibration factors must be changed consecutively, using Analog-to-Digital Converter (ADC) on an
according to a selected sensor. This design, instead of editing the Arduino board. Thus, teh real power is computed, according
source code by the users, provides configuration files and APIs for to the AC active power formula in [8], from instanteneous
remote configuration. This paper presents the hardware design voltage and current obtained from different time. To address
and high-level algorithm for the Arduino firmware. Experiments
this problem and to improve our previous work [11], this paper
on multiple workloads with an external reliable power meter are
setup for parameter calibrations and the meter design accuracy proposes a design with two ADCs responsible for sampling
evaluation. voltage and current separately. Additionally, to support multi-
channel measurement, a multiplexer is integrated.
Keywords—Power Measurement, Power Meter, Arduino, Voltage
Sensor, SCT-013-030, ADC In order to support the portability, the ability to couple
with different current transformers (CT) as the current sensors
is added. This is done by the introduction of configuration files
I. I NTRODUCTION in which each sensor’s calibration factors are set. As a result,
Residential and office buildings utilize electrical appliances the user needs not reprogram and recompile the firmware.
consuming electricity. Saving the energy reduce the operating The organization of this paper starts with background in
cost, and helps decrease greenhouse gas emissions. To come Section II, followed by the design in Section III. Then, the
up with an energy saving plan, the energy consumption of each evaluation and experimental setup are explained in Section IV
appliance should be accounted. Therefore, an energy meter – and V, respectively. The experimental results are present in
e.g., a power meter – comes into play. Section VI. Lastly, the conclusion and future work are narrated
It is important to know energy consumption of individual in Section VII.
or small groups of appliances rather than the whole building,
so that each of them can be controlled towards an energy II. BACKGROUND
saving plan properly. Commercial portable meters are suitable
A. Home Appliances
for mobile measurement for a few points because they are
not designed to stay measuring for a long period of time and Home appliances refer to electrical appliances used in
the price is needed to be considered. Despite the existence of the residential section. They range from small ones such as
stationary power meters – e.g., products by EKM [1], Current- portable device chargers consuming a fraction of watts to
Cost [2], Watts up [3], Kill a Watt [4], OpenEnergyMonitor [5] large devices, e.g., thousand-watt air-conditioners [13]. The
– they have limitation on the number of measured loads and power consumption figures usually refer to the running watts
the compatibility with the ranges of current sensors. Although, (averaged watts required when the appliance runs). Still, many
OpenEnergyMonitor [5] can be coupled with different current appliances consume additional watts referred to as starting
sensors but its current products do not allow the user to change watts for a short period of time when the appliances transition
the sensors without recompiling the firmware. themselves from the off to the on state [14]. The additional
starting watts are caused by the inrush current when the
For academic related works, [6] and [7] propose power
appliances start. This property of appliances can be a cause of
meter designs sensing only current drawn by appliances, ignor- measurement errors if the the starting watts exceed measuring
ing the voltage. They are suitable for measurements for which
device’s limit.
real power accuracy is compromised, however the measure-
ment error is higher than power meters with voltage sensors Another parameter of home appliances to be considered
when measuring non-resistive loads [8]. Current research work is their type. All appliances, also referred to as loads, can
in [9], [10], [11], and [12] introduce power meter designs with be categorized according to their behavior into either linear
both voltage and current sensors, which as a result, render more loads, or non-linear loads [15]. The impedance of linear loads
978-1-4673-7825-3/15/$31.00
c 2015 IEEE
is constant and this makes the current drawn by a linear load
proportional to the voltage applied to it, and the voltage and
current frequencies are equivalent. Resistive (e.g., incandescent
light bulbs, water boilers, toasers), inductive (e.g., fans, water
pumps, blenders), and capacitive (e.g., capacitor banks) loads
are all linear. On the contrary, non-linear loads vary their
impedance depending on the voltage applied. Therefore, the
current drawn is not proportional to the voltage applied to the
load, resulting in distorted current waveform deviated from
the fundamental frequency. Most electronic devices such as
televisions, computers, radios, mobile phone chargers fall into
this load category.
Despite the behavior difference, both load categories use
the same formulas to calculate real power, apparent power,
and power factor, providing that both instantaneous voltage
and current at the same time are known.
III. D ESIGN
The design consists of 3 main components as shown in
Fig. 1. Most of the work in this design contributes to the
transducer shield composed of 3 main modules: the voltage
and current transducer module, the real-time clock module, and
the voltage regulator module. The voltage regulator provides
Fig. 2: Multiplexer Section
+5V supply to the whole shield. The real-time clock module
shown Fig. 4 provides the timestamp for the measurement data.
The core of the voltage and current transducer module consists
of the analog-to-digital conversion section and the multiplexer
section. B. Analog-to-Digital Conversion Section
A. Multiplexer Section
Fig. 2 is the schematic for this section. All the ICs comprise
an analog multiplexer with 15 channels for analog signals from
current sensors. Channel selector is done by 4-bit numbers
ranging from 0 to 14 at pin 20 - 23 of U10, a 4-to-16 line
decoder. The output of this IC is active low; therefore, inverters
U7 - U9 are required. The signal from inverters are fed to
enable pins (E pins) of analog switches U3 - U6 to close or
open the circuit for each current sensor channel. The output of
all CT channels (Z pins) are connected together to provide a
single input for ADC that converts analog signal from a current
sensor to its digital counterpart.
Each analog switch IC (HEF4066B) contains 4 analog
switches inside. Thus, four of this IC provides 16 analog
switches. Nonetheless, one switch is dedicated for the voltage Fig. 3: Analog-to-Digital Conversion Section
channel with circuit always closed so as to add the same dalay
to the voltage signal as the current one.
C. Real-Time Clock Module Algorithm 1 High-Level Firmware Algorithm
Real-time clock module, shown in Fig. 3 consists of the 1: Power up.
real-time clock calendar IC MCP7904, the 32.768kHz crystal, 2: Read configured parameters from the file.
a 3V backup battery, two 2K resistors for I2C communication, 3: Store the parameters in variables.
and a 10K resistor for an interrupt channel. 4: Set numberOf DataSets to be a value
5: curChnl ← 0. Channel of each current sensor
6: activeChnls ← empty list A list to hold active
channels
7: while curChnl < 14 do There are 15 channels.
8: if curChnl has sensor connected then
9: Add curChnl to activeChnls.
10: end if
11: end while
12: if size(activeChnls) = 0 then
13: status ← “no-sensors-connected”
14: goto ending
15: end if
16: i ← 0.
17: while i < numberOf DataSets do
18: curChnl ← 0.
19: while curChnl < size(activeChnls) do
20: Obtain digital voltage and current signals from
Fig. 4: Real-Time Clock Module voltage sensor and current sensor activeChnls[curChnl]
simultaneously.
21: Compensate the voltage and current data with
the configured voltage and current calibration factors for
D. Firmware activeChnls[curChnl].
22: Calculate real power [W].
The overall algorithm of the software is described in
23: Calculate RMS voltage [V].
Algorithm 1. The algorithm starts with the hardware pow-
24: Calculate RMS current [A].
ered up in line 1. Then, all the configured parameters are
25: Obtain timestamp from RTC.
retrieved from the configuration files, and temporarily stored
26: Append to file “MEASDAT.DAT”
in program variables, making them ready for the usage in
activeChnls[curChnl], RealP ower, VRM S , IRM S ,
calculations, as described in lines 2 to 3. Next, at line 5,
T imestamp.
the variable curChnl, used as a counter, representing present
27: curChnl ← curChnl + 1.
current channel number is initialized as zero, pointing to the
28: end while
first current channel. At line 6, the variable activeChnls is a
29: i ← i + 1.
list or an array used to store the connected current channel
30: end while
numbers. Accordingly, all 15 current channels, described in
31: Read contents from file “MEASDAT.DAT”.
Figure 2 as CT In 0−CT In 14, are explored to be examined
32: Display the read contents.
whether there is a current sensor connected to a specific
33: Delete all contents from file “MEASDAT.DAT”.
channel determined by curChnl or not, as described in lines 7
34: ending:
to 11. If a current sensor is detected at a channel, the channel
number, stored in curChnl, is added to the list activeChnls.
Lines 12 to 15 check whether there are no current sensors in this paper. The power accuracy from both designs, obtained
connected. If there are not, the program is terminated. Oth- from the experiments, was shown and compared.
erwise, in line 20, the program obtains voltage and current
The accuracy is measured as the RMS error and percentage
digital data from two ADCs depicted in Figure 3. Then, the
RMS error shown in Equation 1. Therefore, the smaller the
real power, RMS voltage, and RMS current are calculated, as
RMS error is, the better the accuracy exhibits.
described in lines 21 to 24. The timestamp is obtained and a
measured data entry is written to the file MEASDAT.DAT in
binary form, as shown in lines 25 to 26. These data acquisitions 20
and measured data calculations are done for every connected i=1 (x − xi )2
RM SEx = (1)
current channels defined in the list activeChnls, and only 20 20
times as a whole in order not to flood the SD card with plenty RM SEx
amount of data. Lastly, the data entries are retrieved from file P RM SEx = × 100 (2)
x
MEASDAT.DAT to be displayed and they are deleted.
where
RM SEx is RMS error of the reference value x;
IV. M ETHODOLOGIES
P RM SEx is percentage RMS error of the reference value
The evaluation approach was done by comparing the exper- reference value x and
imental results from the design in [11] and the design proposed xi is the ith observed value from the implemented meter.
V. E XPERIMENTAL S ETUP
From now on, the design in [11] is referred to as Consecu-
tive Sampling Design (CSD), and the design proposed in this
paper will be called Simultaneous Sampling Design (SSD).
The components in the setup were categorized into three
categories: 1) the power meters under tested, 2) the reference
power meter, and 3) electric loads. There are two power meters
under tested: the implementation of the design in [11] and the
one presented in this paper. The reference power meter is AXE
MMX-P1 [16]. There were two types of electric loads in the
experiments, namely, linear loads and non-linear loads. The
linear loads were divided into two types, i.e., resistive loads Fig. 6: Experimental Setup
and inductive loads.
The schematic for power accuracy experimental setup was
illustrated in Fig. 5, which corresponded to the actual setup the voltage and current consecutively, inducing phase shift
in Fig. 6. In Fig. 5, The power meter in this paper is refered difference between the two parameters. Even though the phase
to as METER-V2 and the other proposed in [11] was denoted shift was compensated as described in [11], SSD was better
METER-V1. The computer was used as the monitor of the than CSD since the actual signals were obtained from voltage
measurement results. T1 and T2 were current transformers and current channels.
SCT-013-030 [17] with 10 turns at the primary. T3 was used as
the voltage transformers. The varied component is only RLoad Consecutive Sampling Design Simultaneous Sampling Design
or the electric loads for each time of the experiment. In Fig. 6,
14.27
14.12
Approach 1 denotes the design in [11] and Approach 2 means 15
the design in this paper.
11.92
9.89
10
RMS Error [W]
8.23
6.73
5.53
5.44
5.26
4.02
3.95
5 3.06
1.95
1.46
17
12
24
35
48
60
72
.0
0.
0.
3.
6.
1.
0.
00
00
00
00
00
00
00
0
00
00
00
00
00
00
Reference Real Power [W]
30.24
products/p4400.html
29.22
[5] (2015) Openenergymonitor. [Online]. Available: http : / /
30 openenergymonitor.org
[6] C. Luangsa-ard, T. Tantidham, and P. Intakot, “An arduino network
design for multipoint power monitoring system,” in The 2014 First
International Conference on Engineering Science and Innovative Tech-
16.63
20 nology, 2014.
RMS Error [W]
15.29 [7] D. Porcarelli, D. Balsamo, D. Brunelli, and G. Paci, “Perpetual and low-
12.57
7.65
7.8
10
6.43
6.08
3.27
2.03
1.94
sors Handbook on CD-ROM. CRC Press LLC, 1999, ch. 39.
1.31
1.06
1.02
0.78
0.56
0.54
0.17
47
67
88
11
13
16
23
34
00
7.
.0
.0
.0
5.
6.
5.
0.
5.
crocontroller based energy meter,” in Instrumentation and Measure-
00
00
00
00
00
00
00
00
00
00
00
0
00
00
00
00
00
ment Technology Conference, 1998. IMTC/98. Conference Proceedings.
Reference Real Power [W] IEEE, vol. 2, May 1998, pp. 797–800 vol.2.
[11] N. Tamkittikhun, T. Tantidham, and P. Intakot, “Ac power meter design
Fig. 8: RMS Power Errors (Inductive Loads) for home electrical appliances,” in 12th International Conference on
Electrical Engineering/Electronics, Computer, Telecommunications and
Information Technology (ECTI-CON), 2015.
[12] T. Schmid, D. Culler, and P. Dutta, “Meter any wire, anywhere by
Consecutive Sampling Design Simultaneous Sampling Design virtualizing the voltage channel,” in Proceedings of the 2Nd ACM
153.04
116.78
typical-household-appliances/
100 [14] (2011) Wattage worksheet. Briggs & Stratton. [Online]. Available:
RMS Error [W]
http://www.briggsandstratton.com/ ∼ /media/Files/BriggsandStratton/
68.92
Generators/MC111012WattageWorksheetENGFNL2.pdf
50.69
47.91
47.35
21.5
2.89
7.2
1.39
1.18
1.13
45
54
63
10
12
16
18
21
.0
.0
.0
.0
.0
1.
6.
2.
0.
2.
00
00
00
00
00
00
00
00
00
00
0
0
00
00
00
00
00
conditions. The reason is that the SSD obtains the voltage and
current data without phase shift, while the other design does
not.
The work will be extended by integrating a communication
interface in order to allow remote configuration and support
online power monitoring.
R EFERENCES
[1] Ekm metering. [Online]. Available: http://www.ekmmetering.com
[2] Currentcost. [Online]. Available: http://www.currentcost.com
[3] Watts up meters. [Online]. Available: https://www.wattsupmeters.com/
secure/products.php?pn=0