emonTx Arduino Shield V2 showing random values for 3 Phase

Hardware Used:

*emonTx Arduino Shield V2, No RF

  • Arduino Mega 2560
  • 3x CT Current Sensor SCT 013 000
  • AC 9V 200mA Philips Voltage Adapter

Power Specs:

  • Voltage: 230V AC
  • Frequency: 50 Hz

Firmware Used:

(Modified code for Shield as mentioned in comments)

double Vcal = 461.42; // Calibration constant for voltage input
double Ical1 = 90.9; // Calibration constant for current transformer 1
double Ical2 = 90.9; // Calibration constant for current transformer 2
double Ical3 = 90.9; // Calibration constant for current transformer 3

Serial Output:

emonTx Shield CT1234 Voltage 3 Phase example
OpenEnergyMonitor.org
Voltage: 221.47
Phase 1: 0.32 A, -22.70 W, 69.99 VA, PF=-0.324
Phase 2: 0.28 A, 0.54 W, 62.78 VA, PF=0.009
Phase 3: 0.49 A, -88.08 W, 109.38 VA, PF=-0.805

Voltage: 205.78
Phase 1: 0.33 A, -28.74 W, 67.54 VA, PF=-0.426
Phase 2: 0.27 A, 2.08 W, 56.29 VA, PF=0.037
Phase 3: 0.48 A, -80.15 W, 97.87 VA, PF=-0.819

Voltage: 186.75
Phase 1: 0.32 A, -21.25 W, 59.46 VA, PF=-0.357
Phase 2: 0.28 A, -2.58 W, 52.83 VA, PF=-0.049
Phase 3: 0.44 A, ovf W, 81.53 VA, PF=ovf

Voltage: 167.20
Phase 1: 0.28 A, -10.60 W, 46.68 VA, PF=-0.227
Phase 2: 0.28 A, -0.92 W, 46.79 VA, PF=-0.020
Phase 3: 0.38 A, -46.25 W, 64.36 VA, PF=-0.719

Voltage: 75.55
Phase 1: 0.27 A, 1.44 W, 20.34 VA, PF=0.071
Phase 2: 0.28 A, ovf W, 21.25 VA, PF=ovf
Phase 3: nan A, ovf W, nan VA, PF=nan

Voltage: 8.01
Phase 1: 0.28 A, -0.03 W, 2.25 VA, PF=-0.013
Phase 2: nan A, ovf W, nan VA, PF=nan
Phase 3: 0.28 A, ovf W, 2.27 VA, PF=ovf

Voltage: 1.82
Phase 1: 0.32 A, -0.21 W, 0.59 VA, PF=-0.356
Phase 2: 0.31 A, -0.06 W, 0.56 VA, PF=-0.100
Phase 3: 0.30 A, ovf W, 0.55 VA, PF=ovf

Voltage: 1.78
Phase 1: 0.32 A, -0.08 W, 0.57 VA, PF=-0.141
Phase 2: 0.28 A, -0.07 W, 0.50 VA, PF=-0.131
Phase 3: 0.30 A, ovf W, 0.53 VA, PF=ovf

Voltage: 0.84
Phase 1: 0.29 A, -0.00 W, 0.24 VA, PF=-0.001
Phase 2: nan A, ovf W, nan VA, PF=nan
Phase 3: 0.29 A, ovf W, 0.24 VA, PF=ovf

Voltage: 0.34
Phase 1: 0.29 A, 0.01 W, 0.10 VA, PF=0.084
Phase 2: nan A, ovf W, nan VA, PF=nan
Phase 3: 0.29 A, ovf W, 0.10 VA, PF=ovf

Problem:

  • Voltage displayed in the first iteration is correct. Post that the voltage falls successively and stabilises at 0.5V~0.6V
  • Current Values are reasonably correct in all iterations (ignoring random nan/ovf)
  • Both Active Power and Power Factor values are incorrect and appear random

Request Glyn and fellow community members to assist

The ‘ovf’ issues for the shield three-phase is mentioned on this thread. Was there any conclusions @Robert.Wall? It’s not clear looking at the thread.

@Shivi does the single-phase example sketch work ok for you?

Could you post a photo showing your setup?

I had to stop all work on the 3-phase sketch as the bugs/shortcomings in the CM Library seemed to be far more important as they potentially affected far more users.

As quick look at Github shows that the latest version didn’t originate from me, so I can’t help.

Are you sure? I don’t think it originated from us. It was commited 9 months ago. Can you remember @TrystanLea. Do you have a emonTx shield three-phase sketch ready to go @Robert.Wall or should the emonTx V3 3-phase sketch be adapted to replace the current shield three phase sketch

It’s been modified by a name I don’t recognise, without any consultation or reference to me. Hence as far as I’m concerned, they have taken over responsibility for it. The reference version I have is “emonTx V3/Shield CT1234 + 3-phase Voltage example” V.7 dated 17/11/2015. This version is common to all variants - done by preprocessor directives.

Oh dear, sorry I don’t think I was involved with this. I can’t see any name in the sketch. Could you post your version here as a. Zip so we can test and perform a diff to see what’s changed?

Setup Picture
https://drive.google.com/file/d/0Bw9ssd4CGLU3QlVteG1wcHVxQkk/view?usp=sharing

Hardwired Connections

Arduino--------emon Shield

RESET--------RST
3.3V------------3V3
5V---------------5V
GND------------GND
Vin--------------Vin
AREF----------AREF
A0--------------ADC 0
A1--------------ADC 1
A2--------------ADC 2
A3--------------ADC 3
A4--------------ADC 4
A5--------------ADC 5
RX0--------------RX0
TX1--------------TX1
PWM 2--------------2
PWM 3--------------3
PWM 4--------------4
PWM 5--------------5
PWM 6--------------6
PWM 7--------------7
PWM 8--------------8
PWM 9--------------9
PWM 10------------10
PWM 11-------------11
PWM 12-------------12
PWM 13-------------13

I have tried the single phase example but no success

Serial Output for 1 Phase Example

emonTX Shield CT123 Voltage example
OpenEnergyMonitor.org
Power 1: 2
Power 2: -3342
Power 3: -3330
Power 4: -3334
Voltage: 69.16

Power 1: 0
Power 2: 0
Power 3: 0
Power 4: 0
Voltage: 0.85

Power 1: 0
Power 2: 0
Power 3: 0
Power 4: 0
Voltage: 0.44

Power 1: 0
Power 2: 0
Power 3: 0
Power 4: 0
Voltage: 0.59

Why is your voltage reading less than 1 V, after everything has settled? You must have a sensible voltage. That indicates that there is something seriously wrong in the voltage measuring department.

Wow, just seen the photo you posted. There is a lot going on here. There does not seem to be any CT sensors or 9V AC-AC adapters plugged into the shield. This could be the cause of your problems

I wish it was the problem as I had removed the CT and Adapter for the sake of clarity.

I’ve spent a few days (at the expense of the CM library!) going through this and I haven’t succeeded in provoking an error. I’ve just incorporated a modified Paul’s error codes for the temperature sensors (300 = faulty sensor, 301 = absent sensor) and I’m waiting to see if he comments on that.

@glyn.hudson
I’ve emailed you the sketch. I’m not prepared to release it until you’ve tested it on a Shield, which I can’t do.