• No results found

Design and evaluation of sampling, digital processing and networking abilities of new energy-sensing platforms

N/A
N/A
Protected

Academic year: 2021

Share "Design and evaluation of sampling, digital processing and networking abilities of new energy-sensing platforms"

Copied!
47
0
0

Bezig met laden.... (Bekijk nu de volledige tekst)

Hele tekst

(1)

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

(2)

Contents

1 Introduction 3

1.1 Current Solution . . . 3

1.2 Research questions . . . 3

1.3 Outline . . . 4

2 Requirements for our energy meters 4 3 Techniques involving energy usage measurement 6 3.1 Theory of power . . . 6

3.2 Digital power sensing . . . 8

3.3 Methods for analog power sensing . . . 11

3.3.1 Invasive . . . 11

3.3.2 Non-invasive . . . 12

3.4 Techniques for calculating the power . . . 14

3.5 Communication techniques . . . 14

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

4.1.1 Invasive Sensors . . . 16

4.1.2 Non-invasive Sensors . . . 17

4.2 Processing devices . . . 18

4.3 Communication Module . . . 19

4.4 Complete solutions . . . 20

4.4.1 EmonTx V3 . . . 21

4.4.2 Efergy Elite Classic and Engage Hub . . . 21

4.4.3 ACme-A plug-load meter . . . 21

4.4.4 Plugwise Circle and Stretch . . . 22

4.4.5 Comparison . . . 22

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

5.1.1 Hardware of Invasive Solution . . . 23

5.1.2 Calibration of Invasive Solution . . . 24

5.2 Non-invasive Solution . . . 25

5.2.1 Hardware of non-invasive Solution . . . 25

5.2.2 Calibration of non-invasive solution . . . 26

5.3 Direct Solution: Arduino P1-reader . . . 26

5.3.1 Hardware of Arduino P1-reader . . . 26

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

6.1.1 Sensor Reading and Energy Consumption Calculation . . 28

6.1.2 Wi-Fi Communication . . . 28

6.1.3 Communication between Sensor and Wi-Fi module . . . . 29

(3)

6.1.4 Correct timestamp . . . 29

6.2 P1-reader software design . . . 29

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

7.1.1 Sampling rate testing . . . 31

7.1.2 Conclusion . . . 34

7.2 The highest data Load . . . 34

7.2.1 Data load test results . . . 34

7.2.2 Conclusion . . . 35

7.3 The communication . . . 35

7.4 Accuracy . . . 36

7.4.1 Test results non-invasive meter . . . 36

7.4.2 Test Results Invasive Meter . . . 39

7.5 Discussion . . . 41

8 Applications of the energy meter 42 8.1 Fine-grained grid . . . 42

8.2 Monitoring power differences at low level . . . 43

8.3 Monitoring different devices . . . 43

9 Conclusion & Future Work 45

(4)

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 energy consumption. One of the solutions to solve this problem is by saving energy. To save energy, you need to know how energy is being used. Where is the energy consumption large and where can it be reduced. Nowadays, monitoring of en- ergy consumption can be done by smart meters which can provide information about the energy consumption, but it usually lags 24 hours behind and gives information in blocks of 15 minutes or even more. This does not give a real-time view of the consumed energy, while real-time feedback is important in order to know where and when the energy is consumed. Besides real-time feedback, a fine grained grid is another important part of giving good feedback on the en- ergy consumption. Smart meters only tell us about the energy consumption of the building as a whole, but they do not give an indication in which part of the building 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, there already 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, on which the solution was installed, pulses a light every time a certain amount of energy is used. This light was caught by the light sensor of the solution. A processing device, Raspberry Pi 2 [1], was used to process the data of the sensor and calculate the energy usage. This data was sent via Wi-Fi or Ethernet to a central database. An Advantage of this technique is that it is a non-invasive way 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 have a LED that gives an indication about the energy usage, in order to be able to use this solution. Further on, the frequency of sending information is based on the amount of energy usage. This means that consuming less energy means that data 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 increased in anyway by using the LED of the meter. Finally, like the smart meter, this solution 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. This energy meter should be flexible: In order to get information on the energy consumption in a more fine-grained way, the meter should be able to sense

(5)

energy at device level, like outlets, but also at places like the smart meter from the 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 works correctly?

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

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

1.3 Outline

In chapter 2, the requirements of the energy meter will be described. Chapter 3 describes the theory about measuring energy usage. Further on, different techniques 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 the sensor.

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

What follows in chapter 4 is a comparison of the hardware, implementing the described techniques, that are currently available on the market. Then, in chapter 5 and 6, a description of the implementation of the chosen hardware and the software will be described. The results of the tests with the solutions will then be presented and discussed in chapter 7. In chapter 8, applications of the 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. Stability

The hardware of the energy meter should be as reliable as possible. The Raspberry Pi that is currently in use has already broken down a couple of times and even required replacement. In addition, the monitoring of the energy meter needs to be as stable as possible. It is not desirable to have big gaps in the data.

2. Price

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

(6)

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

3. Wireless

The energy meter should send the data wireless. This increases the porta- bility and ease of installation of the energy meter since it does not need any additional wiring.

4. Installation

The installation needs to be easy. Multiple energy meters may be deployed in 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 the sensor.

5. Accuracy of measurement

In order to have an accurate representation of the energy usage, the energy meter needs to be accurate. The sensor should therefore be as accurate as possible. Also, since the measured value needs to be converted to a digital value, the resolution with which the signal will be converted should be as high as possible.

6. Open/closed source

The energy meter may use open or closed source software. However, open source software is preferred because it gives more control of the software.

7. Sampling rate

Another factor in accurately measuring energy is the sampling rate. This should be as high as possible. With higher sampling rates, the energy meter will be able to measure short peaks of energy consumption as well.

(7)

3 Techniques involving energy usage measure- ment

This section contains three parts. First, the theory about measuring energy usage will be explained. After that, the possibilities will be described for mea- suring the energy usage. Two different methods for measuring the energy usage will be discussed. The first group of measurement describes the different pos- sibilities of measuring the energy usage using the meter. The second group of measurements describes ways of measuring the current and voltage itself, which can 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 the amount of power usage. When you know how much power a device uses and how long the devices used this power, the energy can be calculated by multiplying the power used by time elapsed. Therefore, the basis of our energy meter is that it senses the power at a high rate. The power will be saved along with a timestamp. The total amount of energy usage can then be calculated by multiplying the power with the difference between the corresponding timestamp and the previous one. Therefore, it is important to know how the power (P) can be calculated.

The formula for calculating the power is:

P = U I

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 energy consumption are:

1. Apparent power 2. True power 3. Reactive power

The apparent power is the mean current times the mean voltage. In direct current 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 all power that is supplied can be used. This phase difference comes forth from the combination of resistors, capacitors and inductors that are present in electrical circuits 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

(8)

resistors, the total power from the capacitors and the total power from the inductors can be compared using vectors. An example can be seen in Figure 1. 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 and the voltage. Combining the vectors of the resistors, capacitors and inductors, a resulting vector can be calculated of which the angle θ represents the resulting phase difference between the current and the voltage1. 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 of the current is shifted 90 compared to the voltage. This results into a power that 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 between voltage and current is between 0 and 90, a part of the power will be used.

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

(9)

This power is called the true power. The sum of the true power and the reactive power is the apparent power.

The true power is the most interesting power to measure since it is the power that energy companies use to bill over. [2]

It was already stated that the true power is the same as the apparent power for direct current. The apparent power can be calculated according to the formula:

apparent power = IRM S∗ VRM S

where IRM S∗ VRM S is

1 n

i=n

X

i=0

xi∗ 1 n

i=n

X

i=0

yi

RMS stands for root mean square and is used for the average value for the current and voltage. x and y are arrays of samples taken from the voltage and current sensor. n is the amount of samples. In the calculation of the apparent power, the voltage can be estimated since it will not change. In the Netherlands for example, every outlet will output around 230V. The voltage can also be measured and used as RMS value. However, since phase difference may exist between 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 calculated according to the formula:

true power = 1 n

i=n

X

n=0

xiyi

where x, y and n are the same as in the apparent power calculation. Instead of the means that will be multiplied, the individual samples will be multiplied with each other. It is important that the phases of the samples are in the same phase as the measured ones in order to have as accurate a power measurement as possible. This is how the energy meter should measure the power usage in order to calculate the energy consumption. This requires the energy meter to have 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 wise way to read out the data directly from an existing energy meter. First, there needs to be established which different kinds of energy meters exist and pair these meters with means of retrieving data from these meters.

The following different types of meters are distinguished:

Electromechanical Meters

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

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

(10)

these meters give is to translate the analog state of the meter to digital state so that it can be stored digitally. The only way these meters can thus be read out is 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 part omitted 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 light is 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 is less light being reflected. Every revolution of the disk is equal to a set amount of energy consumed. The count of the amount of revolutions is therefore in proportion to the amount of energy used. However, this method is heavily af- fected by ambient lighting. Too much ambient lighting might impair the ability to sense the reflected light. It is therefore needed to have a consistent ambient light. This can be done by making an overlay over the sensors such that outside lighting does not make it into the sensing environment. This too can be difficult and can make for bulky solutions, as most mechanical meters have a glass plate attached to the front of them letting in great amounts of light. This method is quite easy to hook up to any processing device through the use of a breadboard or a pre-made light sensor made for this type of metering. For instance, the TCRT5000 4 module is specialised for this job. In addition to this, it is also quite cheap. It does require additional wiring and soldering to be connected to a processing device.

Electronic Meters

Reading 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 meter has the ability to directly transmit its readings. Some electronic meters have the ability to output their metered usage in the form of pulses5. The power used 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 lighting might affect the readings. The existing solution in the Bernoulliborg project also 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.html

4http://www.vishay.com/docs/83760/tcrt5000.pdf

5http://openenergymonitor.org/emon/buildingblocks/introduction-to-pulse- counting

(11)

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 connect a secondary device to the meter. In these meters there is a relay. This relay closes at every pulse. The secondary device can then be connected such that it can read out whenever the relay switches states. The two forms of relays are called KYZ-relays and KY-relays67. KYZ is an C-form connection and KY are called 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 state increases. This connection is highly reliable (if implemented correctly) as the sensing of the pulses is direct and cannot be affected by outside factors. Like the 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 could then be placed on the meter to register the pulses. Some IR outputs can even transmit data to the receiver. Typically, this data contains information about the metering and is transmitted via the IrDA8 protocol. In order to read out this infrared data the infrared light has to be demodulated so that it can be processed in binary form by a processing device. Naturally, it is imperative that the sensor is in a direct line of sight of the outputted infrared. If there is a bigger distance between the sensor and the output, this will impact the reliability of the meter.

Serial Output

Most modern smart meters in the Netherlands have the feature to output data through a serial port. This port has to be configured according to the Dutch Smart Meter Requirements (DSMR) specification9. The DSMR-specification is based on the IEC 6205610 standard, which is the international version of the COSEM. 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 in essence a serial port, the data can be read out using any serial interface but it requires an RJ11/45 plug to connect. The P1-port transmits telegrams, that contain the data of the meter, at a set interval. This method is arguably the most 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 of a P1-telegram.

6http://www.solidstateinstruments.com/newsletters/kyz-pulses.php

7http://www.schneider-electric.us/sites/us/en/support/faq/faq_main.page?page=

content&country=US&lang=en&locale=en_US&id=FA212484&redirect=true

8http://en.wikipedia.org/wiki/Infrared_Data_Association

9http://www.netbeheernederland.nl/themas/hotspot/hotspot-documenten/

?dossierid=11010056&title=Slimme%20meter&onderdeel=Documenten

10http://en.wikipedia.org/wiki/IEC_62056

(12)

DSMR Version Baudrate Format frequency 2.0 9600 not specified not specified

3.0 9600 not specified 10 seconds

4.0 115200 8N1 10 seconds

5.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 a COSEM object attribute value11.

The port can be interfaced by using a RJ11-cable. In addition to this, it is also a quite cost effective means of acquiring metered results. A processing device 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 are easy solutions that use an Arduino and a stripped RJ11-cable12.

There are numerous commercial solutions that offer the serial interface and a 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 data to a dedicated server where you can log in with an account, which comes with the purchase.

3.3 Methods for analog power sensing

Instead of directly reading out the energy usage from a meter, measuring the current and voltage can also be used for determining the energy usage. For the voltage measuring, a transformer can be used that can transform the voltage from 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 used as analog signal for a processing device to measure the voltage.

For current sensing, multiple measuring techniques can be used. These different methods will be discussed in the following section. The voltage measurement technique 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.html

12http://thinkpad.tweakblogs.net/blog/10673/uitlezen-van-de-slimme-meter-p1- poort-met-een-arduino-en-waarden-opslaan-in-mysql-database#hardware

13https://enelogic.com/nl/prijzen/slimme-meter-live-uitlezen

(13)

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

Shunt resistor

A shunt resistor measures the current using a resistor [3]. It is integrated in the circuit through which the current flows. It uses the voltage drop, that is accu- mulated when the current goes through the resistor, to determine the amount of current. The accuracy of shunt resistors is higher than of other sensors for low 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, the size of shunt resistors increases according to the amount of current that can go through it.

Current transformer

The current transformer transforms the current of the conductor to a lower current via magnetic induction (more details in the section about non-invasive current 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 Sensor

Using the Hall-effect as invasive solution is another possibility. The Hall-effect sensor uses the magnetic field, created by the current through the conductor to create a voltage that is proportional to the magnetic field. The sensors are also 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 against invasive sensors is that they are less accurate at low current values [4]. Below four types of techniques are discussed.

Current Transformer (CT)

This technique uses a core of metal that will be clamped around a conductor of which 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 current as well which will be much smaller according to the amount of windings. The current in the second wire is proportional to the current in the main wire. This

(14)

current can be translated to a voltage which can be used for processing. It can only measure alternating current, which is widely used in offices and homes.

The current transformer contains a metal core which will affect the linearity due to saturation at some point as the current is too high. Therefore, higher currents mean bigger sensors in order to deal with saturation. Two versions of these sensor exist: a sensor with a split core or one with a solid core. A split-core current transformer can be opened and clamped shut around a wire easily, while a solid-core current transformer requires the wire to be put through it before connecting the wire since the transformer cannot be taken off or put on a wire when it is already connected. The disadvantage of a split-core is that constructing a split-core and staying equally accurate as a closed-core sensor results into higher prices1415.

Rogowski coil

The 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. By using a non-magnetic core, Rogowski coils have a higher linearity than current transformers [5] since saturation cannot affect the linearity. Further on, Ro- gowski coils are flexible as well, which increases the ease of installation. For high-current measuring, the Rogowski coil remains compact, while sensors like current 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 current transformer) will often go to a maximum of thousand amps 16. However, the range of current that can be measured is limited by the associated electronics.

Noise can have a large influence when large ranges are downscaled to small ranges. [6]

Magnetic field sensor

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

Multi-core Cable Current Sensor

Both 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. The current flows to the device and back, which results in two opposite magnetic fields which causes the sensors to measure no magnetic field. Another type of sensor senses the magnetic field at different distances from the wire and uses

14http://www.brultech.com/products/ECM1240/CTRequirements/types.htm

15http://www.eetimes.com/document.asp?doc_id=1273236&page_number=1

16http://www.dentinstruments.com/

17http://www.suparule.com/docs/flexiclamp_technology_datasheet.pdf

(15)

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

3.4 Techniques for calculating the power

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

Processing the sensor signal analog

It is possible to calculate the power from the current and voltage by an analog multiplier. The advantage is that the multiplications will be done continuously, which is ideal for high frequency measurements. The disadvantage is, that due to the sensors, phase error arise in the signal of the current and voltage which will be included in the calculations of the multiplier. This gives an inaccurate calculation of the power.

Processing the sensor signal digitally

Processing the sensor information digitally is cheaper since it only needs a pro- cessing device which is also needed in the analog processing solution. The frequency 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 the power.

3.5 Communication techniques

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

Wi-Fi

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

802.15.4

For 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. This is because the communication is meant for sensor networks consisting of low power nodes. In Design and Implementation of a High-Fidelity AC Metering Network [8] Zigbee was compared with Wi-Fi and it appeared that Zigbee used around 50 mW, while Wi-Fi used 750 mW. Further on, networks using Zigbee or 6LoWPAN can consist of more than 65.000 nodes which is ideal for fine-grained systems. A disadvantage of these networks is the range, which is smaller than Wi-Fi or GSM. However, for a network with multiple devices using Zigbee, the

(16)

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

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

(17)

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 first part compares the different sensors that are on the market. The second part compares the different types of data processing devices and the third part com- pares communication modules. The last part compares a couple of complete solutions. We decided to make multiple energy meters. Since measuring the energy must be fine-grained, the energy usage needs to be measured at different levels within a building. This means also at different amount of currents. It is possible to develop a meter that has a sensor which can measure a large range of 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, while energy meters with a smaller range for current can also be used. The resolution with which the signal of the sensor will be sampled becomes much higher when using smaller ranges, which increases the accuracy. Because of this, it is better to develop different energy meters for different levels. Therefore, it is decided to build one energy meter which will function as plug-in meter while an other meter will measure energy at higher levels. Due to this, two different current sensors 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, different amounts of current flow. Depending on where the sensor will be used, it needs to support that current. A high range of current has as advantage that the device can be used on a wider range of levels within a fine-grained grid. However, a higher range also means that the output has a smaller resolution. For example, 0-30 A input, 0-5 V output means a 1 V step for every 6 A. In comparison, 0-100 A input with 0-5 V output means a 1 V step for every 20 A.

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

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

4. Sensitivity It is important to know the sensitivity of the sensor, because this 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).

(18)

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

These are stated in Table 1. These sensors do require additional cabling to ACS712-05BT19 ACS712-20A20 ACS712-30A21

Current range (A) -/+ 5 -/+ 20 -/+ 30

Price (e) 6,50 5,60 4

Output Voltage 0-5 0-5 0-5

Sensitivity (mv/A) 185 100 60

Type Hall effect Hall effect Hall effect

Shipping 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 plug to 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 the ACS712-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 the accuracy of this sensor on some range of current; we can say something about the 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 techniques discussed 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 is the 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 the true measurement on average. The accuracy of the sensor should be as high as possible, 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 200A22

2. HONEYWELL S&C CSLA2CF23 3. CTRC-03100-040024

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

23http://nl.farnell.com/honeywell-s-c/csla2cf/sensor-6-12vdc-125a/dp/1653524?

MER=en-me-pd-r2-alte

24http://www.ccontrolsys.com/w/CTRC_Series_Rogowski_Coil_Current_Transformers

(19)

4. SCT-013-03025 5. SCT-013-0002627

1 2 3 4 5

Price (e) 11,98 11,60 149,80 12 13,56

Range current +/- 200 +/- 125 +/- 400 +/-30 +/- 100

Type 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 the project of EmonTx (Where the SCT-013-000 is part of) that the accuracy is below 1%28. For most others the accuracy wasn’t listed as well. Rogowski Coils are very expensive compared to the others and since such a high current range isn’t needed, it is better to choose a smaller range in order to have more precise measurements. Also, since this sensor is part of an Arduino project, it will be far 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 Uno will 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 Arduino Uno, while the clock-speed is high compared to other Arduino types29

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.html

26http://shop.openenergymonitor.com/100a-max-clip-on-current-sensor-ct/

27http://openenergymonitor.org/emon/buildingblocks/report-yhdc-sct-013-000- current-transformer

28http://openenergymonitor.org/emon/buildingblocks/emontx-error-sources

29http://www.arduino.cc/en/Products.Compare

(20)

Raspberry Pi 2 30[1] Arduino Uno R331 [9]

Price > 36,95 11,50

Clock 900 MHz 16MHz

Memory 1Gb 32kb

Resolution in bits - 1024

Sample rate (Hz) - standard 9,6 kHz

Remarks

Needs an external analog-to-digital converter

Can be borrowed

Table 3: Data processors - Comparison

One of the main advantages of an Arduino is that it has analog inputs which makes it more suitable for reading sensors. For the Raspberry Pi, an additional analog to digital converter (ADC) is needed.

The sampling rate of the Arduino is 9,6 kHz when using the analog input, which can be increased (see section 7.1). The sampling rate for a Raspberry Pi depends on the external ADC. There are a lot of ADCs with higher resolutions than the Arduino Uno but the sampling rate will not be much higher. Further on, the Raspberry Pi has a much higher clock speed than the Uno. Another advantage for the Uno is that since it is much simpler (regarding hardware components) than a Raspberry Pi, it is also more reliable, since fewer hardware components can fail. Also the Arduino is much simpler to use than the Raspberry Pi. The Arduino only requires an implementation of a setup and loop function, while the Raspberry 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 mentioned above 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 amount of sensor information that will be sent.

3. Range indoor If the range is too small, extra routers/base stations may be 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 communication modules are chosen for comparison.

(21)

1. XB24-AWI-00132 2. Arduino Wi-Fi shield33 3. Adafruit CC300034 4. Wi-Fi module - Dongle35 5. ESP8266 Wi-Fi module3637

1 2 3 4 5

Type Zigbee Wi-Fi Wi-Fi Wi-Fi Wi-Fi

Price (e) 25,29 23,07 39,95 14,90 5,00

Data rate (Mbps) 0.25 11 11 150 150

Range indoor (m) max 40 max 100 max 100 max 100 max 100

Compatibility Arduino/Raspberry Pi Arduino Arduino Uno or Mega Raspberry Pi Arduino

Shipping 1 week 1-2 days 1-2 days 1-2 days 1-2 days

Remarks

Needs an receiver.

Raspberry Pi needs some in between parts

Vague documenta- tion

Table 4: Communication modules - Comparison

It has been decided to use Wi-Fi as communication protocol, since this can be easily integrated - Wi-Fi is already available within the building in which the solutions will be used. From the Wi-Fi modules the ESP8266 Wi-Fi module was chosen. It is compatible with the processing device since an Arduino will be used and it is a very cheap module. Although the language of the documentation is originally not in English, big parts of the documentation have been translated and 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- and closed-source solutions. These will be compared and taken into account for our solution.

32http://www.digi.com/products/wireless-wired-embedded-solutions/zigbee-rf- modules/point-multipoint-rfmodules/xbee-series1-module#overview

33https://www.scintilla.utwente.nl/nl/stores/viewcategory?id=67

34https://www.adafruit.com/products/1469

35https://azerty.nl/0-1251-516453/edimax-ew-7811un-netwerkadapter-usb-2-0-802- 11b-802-11g-802-11n.html?channel_code=40

36http://www.tinytronics.nl/shop/ESP8266-WiFi-Module

37https://nurdspace.nl/images/e/e0/ESP8266_Specifications_English.pdf

(22)

4.4.1 EmonTx V3

The EmonTx V3 [10] is a commercially available meter with a price ofe110,76.

It uses a non-invasive CT sensor that can measure currents up to 100 A. It can measure up to 4 currents at the same time. For sensing the voltage, it uses an AC/AC adapter as transformer for the voltage. An Arduino Uno is used as processing 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 shield can be mounted on an Arduino. The shield has a wireless module (RF) which can be used to send the data to a base station. The base station is based on a Raspberry Pi and is available fore25,92.

The EmonTx V3 is open source. A library for the Arduino Uno can be found for the 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 available clamp-on energy meters. Both the Elite Classic and E2 Classic are composed of three separate modules: a CT clamp-on current sensor, a transmitter module and an LCD-monitor. In addition to this, the E2 Classic 2.0 also offers the function of reading out the data from the monitor display by USB. This data can then be loaded into the accompanying software called elink. This software can 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 a range of 40 to 70 meters. The CT-clamps can measure current up to 90A and are compatible with voltages from 110 to 600 volts.

More recent versions like the Engage Three-Phase Hub Kit [11] offer the same functionality as the elite classic, but have an additional hub module added such that the system can be accessed through the Internet. The module is directly connected with an Ethernet cable to a router and can be accessed through the Engage 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 energy consumption of devices that use an outlet. The meter can be placed between an outlet and a device. It uses an invasive sensor (shunt resistor) to measure the current. With an ADE7753 - integrated circuit - it calculates the energy consumption using current and voltage readings. The calculations are made

38http://efergy.com/uk/products/electricity-monitors/elite-classic

39http://efergy.com/uk/products/electricity-monitors/e2-classic-2-0

(23)

in hardware so that there is no need for the software to sample. It uses an Epic Core as microcontroller and a radio module for transmission of data. The transmission is done using Zigbee. The meter sends its information to a base station for further processing. The ACme-A has a sampling speed of 14 kHz and a maximum power of around 16A. This solution can not be bought because it 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 by the company Plugwise. The whole product is closed source. To communicate the metered values, the plug uses the ZigBee communication protocol to send the data to a dedicated receiver, called Stretch, that saves the data. It is of importance to have a good network layout for optimal transfer of data. The closer a circle is placed in respect to a Stretch the more data this plug has to transfer. 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 V340

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-load meter of which we couldn’t find a price. Another thing that strikes is that most meters are working at device level or at meter level but no company that supplies 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 discussed later on in this thesis. The Plugwise will namely be used for comparison. The EmonTx V3 has open source hardware and software which will also be used in our energy meter.

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

(24)

1 2 3 4

Price 95,40/56 105,85 - 109,95

Communication RF 433MHz RF 433MHz 6LoWPAN Zigbee

Current range (A) 100 90 15 16

Type sensing Non-invasive/Invasive Non-invasive Invasive Invasive

Software Open source Open source Closed source Closed source

Report speed Variable (> 1Hz) 0,1 Hz 2800 Hz 0,2 Hz

Remarks 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 addition to these two meters a P1 meter will be described as well, which can directly connect 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-modulee5

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

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

• MB-102 Bread Board,e3

• Jumpers Cables,e3

(25)

• AC-AC 230V-9V adaptere13

• European electrical sockete11,47

• EmonTX Arduino Shield SMTe15,61

The last two items come from http://shop.openenergymonitor.com, the other items come from http://www.tinytronics.nl.

The ACS712 is directly connected to the mains wire and senses the current through this wire. The ACS712 is powered by the Arduino and the output is fed to one of the analog inputs of the Arduino. The ACS712 outputs a 0-5V signal that is proportional to the amount of current sensed.

The ESP8266-01 is the Wi-Fi module that will send the measured data. Even though it is a small sized module it needs an external 3.3V supply since the 3.3V of 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 type breadboards and can deliver both a 5V and 3.3V power supply. This module is used to power the ESP8266 and the logic level converter. The next module that 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.3V signal 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 the voltage. The non-invasive solution uses the same adapter for measuring the voltage. 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 inputs for the non-invasive sensors. It can also be fitted with an RF-module but we chose to not to use this. We use the shield in this solution because it will also be used for the non-invasive solution. But for only measuring the voltage, it would be much cheaper to use other components for connecting it to the Arduino. The invasive 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 voltage that can be used as analog input for the Arduino. The AC-AC adapter changes 230V to 9V. The EmonTx shield scales the 9V further down by dividing it by 11. When the Arduino calculates the power, the voltage needs to be scaled back in order to get the correct power value. Theoretically, this constant for the voltage should then be: 230/(9 ∗ 1.20) ∗ 11 = 234.3. 9 needs to be multiplied with 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.

(26)

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 be determined using a multimeter. The multimeter used is a Fluke 179. It has an accuracy 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 it produces the same voltage. A heating device will be used as a power consumer in order to have a steady current through the wire. The multimeter will be in parallel with the circuit in order to measure the voltage.

Current constant The current constant will, like the voltage constant, also be used 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 a voltage between 0.5V and 4.5V. This means that the measured analog signal should be multiplied with 15 to get the real current since the ratio is 1V per 15A. (60/4).

But, like the voltage constant, it needs to be calibrated since the resistor or sensor itself may have errors. This will be done using the multimeter mentioned at the voltage calibration. But now, the multimeter must be in series with the heating device in order to measure the current.

Phase constant Since phase shifts will occur between the measure point and the analog input at the Arduino, another constant needs to be calibrated, the phase constant, in order to compensate the phase error of the voltage and the current, 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 resistive load. This is the case for the heating device.

Using the heating device with a load of 3.533A and a voltage of 223.0, the following 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 except for the current sensor. The sensor can be connected to one of the non-invasive clamp 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-modulee5

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

(27)

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

• AC-AC 230V-9V adaptere13

• Bread Board,e3

• Jumpers Cables,e3

• European electrical sockete11,47

• EmonTX Arduino Shield SMTe15,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 current sensor. For this reason, the current constant will be different and the phase constant 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 can be 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 case for the invasive solution, it needs to be calibrated since the resistor and sensors may have errors.

Both the current constant, the voltage constant and the phase constant will be determined in the same way as the constants in the invasive solution. After calibrating, 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 a smart meter. Besides that, this solution could be used for giving an indication of the accuracy of the other meters. This solution is quite minimal compared to the other solutions seeing that it only needs an hex inverter41, an Ethernet shield and an RJ11 cable [13].

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

(28)

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. The other components from http://www.tinytronics.nl

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

(29)

6 Design of software

Here the general design of the software of the sensors is described. Both the invasive 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 substantial changes were made to the library, like deleting some of the functions from the temperature and RF functionalities that we do not use. Also some adjustments of the existing functions regarding power calculations were done. Furthermore, the sensor was designed to be configured during run-time. This was done to facilitate the calibration of the sensor. It is also possible to toggle the sensor on and off. All these functions allow an easy means to configure the sensor and test 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 support43 we can directly program the ESP8266 Wi-Fi Module. For easy access we designed a web page that shows actual status of the module: if it is connected to a network, if it has established a TCP connection with a server, and if the sensor is currently logging data. This access-page is generated on the ESP8266 itself and is served by an HTTP server running on the module. The page lets you input the network data and server data you want it to connect to. In addition to this it offers a button that lets the user toggle the sensor on and off. The page also lets the user input calibration parameters for the voltage, amperage and phase. Besides these parameters, the parameter ’crossings’ can be set here as well. This parameter will be discussed in section 7.2. All the data that is sent from the page is POSTed to a HTTP server that runs on the ESP8266. The module then interprets these requests as different routes.

Outgoing communications to a server are done by REST. This is of course only possible 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/EmonLib

43https://github.com/esp8266/Arduino

(30)

6.1.3 Communication between Sensor and Wi-Fi module

The ESP8266 and the sensor module are connected by a serial connection. The communication 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 the logging has been toggled on. The sensor will then send back its sensed data every time it has completed a calculation.

6.1.4 Correct timestamp

For each measurement the Arduino sends, a timestamp is needed as well. The timestamp 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 is probably 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 by the Arduino. In order to solve this problem, some good solutions are available.

An external clock can be used with a more accurate crystal. Libraries are available for the Arduino to use that clock for synchronization.

Another solution is to let the Wi-Fi module request the time from the server at 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 just send the timestamp of the Arduino to the server. The time span within the tests 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 fields in the telegram are needed to extract the consumed energy. Every line of the telegram is read into a buffer. Whenever a line has been read, the line is checked for 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 buffer cleared for the next telegram.

(31)

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 the P1 meter at all and were neither able to test the non-invasive sensor at places were it should measure the energy usage in buildings. We were however able to test 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 plugwise44. According to the technical data of the Energy Monitor 3000, the error percentage of devices up to 2500W is maximal 2%. According to a test from Hardware.info, the Energy Monitor 3000 performed on average with an accuracy of 6.9% which is less accurate45. However, most of the loads used less than 5W. This is much less than the loads that will be normally measured by these energy meters. When looking at the measurements of more than 5W (8 measurements), it performed an average accuracy of 1.9%. The Plugwise circle has an accuracy of 5% of real time measurements according to a declaration of measurement accuracy46. The sampling rate will be tested using the Energy Monitor 3000 while the accuracy will 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 be achieved by the energy meters.

For the P1-meter, the sampling rate cannot be adjusted. The energy meter will just send a set of data every 10 seconds through the P1 port.

For both the invasive and non-invasive meter the sampling rate depends on the processing device. The Arduino has analog inputs from which the analog signal will be converted to a digital signal. There are two parameters within the Arduino 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 that the speed, at which an analog signal can be converted accurately to a digital signal is limited by the digital to analog converter, should be in a range of 50-200 kHz. In order to achieve this, the prescaler is used. The prescaler is a constant which is a divisor of the clock speed. This means that the frequency of the analog to digital converter is the processor frequency divided by the prescaler. The default prescaler for the Arduino is set to 128. This results into

44https://www.plugwise.com/circle

45http://nl.hardware.info/reviews/1460/6/vergelijkingstest-9-energiemeters- tabel-met-testresulaten

46https://www.plugwise.com/media/docs/declaration of measurement accuracy.pdf

(32)

the highest clock speed under the 200 kHz bound: 16M Hz/128 = 125kHz.

One analog read costs 13 cycles, so the theoretical sampling rate with these settings is 125kHz/13 = 9, 6kHz. Both voltage and current needs to be sampled which results into a 4.8kHz sampling rate. By adjusting the prescaler levels we can achieve higher analog to digital conversion frequencies and thus a higher sampling rate. There is a trade-off between the conversion frequency and the accuracy of the conversion. However, in [15] it is stated that frequencies up to 1 MHz do not affect the resolution of the analog input significantly. These frequencies can be reached by changing the prescaler. The prescaler can be set to 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 using a setup with a couple of devices. In this case, two laptops were used. Over half an hour, the non-invasive and invasive meter will measure the energy consump- tion. This will be compared with the measured energy consumption from the Energy Monitor 3000. The comparison will take place over different prescale levels. Since laptops are used, the power measurements will not be equal over every half hour. This causes the comparisons to be less comparable, since the meters may produce better/worse performance at higher energy consumption rates 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 first solution to send data is by sending each analog value directly to the Wi-Fi module. The body of the loop consists of two analog reads and serial prints of the voltage and current. We tested this with the setup mentioned above. The Arduino prints after each round of measurements the time plus the amount of samples taken (one sample is one voltage sample and one current sample). This results 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 Hz

128 870

64 960

32 1010

16 1030

8 1050

4 1055

2 940

Table 6: Baudrate of 115200

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

(33)

rates. With a prescale of 128, one cycle of sampling takes about 1100 ms of which 930 ms is the time to send the data via serial. This sample speed is too slow 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 amount of cycles. Each pair of samples will be filtered and multiplied with each other and 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 communication but needs more calculations at the Arduino and the sampling is not continuous but with a gap in which the data will be sent via serial. This gap is around 9500 µs. In the Netherlands, one cycle of a voltage and current wave is around 1/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 to neglect this loss.

Using the same setup as above, we measured the sampling rate. Only now the Arduino 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 Hz

128 2770

64 3980

32 5050

16 5840

8 6350

4 6710

2 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. Since the sensors will not have an effect on the sample speed, only the non-invasive sensor was used against the Energy Monitor 3000. We used again the same setup. Table 8 shows the different prescalers with the mean deviation of the non-invasive sensor against the Energy Monitor 3000. This deviation is a mean over two measurements. Overall, the measurements of the non-invasive sensor differ with the measurements of the Energy Monitor 3000. This is due to the low power consumption over which these measurements are measured (around the 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 accurate with 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 prescale levels, we saved the individual samples for the voltage and current for each prescale level 150 times in a row. In the Figure 2-5, the measurements can be

(34)

Prescaler deviation (%)

128 5.8

64 6,3

32 9,3

16 5,2

8 60,1

4 1195,6

Table 8: Comparison of the non-invasive and invasive sensor with the Energy Monitor 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 how well the analog signal is sampled under each prescale. For 32 and 16, the sampling 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

Referenties

GERELATEERDE DOCUMENTEN

De Triodos Bank geeft medewerkers waardering in de vorm van ‘schouderklopjes’ aangezien zij van mening zijn dat financiële beloningen maar effect hebben op korte termijn. De

The timer interrupt handler synchronizes all active queues with the current time. For each expired timer it executes the corresponding handler and calls the scheduler. Handling

1) Virtual platform overhead: We introduce an interfering application which is provided a hard reservation [3], i.e. it periodically consumes a fixed fraction of the processor

Whether regular or expedited single sourcing is advantageous depends on the trade-off between the premium that has to be paid on the procurement costs when sourcing from the

De middelen Stomp, A 9396B en SN 38584 lijken op basis van deze eerste proef zonder al te grote kans op schade te kunnen worden toegepast, maar het onkruidbestrijdende effect van

Aan de neiging van de ziel naar iets volmaakts moest worden voldaan: ‘Gedenk dan dat godsdienst niet bestaat in woord, maar in daad, dat er slechts twee geboden zijn: God en de

Voor een half uur terug in de tijd moet je steeds delen door

This paper proposes a much tighter relaxation, and gives an application to the elementary task of setting the regularization constant in Least Squares Support Vector Machines