Testing and comparing the simple arduino energy monitors

Hello there,

Though my I have specialised on Energy I started playing with Arduino after a friend of mine showed me the energy monitors he was building. My professor had a similar crash and so I started trying to build pcbs, test them, improve them etc. So, as part of my diploma thesis, I had the opportunity to build and test the arduino energy monitor proposed here.I then had the meter connected via zigbee to my computer and built a cute GUI in processing, but here I will just go on with my test results.

Firstly, I used the EmonLib Library and the simple program calling the emon1.voltage and emon1.current. I set as parameters, the numbers I have calculated through a simple process with two cheap multimeters (measuring the CT or ACAC transformer output and the equivalent input).

Then, I used the power quality meter FLUKE 1735. I used the laboratory's available loads which are the following:

And I had the following results:

Then I recalibrated the parameters in the code and had the following results:

Finally I added an opamp as proposed here, and got the following results:

(orange: without recalibration, purple: with calibration)

I concluded that somehow the opamp couldn't handle the two signals without further improvements, but since my task was finished I just suggested the use of two op amps. The solution was applied by the next thesis and worked just fine.

Now I would love to build and test this circuit because it will make the boards so much prettier. I m also going to set the raspberry pi server the next days and i m really hoping to add a small part to the beautiful emoncms code.

Anyways, I don't know if my conclusions will be of any use, I really hope so. I am fully available for any further information

Robert Wall's picture

Re: Testing and comparing the simple arduino energy monitors

It would have been very interesting to see your results had you used the emonTx V3 as the test vehicle. What current range had you set your ct and burden resistor to measure? Your graph seems to indicate that you would not be able to measure above about 50 A. By default, the emonTx has a 100 A input with the standard ct and burden, and so your 20 A maximum test current represents a load of only 4.6 kW, which is rather less than that which many people require.

I am not sure what the voltage error is telling us, other than the voltage of the supply drops when you apply a load - which should come as no surprise.

It is however very interesting to see that the current error at very small currents is very much in line with theoretical predictions that take into account the essentially random position of the mean input voltage (the 'bias midpoint') relative to the ADC steps, and the limited capabilities of the 10-bit ADC. I have attached a screenshot of the results of a spreadsheet showing the calculated error against the input amplitude for varying dc offset as presented to the ADC.

We have for a long time been fairly certain that on the Arduino board, the absence of a filter between the analogue and digital sections has been a source of unwanted noise input - appearing as a few tens or maybe hundred milliamps of load current, especially when using rms current output rather than real power - and this unwanted noise has been significantly reduced in the emonTx V3  with careful PCB layout and the use of a filter. I have often thought that some digital noise might function as a dither input that could actually improve the performance at very small signals, and although you do not mention this, I wonder whether you have considered the effect of dither on the ADC performance and hence the accuracy at very low currents?

For your information, the emonTx V3 available from the shop incorporates the single supply circuit you cite.

ioannamirto's picture

Re: Testing and comparing the simple arduino energy monitors

Hey Robert,

thanks a lot for your feedback.

First of all yes, I could only measure up to 20A because that was the load we have easily accesible in our lab. Secondly, I would really like to test emonTx V3, I should suggest my professor to provide me with one-I hadn't checked the forums for a while but after I posted my thread, I saw the nice clean&tidy emonTx V3, great job really. So, I ll certainly see what I could do.

The problem with the voltage was the error between the FLUKE measurement and the Arduino, which didn't appear in the circuit without the opamp. Probably there was some kind of interference between the current and voltage signal or that was just my primitive guess.

And no I haven't considered the effect of dither on the ADC performance, it seems very interesting indeed, and I wonder how I could also test that.

Anyways, thanks again for your comments.

calypso_rae's picture

Re: Testing and comparing the simple arduino energy monitors

ioannamirto: When you do your comparison between the Fluke and the Arduino, are the two sets of data obtained at the same time?  Or do you repeat the test sequence twice, once for each measurement system?

I ask this because the Fluke measurements in your final test show very little change as the current is increased.  If the Fluke has been unchanged during all of the tests, why should the final run be different than the previous two? 

If you ignore the final set of Fluke data, the three runs with the Arduino look fairly similar.  The final graph, which includes the op amp, looks less noisy that the other two which is probably to be expected.

I have always used the op amp in my own circuits, but the overall performance when monitoring Real Power seems to be no different than when using an emonTx V2.  The test currents that I use are are generally less than 13 Amps.

ioannamirto's picture

Re: Testing and comparing the simple arduino energy monitors

Hey calypso_rae

so yes! I took the measurements at the same time, I had two csv files and made really exact comparisons. But Ι m really sorry, I don't get the question about my final test, which one do you mean the last voltage comparison? It's a different scale, I think we have a change of -1V in FLUKE measurement which is rather similar to the previous behavior. Or again I didn't get the question :)

calypso_rae's picture

Re: Testing and comparing the simple arduino energy monitors

Sorry, I had not noticed that  your three voltage graphs have different vertical scales. 

I have no idea why your op-amp circuit is showing a reduced value for your high current tests.   The output pin of the op-amp should sit  mid-way between the voltage rails at all times.  It should not be affected by any current that is passing through the CT. 

Robert Wall's picture

Re: Testing and comparing the simple arduino energy monitors

ioannamirto,

Can you publish your complete test circuit, including all component values and, for the transformers (current and voltage) the maker's name and their part numbers, and any other details.

ioannamirto's picture

Re: Testing and comparing the simple arduino energy monitors

Of course!

Here is my circuit with the opamp but for the names of manufacturers I should go to the lab, tomorrow probably! The CT was part of another ready-made monitor and the voltage transformer was half self-made

 

 

I really don't know why this was happening, I have redone my pcb 3 times and counted 2 or 3.But if you can't find an explanation too, I ll probably do it again :)

 

 

calypso_rae's picture

Re: Testing and comparing the simple arduino energy monitors

That circuit doesn't look quite right to me. 

There should not be a capacitor at the A2 input.   The A2 input should be connected directly to the CT

At the lower end of R3, are the two wires connected?  They need to be.  The diagram would be more clear if these wires were drawn staggered or offset.

 

Robert Wall's picture

Re: Testing and comparing the simple arduino energy monitors

As Robin says, as you have drawn it, there is no connection between the CT and the output of the op.amp.  That's definitely not right. And the same is true for the junction of R4, R5 and C1, The op.amp feedback connection and the GND (pin 2) connection are shown the same way, and there is surely no connection there. You never have a connection where wires cross, simply to avoid the confusion you have here. If there is a connection, you always draw it so that the wires meet at two points separated by a short distance.

If you are going to repeat the measurements, I suggest you try to measure the ac signal on the output of the op.amp. There should be none. If there is, that is the problem. The way to get an ac signal on there is to try to draw too much current out of, or feed too much current into, the op.amp output. C2 will certainly do that, as it is in effect short circuiting the current transformer output to GND, which means the op.amp side of the CT will be dragged up and down, which will affect the voltage that the A1 input sees. 

I suggest you measure the alternating voltage at the op.amp output with C2 in place, then repeat the measurement with C2 removed.

Also, it would be good to know what is the voltage transformer output voltage at your maximum mains voltage, and for the current input what is the CT ratio (rated primary current to secondary current) and the burden resistor value, or if you are using  CT with a built-in burden, the rated primary current and the output voltage at that current.

ioannamirto's picture

Re: Testing and comparing the simple arduino energy monitors

Hey guys,

I couldn't make it to the lab today, so that will be Monday again and i am planning to check all of your suggestions and try to answer all the questions.

I really really appreciate your feedback.

Have a nice weekend!

ioannamirto's picture

Re: Testing and comparing the simple arduino energy monitors

Hey guys!

The FLUKE meter is not available these days that's why I'm so late.

I'll be back

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.