Newbie questions on emonTX shield V2

Dear all,

first of all I would like to wish you happy new year.

I found out about Openenergymonitor one month ago and since I have already spent some time playing around with various arduino sensors etc I wanted to create a power monitor for my apartment and I thought that this is the right equipment for me to start with.

So I ordered from OpenEnergyMonitor shop the emonTX shield V2 (no RF) to start with. I got also 3 CT clips and the AC-AC euro adapter for the voltage.

I finished with the Shield soldering and I put it on an Arduino Uno to give it a try.

I used the default sketches from github for the TX shield.

First test with the Shield_CT1234_3Phase_Voltage sketch, with the AC AC adapter and the 3 CTs connected to the shield with no connection to any device cable to get a measurement.

The first issue I have is that always the first measurement I get when the sketch is running it shows a very high voltage value:

emonTX Shield CT1234 Voltage 3 Phase example
OpenEnergyMonitor.org
Node: 10 Freq: 868Mhz Network: 210
Total Samples: 283 Power Samples: 269 Time: 233 Crossings: 22

Voltage: 387.80
Current 1: 91.28 Power 1: 30659.53 VA 1: 35397.49 PF 1: 0.87
Current 2: 90.80 Power 2: 31936.00 VA 2: 35210.78 PF 2: 0.91
Current 3: 91.09 Power 3: 33184.83 VA 3: 35324.41 PF 3: 0.94

the next measurements are similar to the below:

Total Samples: 285 Power Samples: 270 Time: 235 Crossings: 22

Voltage: 194.05

Current 1: 0.15 Power 1: -1.08 VA 1: 28.86 PF 1: -0.04
Current 2: 0.11 Power 2: -0.34 VA 2: 20.79 PF 2: -0.02
Current 3: 0.10 Power 3: 0.77 VA 3: 19.04 PF 3: 0.04

or

Total Samples: 284 Power Samples: 269 Time: 233 Crossings: 22

Voltage: 194.16
Current 1: 0.15 Power 1: -4.46 VA 1: 29.27 PF 1: -0.15
Current 2: 0.10 Power 2: -0.74 VA 2: 20.02 PF 2: -0.04
Current 3: 0.10 Power 3: 0.77 VA 3: 20.37 PF 3: 0.04

 

but then again, when it finishes with the measurements and start over again, it gives another high voltage value:

emonTX Shield CT1234 Voltage 3 Phase example
OpenEnergyMonitor.org
Node: 10 Freq: 868Mhz Network: 210
Total Samples: 284 Power Samples: 270 Time: 233 Crossings: 22

Voltage: 400.65
Current 1: 91.64 Power 1: 32124.77 VA 1: 36714.03 PF 1: 0.87
Current 2: 91.16 Power 2: 32438.34 VA 2: 36521.48 PF 2: 0.89
Current 3: 91.46 Power 3: 33008.75 VA 3: 36642.04 PF 3: 0.90

I commented out all other readings and left only the Voltage and it seems that for some reason always the first reading gives a high value around 500 and then it smoothly goes down to aprox. 200 and again the same.

What might be the reason for this? Any ideas?

 

Without changing anything on the setup, I run the EmonTx Shield 4 x CT example sketch, and getting below values:

emonTX Shield CT123 example
OpenEnergyMonitor.org
Node: 10 Freq: 433Mhz Network: 210
10583 10525 10553
31 34 39
24 23 27
22 39 24
22 40 25
21 41 24
21 38 23
23 41 25
21 41 26
22 41 25
22 40 25
21 41 25
22 39 24
21 40 25

Is this normal to have such values with the CTs just plugged into the shield?

 

I have a 2500 W heating device (atlantic thermo heater) and tried to test with the TC1 attached to the power cable when it is on heating. The readings on TC1 are almost the same as before. 

By reading some posts around the forum I read somewhere to test with the power cable to pass 2 times through the TC.

I tried this and the readings I get now are :

5 40 25
47 42 25
48 41 25
44 42 26
47 41 26
47 40 22
46 41 26
45 41 24

I would expect a bigger figure since without any power cable attached on the TC1, the reading is aprox. 20 and the difference is around 25.

 

i would like to thank you in advance for any help on these.

And something else I would like to ask, can you please confirm if pin 8 or some other pin on the TX shield is not used by the shield and I can use it with the ARduino to put another sensor I have at the same time?

Thanks and Happy new year again !!!

 

 

calypso_rae's picture

Re: Newbie questions on emonTX shield V2

John, it may be worth running the first few sketches on my Summary Page.  They will show you how your hardware is working.  If you loop (one core of) the supply cable twice around your CT, the current values should indeed double.  This section of my PV Diversion article may be helpful too.

If using the emonTx Shield, you may need to change some of the pin numbers.

Robert Wall's picture

Re: Newbie questions on emonTX shield V2

The first issue I have is that always the first measurement I get when the sketch is running it shows a very high voltage value:

This is because the software high pass filters have not had time to settle. If you wish, you can inhibit the output in the same way that RF transmission is inhibited while the filters settle.

when it finishes with the measurements and start over again, it gives another high voltage value

It should not do that. I'll take a look at the sketch later.

Is this normal to have such values with the CTs just plugged into the shield?

Unfortunately, yes. It is due to noise picked up by the ADC input, we think from the processor's own digital circuits.

I can't check the calibration without knowing what your system voltage is, and which c.t's you have used. When you say "the TC1 attached to the power cable" - how? Are you passing the whole 3-core cable through the c.t? If so, I would expect zero output. As calypso_rae says, only one core - either line or neutral - should pass through the c.t.

I will check on pin 8 later, however you can find a set of circuit diagrams on Solderpad - details are on the Shield page

xerox1821's picture

Re: Newbie questions on emonTX shield V2

Hi Robert,

thanks for the prompt reply. 

Regarding your first comment: "If you wish, you can inhibit the output in the same way that RF transmission is inhibited while the filters settle." I am not sure what exactly to do here.

What I did as soon as I saw this first high number, I put more time for the filters to settle (10000 instead of 5000), but no difference.

The CTs I have are these sold by OpenEnergyMonitor (purchased from OpenEnergyMonitor).

You are right. I am embarrassed to say that I did this wrong connection and it is true that there was no change to the output values (with the same noise)   ;-)

 

Thanks a lot. I will continue testing and maybe then I will have more questions for calibration.

For sure the first high voltage value I am getting at the restart point of the sketch is an issue. By the way, I tested and this value is always there, even if there is no voltage connected to the EmonTX shield !!! So, first value is a high number and all the others around 0.3-0.4

calypso_rae's picture

Re: Newbie questions on emonTX shield V2

John, you may find it helpful to run some of the sketches near the top of my Summary Page.  This will show how your hardware is behaving. 

Your AC voltage sensor will work best when its output spans most of the 10-bit range of the ADC, i.e. 0 - 1023.  Similarly, your current sensor should use most of this range when the maximum current that you want to measure is flowing through the CT.  When a smaller current is flowing, the amplitude (range) of the output signal will be doubled if you loop the current-carrying conductor twice around the CT rather than just once.  When no current is flowing, the resulting signal from the ADC should be very small, no more than a couple of ADC steps, e.g. 511 - 513.   If your output values (for either sensor) are not fairly symmetrical around 512, then your reference circuit is suspect.

MinMaxAndRangeChecker is a simple tool which displays the raw ADC values from each of the first four analog inputs (AN0 - AN3).  RawSamplesTool_4ss_2 provides a snapshot of your V and I waveforms during one or more individual mains cycles.  If this sketch runs correctly, it shows that your voltage sensor is OK.  Prior to the display appearing on the Serial Monitor, there should be a slow countdown (one per second).  If this sketch doesn't run properly, there is something wrong with your voltage sensor.  When using the Shield, you may need to alter the pin number definitions.

Hardware issues are much easier to track down and fix while using simple tools like these.  Once your hardware is behaving as expected, then you can run the appropriate software for whatever you want your rig to do.

Hope this helps.

xerox1821's picture

Re: Newbie questions on emonTX shield V2

I made the right connection of the CT to the heater cable and I managed to get good readings. Tested voltage with the multi meter and by adjusting the variable in the sketch I have good readings now.

 

The only thing is that I am still getting the high voltage reading at the beginning of each cycle. It should be something in the sketch causing this. I put some more delay to the initial one (20000) but nothing.

Did anyone else phased the same issue with this sketch?

 

thanks in advance

Robert Wall's picture

Re: Newbie questions on emonTX shield V2

Initial false values due to the filters: The output you see on the serial monitor and the values sent to emonCMS or the emonGLCD are sent by different methods. If you look at the code, the RF transmission is inside a conditional branch "if (settled) { ... }"

If you put the "Serial.print(...)" statements inside a similar conditional, you will get no output printed until FILTERSETTLETIME has expired. But you must continue measuring because the filters need to run to be able to settle.

I can't see any other reason for the high voltage each time - and I never saw it, other than when starting the sketch for the first time, when developing and testing the sketch on an emonTx V2.  I don't have a shield, and nobody else has reported this problem. I'm checking further.

[Edit]

That's weird. I see the high voltage each time I start the serial monitor - but only under Linux. I have a new machine and I've just switched from Windows to Ubuntu 12.04, I don't see the same effect with my old machine under Windows (which is why I never saw it before). It has to be tied up with the way the serial port is handled inside the monitoring computer, interrupts and the timing of the measurement. I don't know of a way to test if the output is being received and handled by the monitoring computer.

As a work-around, when you have finished testing, comment out this line near the top of the sketch:

#define SERIALPRINT

That should cure the problem.

xerox1821's picture

Re: Newbie questions on emonTX shield V2

Hi Robin.

Thanks once more for the valuable and fast reponce.

I checked your simple tool and now I am more confident that the shield it works fine.

Please find below the raw data I get from the serial monitor, with CT connected only on CT1:

ready ...
The Min, Max and Range ADC values for analog inputs 0 to 3:
   0   0   0;     0   0   0;     0 269 269;     0 512 512
   0   0   0;     0   0   0;   249 768 519;   512 513   1
   0   0   0;     0   0   0;   248 764 516;   512 513   1
   0   0   0;     0   0   0;   248 764 516;   512 513   1
   0   0   0;     0   0   0;   248 764 516;   512 513   1

   0   0   0;     0   0   0;   249 767 518;   512 513   1
   0   0   0;     0   0   0;   248 766 518;   512 513   1
   0   0   0;     0   0   0;   248 765 517;   512 513   1
   0   0   0;     0   0   0;   248 765 517;   512 513   1
   0   0   0;     0   0   0;   248 765 517;   512 513   1

   0   0   0;     0   0   0;   250 766 516;   512 513   1
   0   0   0;     0   0   0;   249 765 516;   512 513   1
   0   0   0;     0   0   0;   249 764 515;   512 513   1
   0   0   0;     0   0   0;   249 764 515;   512 513   1
   0   0   0;     0   0   0;   249 764 515;   512 513   1

  Since you know better to read the outcome, as you previous wrote me ADC steps around 511-513 should be fine.

 

Regarding your latest post:

I also checked the shield on a laptop running Windows (my main machine is an imac), and I am still getting these high values.

But you are totally right that there is no reason to worry about such values, since the values that we are using for further processing are the ones within the if settled statement.

 

Thanks a lot for the help.

calypso_rae's picture

Re: Newbie questions on emonTX shield V2

John, the results that you've posted using MinMaxAndRangeChecker show that:

Analog inputs 0 & 1 are earthed.

Analog i/p 2 has an AC signal that occupies 50% of the ADC's range.  The DC bias looks fine.

Analog i/p 3 has the correct DC bias but no AC signal is present.

Is this what you were expecting?  If an AC current was flowing through your CT at the time of these measurements, then either it (or the AC voltage signal) was not being seen by the processor. 

If you turn off the voltage source, do your readings change?

calypso_rae's picture

Re: Newbie questions on emonTX shield V2

John, according to the SolderPad schematic for the emonTx Shield, the AC voltage signal is processed via Analog i/p 0.  CTs 1-4 are processed via Analog inputs 1-4 respectively.  This is different than for the emonTx V2 where the voltage sensor was on An i/p 2. 

The results that you've posted do not suggest to me that your voltage sensor, which needs to be on An 0 for the Shield, is working as intended.

My MinMaxAndRangeChecker sketch does not care what platform it's running on.  Its results will be in different columns according to the hardware platform.

Send me a PM if you're still having difficulties with running this tool.

 

xerox1821's picture

Re: Newbie questions on emonTX shield V2

Hi Robin,

below you can see the settings I ve done in your sketch:

  val_a0 = analogRead(2); //  CT2
  val_a1 = analogRead(3); //  CT3
  val_a2 = analogRead(0); //  Vsensor
  val_a3 = analogRead(1); //  CT1

The results that I previously posted are with CT1 attached on the shield with no current flowing through CT1.

calypso_rae's picture

Re: Newbie questions on emonTX shield V2

OK, that demo sketch was intended to be run without requiring any changes.

 

Comment viewing options

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