No Vrms reading from emonTx v2

Decided to try to send Vrms voltage from emonTx but I’m getting 0V. Is the fault in the sketch?
I’ve checked the ac-ac adapter & it’s putting out approx 12V with no load

my_emonTx_v2_12-03-2019_3.ino (7.2 KB)

No. It’s giving me credible voltage and power readings, both on the monitor and by radio (but you’re not actually calculating and assigning the values of apparent power - when I add those, it’s populating and transmitting those numbers as well).

So where are you expecting to read the voltage and you’re not?

N.B. If it wasn’t using the voltage, the powers would be zero, or very small.


ct1 = -8229W	ct2 = -7763W	ct3 = -7860W	Vrms = 25866V

ct1 = -8215W	ct2 = -7763W	ct3 = -7856W	Vrms = 25847V

ct1 = -8233W	ct2 = -7772W	ct3 = -7859W	Vrms = 25870V

ct1 = -8247W	ct2 = -7788W	ct3 = -7886W	Vrms = 25899V

ct1 = -8263W	ct2 = -7793W	ct3 = -7902W	Vrms = 25923V

I receive power readings on the serial port of emonGLCD for ct1 & ct2 (I don’t use ct3) but 0V Vrms. On emonBasePi I get Vrms = 0.14.
I haven’t looked at serial output on emonTx yet

Don’t understand this remark

Because it multiplies the voltage by current to get power, it must be using the voltage internally in the calculation, so the voltage is lost somewhere in transmission. For me, it’s getting sent, so you need to look at the GLCD sketch and trace it through onto the screen; and for the Base, it looks as if you might be picking up the wrong bytes and calling them voltage - remember that you need a non-standard entry in emonhub.conf as you’re sending the data in a different format to any of the examples in there.

Yours should look like this:

[[10]]
    nodename = emontx1
    [[[rx]]]
       names = power1, app1, power2, app2, power3, app3, vrms
       datacode = h
       scales = 1,1,1,1,1,1,0.01
       units =W,x,W,x,W,x,V

It’s late, I should have understood this

OK, changed [[10]] to yor suggestion & now I’m getting 2.54 reading in emonBase Pi Vrms; my actual meter reading is 248V so I assume a x100 or so to give a correct reading?

Are you dividing by 100 twice? The value sent by the emonTx is centivolts :open_mouth:, (as post no.2 above) so I put “0.01” in the “scales = ” line to bring it back to volts. If you’re dividing again by 100 in emoncms, then doing it twice is wrong, and you need to get rid of one or the other.

In emonTx the line is: emontx.Vrms = ct1.Vrms*100;
In emonBasePi it’s the raw value of 2.54 so should I multiply 2.54 by 97.24 to give 248V?

But where in the emonBase are you looking? There are two, more or less independent, parts to your emonBase:

  1. The radio signal is received and passed as a serial data stream to emonHub. That interprets it according to the rules in emonhub.conf. EmonHub then sends the interpreted data to:
  2. emonCMS, where it appears on the Inputs page. There, you can do various operations on it, including scaling, and send it to a Feed for storage. (The On-line emoncms.org doesn’t have emonHub.)

So I think you have a divide-by-100 (or multiply by 0.01) in both emonhub.conf and in the Input page of emonCMS. Rather than multiplying by 100, you should take one of those out.

Changed [[10]] scales = 1,1,1,1,1,1,0.01 to scales = 1,1,1,1,1,1,1 & now Vrms = 255. Is that accurate enough?

That’s your decision! The “right” place to get it accurate is in your emonTx sketch: change the “238.56” in the 3 places it appears.
ct1.voltageTX(238.56, 1.7);

Do you mean change ct1.voltageTX(238.56, 1.7) to ct1.voltageTX(255, 1.7);

No, that will make the reading you get even higher. That number is the voltage that gives 1 V at the input to the ADC in your emonTx, it’s not the voltage you want it to read. If you mains voltage is exactly the nominal 240 V, and you’re reading 255 V from the emonTx, then the new voltage calibration constant will be 238.56 × 240 ÷ 255 = 224.53.
You must read the true mains voltage with a meter, and note that and the reading you see from the emonTx, and use those numbers.

Now getting a reading within 3V of actual mains voltage so that’s close enough.
Thanks robert

Just noticed that the Vrms value appears correctly in emonBase & emoncms (.org & local) but zero on emonGLCD serial

//power1 = grid, power2 = not used, power3 = solar, Vrms = mains voltage, consuming = grid + solar
typedef struct { int power1, power2, power3, Vrms; } PayloadTX;
PayloadTX emontx;

Produces this serial output:
Page 1 emontx: grid = 615W solar = 0W consuming = 615W Vrms = 0V

Any suggestions?

Remind me which emonGLCD sketch you’re using. It sounds as if you need to be looking in there to see where it’s gone AWOL.

Looking at your emonTx V2 sketch, the payload for that is

typedef struct
{
  int power1, app1;     //consuming/grid power  app1 = apparent power
  int power2, app2;     //solar PV
  int power3, app3;     //pulse grid power
  int Vrms;
}

If that’s correct, your GLCD is not receiving its data direct from the emonTx. The two data structures must match for that to happen. (See Learn→Electricity Monitoring→Networking→Sending data between nodes→Sending data between nodes with the RFM12/69)

There seems to a contradiction. My emonGLCD sketch states “The sketch assumes emonx.power1 is consuming/grid power and emontx.power3 is solar PV generation”. My emonTx sketch states "int power3, app3; //solar power – app3 = apparent power (when using batteries to power emonTx).
I only get a reading if I use CT2 for solar (I assume int power1 equates to CT1, int power2 equates to CT2 & int power3 equates to CT3

My_emonGLCD_17-3-2019_1.ino (23.5 KB)

my_emonTx_v2_13-03-2019_2.ino (7.9 KB)

I’ll load those sketches and see what I can find. At first sight, they shouldn’t be working at all because the payloads don’t match. If you read the link I gave you, you’ll see that the names mean nothing in the air, it the positions of the data bytes that count. This is how they line up:

emonTx emonGLCD
power1 power1
app1 power2
power2 power3
app2 ?
power3 ?
app3 ?
Vrms ?

As I understand it app1, app2 & app3 are used if running on batteries which I’m not hence I don’t use them

No, they are just empty values - they don’t exist anywhere else in the sketch, so they can NEVER have a value other than zero. But don’t take them out - it will have repercussions in your Nanode/emonBase and emonCMS.

There’s only part of your GLCD sketch there, where is the rest?