The EmonTxV3 Continuous Monitoring firmware is now available to download on github here: https://github.com/openenergymonitor/EmonTxV3CM (version 1.0-beta).
The firmware is a replacement for the standard EmonTxV3 Discrete Sampling firmware that comes pre-programmed on the EmonTxV3 units that we send out. It uses the EmonLibCM library maintained by @Robert.Wall, available here:
- Github: https://github.com/openenergymonitor/EmonLibCM.
- Original forum post: EmonLibCM - Version 2.01
EmonTxV3CM provides better results than the discrete sampling firmware which uses the emonLib library, especially where PV Diverters or other fast changing loads are in use. The EmonLibCM library continuously measures in the background the voltage and all the current input channels in turn and calculates a true average quantity for each.
- Continuous Monitoring on all four EmonTxV3 CT channels and ACAC Voltage input channel.
- Real power (Watts) and cumulative energy (Watt-hours) measurement per CT channel.
- RMS Voltage measurement.
- Support for 3x DS18B20 temperature sensors.
- Support for pulse counting.
- Resulting readings transmitted via RFM radio and printed to serial.
- Serial configuration of RFM radio and calibration values.
How to use
Either download directly or use ‘git clone’ to download this repository into a directory called EmonTxV3CM in your Arduino Sketchbook directory. Ensure that both EmonTxV3CM.ino and config.ino are in the same folder.
Either download directly or use ‘git clone’ to download the EmonLibCM library into your Arduino Libraries directory.
Either download directly or use ‘git clone’ to download the JeeLib library into your Arduino Libraries directory.
Open the Arduino IDE (or restart, to reload the libraries). Open the EmonTxV3CM firmware, ensure that both EmonTxV3CM.ino and config.ino are present as two tabs in the IDE when the firmware is open.
Use a 5v USB to UART cable to upload the firmware to emonTx.
Configure EmonHub on the receiving base station to decode the RFM data packet using the decoder below, note data whitening setting.
Todo: PlatformIO compilation and upload instructions.
To decode the data packet sent by this firmware, add the following emonhub node configuration to /etc/emonhub/emonhub.conf (configurable via the web interface on an EmonBase or EmonPi).
Note: This firmware uses data whitening to improve the reliability of the data transmission. A standard pattern of 1s and 0s is overlayed on the underlying data, this prevents sync issues that result from too many zero values in a packet. When the packet is received it is decoded by emonhub. The ‘whitening = 1’ is required to tell emonhub to decode the packet correctly.
[] nodename = emontx8 [[[rx]]] names = MSG, Vrms, P1, P2, P3, P4, E1, E2, E3, E4, T1, T2, T3, pulse datacodes = L,h,h,h,h,h,L,L,L,L,h,h,h,L scales = 1,0.01,1,1,1,1,1,1,1,1,0.01,0.01,0.01,1 units = n,V,W,W,W,W,Wh,Wh,Wh,Wh,C,C,C,p whitening = 1
Serial configuration currently supports configuration of the RFM radio and current & voltage channels. Serial configuration of temperature sensors, pulse input and data log period is currently disabled. See commented sections of code. Further work and testing is required to enable these features.
This firmware example is open source, licensed under GNU General Public License v3.0.
We will be switching over to using this firmware as standard on the EmonTx units that we send out in due course after a period of open beta testing.