design and evaluation of sampling, digital processing and...

47
Bachelorproject Design and evaluation of sampling, digital processing and networking abilities of new energy-sensing platforms Authors: Gerben Hettinga (s2409429) Bob Reimink(s2370190) Supervisors: Dr. D. Bucur T.A. Nguyen July 7, 2015

Upload: others

Post on 17-Jan-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Design and evaluation of sampling, digital processing and ...fse.studenttheses.ub.rug.nl/12871/1/thesis.pdf · 3 describes the theory about measuring energy usage. Further on, di

Bachelorproject

Design and evaluation ofsampling, digital processing and

networking abilities of newenergy-sensing platforms

Authors:Gerben Hettinga (s2409429)Bob Reimink(s2370190)

Supervisors:Dr. D. BucurT.A. Nguyen

July 7, 2015

Page 2: Design and evaluation of sampling, digital processing and ...fse.studenttheses.ub.rug.nl/12871/1/thesis.pdf · 3 describes the theory about measuring energy usage. Further on, di

Contents

1 Introduction 31.1 Current Solution . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.2 Research questions . . . . . . . . . . . . . . . . . . . . . . . . . . 31.3 Outline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

2 Requirements for our energy meters 4

3 Techniques involving energy usage measurement 63.1 Theory of power . . . . . . . . . . . . . . . . . . . . . . . . . . . 63.2 Digital power sensing . . . . . . . . . . . . . . . . . . . . . . . . . 83.3 Methods for analog power sensing . . . . . . . . . . . . . . . . . . 11

3.3.1 Invasive . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113.3.2 Non-invasive . . . . . . . . . . . . . . . . . . . . . . . . . 12

3.4 Techniques for calculating the power . . . . . . . . . . . . . . . . 143.5 Communication techniques . . . . . . . . . . . . . . . . . . . . . 14

4 Hardware Options for Energy meters 164.1 Sensors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

4.1.1 Invasive Sensors . . . . . . . . . . . . . . . . . . . . . . . 164.1.2 Non-invasive Sensors . . . . . . . . . . . . . . . . . . . . . 17

4.2 Processing devices . . . . . . . . . . . . . . . . . . . . . . . . . . 184.3 Communication Module . . . . . . . . . . . . . . . . . . . . . . . 194.4 Complete solutions . . . . . . . . . . . . . . . . . . . . . . . . . . 20

4.4.1 EmonTx V3 . . . . . . . . . . . . . . . . . . . . . . . . . . 214.4.2 Efergy Elite Classic and Engage Hub . . . . . . . . . . . . 214.4.3 ACme-A plug-load meter . . . . . . . . . . . . . . . . . . 214.4.4 Plugwise Circle and Stretch . . . . . . . . . . . . . . . . . 224.4.5 Comparison . . . . . . . . . . . . . . . . . . . . . . . . . . 22

5 Chosen Solutions 235.1 Invasive Solution: Arduino current sensor . . . . . . . . . . . . . 23

5.1.1 Hardware of Invasive Solution . . . . . . . . . . . . . . . . 235.1.2 Calibration of Invasive Solution . . . . . . . . . . . . . . . 24

5.2 Non-invasive Solution . . . . . . . . . . . . . . . . . . . . . . . . 255.2.1 Hardware of non-invasive Solution . . . . . . . . . . . . . 255.2.2 Calibration of non-invasive solution . . . . . . . . . . . . . 26

5.3 Direct Solution: Arduino P1-reader . . . . . . . . . . . . . . . . . 265.3.1 Hardware of Arduino P1-reader . . . . . . . . . . . . . . . 26

6 Design of software 286.1 Non-invasive and invasive energy meter software design . . . . . 28

6.1.1 Sensor Reading and Energy Consumption Calculation . . 286.1.2 Wi-Fi Communication . . . . . . . . . . . . . . . . . . . . 286.1.3 Communication between Sensor and Wi-Fi module . . . . 29

1

Page 3: Design and evaluation of sampling, digital processing and ...fse.studenttheses.ub.rug.nl/12871/1/thesis.pdf · 3 describes the theory about measuring energy usage. Further on, di

6.1.4 Correct timestamp . . . . . . . . . . . . . . . . . . . . . . 296.2 P1-reader software design . . . . . . . . . . . . . . . . . . . . . . 29

7 Evaluation of non-invasive and invasive energy meter 307.1 The sampling rate . . . . . . . . . . . . . . . . . . . . . . . . . . 30

7.1.1 Sampling rate testing . . . . . . . . . . . . . . . . . . . . 317.1.2 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . 34

7.2 The highest data Load . . . . . . . . . . . . . . . . . . . . . . . . 347.2.1 Data load test results . . . . . . . . . . . . . . . . . . . . 347.2.2 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . 35

7.3 The communication . . . . . . . . . . . . . . . . . . . . . . . . . 357.4 Accuracy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

7.4.1 Test results non-invasive meter . . . . . . . . . . . . . . . 367.4.2 Test Results Invasive Meter . . . . . . . . . . . . . . . . . 39

7.5 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

8 Applications of the energy meter 428.1 Fine-grained grid . . . . . . . . . . . . . . . . . . . . . . . . . . . 428.2 Monitoring power differences at low level . . . . . . . . . . . . . . 438.3 Monitoring different devices . . . . . . . . . . . . . . . . . . . . . 43

9 Conclusion & Future Work 45

2

Page 4: Design and evaluation of sampling, digital processing and ...fse.studenttheses.ub.rug.nl/12871/1/thesis.pdf · 3 describes the theory about measuring energy usage. Further on, di

1 Introduction

Energy consumption is becoming more and more problematic in this world.While we are increasing our energy consumption, we want to decrease the harm-ful effects by switching over to a more sustainable form of energy and energyconsumption. One of the solutions to solve this problem is by saving energy. Tosave energy, you need to know how energy is being used. Where is the energyconsumption large and where can it be reduced. Nowadays, monitoring of en-ergy consumption can be done by smart meters which can provide informationabout the energy consumption, but it usually lags 24 hours behind and givesinformation in blocks of 15 minutes or even more. This does not give a real-timeview of the consumed energy, while real-time feedback is important in order toknow where and when the energy is consumed. Besides real-time feedback, afine grained grid is another important part of giving good feedback on the en-ergy consumption. Smart meters only tell us about the energy consumption ofthe building as a whole, but they do not give an indication in which part of thebuilding energy is being consumed and thus where it could be saved.

1.1 Current Solution

In the Bernoulliborg, one of the buildings of the University of Groningen, therealready exists a solution that measured the energy consumption in real-time.The solution used a light sensor to read out the energy usage. The meter, onwhich the solution was installed, pulses a light every time a certain amount ofenergy is used. This light was caught by the light sensor of the solution. Aprocessing device, Raspberry Pi 2 [1], was used to process the data of the sensorand calculate the energy usage. This data was sent via Wi-Fi or Ethernet toa central database. An Advantage of this technique is that it is a non-invasiveway to measure the energy consumption. There was no need to adjust the in-stallation of the meter.

However, this solution had some disadvantages as well. Meters need to havea LED that gives an indication about the energy usage, in order to be able touse this solution. Further on, the frequency of sending information is based onthe amount of energy usage. This means that consuming less energy means thatdata will be sent less frequently. Another disadvantage is that the accuracy de-pends on the accuracy of the meter. Therefore, the accuracy can’t be increasedin anyway by using the LED of the meter. Finally, like the smart meter, thissolution only gives information about the building as a whole - at meter level.It can’t be fine-grained since a building has only one smart meter.

1.2 Research questions

In order to solve these problems, a new type of energy meter is needed. Thisenergy meter should be flexible: In order to get information on the energyconsumption in a more fine-grained way, the meter should be able to sense

3

Page 5: Design and evaluation of sampling, digital processing and ...fse.studenttheses.ub.rug.nl/12871/1/thesis.pdf · 3 describes the theory about measuring energy usage. Further on, di

energy at device level, like outlets, but also at places like the smart meter fromthe building or per floor.For the energy meter itself, the following questions will be answered.

1. What is the highest sampling rate at which the sensing process workscorrectly?

2. What is the highest load of data to be processed at which the real-timerequirements are fulfilled?

3. What is the most effective, but still reliable, communication protocol thatcan be designed?

1.3 Outline

In chapter 2, the requirements of the energy meter will be described. Chapter3 describes the theory about measuring energy usage. Further on, differenttechniques that could be used for the energy meter are described and discussed.In order to do this, the energy meter is divided into three different parts:

1. Sensor part. An energy meter needs to sense the energy.

2. Processing part. The meter needs to process the signal coming from thesensor.

3. Communication part. The meter needs to be able to send the processedsignal to a gateway.

What follows in chapter 4 is a comparison of the hardware, implementing thedescribed techniques, that are currently available on the market. Then, inchapter 5 and 6, a description of the implementation of the chosen hardwareand the software will be described. The results of the tests with the solutionswill then be presented and discussed in chapter 7. In chapter 8, applications ofthe energy meter are described and chapter 9 is the conclusion of this project.

2 Requirements for our energy meters

The energy meter has a couple of requirements.

1. StabilityThe hardware of the energy meter should be as reliable as possible. TheRaspberry Pi that is currently in use has already broken down a couple oftimes and even required replacement. In addition, the monitoring of theenergy meter needs to be as stable as possible. It is not desirable to havebig gaps in the data.

2. PriceSince the energy meter in this project may be used as part of a fine-grained

4

Page 6: Design and evaluation of sampling, digital processing and ...fse.studenttheses.ub.rug.nl/12871/1/thesis.pdf · 3 describes the theory about measuring energy usage. Further on, di

network, the price should be as low as possible. A higher price for a singleenergy meter has much more impact on the price for a fine-grained gridof the same energy meters.

3. WirelessThe energy meter should send the data wireless. This increases the porta-bility and ease of installation of the energy meter since it does not needany additional wiring.

4. InstallationThe installation needs to be easy. Multiple energy meters may be deployedin the building in order to have a fine-grained grid. Supplementary hard-ware may be needed to attach the energy meter to the electrical circuit.It may be needed to interrupt the electrical circuit in order to install thesensor.

5. Accuracy of measurementIn order to have an accurate representation of the energy usage, the energymeter needs to be accurate. The sensor should therefore be as accurate aspossible. Also, since the measured value needs to be converted to a digitalvalue, the resolution with which the signal will be converted should be ashigh as possible.

6. Open/closed sourceThe energy meter may use open or closed source software. However, opensource software is preferred because it gives more control of the software.

7. Sampling rateAnother factor in accurately measuring energy is the sampling rate. Thisshould be as high as possible. With higher sampling rates, the energymeter will be able to measure short peaks of energy consumption as well.

5

Page 7: Design and evaluation of sampling, digital processing and ...fse.studenttheses.ub.rug.nl/12871/1/thesis.pdf · 3 describes the theory about measuring energy usage. Further on, di

3 Techniques involving energy usage measure-ment

This section contains three parts. First, the theory about measuring energyusage will be explained. After that, the possibilities will be described for mea-suring the energy usage. Two different methods for measuring the energy usagewill be discussed. The first group of measurement describes the different pos-sibilities of measuring the energy usage using the meter. The second group ofmeasurements describes ways of measuring the current and voltage itself, whichcan be used to calculate the energy usage.

3.1 Theory of power

In order to know how much energy is used, it is important to know how theamount of power usage. When you know how much power a device uses and howlong the devices used this power, the energy can be calculated by multiplyingthe power used by time elapsed. Therefore, the basis of our energy meter isthat it senses the power at a high rate. The power will be saved along witha timestamp. The total amount of energy usage can then be calculated bymultiplying the power with the difference between the corresponding timestampand the previous one. Therefore, it is important to know how the power (P)can be calculated.The formula for calculating the power is:

P = UI

V is the voltage and I the current. However, in practice it is not that simple.This is because there are different kind of powers and different types of meth-ods of calculating these. The powers that are important in measuring energyconsumption are:

1. Apparent power

2. True power

3. Reactive power

The apparent power is the mean current times the mean voltage. In directcurrent circuits, this power represents the true power that is used by the devices.However, in alternating current circuits, the current and voltage are alternating.In doing so, there may exist a phase difference between both, due to which not allpower that is supplied can be used. This phase difference comes forth from thecombination of resistors, capacitors and inductors that are present in electricalcircuits of devices. Capacitors cause the current to lag 90 behind the voltage,while inductors cause the current to lead 90 ahead of the voltage.The combination of these elements results into one combined phase difference.In order to know what that phase difference is, the total power caused by the

6

Page 8: Design and evaluation of sampling, digital processing and ...fse.studenttheses.ub.rug.nl/12871/1/thesis.pdf · 3 describes the theory about measuring energy usage. Further on, di

resistors, the total power from the capacitors and the total power from theinductors can be compared using vectors. An example can be seen in Figure1. The length of the vector represents the amount of power that they use and

Figure 1: in = inductors, ca = capacitors and re = resistors

the angle of the vector represent the phase difference between the current andthe voltage. Combining the vectors of the resistors, capacitors and inductors, aresulting vector can be calculated of which the angle θ represents the resultingphase difference between the current and the voltage 1. In Figure 2, a voltage

Figure 2: Example of reactive power with a net power of zero1

and current are shown over time with the corresponding power. The phase ofthe current is shifted 90 compared to the voltage. This results into a powerthat is equal back and forth. Therefore the total power used is effectively zero.Power that is not used is called reactive power. When the phase betweenvoltage and current is between 0 and 90, a part of the power will be used.

1http://physics.bu.edu/~duffy/PY106/ACcircuits.html

7

Page 9: Design and evaluation of sampling, digital processing and ...fse.studenttheses.ub.rug.nl/12871/1/thesis.pdf · 3 describes the theory about measuring energy usage. Further on, di

This power is called the true power. The sum of the true power and the reactivepower is the apparent power.The true power is the most interesting power to measure since it is the powerthat energy companies use to bill over. [2]It was already stated that the true power is the same as the apparent power fordirect current. The apparent power can be calculated according to the formula:

apparent power = IRMS ∗ VRMS

where IRMS ∗ VRMS is

1

n

i=n∑i=0

xi ∗1

n

i=n∑i=0

yi

RMS stands for root mean square and is used for the average value for thecurrent and voltage. x and y are arrays of samples taken from the voltage andcurrent sensor. n is the amount of samples. In the calculation of the apparentpower, the voltage can be estimated since it will not change. In the Netherlandsfor example, every outlet will output around 230V. The voltage can also bemeasured and used as RMS value. However, since phase difference may existbetween the voltage and the current, not all power may be used by the device.The power that is used by the device is the true power and can be calculatedaccording to the formula:

true power =1

n

i=n∑n=0

xiyi

where x, y and n are the same as in the apparent power calculation. Insteadof the means that will be multiplied, the individual samples will be multipliedwith each other. It is important that the phases of the samples are in the samephase as the measured ones in order to have as accurate a power measurementas possible. This is how the energy meter should measure the power usage inorder to calculate the energy consumption. This requires the energy meter tohave both a voltage and a current sensor.

3.2 Digital power sensing

Since most meters give various ways to output their metered results, it is a wiseway to read out the data directly from an existing energy meter. First, thereneeds to be established which different kinds of energy meters exist and pairthese meters with means of retrieving data from these meters.The following different types of meters are distinguished:

Electromechanical MetersElectromechanical meters2 operate by translating the power passing throughthe meter by rotating a disk through magnetic induction. The challenge that

2http://en.wikipedia.org/wiki/Electricity_meter#Electromechanical_meters

8

Page 10: Design and evaluation of sampling, digital processing and ...fse.studenttheses.ub.rug.nl/12871/1/thesis.pdf · 3 describes the theory about measuring energy usage. Further on, di

these meters give is to translate the analog state of the meter to digital state sothat it can be stored digitally. The only way these meters can thus be read outis indirectly. This can be done using a light-sensing mechanism.

Light-sensing

This solution is also used in the current solution. Most disks have a small partomitted to be able to denote the point where the disk has made a full revolu-tion. Using this property, it is possible to construct a mechanism where a lightis pointed at the disk and a light-sensor is used to measure the reflected light3.Whenever the missing part comes around, the light sensor senses that there isless light being reflected. Every revolution of the disk is equal to a set amountof energy consumed. The count of the amount of revolutions is therefore inproportion to the amount of energy used. However, this method is heavily af-fected by ambient lighting. Too much ambient lighting might impair the abilityto sense the reflected light. It is therefore needed to have a consistent ambientlight. This can be done by making an overlay over the sensors such that outsidelighting does not make it into the sensing environment. This too can be difficultand can make for bulky solutions, as most mechanical meters have a glass plateattached to the front of them letting in great amounts of light. This method isquite easy to hook up to any processing device through the use of a breadboardor a pre-made light sensor made for this type of metering. For instance, theTCRT5000 4 module is specialised for this job. In addition to this, it is alsoquite cheap. It does require additional wiring and soldering to be connected toa processing device.

Electronic MetersReading out electronic meters might prove to be more effective than electrome-chanical meters. Some electronic meters have the ability to transmit readings,through a direct connection or wireless. However, not every electronic meterhas the ability to directly transmit its readings. Some electronic meters havethe ability to output their metered usage in the form of pulses5. The powerused at each pulse can be different per meter.

Pulse Output through light-sensor

Meters that output their pulses through the blinking of a light, typically a LED,can be read out using a light-sensor. However, these Light Dependent Resistors(LDR) are susceptible to every sort of light. High amounts of ambient lightingmight affect the readings. The existing solution in the Bernoulliborg projectalso uses this kind of sensing. This is a fairly easy way to read out the meter.It does not require excessive amounts of hardware or complicated code.

Pulse sensing through direct output

3http://www.sensorbay.com/2012/11/project-1-home-energy-monitor-with.html4http://www.vishay.com/docs/83760/tcrt5000.pdf5http://openenergymonitor.org/emon/buildingblocks/introduction-to-pulse-

counting

9

Page 11: Design and evaluation of sampling, digital processing and ...fse.studenttheses.ub.rug.nl/12871/1/thesis.pdf · 3 describes the theory about measuring energy usage. Further on, di

A more direct and possibly more accurate way to read out pulses is through di-rect connection with the pulse output. Some meters have the ability to connecta secondary device to the meter. In these meters there is a relay. This relaycloses at every pulse. The secondary device can then be connected such that itcan read out whenever the relay switches states. The two forms of relays arecalled KYZ-relays and KY-relays67. KYZ is an C-form connection and KY arecalled A-form connections. C-form has 3 wired connections and A-form has two.When there is high energy use, the speed with which the relay changes stateincreases. This connection is highly reliable (if implemented correctly) as thesensing of the pulses is direct and cannot be affected by outside factors. Likethe light sensor, it does not need excessive hardware or complicated code.

Infrared output

Pulses can also be emitted through an infrared output (IR). An IR-sensor couldthen be placed on the meter to register the pulses. Some IR outputs can eventransmit data to the receiver. Typically, this data contains information aboutthe metering and is transmitted via the IrDA8 protocol. In order to read outthis infrared data the infrared light has to be demodulated so that it can beprocessed in binary form by a processing device. Naturally, it is imperative thatthe sensor is in a direct line of sight of the outputted infrared. If there is a biggerdistance between the sensor and the output, this will impact the reliability ofthe meter.

Serial Output

Most modern smart meters in the Netherlands have the feature to output datathrough a serial port. This port has to be configured according to the DutchSmart Meter Requirements (DSMR) specification9. The DSMR-specification isbased on the IEC 6205610 standard, which is the international version of theCOSEM. It embodies the set of standards for electricity metering data exchange.The port the meter uses to output its metering data is called P1. This is inessence a serial port, the data can be read out using any serial interface but itrequires an RJ11/45 plug to connect. The P1-port transmits telegrams, thatcontain the data of the meter, at a set interval. This method is arguably themost precise out of all the methods as it has a direct data connection.There are currently 5 major versions of the DSMR-specification. Not every me-ter has the most recent version of the specification and they differ quite a lot.The following table shows the parameters regarding the sending and format ofa P1-telegram.

6http://www.solidstateinstruments.com/newsletters/kyz-pulses.php7http://www.schneider-electric.us/sites/us/en/support/faq/faq_main.page?page=

content&country=US&lang=en&locale=en_US&id=FA212484&redirect=true8http://en.wikipedia.org/wiki/Infrared_Data_Association9http://www.netbeheernederland.nl/themas/hotspot/hotspot-documenten/

?dossierid=11010056&title=Slimme%20meter&onderdeel=Documenten10http://en.wikipedia.org/wiki/IEC_62056

10

Page 12: Design and evaluation of sampling, digital processing and ...fse.studenttheses.ub.rug.nl/12871/1/thesis.pdf · 3 describes the theory about measuring energy usage. Further on, di

DSMR Version Baudrate Format frequency2.0 9600 not specified not specified3.0 9600 not specified 10 seconds4.0 115200 8N1 10 seconds5.0 115200 8N1 1 second

A P1 telegram from DSMR version 3.0 and lower have the following structure:

/ XXXZ Ident CR LF CR LF Data ! CR LF

A P1 telegram from DSMR version 4.0 and up have the following structure:

/ XXXZ Ident CR LF CR LF Data ! CRC CR LF

The data block of the telegram consists of several fields each denoted by aCOSEM object attribute value11.

The port can be interfaced by using a RJ11-cable. In addition to this, it isalso a quite cost effective means of acquiring metered results. A processingdevice can function as the serial interface and by adding an Ethernet- or Wi-Fi-module the acquired data can be sent to a server for further use. There areeasy solutions that use an Arduino and a stripped RJ11-cable12.

There are numerous commercial solutions that offer the serial interface anda means of visualizing the acquired data. One of these solutions is the Enel-ogic13. It uses an Ethernet cable to connect to a router. It then sends the datato a dedicated server where you can log in with an account, which comes withthe purchase.

3.3 Methods for analog power sensing

Instead of directly reading out the energy usage from a meter, measuring thecurrent and voltage can also be used for determining the energy usage. For thevoltage measuring, a transformer can be used that can transform the voltagefrom high voltage (230 Volts in the Netherlands for example) to a low voltage.The low voltage will be proportional to the higher voltage and can then be usedas analog signal for a processing device to measure the voltage.For current sensing, multiple measuring techniques can be used. These differentmethods will be discussed in the following section. The voltage measurementtechnique can be used in combination with each of the current sensing tech-niques.

3.3.1 Invasive

If it is needed to give a more fine-grained overview of the consumption of en-ergy, plug-in meters might be a good way to do this. Plug-in meters have the

11http://www.dlms.com/documentation/listandmaintenanceofstandarditems/standardobiscodes.html12http://thinkpad.tweakblogs.net/blog/10673/uitlezen-van-de-slimme-meter-p1-

poort-met-een-arduino-en-waarden-opslaan-in-mysql-database#hardware13https://enelogic.com/nl/prijzen/slimme-meter-live-uitlezen

11

Page 13: Design and evaluation of sampling, digital processing and ...fse.studenttheses.ub.rug.nl/12871/1/thesis.pdf · 3 describes the theory about measuring energy usage. Further on, di

ability to directly monitor energy consumption because they are integrated inthe energy circuit. The types of sensors these meters use are called invasive,because they are integrated into the circuit. Different approaches are used bythe plug-in meters for measuring the current, these are discussed below. Thecommon disadvantage of invasive sensors is the installation. The sensors needto be put between the conductor. Therefore, these type of sensors can only beused as plug-in meters because they are not easily integrated into an appliance.

Shunt resistorA shunt resistor measures the current using a resistor [3]. It is integrated in thecircuit through which the current flows. It uses the voltage drop, that is accu-mulated when the current goes through the resistor, to determine the amountof current. The accuracy of shunt resistors is higher than of other sensors forlow currents and doesn’t need external power supply. It can measure high fre-quencies, more than 500 kHz. A disadvantage is that because of saturation, thesize of shunt resistors increases according to the amount of current that can gothrough it.

Current transformerThe current transformer transforms the current of the conductor to a lowercurrent via magnetic induction (more details in the section about non-invasivecurrent transformer). These sensors are safer than, for example, shunt resistors,because they convert the current to a lower current before measuring. Disad-vantage is the higher cost. [4]

Hall-Effect SensorUsing the Hall-effect as invasive solution is another possibility. The Hall-effectsensor uses the magnetic field, created by the current through the conductorto create a voltage that is proportional to the magnetic field. The sensors arealso highly efficient as they offer very little resistance to the current to sense it.There are sensors on the market for 5, 20 and even 30A that are quite cheap.

3.3.2 Non-invasive

This type of sensors does not need to be integrated into the electrical circuit.Therefore, they have the advantage to be installed more easily into existing sys-tems than invasive sensors. Disadvantage of these non-invasive sensors againstinvasive sensors is that they are less accurate at low current values [4]. Belowfour types of techniques are discussed.

Current Transformer (CT)This technique uses a core of metal that will be clamped around a conductor ofwhich the current will be measured. A second wire is wound around the metal.Due to the magnetic field caused by the current, the winding will have a currentas well which will be much smaller according to the amount of windings. Thecurrent in the second wire is proportional to the current in the main wire. This

12

Page 14: Design and evaluation of sampling, digital processing and ...fse.studenttheses.ub.rug.nl/12871/1/thesis.pdf · 3 describes the theory about measuring energy usage. Further on, di

current can be translated to a voltage which can be used for processing. It canonly measure alternating current, which is widely used in offices and homes.The current transformer contains a metal core which will affect the linearitydue to saturation at some point as the current is too high. Therefore, highercurrents mean bigger sensors in order to deal with saturation. Two versionsof these sensor exist: a sensor with a split core or one with a solid core. Asplit-core current transformer can be opened and clamped shut around a wireeasily, while a solid-core current transformer requires the wire to be put throughit before connecting the wire since the transformer cannot be taken off or puton a wire when it is already connected. The disadvantage of a split-core is thatconstructing a split-core and staying equally accurate as a closed-core sensorresults into higher prices 1415.

Rogowski coilThe Rogowski coil works according to the same principles as the current trans-former. The difference is that a Rogowski coil uses a non-magnetic core. Byusing a non-magnetic core, Rogowski coils have a higher linearity than currenttransformers [5] since saturation cannot affect the linearity. Further on, Ro-gowski coils are flexible as well, which increases the ease of installation. Forhigh-current measuring, the Rogowski coil remains compact, while sensors likecurrent transformers will get bigger in order to deal with the saturation. Ro-gowski coils go up to multiple thousands of amps while others (like the currenttransformer) will often go to a maximum of thousand amps 16. However, therange of current that can be measured is limited by the associated electronics.Noise can have a large influence when large ranges are downscaled to smallranges. [6]

Magnetic field sensorThe Viridiscope system [7] uses a magnetic sensor (HMC1002) to sense changesin the magnetic field. These changes can be correlated with changes in powerconsumption. However, this method only senses the resistive power used. Ac-cording to the paper, the standard deviation of the change in the magnetic fieldhas a strong correlation with the power consumption. The reliability and pre-cision of this method seem dubious, but this is a versatile method of sensingpower on arbitrary points within an electrical network.

Multi-core Cable Current SensorBoth the current transformer and the Rogowski coil can only be used on a single-core cable. Cables going to, for example, devices are multi-core cables17. Thecurrent flows to the device and back, which results in two opposite magneticfields which causes the sensors to measure no magnetic field. Another type ofsensor senses the magnetic field at different distances from the wire and uses

14http://www.brultech.com/products/ECM1240/CTRequirements/types.htm15http://www.eetimes.com/document.asp?doc_id=1273236&page_number=116http://www.dentinstruments.com/17http://www.suparule.com/docs/flexiclamp_technology_datasheet.pdf

13

Page 15: Design and evaluation of sampling, digital processing and ...fse.studenttheses.ub.rug.nl/12871/1/thesis.pdf · 3 describes the theory about measuring energy usage. Further on, di

the differences in the measurements to calculate the current. A disadvantageis that the accuracy isn’t as high as the other methods. The advantage is thatthere is no need for splitting a multi-core cable, which makes the installationeven easier.

3.4 Techniques for calculating the power

There are two different techniques: processing the sensor signal in a digital oranalog way.

Processing the sensor signal analogIt is possible to calculate the power from the current and voltage by an analogmultiplier. The advantage is that the multiplications will be done continuously,which is ideal for high frequency measurements. The disadvantage is, that dueto the sensors, phase error arise in the signal of the current and voltage whichwill be included in the calculations of the multiplier. This gives an inaccuratecalculation of the power.

Processing the sensor signal digitallyProcessing the sensor information digitally is cheaper since it only needs a pro-cessing device which is also needed in the analog processing solution. Thefrequency of multiplying depends on the analog to digital converter of the pro-cessing device but is in most cases high enough for accurate calculations of thepower.

3.5 Communication techniques

Communication techniques are needed for sending the information retrieved bythe data processor to a central database. Different techniques can be used forthis purpose.

Wi-FiWi-Fi is based on the IEEE 802.11 standard. It has a range of 35-100 meterindoors and a data rate up to 54 Mbps [8]. Nowadays, it is widely used as anetwork by all kinds of devices.

802.15.4For 802.15.4 there are two different options compared: 6LoWPAN and Zig-bee. The data rate is 250 kbps which is very small compared to Wi-Fi. Thisis because the communication is meant for sensor networks consisting of lowpower nodes. In Design and Implementation of a High-Fidelity AC MeteringNetwork [8] Zigbee was compared with Wi-Fi and it appeared that Zigbee usedaround 50 mW, while Wi-Fi used 750 mW. Further on, networks using Zigbee or6LoWPAN can consist of more than 65.000 nodes which is ideal for fine-grainedsystems. A disadvantage of these networks is the range, which is smaller thanWi-Fi or GSM. However, for a network with multiple devices using Zigbee, the

14

Page 16: Design and evaluation of sampling, digital processing and ...fse.studenttheses.ub.rug.nl/12871/1/thesis.pdf · 3 describes the theory about measuring energy usage. Further on, di

devices can be used as router for the data which compensates for the lack ofrange. The advantage of 6LoWPAN over Zigbee is that this network can alsocommunicate with networks like Wi-Fi. The disadvantage is that the availabil-ity of the hardware - that implement the 6LoWPAN - is not high, while theavailability of Zigbee modules is high on the market18.

18http://www.lsr.com/white-papers/zigbee-vs-6lowpan-for-sensor-networks

15

Page 17: Design and evaluation of sampling, digital processing and ...fse.studenttheses.ub.rug.nl/12871/1/thesis.pdf · 3 describes the theory about measuring energy usage. Further on, di

4 Hardware Options for Energy meters

In this section, a variety of hardware possibilities are discussed and chosen.This hardware uses the techniques described in the previous section. The firstpart compares the different sensors that are on the market. The second partcompares the different types of data processing devices and the third part com-pares communication modules. The last part compares a couple of completesolutions. We decided to make multiple energy meters. Since measuring theenergy must be fine-grained, the energy usage needs to be measured at differentlevels within a building. This means also at different amount of currents. It ispossible to develop a meter that has a sensor which can measure a large rangeof currents. This could then be used at every level within a building. But then,energy meters at low levels will only use a fraction of the current range, whileenergy meters with a smaller range for current can also be used. The resolutionwith which the signal of the sensor will be sampled becomes much higher whenusing smaller ranges, which increases the accuracy. Because of this, it is betterto develop different energy meters for different levels. Therefore, it is decidedto build one energy meter which will function as plug-in meter while an othermeter will measure energy at higher levels. Due to this, two different currentsensors will be used.

4.1 Sensors

4.1.1 Invasive Sensors

The following features are used for comparison:

1. Current range At different levels in the fine-grained energy grid, differentamounts of current flow. Depending on where the sensor will be used, itneeds to support that current. A high range of current has as advantagethat the device can be used on a wider range of levels within a fine-grainedgrid. However, a higher range also means that the output has a smallerresolution. For example, 0-30 A input, 0-5 V output means a 1 V step forevery 6 A. In comparison, 0-100 A input with 0-5 V output means a 1 Vstep for every 20 A.

2. Price An important feature since one of the requirements is the cost ofthe project.

3. Output Output is important in order to know what is required to connectthe sensor to a processing device.

4. Sensitivity It is important to know the sensitivity of the sensor, becausethis will contribute to the resolution and accuracy of energy meter.

5. Type Type is important since the different types have different advan-tages/disadvantages. (discussed in Section 3.3.1).

16

Page 18: Design and evaluation of sampling, digital processing and ...fse.studenttheses.ub.rug.nl/12871/1/thesis.pdf · 3 describes the theory about measuring energy usage. Further on, di

6. Shipping time In order to create a device and evaluate it, the shippingtime of the sensor should not be too long.

These are stated in Table 1. These sensors do require additional cabling to

ACS712-05BT19 ACS712-20A 20 ACS712-30A 21

Current range (A) -/+ 5 -/+ 20 -/+ 30Price (e) 6,50 5,60 4Output Voltage 0-5 0-5 0-5Sensitivity (mv/A) 185 100 60Type Hall effect Hall effect Hall effectShipping time 1-2 days 1 day

Table 1: Invasive sensors - Comparison

be connected to a processing device and dis-assembly of a wall socket or plugto be integrated into a circuit. The ACS712-30A will be used as invasive sen-sor. Although this sensor has a higher range of current, than for instance theACS712-20A, and therefore is less sensitive, it is possible to make some infer-ences about the other sensors using this sensor. Since we can determine theaccuracy of this sensor on some range of current; we can say something aboutthe accuracy of the other sensors within this range of current.

4.1.2 Non-invasive Sensors

In this section, a set of non-invasive sensors, which implement the techniquesdiscussed in Section 3.1.3, are compared. A feature that will be used for com-parison but hasn’t been mentioned in the comparison of the invasive sensor isthe accuracy.Most non-invasive sensors have an indication of accuracy. This accuracy indi-cates how well the measurements over the whole current range differ from thetrue measurement on average. The accuracy of the sensor should be as high aspossible, which means that the difference percentage, indicating the accuracy,should be as low as possible.After researching what is commercially available, the following non-invasive sen-sors are compared, of which the features can be seen in Table 2.

1. SCT-019 200A 22

2. HONEYWELL S&C CSLA2CF 23

3. CTRC-03100-040024

22http://www.elecfreaks.com/store/noninvasive-ac-current-sensor-sct019-200a-

max-p-89.html23http://nl.farnell.com/honeywell-s-c/csla2cf/sensor-6-12vdc-125a/dp/1653524?

MER=en-me-pd-r2-alte24http://www.ccontrolsys.com/w/CTRC_Series_Rogowski_Coil_Current_Transformers

17

Page 19: Design and evaluation of sampling, digital processing and ...fse.studenttheses.ub.rug.nl/12871/1/thesis.pdf · 3 describes the theory about measuring energy usage. Further on, di

4. SCT-013-03025

5. SCT-013-0002627

1 2 3 4 5Price (e) 11,98 11,60 149,80 12 13,56

Range current +/- 200 +/- 125 +/- 400 +/-30 +/- 100Type CT Hall effect Rogowski Coil CT CT

Accuracy (%) 1.0 - 1.0 - -Shipping time 7-25 days 1 day - 1-2 days 1-2 days

Output 0.333 V, AC 13,2 V, DC 0.333 V, AC 1 V 0.05 V,Remarks close-core Arduino Project

Table 2: Current sensors - Comparison

We choose the SCT-013-000. Although no accuracy is listed, it is stated in theproject of EmonTx (Where the SCT-013-000 is part of) that the accuracy isbelow 1% 28. For most others the accuracy wasn’t listed as well. Rogowski Coilsare very expensive compared to the others and since such a high current rangeisn’t needed, it is better to choose a smaller range in order to have more precisemeasurements. Also, since this sensor is part of an Arduino project, it will befar more easy to set it up.

4.2 Processing devices

Two types seem to be the best choice as device for processing sensor informa-tion. The mini-computer Raspberry Pi 2 [1] and the microcontroller Arduino [9].These two have a large community for information and a large amount of com-patible modules for communication. Of all types of Arduino, the Arduino Unowill be used for comparison. The Arduino Uno is used for most sensing applica-tions. Since only one sensor and Wi-Fi shield will be mounted on the Arduino,the amount of in-/outputs can be minimal which is the case for the ArduinoUno, while the clock-speed is high compared to other Arduino types 29

In Table 3, a comparison is made between the Arduino Uno and the Rasp-berry Pi 2.

25http://www.seeedstudio.com/depot/Noninvasive-AC-Current-Sensor-30A-max-p-

519.html26http://shop.openenergymonitor.com/100a-max-clip-on-current-sensor-ct/27http://openenergymonitor.org/emon/buildingblocks/report-yhdc-sct-013-000-

current-transformer28http://openenergymonitor.org/emon/buildingblocks/emontx-error-sources29http://www.arduino.cc/en/Products.Compare

18

Page 20: Design and evaluation of sampling, digital processing and ...fse.studenttheses.ub.rug.nl/12871/1/thesis.pdf · 3 describes the theory about measuring energy usage. Further on, di

Raspberry Pi 2 30 [1] Arduino Uno R3 31 [9]Price > 36,95 11,50Clock 900 MHz 16MHz

Memory 1Gb 32kbResolution in bits - 1024Sample rate (Hz) - standard 9,6 kHz

RemarksNeeds an externalanalog-to-digitalconverter

Can be borrowed

Table 3: Data processors - Comparison

One of the main advantages of an Arduino is that it has analog inputs whichmakes it more suitable for reading sensors. For the Raspberry Pi, an additionalanalog to digital converter (ADC) is needed.The sampling rate of the Arduino is 9,6 kHz when using the analog input, whichcan be increased (see section 7.1). The sampling rate for a Raspberry Pi dependson the external ADC. There are a lot of ADCs with higher resolutions than theArduino Uno but the sampling rate will not be much higher. Further on, theRaspberry Pi has a much higher clock speed than the Uno. Another advantagefor the Uno is that since it is much simpler (regarding hardware components)than a Raspberry Pi, it is also more reliable, since fewer hardware componentscan fail. Also the Arduino is much simpler to use than the Raspberry Pi. TheArduino only requires an implementation of a setup and loop function, while theRaspberry Pi needs among other things an installation of an operating system.

Based on this, the Arduino Uno will be used.

4.3 Communication Module

For the communication module, the features that weren’t already mentionedabove are stated here:

1. Type Important is to know what kind of communication will be used.The different types were discussed in Section 3.5

2. Data rate It is important to know if the data rate satisfies the amountof sensor information that will be sent.

3. Range indoor If the range is too small, extra routers/base stations maybe needed to receive the data.

4. Compatibility Depending on the data processor, not every communica-tion module will be compatible.

After researching what is commercially available, the following communicationmodules are chosen for comparison.

19

Page 21: Design and evaluation of sampling, digital processing and ...fse.studenttheses.ub.rug.nl/12871/1/thesis.pdf · 3 describes the theory about measuring energy usage. Further on, di

1. XB24-AWI-001 32

2. Arduino Wi-Fi shield 33

3. Adafruit CC3000 34

4. Wi-Fi module - Dongle35

5. ESP8266 Wi-Fi module 3637

1 2 3 4 5Type Zigbee Wi-Fi Wi-Fi Wi-Fi Wi-Fi

Price (e) 25,29 23,07 39,95 14,90 5,00Data rate (Mbps) 0.25 11 11 150 150Range indoor (m) max 40 max 100 max 100 max 100 max 100

Compatibility Arduino/Raspberry Pi Arduino Arduino Uno or Mega Raspberry Pi ArduinoShipping 1 week 1-2 days 1-2 days 1-2 days 1-2 days

Remarks

Needs an receiver.Raspberry Pi needssome in betweenparts

Vague documenta-tion

Table 4: Communication modules - Comparison

It has been decided to use Wi-Fi as communication protocol, since this can beeasily integrated - Wi-Fi is already available within the building in which thesolutions will be used. From the Wi-Fi modules the ESP8266 Wi-Fi module waschosen. It is compatible with the processing device since an Arduino will be usedand it is a very cheap module. Although the language of the documentation isoriginally not in English, big parts of the documentation have been translatedand there is a large community active around the ESP8266.

4.4 Complete solutions

In this section, a couple of existing solutions are described. These are open- andclosed-source solutions. These will be compared and taken into account for oursolution.

32http://www.digi.com/products/wireless-wired-embedded-solutions/zigbee-rf-

modules/point-multipoint-rfmodules/xbee-series1-module#overview33https://www.scintilla.utwente.nl/nl/stores/viewcategory?id=6734https://www.adafruit.com/products/146935https://azerty.nl/0-1251-516453/edimax-ew-7811un-netwerkadapter-usb-2-0-802-

11b-802-11g-802-11n.html?channel_code=4036http://www.tinytronics.nl/shop/ESP8266-WiFi-Module37https://nurdspace.nl/images/e/e0/ESP8266_Specifications_English.pdf

20

Page 22: Design and evaluation of sampling, digital processing and ...fse.studenttheses.ub.rug.nl/12871/1/thesis.pdf · 3 describes the theory about measuring energy usage. Further on, di

4.4.1 EmonTx V3

The EmonTx V3 [10] is a commercially available meter with a price of e110,76.It uses a non-invasive CT sensor that can measure currents up to 100 A. It canmeasure up to 4 currents at the same time. For sensing the voltage, it usesan AC/AC adapter as transformer for the voltage. An Arduino Uno is used asprocessing device. Since the sensors cannot be mounted directly to the Arduino,a EmonTx shield is used. The sensors can connect to this shield and the shieldcan be mounted on an Arduino. The shield has a wireless module (RF) whichcan be used to send the data to a base station. The base station is based on aRaspberry Pi and is available for e25,92.The EmonTx V3 is open source. A library for the Arduino Uno can be found forthe EmonTx V3 in which functions for power measurement are implemented.

4.4.2 Efergy Elite Classic and Engage Hub

The Efergy Elite Classic38 and E2 Classic 2.0 39 are commercially availableclamp-on energy meters. Both the Elite Classic and E2 Classic are composed ofthree separate modules: a CT clamp-on current sensor, a transmitter moduleand an LCD-monitor. In addition to this, the E2 Classic 2.0 also offers thefunction of reading out the data from the monitor display by USB. This datacan then be loaded into the accompanying software called elink. This softwarecan then show graphs and supply other information about the metered data.However, the elink software is closed source and only available for recent Win-dows and Apple operating systems.The data is transferred by the transmitter over 433.5 MHz RF and can be trans-mitted every 6, 12 or 18 seconds. According to Efergy, the transmitter has arange of 40 to 70 meters. The CT-clamps can measure current up to 90A andare compatible with voltages from 110 to 600 volts.

More recent versions like the Engage Three-Phase Hub Kit [11] offer the samefunctionality as the elite classic, but have an additional hub module added suchthat the system can be accessed through the Internet. The module is directlyconnected with an Ethernet cable to a router and can be accessed through theEngage web-portal or a smart phone application.

4.4.3 ACme-A plug-load meter

The ACme-A plug-load meter [3] is an energy meter that can measure energyconsumption of devices that use an outlet. The meter can be placed betweenan outlet and a device. It uses an invasive sensor (shunt resistor) to measurethe current. With an ADE7753 - integrated circuit - it calculates the energyconsumption using current and voltage readings. The calculations are made

38http://efergy.com/uk/products/electricity-monitors/elite-classic39http://efergy.com/uk/products/electricity-monitors/e2-classic-2-0

21

Page 23: Design and evaluation of sampling, digital processing and ...fse.studenttheses.ub.rug.nl/12871/1/thesis.pdf · 3 describes the theory about measuring energy usage. Further on, di

in hardware so that there is no need for the software to sample. It uses anEpic Core as microcontroller and a radio module for transmission of data. Thetransmission is done using Zigbee. The meter sends its information to a basestation for further processing. The ACme-A has a sampling speed of 14 kHzand a maximum power of around 16A. This solution can not be bought becauseit is in the prototype stage.

4.4.4 Plugwise Circle and Stretch

The Plugwise Circle is a plug-in smart energy meter designed and produced bythe company Plugwise. The whole product is closed source. To communicatethe metered values, the plug uses the ZigBee communication protocol to sendthe data to a dedicated receiver, called Stretch, that saves the data. It is ofimportance to have a good network layout for optimal transfer of data. Thecloser a circle is placed in respect to a Stretch the more data this plug has totransfer. The recommended distance between Circles is 5-10 meters.

4.4.5 Comparison

In Table 5, a comparison of these solutions can be seen.

1. EmonTx V3 40

2. Efergy Elite Classic and Engage Hub

3. ACme-A plug-load meter

4. Plugwise Circle and Stretch

The prices of these solutions are quite high. Except for the Acme A plug-loadmeter of which we couldn’t find a price. Another thing that strikes is thatmost meters are working at device level or at meter level but no company thatsupplies devices for different ranges of current except for the Efergy Elite Classic.Further on, information about the accuracy of these solutions was hard to find.For the EmonTx V3 and the Plugwise, the accuracy is stated and discussedlater on in this thesis. The Plugwise will namely be used for comparison. TheEmonTx V3 has open source hardware and software which will also be used inour energy meter.

40http://shop.openenergymonitor.com/emontx-v3/

22

Page 24: Design and evaluation of sampling, digital processing and ...fse.studenttheses.ub.rug.nl/12871/1/thesis.pdf · 3 describes the theory about measuring energy usage. Further on, di

1 2 3 4Price 95,40/56 105,85 - 109,95

Communication RF 433MHz RF 433MHz 6LoWPAN ZigbeeCurrent range (A) 100 90 15 16

Type sensing Non-invasive/Invasive Non-invasive Invasive InvasiveSoftware Open source Open source Closed source Closed source

Report speed Variable (> 1Hz) 0,1 Hz 2800 Hz 0,2 HzRemarks Needs receiver 433 MHz contains 2 Sensors contains 2 Sensors

Table 5: Comparison of complete solutions

5 Chosen Solutions

In this section, the energy meters are described. The hardware and the cali-bration of the invasive and non-invasive meters will be discussed. In additionto these two meters a P1 meter will be described as well, which can directlyconnect to the meter of a building and sense energy consumption at meter level.

5.1 Invasive Solution: Arduino current sensor

5.1.1 Hardware of Invasive Solution

This solution consists out of the following parts:

• Allegro ACS712-30A, e4

• Arduino Uno, e11,50

• ESP8266-01 Wi-Fi UART-module e5

• YwRobot 540354 MB-102 5v/3.3v power supply e2.50

• 2-channel bi-directional 3.3v-5v logic level converter e2.50

• MB-102 Bread Board, e3

• Jumpers Cables, e3

23

Page 25: Design and evaluation of sampling, digital processing and ...fse.studenttheses.ub.rug.nl/12871/1/thesis.pdf · 3 describes the theory about measuring energy usage. Further on, di

• AC-AC 230V-9V adapter e13

• European electrical socket e11,47

• EmonTX Arduino Shield SMT e15,61

The last two items come from http://shop.openenergymonitor.com, the otheritems come from http://www.tinytronics.nl.The ACS712 is directly connected to the mains wire and senses the currentthrough this wire. The ACS712 is powered by the Arduino and the output isfed to one of the analog inputs of the Arduino. The ACS712 outputs a 0-5Vsignal that is proportional to the amount of current sensed.

The ESP8266-01 is the Wi-Fi module that will send the measured data. Eventhough it is a small sized module it needs an external 3.3V supply since the 3.3Vof the Arduino output does not deliver enough current to power the module cor-rectly. Here the YwRobot 54043 comes in. It is specialized for MB-102 typebreadboards and can deliver both a 5V and 3.3V power supply. This moduleis used to power the ESP8266 and the logic level converter. The next modulethat is included is a 2-channel bi-directional logic level converter. Since the se-rial input and output of the Arduino is 5V and the ESP8266-01 expects a 3.3Vsignal it needs to be converted so to not damage any of the modules.

The European electrical AC-AC 230V-9V adapter is used for measuring thevoltage. The non-invasive solution uses the same adapter for measuring thevoltage. The EmonTx shield is used to connect the adapter. This shield is Ar-duino Uno compatible and has one input for an electrical adapter and 4 inputsfor the non-invasive sensors. It can also be fitted with an RF-module but wechose to not to use this. We use the shield in this solution because it will also beused for the non-invasive solution. But for only measuring the voltage, it wouldbe much cheaper to use other components for connecting it to the Arduino. Theinvasive sensor can be put on another analog input of the Arduino.The EmonLib library is used for calculating the true power.

5.1.2 Calibration of Invasive Solution

In the EmonLib library, there are different parameters that need to be cali-brated.Voltage constant The voltage that is measured is scaled down to a voltagethat can be used as analog input for the Arduino. The AC-AC adapter changes230V to 9V. The EmonTx shield scales the 9V further down by dividing it by11. When the Arduino calculates the power, the voltage needs to be scaledback in order to get the correct power value. Theoretically, this constant forthe voltage should then be: 230/(9∗1.20)∗11 = 234.3. 9 needs to be multipliedwith 1.20 because no load on the adapter means a higher transformed voltage,which will be the case when the adapter is used for sensing only.

24

Page 26: Design and evaluation of sampling, digital processing and ...fse.studenttheses.ub.rug.nl/12871/1/thesis.pdf · 3 describes the theory about measuring energy usage. Further on, di

However, the adapter itself and the resistors in between may have some devia-tion, due to which the voltage-constant can differ. The voltage constant will bedetermined using a multimeter. The multimeter used is a Fluke 179. It has anaccuracy of 2.0% for AC voltage and 1.5% for AC current [12]. The multime-ter can measure the voltage and the voltage constant can be adjusted until itproduces the same voltage. A heating device will be used as a power consumerin order to have a steady current through the wire. The multimeter will be inparallel with the circuit in order to measure the voltage.Current constant The current constant will, like the voltage constant, also beused for scaling the measured number in the Arduino back to the real current.The sensor has a range from -30A to 30A and the output of the sensor is avoltage between 0.5V and 4.5V. This means that the measured analog signalshould be multiplied with 15 to get the real current since the ratio is 1V per15A. (60/4).But, like the voltage constant, it needs to be calibrated since the resistor orsensor itself may have errors. This will be done using the multimeter mentionedat the voltage calibration. But now, the multimeter must be in series with theheating device in order to measure the current.Phase constant Since phase shifts will occur between the measure point andthe analog input at the Arduino, another constant needs to be calibrated, thephase constant, in order to compensate the phase error of the voltage and thecurrent, so that the true power can be calculated. This can be calibrated by us-ing the fact that the apparent and true power are the same at a purely resistiveload. This is the case for the heating device.Using the heating device with a load of 3.533A and a voltage of 223.0, thefollowing constants were determined:

1. Voltage: 246.5

2. Current: 14.92

3. Phase: 1.09

5.2 Non-invasive Solution

5.2.1 Hardware of non-invasive Solution

The non-invasive solution uses the same setup as the invasive solution exceptfor the current sensor. The sensor can be connected to one of the non-invasiveclamp inputs on the EmonTx shield.List of hardware components:

• YHDC SCT-013-000 Current Clamp, e11,15

• Arduino Uno, e11,50

• ESP8266-01 Wi-Fi UART-module e5

• Ywrobot 540354 MB-102 5v/3.3v power supply e2.50

25

Page 27: Design and evaluation of sampling, digital processing and ...fse.studenttheses.ub.rug.nl/12871/1/thesis.pdf · 3 describes the theory about measuring energy usage. Further on, di

• 2-channel bi-directional 3.3v-5v logic level converter e2.50

• AC-AC 230V-9V adapter e13

• Bread Board, e3

• Jumpers Cables, e3

• European electrical socket e11,47

• EmonTX Arduino Shield SMT e15,61

The Current clamp was bought at http://shop.openenergymonitor.com.

5.2.2 Calibration of non-invasive solution

This solution has the same setup as the invasive solution except for the currentsensor. For this reason, the current constant will be different and the phaseconstant will likely be different as well.Current constant The measured current is first transformed down from +/-100A to +/- 50mA. A burden resistor of 33Ω is used to get a voltage which canbe used as analog input for the Arduino. So, in order to scale the current back,the current constant should be: 1/33 ∗ (100/0.050) = 60.06. As was the casefor the invasive solution, it needs to be calibrated since the resistor and sensorsmay have errors.Both the current constant, the voltage constant and the phase constant will bedetermined in the same way as the constants in the invasive solution. Aftercalibrating, the following constants will be used:

1. Voltage: 246.5

2. Current: 60.99

3. Phase: 1.32

5.3 Direct Solution: Arduino P1-reader

5.3.1 Hardware of Arduino P1-reader

The P1-reader is meant for reading the energy consumption directly from asmart meter. Besides that, this solution could be used for giving an indicationof the accuracy of the other meters. This solution is quite minimal comparedto the other solutions seeing that it only needs an hex inverter41, an Ethernetshield and an RJ11 cable [13].

41http://www.ti.com/lit/ds/symlink/sn54hc04.pdf

26

Page 28: Design and evaluation of sampling, digital processing and ...fse.studenttheses.ub.rug.nl/12871/1/thesis.pdf · 3 describes the theory about measuring energy usage. Further on, di

List of hardware components:

• Arduino Uno, e11,15

• Arduino Ethernet Shield W5100. e13,00

• Texas Instruments SN74HC04 Hex Inverter, e0,69

• RJ11 cable, e2,59

The Hex Inverter and RJ11 cable come from https://www.conrad.nl. Theother components from http://www.tinytronics.nl

When the cable is connected to the meter, the meter will output its data throughthe P1 port. The Arduino only needs one open digital port to receive the serialdata. The inverter is needed because for some versions of the DSMR-protocoland different types of meters the data is outputted in an inverted form. To freeup computation time on the software side a hardware inverter is used. Using theEthernet shield, the P1-meter can send the retrieved information to a server.

27

Page 29: Design and evaluation of sampling, digital processing and ...fse.studenttheses.ub.rug.nl/12871/1/thesis.pdf · 3 describes the theory about measuring energy usage. Further on, di

6 Design of software

Here the general design of the software of the sensors is described. Both theinvasive and the non-invasive sensor use the same software design.

6.1 Non-invasive and invasive energy meter software de-sign

6.1.1 Sensor Reading and Energy Consumption Calculation

The sensor makes use of the EmonLib42 open source energy monitoring li-brary that was specifically made to run on Arduino. However, some substantialchanges were made to the library, like deleting some of the functions from thetemperature and RF functionalities that we do not use. Also some adjustmentsof the existing functions regarding power calculations were done. Furthermore,the sensor was designed to be configured during run-time. This was done tofacilitate the calibration of the sensor. It is also possible to toggle the sensoron and off. All these functions allow an easy means to configure the sensor andtest it.

6.1.2 Wi-Fi Communication

The found values by the sensor need to be communicated to a gateway by Wi-Fi.Using the Arduino IDE with ESP8266 support 43 we can directly program theESP8266 Wi-Fi Module. For easy access we designed a web page that showsactual status of the module: if it is connected to a network, if it has establisheda TCP connection with a server, and if the sensor is currently logging data. Thisaccess-page is generated on the ESP8266 itself and is served by an HTTP serverrunning on the module. The page lets you input the network data and serverdata you want it to connect to. In addition to this it offers a button that lets theuser toggle the sensor on and off. The page also lets the user input calibrationparameters for the voltage, amperage and phase. Besides these parameters, theparameter ’crossings’ can be set here as well. This parameter will be discussedin section 7.2. All the data that is sent from the page is POSTed to a HTTPserver that runs on the ESP8266. The module then interprets these requests asdifferent routes.

Outgoing communications to a server are done by REST. This is of course onlypossible when the ESP8266 has established a TCP-connection with a server.We designed a simple server-database solution that accepts POST requests to’/logger’ so as to test this.

42https://github.com/openenergymonitor/EmonLib43https://github.com/esp8266/Arduino

28

Page 30: Design and evaluation of sampling, digital processing and ...fse.studenttheses.ub.rug.nl/12871/1/thesis.pdf · 3 describes the theory about measuring energy usage. Further on, di

6.1.3 Communication between Sensor and Wi-Fi module

The ESP8266 and the sensor module are connected by a serial connection. Thecommunication between the modules therefore has to go over this serial connec-tion. We designed the message structure between the modules as follows:

• GET: <get,var>

• SET: <var,value>

• Sensor data: <value,value>

For example, the ESP8266 will send <log,1> to the sensor module when thelogging has been toggled on. The sensor will then send back its sensed dataevery time it has completed a calculation.

6.1.4 Correct timestamp

For each measurement the Arduino sends, a timestamp is needed as well. Thetimestamp is generated by the Arduino and is forwarded by the Wi-Fi module.This timestamp is based on the clock of the Arduino. This gives two problems.The time is not that accurate because of the clock crystal. The drift of time isprobably somewhere in the order of several seconds per day.A second problem is the time offset. Sending the information costs some time,in which case the time at the server is some time ahead of the timestamp sent bythe Arduino. In order to solve this problem, some good solutions are available.An external clock can be used with a more accurate crystal. Libraries areavailable for the Arduino to use that clock for synchronization.Another solution is to let the Wi-Fi module request the time from the serverat a certain interval and use that time to synchronize the time at the Arduino.But then the problem of time offset needs to be solved as well.Due to the scope of the project, we will not focus on this problem, we will justsend the timestamp of the Arduino to the server. The time span within thetests is small enough to neglect the time drift of the Arduino.

6.2 P1-reader software design

Whenever something is plugged into the P1-port of a smart meter and the re-quest line is pulled up to 5V; The smart meter will transmit its data.

The smart meter will output a whole telegram of data but only a few fieldsin the telegram are needed to extract the consumed energy. Every line of thetelegram is read into a buffer. Whenever a line has been read, the line is checkedfor an identifier for the field we need to save. When the end of telegram char-acter ! is encountered, the accumulated data will be sent away and the buffercleared for the next telegram.

29

Page 31: Design and evaluation of sampling, digital processing and ...fse.studenttheses.ub.rug.nl/12871/1/thesis.pdf · 3 describes the theory about measuring energy usage. Further on, di

7 Evaluation of non-invasive and invasive en-ergy meter

In this section the evaluation of the energy sensors will be done. Unfortunately,we weren’t be able to test devices at the meter. Therefore, we couldn’t test theP1 meter at all and were neither able to test the non-invasive sensor at placeswere it should measure the energy usage in buildings. We were however able totest the non-invasive and invasive meter at device level.Two other meters will be used for functioning as ground truth for our two meters.The Energy Monitor 3000 [14] will be used and the plugwise 44. According tothe technical data of the Energy Monitor 3000, the error percentage of devicesup to 2500W is maximal 2%. According to a test from Hardware.info, theEnergy Monitor 3000 performed on average with an accuracy of 6.9% which isless accurate 45. However, most of the loads used less than 5W. This is much lessthan the loads that will be normally measured by these energy meters. Whenlooking at the measurements of more than 5W (8 measurements), it performedan average accuracy of 1.9%. The Plugwise circle has an accuracy of 5% of realtime measurements according to a declaration of measurement accuracy 46. Thesampling rate will be tested using the Energy Monitor 3000 while the accuracywill be tested using the Plugwise Circle.

7.1 The sampling rate

One of the points to evaluate is what the highest sampling rate is that can beachieved by the energy meters.For the P1-meter, the sampling rate cannot be adjusted. The energy meter willjust send a set of data every 10 seconds through the P1 port.For both the invasive and non-invasive meter the sampling rate depends onthe processing device. The Arduino has analog inputs from which the analogsignal will be converted to a digital signal. There are two parameters within theArduino that are responsible for the sampling rate:

1. Clock speed

2. prescaler

The clock speed of the ATmega328 chip is 16 MHz. In [15] it is stated thatthe speed, at which an analog signal can be converted accurately to a digitalsignal is limited by the digital to analog converter, should be in a range of50-200 kHz. In order to achieve this, the prescaler is used. The prescaler is aconstant which is a divisor of the clock speed. This means that the frequencyof the analog to digital converter is the processor frequency divided by theprescaler. The default prescaler for the Arduino is set to 128. This results into

44https://www.plugwise.com/circle45http://nl.hardware.info/reviews/1460/6/vergelijkingstest-9-energiemeters-

tabel-met-testresulaten46https://www.plugwise.com/media/docs/declaration of measurement accuracy.pdf

30

Page 32: Design and evaluation of sampling, digital processing and ...fse.studenttheses.ub.rug.nl/12871/1/thesis.pdf · 3 describes the theory about measuring energy usage. Further on, di

the highest clock speed under the 200 kHz bound: 16MHz/128 = 125kHz.One analog read costs 13 cycles, so the theoretical sampling rate with thesesettings is 125kHz/13 = 9, 6kHz. Both voltage and current needs to be sampledwhich results into a 4.8kHz sampling rate. By adjusting the prescaler levels wecan achieve higher analog to digital conversion frequencies and thus a highersampling rate. There is a trade-off between the conversion frequency and theaccuracy of the conversion. However, in [15] it is stated that frequencies upto 1 MHz do not affect the resolution of the analog input significantly. Thesefrequencies can be reached by changing the prescaler. The prescaler can be setto 1, 2, 4, 8, 16, 32, 64 and 128.

7.1.1 Sampling rate testing

Testing what the highest sampling rate is that can be used will be done usinga setup with a couple of devices. In this case, two laptops were used. Over halfan hour, the non-invasive and invasive meter will measure the energy consump-tion. This will be compared with the measured energy consumption from theEnergy Monitor 3000. The comparison will take place over different prescalelevels. Since laptops are used, the power measurements will not be equal overevery half hour. This causes the comparisons to be less comparable, since themeters may produce better/worse performance at higher energy consumptionrates than lower rates. However, we didn’t possess any other device with a rea-sonable amount of power usage at the time.

Two solutions can be used within the software to send the data. The firstsolution to send data is by sending each analog value directly to the Wi-Fimodule. The body of the loop consists of two analog reads and serial prints ofthe voltage and current. We tested this with the setup mentioned above. TheArduino prints after each round of measurements the time plus the amount ofsamples taken (one sample is one voltage sample and one current sample). Thisresults into Table 6 which shows the sampling rates at different prescale levels.The sampling rate is low, a prescale of 4 gives a sampling rate of 1055 Hz. Since

Prescaler Sample speed in Hz128 87064 96032 101016 10308 10504 10552 940

Table 6: Baudrate of 115200

the frequency in the Netherlands of the voltage is 50Hz, only 20 samples will betaken from each cycle. Serial sending is the leading cause of these low sampling

31

Page 33: Design and evaluation of sampling, digital processing and ...fse.studenttheses.ub.rug.nl/12871/1/thesis.pdf · 3 describes the theory about measuring energy usage. Further on, di

rates. With a prescale of 128, one cycle of sampling takes about 1100 ms ofwhich 930 ms is the time to send the data via serial. This sample speed is tooslow for an accurate representation of power consumption.The second solution uses the setup that EmonTx uses for calculating the power.First, samples of voltage and current will be taken from a configurable amountof cycles. Each pair of samples will be filtered and multiplied with each otherand added to a total sum. After taking the samples, the mean will be cal-culated and sent via serial. This reduces the amount of serial communicationbut needs more calculations at the Arduino and the sampling is not continuousbut with a gap in which the data will be sent via serial. This gap is around9500 µs. In the Netherlands, one cycle of a voltage and current wave is around1/50 = 0, 02s = 20000µs. This means that between every round of data sam-pling, less than half a cycle will not be measured. Therefore, we decided toneglect this loss.Using the same setup as above, we measured the sampling rate. Only now theArduino will not do any serial printing, but will do some calculations and sav-ings. In Table 7 the results of the measurements can be seen. This solution

Prescaler Sample speed in Hz128 277064 398032 505016 58408 63504 67102 3240

Table 7: Prescaler with corresponding sampling speed

produces higher sampling rates, hence we will use this method of sampling.Now that the sampling speeds are known, the accuracy needs to be tested. Sincethe sensors will not have an effect on the sample speed, only the non-invasivesensor was used against the Energy Monitor 3000. We used again the samesetup. Table 8 shows the different prescalers with the mean deviation of thenon-invasive sensor against the Energy Monitor 3000. This deviation is a meanover two measurements. Overall, the measurements of the non-invasive sensordiffer with the measurements of the Energy Monitor 3000. This is due to thelow power consumption over which these measurements are measured (aroundthe 60W). In the section about accuracy, more will be discussed about the non-invasive sensor and low power measurements.However, it is clearly visible that the non-invasive energy meter is less accuratewith a prescale of 8 or lower. Due to this, the prescale of two hasn’t been mea-sured at all.In order to look more precise at how accurate the signal stays at different prescalelevels, we saved the individual samples for the voltage and current for eachprescale level 150 times in a row. In the Figure 2-5, the measurements can be

32

Page 34: Design and evaluation of sampling, digital processing and ...fse.studenttheses.ub.rug.nl/12871/1/thesis.pdf · 3 describes the theory about measuring energy usage. Further on, di

Prescaler deviation (%)128 5.864 6,332 9,316 5,28 60,14 1195,6

Table 8: Comparison of the non-invasive and invasive sensor with the EnergyMonitor 3000 at different prescale levels. Measurements are in kWh.

seen against the prescale of respectively 32, 16, 8 and 4.

Figure 3: Prescale = 32 Figure 4: Prescale = 16

Figure 5: Prescale = 8 Figure 6: Prescale = 4

Blue: voltage, red: current and yellow: x-axis. The amplitudes of the voltage,current and power are not relative to each other. It is taken over 150 samples.

When looking at the samples of the voltage, it can be clearly seen howwell the analog signal is sampled under each prescale. For 32 and 16, thesampling is accurate, but for 8, the signal is less stable and for 4 even less.Not only is a prescale of 4 samples not stable, the signal for the current is

33

Page 35: Design and evaluation of sampling, digital processing and ...fse.studenttheses.ub.rug.nl/12871/1/thesis.pdf · 3 describes the theory about measuring energy usage. Further on, di

also shifted 90in comparison with the other 3 charts. We cannot explain thisbehaviour other than that it just can’t read the analog input correctly at thatrate. Therefore, the prescale of 16 will be used, which means a sampling rateof 5840 Hz. This prescale value allows us to have the optimal trade-off betweenspeed and accuracy.

7.1.2 Conclusion

In order to achieve the highest sampling rate at which the sensing process workscorrectly. It is decided to measure the power over multiple cycles of the voltageand save the mean power of that round, instead of one sample at the time. Inthis way, a sampling rate of 5840 could be reach while the energy meter staysaccurate

7.2 The highest data Load

What is the highest load of data to be processed at which the real-time require-ments are fulfilled? Samples are taken over a certain amount of times that thevoltage wave crosses from positive voltage to negative voltage. The average ofthe samples over these crossings will then be sent to the Wi-Fi-module. De-creasing the amount of crossings results into a higher data load, since this willincrease the rate at which the Arduino sends the data to the Wi-Fi module.For testing different data loads, only the non-invasive will be tested with differ-ent counts of crossings, since the sensor will not be of any influence on the dataload. For each different amount of crossings, a time span of half an hour will beused to check whether the energy meter can handle the rate at which the dataneeds to be sent to a server.

7.2.1 Data load test results

We started at 140 crossings which means that the data is stored at the serverevery 1.4 seconds. Finally, at 40 crossings (0.4 seconds) the Wi-Fi modulestopped functioning after a few seconds, while at 50 crossings (0.5 seconds) itfunctions well.Another effect of decreasing the amount of crossings is a loss of accuracy ofthe energy meter. However, we neglected this for the following reason. Itwas already stated that the gap between two series of measurements is 9.5milliseconds. At 140 crossings, a percentage of 0,6% is not measured everytime. At 50 crossings, this is 1.8%. This is an increase of only 1,2% and can beseen as negligible. Also the mean power measured over the 50 crossings will bethe mean power over both the measured and not measured part. Therefore, thedifference between 140 and 50 crossings will be very small and therefore, theaccuracy loss will be too small to observe. So, it will be neglected.

34

Page 36: Design and evaluation of sampling, digital processing and ...fse.studenttheses.ub.rug.nl/12871/1/thesis.pdf · 3 describes the theory about measuring energy usage. Further on, di

7.2.2 Conclusion

The highest load of data to be processed at which the real-time requirements arefulfilled is one successful Watt sampling processed and sent every 0.5 seconds.

7.3 The communication

What is the most effective, but still reliable, communication protocol that canbe designed? The design of the communication can be read in Section 6.1. Inthe part about sampling, it was decided to send data every time after a setof 5840 samples has been taken, since the serial communication is too slow forsending the samples one by one, which is the only way to send data from theArduino to the Wi-Fi module. TCP is chosen over UDP because of the reliabilityboth in the delivery and the completeness of the data. For storing the data,there is a server in the BernoulliBorg with a database. This data can be sent viaRabbitMQ. However, the Wi-Fi module only supports personal Wi-Fi networks.These networks only require a SSID and a password. Therefore, it is not possibleto send the data from the Wi-Fi module to the RabbitMQ because the networkat the BernoulliBorg uses an enterprise-styled network layout. These networksrequire not only an SSID but also a username and a password. They also deployvarious encryption mechanisms which are too heavy weight for a simple Wi-Fimodule.In order to solve this problem, the Wi-Fi module could be exchanged for anEthernet solution. Disadvantage of this solution is that the installation wouldbe more difficult since an Ethernet port is needed. Also, one of our requirementsis to use wireless communication and having a wire connected to the modulecompletely defeats its purpose.Another solution is to use a base station. This base station will have twoseparate connections. The base station will use an ESP8266 to receive incomingdata from the energy meters. This data is then sent via serial to the base stationmain processing unit. This processing unit is then connected, either through anEthernet connection or through Wi-Fi, to another main network. The incomingdata from the serial connection is then collected and packaged into correct form.Hereafter, it can be sent via RabbitMQ over the main network. Disadvantage isthat extra hardware is needed. However, we did a short test in which we lookedhow far the Wi-Fi module could send its data. This was roughly 30 metersfar and around two stories high. This means that only a few base stations areneeded to cover a whole building like the Bernoulliborg. Instead of multiple basestations, the data could also be redirected through in-range Wi-Fi modules ofother energy meters so that only one base station is needed.These solutions have only been researched, not implemented. For this project,the data will just be extracted, by connecting a laptop to the access point ofthe Wi-Fi module. Most libraries for the Wi-Fi module use HTTP requestsover REST to send messages. So, this will be used for data transfer, whichcan also be used for the solution with a base station. The data that will betransferred is an ID of the energy meter, a timestamp in milliseconds and a

35

Page 37: Design and evaluation of sampling, digital processing and ...fse.studenttheses.ub.rug.nl/12871/1/thesis.pdf · 3 describes the theory about measuring energy usage. Further on, di

double representing the amount of power.

7.4 Accuracy

In this section, the accuracy of the non-invasive and invasive meter will be tested.These two meters will be compared to the Plugwise Circle’s measurements.Every 5 seconds, the plugwise sends the amount of power it has sensed. Thispower is in Watt and it was already stated that it has an accuracy of 5% witha significance of +/- 0.5 W.In order to see how accurate the meters are, multiple devices will be used whichwill differ in the amount of current they use and stability of the current usage.

List of devices:

• Lamp standard with 4 lamps

• LCD Monitor

• Heater

• Construction blowdryer

• Vacuum cleaner 1400W/900W/600W/400W/250W

• Personal Desktop idling at the log-in screen

All of these devices have a reasonable steady amount of power they use, whichmakes them ideal for a comparison. We were not able to acquire any devicesthat had a higher power consumption level. This means we were not able totest the full range of current that can be sensed by the sensors. For each device,we took more than 10 samples of 2 minutes. This was done for the non-invasiveand plugwise sensor comparison as well as for the invasive and plugwise sensorcomparison. For each sample, we calculated the amount of Watthour that thesensors measured. After this, for each comparison, we calculated the meanWatthour with a 95% confidence interval.

7.4.1 Test results non-invasive meter

As seen from Figure 7 it can be stated that the range of mean difference of themeasured Watts per hour lies between [−1.6, 0.6] for this range of test devices.This is acceptable, certainly for higher ranges of power, because the differenceis relatively small and there is not a steady trend of increased inaccuracy ob-servable when higher ranges of power are measured.

36

Page 38: Design and evaluation of sampling, digital processing and ...fse.studenttheses.ub.rug.nl/12871/1/thesis.pdf · 3 describes the theory about measuring energy usage. Further on, di

Appliance PlugWise Means (Wh) Mean Difference Standard Deviation 95% Confidence intervalmonitor 0.8735138868 0.3440859015 0.0171990658 0.0075376844login 2.6209999978 0.5716792371 0.0579022507 0.0253763139lamps 3.1355694433 0.3812323331 0.0051013203 0.0026721859Vacuum 250W 8.2465972222 -0.6001309766 0.0224570963 0.0127060649Vacuum 400W 13.2001767677 -0.6918984742 0.0553023988 0.0326810287Vacuum 630W 20.885154321 -1.1371556867 0.0109236014 0.0071366218Vacuum 900W 30.12325 -1.4837824953 0.0140324766 0.0086972593Vacuum 1400W 44.7752777778 -1.4225486287 0.2047249347 0.1638110549Blowdryer 48.2655 -0.8222721625 0.1203943262 0.0746198053heater 60.0279513897 -0.5784320796 0.0673715932 0.033011474

Table 9: Non-invasive comparison to the plugwise, ordered by Plugwise means

0 5 10 15 20 25 30 35 40 45 50 55 60 65

−1.5

−1

−0.5

0

0.5

Plugwise Mean Wh

Non

-Inva

sive

Mea

nD

iffer

enceWh

Mean Difference Wh

Figure 7: Non-invasive vs Plugwise.

37

Page 39: Design and evaluation of sampling, digital processing and ...fse.studenttheses.ub.rug.nl/12871/1/thesis.pdf · 3 describes the theory about measuring energy usage. Further on, di

Appliance PlugWise Means Mean Percentage Standard Deviation 95% Confidence intervalmonitor 0.8735138868 39.4049653267 2.1927378191 0.960992062login 2.6209999978 21.8664788925 2.6164226884 1.146676731lamps 3.0733730189 12.4041022072 0.1312892389 0.0687722454Vacuum 250W 8.2465972222 -7.277047769 0.2468980187 0.1396931379Vacuum 400W 13.2001767677 -5.2432510794 0.4366078027 0.2580139819Vacuum 630W 20.8564444444 -5.4449243078 0.0361181737 0.0235967732Vacuum 900W 30.12325 -4.9265430744 0.0903490395 0.0559978859Vacuum 1400W 44.7752777778 -3.1816058052 0.4838680665 0.3871679751PHG 48.2655 -1.7041387946 0.2514986232 0.1558775973heater 60.0279513897 -0.9637922781 0.1133609125 0.0555458264

Table 10: Non-invasive comparison to the Plugwise, ordered by Plugwise means

0 5 10 15 20 25 30 35 40 45 50 55 60 65

0

10

20

30

40

Plugwise Mean Wh

Non

-Inva

sive

Mea

nD

iffer

ence

%

Mean Difference %

Figure 8: Non-invasive vs Plugwise.

38

Page 40: Design and evaluation of sampling, digital processing and ...fse.studenttheses.ub.rug.nl/12871/1/thesis.pdf · 3 describes the theory about measuring energy usage. Further on, di

Figure 8 gives us a better visualization of the comparison of the Plugwiseand the Non-invasive meter. For lower ranges of power consumption (10-15 Wh)the error is relatively big. After this the error seems to level out to about −1%.This is because the amount of difference in Wh does not increase substantiallybut the proportion decreases when the amount of power goes up.

7.4.2 Test Results Invasive Meter

Appliance PlugWise Means Mean Difference (Wh) Standard Deviation 95% Confidence Intervalmonitor 0.868710315 -0.0275162707 0.0072031223 0.0037731569login 2.5982361102 0.0355958923 0.008328888 0.003650229lamps 3.1355694433 0.0065249264 0.0099750661 0.0043716851Vacuum 250W 8.2812373737 0.2353898174 0.0229938474 0.0135882458Vacuum 400W 13.0827020202 0.2329638081 0.0396161253 0.0245538777Vacuum 630W 20.9924494949 -0.1994374672 0.0138162525 0.0081647334Vacuum 900W 29.9721388889 -0.4534746397 0.0152390173 0.0094450672Vacuum 1400W 46.132037037 -0.5462507183 0.0150229015 0.0084998505PHG 48.0559722222 -0.0781926951 0.0235109076 0.0153601774heater 60.0288703693 -0.6050371425 0.0405647668 0.0205282272

Table 11: Invasive comparison to the Plugwise, ordered by Plugwise means

0 5 10 15 20 25 30 35 40 45 50 55 60 65

−0.6

−0.4

−0.2

0

0.2

Plugwise Mean Wh

Inva

sive

Mea

nD

iffer

enceWh

Mean Difference Wh

Figure 9: Invasive vs Plugwise.

The Invasive meter has a smaller difference in measured Wh differences.

39

Page 41: Design and evaluation of sampling, digital processing and ...fse.studenttheses.ub.rug.nl/12871/1/thesis.pdf · 3 describes the theory about measuring energy usage. Further on, di

From Figure 9 it shows us the range of the differences is approximately [−0.65, 0.3].This range is considerably smaller than the range of the Non-invasive meter.

Appliance PlugWise Means Mean Percentage Standard Deviation 95% Confidence intervalmonitor 0.868710315 -3.1665093446 0.8265118635 0.4329454351login 2.5982361102 1.3623669348 0.2744524527 0.1202818805lamps 3.1355694433 0.2070983194 0.3173011088 0.139060787Vacuum 250W 8.1943981481 2.8431637873 0.2780067842 0.1642884918Vacuum 400W 13.2416111111 1.7589653415 0.2945339319 0.1825506679vacuum 630W 20.9924494949 -0.9500403024 0.0657568679 0.0388591116Vacuum 900W 29.9721388889 -1.5129604217 0.0494309687 0.0306370688vacuum 1400W 46.1422222222 -0.5462507183 0.0150229015 0.0084998505PHG 48.0559722222 -0.1625565802 0.0494695323 0.0323195005heater 60.0288703693 -1.0078795939 0.067051712 0.0339322245

Table 12: Invasive comparison to the Plugwise, ordered by Plugwise means

0 5

10 15 20 25 30 35 40 45 50 55 60 65−4

−2

0

2

Plugwise Mean Wh

Inva

sive

Mea

nD

iffer

ence

%

Mean Difference

Figure 10: Invasive vs Plugwise.

Given the smaller range of differences in Wh, it is also much more precise ifwe look at the mean difference percentage. First of all the range of differencelies between [−4%, 4%] and has no extreme outliers like the Non-invasive meter.Like the Non-invasive meter the difference also steadies out when the amountof power increases.

40

Page 42: Design and evaluation of sampling, digital processing and ...fse.studenttheses.ub.rug.nl/12871/1/thesis.pdf · 3 describes the theory about measuring energy usage. Further on, di

7.5 Discussion

Since the Plugwise is used as a ground truth, we have to factor in the error rangeof the Plugwise meter as well. For the Non-invasive meter this will greatly in-crease the range of error compared to the true power used. Since the error forthe individual measurements of the Plugwise is -5% to 5%, and the differencefor the Non-invasive compared to the Plugwise ranges reasonably from approx-imately -10% to 0%, the ultimate range of the Non-invasive will be -14.5% to5%. The Invasive has a smaller error and will amount to -8.8% to 8.8%. Keepin mind, these are percentages that take in effect the whole range of power thatcan be measured by the sensors. For higher amounts of power these percentageswill be smaller.

41

Page 43: Design and evaluation of sampling, digital processing and ...fse.studenttheses.ub.rug.nl/12871/1/thesis.pdf · 3 describes the theory about measuring energy usage. Further on, di

8 Applications of the energy meter

During the project, we also looked at the different applications in which theseenergy meters could be used.

8.1 Fine-grained grid

The first option, for which the energy meters were also developed, is by usingthem in a fine-grained grid within a building. Retrieving one single number,real-time, of what a building as a whole is using is not very useful in under-standing the energy consumption within the building. Therefore, the threedeveloped energy meters can help by retrieving more fine-grained informationabout the usage within a building. The invasive meter can be used for sensingsingle devices. Since hundreds of devices may be used within one building, itwill be expensive to use energy meters for all these devices. Also, not all energyconsumers, like ceiling fitted lamps, use (directly) accessible sockets. Therefore,the non-invasive meter can be used for monitoring the energy consumption perfloor or per group. And as top level monitoring, the P1 meter could be used forretrieving the total consumption.

Figure 11: Grid layout showing the levels at which the meters shouldfunction

42

Page 44: Design and evaluation of sampling, digital processing and ...fse.studenttheses.ub.rug.nl/12871/1/thesis.pdf · 3 describes the theory about measuring energy usage. Further on, di

8.2 Monitoring power differences at low level

The invasive sensor could also be used in other ways like monitoring deviceusage with small power changes. For example, the power usage of the LCD-monitor depends on the colors that are shown at the screen. Take Figure 12.This figure represents the power usage over time of a LCD-monitor. First, a

Figure 12: LCD-monitor power usage

black background was used. After that, the background was changed to whiteand finally to a red background. It is clearly visible from the figure that thethree different backgrounds have a different power usage. In this case a whitebackground uses the least power, a difference of more than 1W regarding theblack background. So, in order to save energy, you should use applications thatinvolve white colored interfaces.More of these kind of subtle changes of power usage can be monitored using theinvasive energy meter.

8.3 Monitoring different devices

Another application in which the energy meter could be used is recognizing de-vices and see interactions with those devices. We took as example a refrigerator.In Figure 13 the power consumption of the refrigerator can be seen over a time of15 hours. A clear pattern can be seen. About every 75 minutes, the compressorturns on resulting in a high peak for not more than 3 seconds. Then, the powerconsumption drops to less than 100W. After a while, the compressor stops andthe power consumption drops to a low amount of Watt till the next turn on ofthe compressor. A clear pattern that can be easily recognized. When measur-ing at higher levels (at the meter for example), the refrigerator can probably berecognized. The patterns of devices can be learned. Therefore, with this meter,it is possible to monitor energy consumption at higher levels and extract thedifferent energy consuming devices from the total power, so that it can be seenwhich devices are on or off.

43

Page 45: Design and evaluation of sampling, digital processing and ...fse.studenttheses.ub.rug.nl/12871/1/thesis.pdf · 3 describes the theory about measuring energy usage. Further on, di

Figure 13: Refrigerator over a period of 15 hours

Besides recognizing devices, usage of the device can also be seen. After thesecond peak in Figure 13, the power consumption remains at 100W for a longerperiod than the other times. This was right after the user had opened the re-frigerator and thus increased the temperature. The refrigerator needed to cool alonger time, which indicates that the refrigerator has been used (Around suppertime).So, this is another application in which our energy meters could be used.

44

Page 46: Design and evaluation of sampling, digital processing and ...fse.studenttheses.ub.rug.nl/12871/1/thesis.pdf · 3 describes the theory about measuring energy usage. Further on, di

9 Conclusion & Future Work

In this project, we designed three different energy meters. Unfortunately, theP1-meter could not be tested during the project. Further on, two energy metersthat can be used at lower levels, an invasive and a non-invasive energy meter,have been tested. They can sample at a rate of 5840Hz. And the speed withwhich the energy meters can send the measured energy is once every 0.5 seconds.Besides sampling and calculating, we made a setup for the communication fromthe energy meter to a server that is both reliable and effective. Unfortunately,the Wi-Fi module is not compatible with every network. This leaves open acommunication problem to be solved in the future. Now that these meters havebeen developed, research should be done on how to use these energy meterswithin a fine-grained network. How should these meters be placed? And howmany in order to get a good picture of where, how and when the energy isconsumed within a building.

45

Page 47: Design and evaluation of sampling, digital processing and ...fse.studenttheses.ub.rug.nl/12871/1/thesis.pdf · 3 describes the theory about measuring energy usage. Further on, di

References

[1] Raspberry Pi Model 2B. https://www.raspberrypi.org/products/

raspberry-pi-2-model-b/. Accessed: May, 2015.

[2] Electric Power Single and Three Phase Power Active Reactive Appar-ent. http://electrical4u.com/electric-power-single-and-three-

phase. Accessed: June, 2015.

[3] Xiaofan Jiang, Stephen Dawson-haggerty, Prabal Dutta, and David Culler.Design and implementation of a high-fidelity ac metering network. In InProc. Information Processing in Sensor Networks, 2009.

[4] P.E. Bill Drafts. Methods of Current Measurement. http://fwbell.com/downloads/files/Methods_Current_Measurement.pdf. Accessed: May,2015.

[5] J. La T. Exon D. A. Ward. Using rogowski coils for transient currentmeasurements. Engineering Science and Education Journal, 2(3):105–113,June 1993.

[6] Bob Hughes Veselin Skendzi. Using rogowski coils inside protective relays.IEEE, pages 1–10, April 2013.

[7] Younghun Kim, Thomas Schmid, Zainul M. Charbiwala, and Mani B. Sri-vastava. Viridiscope: Design and implementation of a fine grained powermonitoring system for homes. In Proc. Ubicomp09, 245–254, 2009.

[8] Chung-Chou Shen Jin-Shyan Lee, Yu-Wei Su. A comparative study ofwireless protocols: Bluetooth, uwb, zigbee, and wi-fi. IEEE, pages 46–51,2007.

[9] Arduino UNO. http://www.arduino.cc/en/Main/arduinoBoardUno. Ac-cessed: May, 2015.

[10] OpenEnergyMonitor emontx. http://openenergymonitor.org/emon/

emontx. Accessed: June, 2015.

[11] Efergy engage three-phase hub kit. http://efergy.com/uk/products/

electricity-monitors-packs/engagekit3phase-hub-198. Accessed:June, 2015.

[12] Fluke Models 175, 177 & 179 True RMS Multimeters Fluke Manual, 2003.

[13] Ian. P1 meter uitlezen. http://www.iproto.nl/post/37?title=P1+

poort+%26quot%3Bslimme%26quot%3B+meter+uitlezen. Accessed: June,2015.

[14] Voltcraft Energy Monitor 3000 Manual, 2011.

[15] AVR120: Characterization and Calibration of the ADC on an AVR, 2006.

46