I’d like to announce a new firmware for the emonTx3 which does continuous sampling. It provides high rate continuous sampling (19230 samples per second), uses all four channels and provides extensive information about your power and energy usage.
The firmware is here: https://github.com/CraigMarkwardt/emontx3-continuous
I’ve been using it for the past few months and I have experienced accuracies of better than 1% compared to my official utility bills. I know there are several other attempts at doing continuous monitoring, but felt that my approach was significantly different and added enough capabilities, that it was worth publishing to the community. In particular, the fast sampling, true reactive power sampling, and continuous utility energy reporting are things I had not seen before.
Please enjoy! More details below, and a full report can be found on the github main page.
This is emontx3-continuous, a firmware for emonTx energy monitors using an Arduino microcontroller. Its key benefits are that it provides high rate (19230 samples/second) continuous sample of your power usage and reports cumulative energy use like a utility meter. It reports your active and reactive power usage to allow you to distinguish between resistive, capacitive and inductive loads in your household. It also reports your mains voltage, frequency and mains quality. It is designed to work with the “EmonESP” ESP8266 wifi output, transformer input, and 5V USB.
This firmware is recommended for users who:
- intend to connect via EmonESP (not the built-in RFM69)
- have an AC transformer input to measure mains voltage
- want to achieve maximum accuracy through calibration (which requires rebuilding the firmware using the Arduino IDE)
This firmware is not recommended for users who:
- use an emonBase (via the on-board RFM69); because RFM69 support is not possible
- don’t have the AC-AC voltage sensor adapter; because the features of emonTx3-continuous require the mains voltage input.
The emontx3-continuous firmware has the following features.
- Continuously samples inputs at 19230 samples/second, or 3846 samples/second for each input channel, with full 10-bit ADC resolution
- Intended to be used with “EmonESP” wifi transmitter
- This sample rate is equivalent to 77 samples per 50 Hz AC waveform and 64 samples per 60 Hz AC waveform, which allows to capture most fast power transients such as switch-mode power supplies.
- Supports all four emonTx current transformer inputs
- Requires AC-AC voltage sense input, so that mains voltage can be measured
- For each input channel reports, RMS current, power factor, active, reactive and apparent power. Active power is power in-phase with the mains voltage such as incandescent bulbs; and reactive power is 90 degrees out-of-phase with mains voltage (typically AC motors, compressors and fans).
- Reports total cumulative active and reactive energy usage. This is cumulative and builds up over time, just like a utility meter.
- Reports the AC mains voltage, mains frequency to three digits of accuracy, and the AC crest factor, which can be used to diagnose AC power faults.
- Automatically determines mains AC frequency at startup (50 Hz or 60 Hz)
- Is fully calibratable. Voltage, current and phase offset calibration factors are availaable.
- Adjusts for sample time offsets beteween voltage and current, with accuracy of better than 1%.
- Should be compatible with 3-phase power systems. The phase offset variables can be set to align all inputs to one voltage leg.
- Measures pulse input to allow utility meter pulse input (not tested).
- Reports other diagnostic information such as uptime, version, and internal buffer sizes.
Features not supported
- the firmware uses features specific to the Atmel hardware, and will be difficult to port to other architectures.
- the RFM69 transmitter on-board the emonTx is not supported; the transmitter software library is not compatible with the methods used by emonTx3-continous to achieve high sample rates (it is busy-wait driven instead of interrupt-driven).
- the standard emonTx temperature/humidity sensor accessory is not usable because the DallasTemperature library is not compatible with the methods used by emonTx3-continous to achieve high sample rates (it is busy-wait driven instead of interrupt-driven).
- a mains AC-AC transformer is required. No-voltage input is not supported. Without the AC-AC transformer, accuracy will be much lower and you may as well use the standard emonTx firmware.
- because of the AC-AC transformer requirement, you will also need to power the unit separately with 5VDC (with the USB input, for example)
The emontx-continuous provides many readings about your home power system. Since it is different and more advanced than the standard emonTx firmware, do not expect the readings to be exactly the same. You will need to develop new charts and visualizations for all the data you are producing. Here is a description of the data fields.
Readings are produced with a 4-character name, such as “vrms” which identify the reading, and may be an integer or floating point value. Note that some readings start with an underscore, such as _ever. These are intended to be MQTT “retained” readings that are kept for late clients, and are typically reserved for readings which are diagnostic in nature.
emontx-continuous provides readings about your mains voltage, frequency and quality. This can inform you about the quality of mains voltage you are receiving from your utility. These values are reported every 10 seconds.
- vman - mains AC voltage dip switch setting, in volts. Either 120 or 240.
- vrms - mains AC voltage, in volts.
- vfrq - mains AC frequency, in Hertz.
- vcrs - mains AC crest factor, as a fraction. This is a diagnostic of your mains voltage quality. Crest factor is defined as Vmax/Vac where Vmax is the maximum voltage and Vac is the AC (rms) voltage. For typical AC voltage, the crest factor is 1.414; deviations indicate non-sinusoidal voltage condition.
emontx-continuous reports power usage of each of the four inputs. It reports the rms current, active and reactive power, and power factor. These readings are produced every 30 seconds, and represent the average power usage over the past 30 second interval.
- irmsN - for current sensor N, rms current usage in Amps.
- pacN - for current sensor N, active power usage in Watts.
- preN - for current sensor N, reactive power usage in Watts. A positive value indicates capacitive load, negative indicates inductive.
- powN - for current sensor N, fractional power factor. Power factor is defined as powN = pacN / papN, where papN = (vrms*irmsN) is the apparent power usage.
Cumulative energy monitoring
emontx-continuous reports cumulative energy usage just like an energy meter. It is the true continuous sum of energy usage without interruptions, averaged over the full waveform of every AC cycle. The reported values are produced every 60 seconds, and represent the sum of all available input channels.
- _enac - total cumulative active energy usage, in kWh, for all four input channels combined.
- _enre - total cumulative reactive energy usage, in kWh, for all four input channels combined. Your power company typically does not bill you for this energy usage.
If you have a utility meter with LED pulser, you can retrieve these pulses with a pulse sensor.
- pulse - The reported value is total number of pulses received since startup.
These diagnostics are typically not useful for reporting home energy usage, but are useful for diagnosing the state of the device itself.
- _ever - emonTx firmware version, as a 4-digit integer number.
- _uptm - total system uptime, in seconds, since last reset.
- _adcd - maximum ADC ring buffer depth. A diagnostic which indicates possible processing overload.
- _novr - number of ADC samples lost due to ring buffer overflow. Any value different than zero indicates processor overload.
- vdel - correction factor for out-of-phase voltage readings, as a fractional quantity.
More information on how it works and how to use it on the github page.
Reformatted post for readability and corrected RFM96 to RFM69 - BT, Moderator