EmonVS - Do I really need this?

Hi, I am planning to use a couple of WiFi enabled emonTX v4s to monitor current draw and temperature for some equipment and I am not concerned with the main electrical panel. The appeal to me of the OpenEnergy solution is the monitoring frequency (15 seconds) and the CMS.

So I ordered the emonVS as well as the emonTX v4s, but in looking at the emonVS, I am wondering why or if I need it versus just powering the emonTX v4 via 5VDC directly without the emonVS.

For my initial setup and testing, I will connect the emonVS, but it seems overkill for my application. What is the downside or what capability do I lose if I don’t use the emonVS?

Thank you,

If you are not interested in power, only current, and you have a 5 V d.c. supply available, then you don’t need the emonVs.

I’ve lost touch with which sketches will offer current-only monitoring and which is the factory default one while I’ve been working on emonLibDB, but I can assure you emonLibDB is not designed to work without a mains voltage reference, so you need to look for a sketch which uses emonLibCM - and by default it will report apparent power. You will almost certainly need to modify it to report current directly.

Depending on how you handle the data from the emonTx, you should be able to get reports of power/current quite a lot faster than 15 second intervals should you need to. The restriction is likely to be the temperature measurements and emonCMS’s ability to process and store the data.

Hi Robert,

Thank you for the reply. Just want to make sure I understand what you are saying. Here is what I understand from your reply:

  • If I use the emonVS then I do NOT need to modify anything.

  • If I remove the emonVS and power via 5VDC directly, then I need to look for the sketch that uses emonLibCM and modify to report current directly. Is the modification at the board level, a jumper, or a configuration setting? This part is unclear.

Thank you,


No, the two things you are concerned about are independent.

The emonTx4 can use either the emonVs or another 5 V d.c. source as its operating power. Note you’ll need about 1 A if you add the Wi-Fi module.

The default sketch loaded in the emonTx4 at the factory uses emonLibDB, an energy monitoring library and it’s this which expects a voltage reference from the a.c. mains supply to work. It’s not been designed to run without. Nor does it handle temperature measurement,

However, the predecessor to this, emonLibCM, has been designed to run without the a.c. mains reference voltage, and it has temperature measurement built in.

The change is in software. You need to get the sketch for the emonTx4 which uses this library, then to be able to read current directly instead of apparent power (i.e. current × the nominal mains voltage) you need to edit the sketch and replace the apparent power value with the current (i.e. delete the " × voltage" in one line where it appears). Then you must compile the sketch and upload it to your emonTx4. If you’re happy to get apparent power and then divide by voltage to get back to current after the emonTx4, then fine - you don’t need to edit the sketch. But you’ll still need to replace the default sketch with another.

I think the information you want is here: Firmware — OpenEnergyMonitor 0.0.1 documentation
and the sketch is
But I’ve not checked or tested this.

Thanks @Robert.Wall

Just a couple of clarifying points:

The default single phase firmware loaded to the emonTx4 is still the emonLibCM version so that temperature sensing can be supported.

The emonLibDB firmware is currently only loaded for 3 phase users or those who order the further 6 CT expansion board (in single or 3 phase configuration).

So @grod55 should have right firmware assuming that this is a single phase setup for operation without an emonVS, though accuracy is obviously significantly impaired without the voltage monitoring.

@grod55 we do also do the a lower cost emonVs-mini option which is just a voltage sensor, it does not include a power supply, this might be of interest emonVS-mini: UK Plug - Shop | OpenEnergyMonitor

Even if the sketch that uses emonLibCM is pre-loaded, @grod55 still needs to get it, edit it and re-load it if he wants a direct measurement of current sent, rather than apparent power.

Ah ok, yes agreed!

Hi Robert,

I found the sketch for emonTx4, version 1.57. There are two files, one is the config. Below are the references to voltage in the non-config file, with my comments in yellow.

I do not find the “x voltage” line that you reference. replace the apparent power value with the current (i.e. delete the " × voltage" in one line where it appears).

Also, when you say – “If you’re happy to get apparent power and then divide by voltage to get back to current after the emonTx4, then fine - you don’t need to edit the sketch. But you’ll still need to replace the default sketch with another.” I am assuming you mean replace emonLibDB with emonLibCM – correct?

Your assistance is greatly appreciated.

Thank you,


bool showCurrents = false; // Print to serial voltage, current & p.f. values

Do I change false to true?

//----------------------------emonTx V4 hard-wired connections-----------------------------------

const byte LEDpin = PIN_PB2; // emonTx V4 LED

const byte DIP_switch1 = PIN_PA4; // RF node ID (default no change in node ID, switch on for nodeID + 1) switch off D8 is HIGH from internal pullup

const byte DIP_switch2 = PIN_PA5; // Voltage selection 240 / 120 V AC (default switch off 240V) - switch off D9 is HIGH from internal pullup

No changes?

Serial.print(F("Reference voltage calibration: "));

No changes?

// Using AVR-DB 1.024V internal voltage reference


EmonLibCM_SetADC_VChannel(0, EEProm.vCal); // ADC Input channel, voltage calibration

EmonLibCM_SetADC_IChannel(3, EEProm.i1Cal, EEProm.i1Lead); // ADC Input channel, current calibration, phase calibration

EmonLibCM_SetADC_IChannel(4, EEProm.i2Cal, EEProm.i2Lead); // The current channels will be read in this order

EmonLibCM_SetADC_IChannel(5, EEProm.i3Cal, EEProm.i3Lead);

EmonLibCM_SetADC_IChannel(6, EEProm.i4Cal, EEProm.i4Lead);

EmonLibCM_SetADC_IChannel(8, EEProm.i5Cal, EEProm.i5Lead);

EmonLibCM_SetADC_IChannel(9, EEProm.i6Cal, EEProm.i6Lead);

// to show voltage, current & power factor for calibration:

Serial.print(F(",I1:")); Serial.print(EmonLibCM_getIrms(EmonLibCM_getLogicalChannel(1)),3);

Serial.print(F(",I2:")); Serial.print(EmonLibCM_getIrms(EmonLibCM_getLogicalChannel(2)),3);

Serial.print(F(",I3:")); Serial.print(EmonLibCM_getIrms(EmonLibCM_getLogicalChannel(3)),3);

Serial.print(F(",I4:")); Serial.print(EmonLibCM_getIrms(EmonLibCM_getLogicalChannel(4)),3);

Serial.print(F(",I5:")); Serial.print(EmonLibCM_getIrms(EmonLibCM_getLogicalChannel(5)),3);

Serial.print(F(",I6:")); Serial.print(EmonLibCM_getIrms(EmonLibCM_getLogicalChannel(6)),3);

Serial.print(F(",pf1:")); Serial.print(EmonLibCM_getPF(EmonLibCM_getLogicalChannel(1)),4);

Serial.print(F(",pf2:")); Serial.print(EmonLibCM_getPF(EmonLibCM_getLogicalChannel(2)),4);

Serial.print(F(",pf3:")); Serial.print(EmonLibCM_getPF(EmonLibCM_getLogicalChannel(3)),4);

Serial.print(F(",pf4:")); Serial.print(EmonLibCM_getPF(EmonLibCM_getLogicalChannel(4)),4);

Serial.print(F(",pf5:")); Serial.print(EmonLibCM_getPF(EmonLibCM_getLogicalChannel(5)),4);

Serial.print(F(",pf6:")); Serial.println(EmonLibCM_getPF(EmonLibCM_getLogicalChannel(6)),4);


Sorry, yes, my brain appears to have been asleep when I wrote those lines. Unfortunately, it’s not working properly now either - it’s too hot here to think straight.

The sketch you want is indeed EmonTxV4_6x_temperature
This does use emonLibCM, so this should not be changed. (You can get the full documentation on emonLibCM by downloading it from the forum here: https://community.openenergymonitor.org/t/emonlibcm-version-2-2-2/

How are you getting the data out of your emonTx? This is likely to have a bearing on the changes you need (or don’t need) to make.

What you need in any case is as you rightly say: EmonLibCM_getIrms(…) will get the actual current on its own. The potential catch is, it’s a double, and if you’re not careful it’ll get truncated to an integer (Power or VA is big enough to be OK as an integer, current isn’t).

If you’re using the radio, but I suspect you might not be, you should multiply by 10 or 100 before it gets truncated when it’s assigned to an integer, then you’ll have one or two decimal places when you restore it later.

If you’re using only the serial USB connection, the code for this is inside the if
if (EEProm.json_enabled) { ... }
and the obvious best way to add the current is to change the serial.print(...) for the relevant P to (e.g.)
Serial.print(F(",\"P1\":")); Serial.print(EmonLibCM_getIrms(0)); or add it as another line,
and this automatically gives a human-readable number to 2 places of decimal, and ignores the r.f. data structure completely.

Sorry, no ‘special’ formatting is allowed by Discourse, so apologies if I’ve missed a question. I’d recommend you use the forum-then you can see your post as I see it
EmonVS - Do I really need this? - #8 by grod55

No - this is debugging print for use when calibrating.

You set the calibration etc by doing it via the serial port (‘on-line’) and saving the new values to EEPROM. This what the ‘conf’ file does. However, the defaults are in the EEProm structure at the top of the main source file, so if you know the approximate values in advance, you can change the defaults here.

Don’t change anything else until you’re sure of the consequences.

Hi Robert,

My intent is to use this setup on a split AC system, which is why I ordered 2 emonTX4s. One of the emonTX4s will have 2 CTs. The first CT will clamp onto the compressor power source and the other CT will clamp onto the compressor fan power source. This unit is typically outside of a building – so this is why I wanted wifi as the network connection. The second emonTX4 will be inside the building at the HVAC unit and will have 1 CT to connect to the supply fan power source, plus 2 temperature probes to measure return air and conditioned air. This TX4 will also be connected by wifi. The plan is that this solution will help in diagnosing HVAC issues. A bad compressor will have a very high current draw (often at its rating limit), this is why I want to measure current.

One of the things that is appealing about the emon setup is the frequency of reporting and the emonCMS. Other systems that I have looked at do not provide this level of granularity. A Raspberry PI based solution seemed to be the path to take, and then I found the OpenEnergy community and thought I would see if this approach would work. I am not a programmer and have just enough rudimentary knowledge to get myself into trouble quickly.

Hopefully, this helps you understand what I am trying to accomplish.

I do appreciate all the help you are providing, and this has been a great learning experience.

Best regards,


Hello Gordon

Reading through the last couple of posts I think the most straight forward solution is to leave the firmware on both EmonTx4 units unchanged (assuming you haven’t changed them yet?)

Then in Emoncms as Robert suggested the data will be reported as apparent power. You can then if you wish divide by 240V to give you the current value on each channel.

This would look like this in Emoncms:

0.004167 being 1/240

Hi Trystan,

Thank you. I have not changed anything, so this seems the best approach.

Greatly appreciated.