Difference between revisions of "EmonTx V3.4"

From OpenEnergyMonitor Wiki
Jump to: navigation, search
(Optical Pulse Counting)
m
 
(43 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
=emonTx V3.4=
 
=emonTx V3.4=
The emonTx V3.4 is the latest version of the emonTx Low Power Wireless Energy Monitoring Node designed for monitoring AC electrical power on (up to) 4 separate (household/building) circuits using non-invasive clip on CT current sensors and an AC-AC Voltage adapter to provide a voltage signal for full Real Power calculations. The emonTx V3.4 is a minor update to the [[emonTx_V3]]
+
The emonTx V3.4 is the latest version of the emonTx Low Power Wireless Energy Monitoring Node designed for monitoring AC electrical power on a maximum of 4 separate (household/building) circuits using non-invasive clip-on CT sensors and an AC-AC Voltage adapter to provide a voltage signal for Real Power calculations. The emonTx V3.4 is a minor update to the [[emonTx_V3]]
  
 
[[File:emontx_V3_4_top.jpg|750 px|emonTx V3.4]]
 
[[File:emontx_V3_4_top.jpg|750 px|emonTx V3.4]]
Line 15: Line 15:
 
* An on-board 3x AA battery option '''with remote monitoring of battery voltage'''
 
* An on-board 3x AA battery option '''with remote monitoring of battery voltage'''
 
* Terminal block access to power rails, digital and analogue I/O and IRQ port for connecting pulse counting sensor / DS18B20 temperature / Aux sensors  
 
* Terminal block access to power rails, digital and analogue I/O and IRQ port for connecting pulse counting sensor / DS18B20 temperature / Aux sensors  
* '''DIP switch selection of RF node ID and 240V/110V AC adapter selection, see [[#DIP Switch Config]]'''
+
* '''DIP switch selection of RF node ID and 240V/120V AC adapter selection, see [[#DIP Switch Config]]'''
 
<nowiki>
 
<nowiki>
 
* when AC-AC voltage adapter is connected
 
* when AC-AC voltage adapter is connected
Line 34: Line 34:
 
==Overview==
 
==Overview==
  
Using an ATmega328 microprocessor the emonTx V3.4 runs standard Arduino sketches and is easy to customise and upload code using the Arduino IDE and a USB to UART cable.
+
Using an ATmega328 microprocessor, the emonTx V3.4 runs standard Arduino sketches. It is easy to customise and upload code using the Arduino IDE and a USB to UART cable.
 
+
The data from the emonTx V3.4 is transmitted via wireless RFM12B / RFM68CW (433/868Mhz) to an emonBase web-connected base-station (we recommend a Raspberry Pi with an RFM12Pi) which then posts the data onto an emoncms server (e.g. http://emoncms.org) for logging, processing and graphing.
+
  
 +
The data from the emonTx V3.4 is transmitted via an RFM12B / RFM68CW 433/868 MHz radio to an emonBase web-connected base-station (we recommend a Raspberry Pi with an RFM12Pi) which then posts the data onto an emoncms server (e.g. http://emoncms.org) for logging, processing and graphing.
  
 
==DIP Switch Config==
 
==DIP Switch Config==
  
The emonTx V3.4 has a couple of DIP switches allowing changing of node ID and setting UK/EU or US AC-AC adapter calibration without having to change the firmware. The unit must be restarted after changing DIP switch positions. Default DIP switch selection (both off) is node ID 10 and 240V AC.   
+
The emonTx V3.4 has two DIP switches enabling selection of RF node ID and setting UK/EU or US AC-AC adapter choice without having to change the firmware. The unit must be restarted after changing DIP switch positions. Default DIP switch selection (both off) is node ID 10 and 240V AC.   
 +
 
 +
'''Note: newer emonTx V3 firmware (V2.3+) use node ID 8 and 7, instead of 10 and 9 (shown below) see [https://github.com/openenergymonitor/emonhub/blob/emon-pi/configuration.md#emontx-v3-emontxv3_4_discretesamplingino-v23 emonhub config guide] for more info'''
 +
 
 +
'''Note#2: RF node ID can now be set using serial config. See [https://community.openenergymonitor.org/t/emontx-emonth-configure-rf-settings-via-serial-released-fw-v2-6-v3-2/2064 forum post]'''
  
 
[[file:EmonTx_V3.4_DIP_Switch.jpg]]
 
[[file:EmonTx_V3.4_DIP_Switch.jpg]]
 
  
 
==Power Supply Options==
 
==Power Supply Options==
Line 56: Line 58:
  
 
===Powering via DC (1-3)===
 
===Powering via DC (1-3)===
When powering the emonTx V3 via DC (1-3) (and running the main emonTx firmware ([https://github.com/openenergymonitor/emonTxFirmware/tree/master/emonTxV3/RFM12B/emonTxV3_RFM12B_DiscreteSampling emonTxV3_RFM12B_DiscreteSampling])) the emonTx V3 will take Apparent Power measurements, measuring only current, assuming the Power Factor of 1 and Vrms to be 230V, power saving mode will also be implemented, going into sleep mode in between readings (default every 10s) to save battery power.
+
When powering the emonTx V3 via DC (1-3) and running the default emonTx firmware the emonTx V3 will take Apparent Power measurements, measuring only current, assuming the Power Factor of 1 and Vrms to be 230V, power saving mode will also be implemented, going into sleep mode between readings (default every 10s) to save battery power.
  
 
'''The red LED indicator will illuminate for a couple of seconds then extinguish never to flash again if powering from a DC source. If the LED flashes multiple times at startup this indicates the emonTx is detecting an AC waveform - this can happen if an AC adapter has just been removed, hit the reset button if this occurs. When powering the unit via 5V USB/battery it is advisable to remove the JP2 jumper if an AC-AC adapter is present.'''
 
'''The red LED indicator will illuminate for a couple of seconds then extinguish never to flash again if powering from a DC source. If the LED flashes multiple times at startup this indicates the emonTx is detecting an AC waveform - this can happen if an AC adapter has just been removed, hit the reset button if this occurs. When powering the unit via 5V USB/battery it is advisable to remove the JP2 jumper if an AC-AC adapter is present.'''
  
 
===Powering via AC (4)===
 
===Powering via AC (4)===
A nice feature of the emonTx V3 is the ability to use an AC-AC adapter to power the unit at the same time as simultaneously providing an AC voltage waveform sample. If the emonTx V3 detects the presence of an AC waveform (AC adapter connected) at startup it will automatically implement Real Power and Vrms measurements by sampling the AC waveform. Real Power is what you get billed for and can sometimes (depending on the appliances connected to the circuit being monitored) vary significantly from Apparent Power - see Building Blocks for more info on AC power theory. For best power monitoring accuracy we recommend powering with an AC-AC adapter whenever possible.
+
A nice feature of the emonTx V3 is the ability to use an AC-AC adapter to power the unit while simultaneously providing an AC voltage sample. If the emonTx V3 detects the presence of an AC adapter at startup, it will automatically implement Real Power and Vrms measurements by sampling the AC voltage. Real Power is what you get billed for, and depending on the appliances connected to the circuit being monitored, can vary significantly from Apparent Power - see Building Blocks for more info on AC power theory. For best energy monitoring accuracy, we recommend powering the EmonTX with an AC-AC adapter whenever possible.
 
+
Using the AC voltage waveform for reference also enables the emonTx to monitor the direction of the current flow, this is important for solar PV monitoring. If you notice a negative reading when you were expecting a positive one, flip the orientation of the CT. '''The red indicator LED will flash at startup then flash once every 10 s to indicate that an AC waveform has been detected'''. Sleep mode will be disabled to keep a more consistent power draw on the AC circuit.
+
 
+
''Important note regarding powering with AC: powering via AC is only recommended for standard emonTx operation without auxiliary sensors (apart from up to 4 DS18B20 temperature sensors) or equipment (e.g. relay modules) connected. Correct operation via the ac supply is critically dependent upon using the correct ac-ac adapter. If you are using the recommended ac-ac adapter and the current draw exceeds 10 mA and the mains supply is below the minimum allowable, then the circuit operation will be impaired, adversely affecting the reading accuracy of the emonTx. To avoid damage to the emonTx V3's circuits, the current drawn from the AC circuit should never exceed 60mA - see technical wiki for more info. If more than 10 mA of current is required it is recommended to remove jumper 2 (JP2) and power the emonTx via 5V USB. When JP2 is removed, the AC-AC adapter if connected will only be used to provide an AC sample. It will not power the emonTx.''
+
 
+
==Uploading Arduino Firmware==
+
 
+
===Compiling and Uploading using Arduino IDE===
+
The emonTx V3 uses the ATmega328 microcontroller (same as Arduino Uno) and comes with the Optiboot (Arduino Uno) serial bootloader installed. This makes it super easy to upload new code to the emonTx V3 from the Arduino IDE.  
+
  
 +
Using the AC voltage for reference also enables the emonTx to monitor the direction of current flow. This is important for solar PV monitoring. If you notice a negative reading when you were expecting a positive one, reverse the orientation of the CT on the conductor. '''The red indicator LED will flash at startup then flash once every 10 seconds to indicate an AC waveform has been detected'''. Sleep mode will be disabled to keep a more consistent power draw on the AC circuit.
  
'''A [http://shop.openenergymonitor.com/programmers/ USB to UART cable] is required to upload new Arduino firmware sketches'''
+
''Important note regarding powering with AC: powering via AC is recommended only for standard emonTx operation without auxiliary sensors (apart from a maximum of 4 DS18B20 temperature sensors) or equipment (e.g. relay modules) connected. Correct operation via the AC supply is critically dependent upon using the correct AC-AC adapter. If you are using the recommended AC-AC adapter and the current draw exceeds 10 mA and the mains supply is below the minimum allowable, then circuit operation will be impaired, adversely affecting the accuracy of the emonTx. To avoid damage to the emonTx V3 circuits, the current drawn from the AC circuit should never exceed 60mA - see the technical wiki for more info. If more than 10 mA of current is required, it is recommended to remove jumper 2 (JP2) and power the emonTx via the 5V mini-USB connector. When JP2 is removed, the AC-AC adapter (if connected) will be used only to provide an AC voltage sample, i.e. it will not power the emonTx.''
  
 +
==Uploading Firmware==
  
Start by downloading the firmware, libraries and setting up the Arduino programming environment by following this guide:
+
Latest firmware source code and compiling instructions can be found in the Firmware section of emonTx 3 Github:
  
[http://openenergymonitor.org/emon/buildingblocks/setting-up-the-arduino-environment Setting up the Arduino Programming Environment]
+
[https://github.com/openenergymonitor/emontx3 https://github.com/openenergymonitor/emontx3]
  
Once complete the emonTx V3 firmware location should be navigable from within the Arduino IDE by going to:
+
Also see compiling instructions are part of the user guide:
  
''File > Sketchbook > OpenEnergyMonitor > emonTxFirmware > emonTxV3''
+
[https://guide.openenergymonitor.org/technical/compiling https://guide.openenergymonitor.org/technical/compiling]
  
 
===Flashing Pre-compiled .hex===
 
===Flashing Pre-compiled .hex===
  
The main emonTx V3.4 for RFM69CW ''[https://github.com/openenergymonitor/emonTxFirmware/tree/master/emonTxV3/RFM69CW/emonTxV3_RFM69CW_DiscreteSampling]'' firmware as pre-loaded onto pre-build emonTx is also supplied as a pre-compiled .hex file.  
+
The main emonTx v3.4 RFM69CW firmware as pre-loaded onto pre-build emonTx, is also supplied as a pre-compiled .hex file. Download from:
  
GitHub can be used to make sure you have the latest version:
+
[[https://github.com/openenergymonitor/emontx3/releases https://github.com/openenergymonitor/emontx3/releases]
  
<code>
 
$ git clone https://github.com/openenergymonitor/emonTxFirmware.git
 
</code>
 
  
 
'''Linux''' : use AVRdude
 
'''Linux''' : use AVRdude
Line 100: Line 92:
 
<code> $ avrdude -v  -c arduino -p ATMEGA328P -P /dev/ttyUSB0 -b 115200 -U flash:w:emonTxV3_RFM69CW_DiscreteSampling_433.cpp.hexx</code>
 
<code> $ avrdude -v  -c arduino -p ATMEGA328P -P /dev/ttyUSB0 -b 115200 -U flash:w:emonTxV3_RFM69CW_DiscreteSampling_433.cpp.hexx</code>
  
Specifying the USB port of your USB to UART programmer and the correct name and location of the .hex file
+
Specify the port your USB to UART programmer is connected to, and the path name of the .hex file
  
'''Windows''' :you might be able to use the the [http://www.hobbytronics.co.uk/arduino-xloader XLoader] application to upload .hex files (we have not tested this ourselves, please update wiki if you have)
+
'''Windows''' :you might be able to use the the [http://www.hobbytronics.co.uk/arduino-xloader XLoader] application to upload .hex files (we have not tested this, please update the wiki if you have)
  
 
===Flashing the Bootloader===
 
===Flashing the Bootloader===
  
''Should not be required''
+
''Not normally required''
  
The OptioBoot Arduino Uno serial bootloader should be ready loaded onto the ATmega328 on the emonTx in the factory. If however for any reason you need to re-upload the bootloader and set the fuses this can be done:
+
The OptioBoot Arduino Uno serial bootloader should be ready loaded onto the ATmega328 on the emonTx from the factory. If however, for any reason you need to reload the bootloader and set the fuses, here is the procedure:
 
+
The stock emonTx firmware can be downloaded in pre-compiled .hex form including the bootloader from github, look for .hex file including the word "bootloader" in the title on the emonTx V3 GitHub. 
+
  
 +
The stock emonTx firmware including the bootloader, can be downloaded in pre-compiled .hex form from github. Look for a .hex file including the word "bootloader" in the title, on the emonTx V3 GitHub page. 
  
 
The .hex file can be flashed, and the fuses set, on the ATmega328 using the following avrdude command:   
 
The .hex file can be flashed, and the fuses set, on the ATmega328 using the following avrdude command:   
Line 117: Line 108:
 
<code><pre>$ sudo avrdude -v -p atmega328p -c avrispmkII -P usb -e -Ulock:w:0x3F:m -Uefuse:w:0x05:m -Uhfuse:w:0xDE:m -Ulfuse:w:0xFF:m -U flash:w:emonTxV3_4_RFM12B_DiscreteSampling_bootloader.cpp.hex:i  -Ulock:w:0x0F:m</pre></code>
 
<code><pre>$ sudo avrdude -v -p atmega328p -c avrispmkII -P usb -e -Ulock:w:0x3F:m -Uefuse:w:0x05:m -Uhfuse:w:0xDE:m -Ulfuse:w:0xFF:m -U flash:w:emonTxV3_4_RFM12B_DiscreteSampling_bootloader.cpp.hex:i  -Ulock:w:0x0F:m</pre></code>
  
or to speed things up:
+
or, to speed things up:
  
 
<code><pre>$ sudo avrdude -V -u -p atmega328p -c avrispmkII -P usb -e -Ulock:w:0x3F:m -Uefuse:w:0x05:m -Uhfuse:w:0xDE:m -Ulfuse:w:0xFF:m -U flash:w:emonTxV3_4_RFM12B_DiscreteSampling_bootloader.cpp.hex:i  -Ulock:w:0x0F:m</pre></code>
 
<code><pre>$ sudo avrdude -V -u -p atmega328p -c avrispmkII -P usb -e -Ulock:w:0x3F:m -Uefuse:w:0x05:m -Uhfuse:w:0xDE:m -Ulfuse:w:0xFF:m -U flash:w:emonTxV3_4_RFM12B_DiscreteSampling_bootloader.cpp.hex:i  -Ulock:w:0x0F:m</pre></code>
  
If, for any reason (e.g to make a backup) you want to read the data back from the ATmega328 this can be done with:
+
If, for any reason e.g to make a backup, you want to read the data ''from'' the ATmega328 this can be done with:
  
<code><pre> $ avrdude -v -p atmega328p -c avrispmkII -P usb -U flash:r:test_intel.hex:i</pre></code>
+
<code><pre>$ avrdude -v -p atmega328p -c avrispmkII -P usb -U flash:r:test_intel.hex:i
 +
Note: if your USB to serial interface uses the CP2102 chip, change avrispmkII to arduino</pre></code>
  
 
===Arduino Firmware Info===
 
===Arduino Firmware Info===
  
See GitHub readme for firmware info:  
+
See the GitHub readme for firmware info:  
  
'''All emonTx V3 firmware is available [https://github.com/openenergymonitor/emonTxFirmware on Github:emonTxFirmware]'''
+
'''All emonTx V3 firmware is available [https://github.com/openenergymonitor/emontx3 on Github:emonTxFirmware]'''
  
All emonTx V3's sold pre-assembled with a radio module are shipped with '''Discrete Sampling''' firmware. This is the main firmware for the emonTx V3 and has been tested and calibrated based on the nominal component values. If better accuracy is required, and facilities are available, then the unit should be re-calibrated to take account of variations present in the actual components used. You will need access to a programmer to reload the sketch.
+
All emonTx V3s sold pre-assembled with a radio module are shipped with '''Discrete Sampling''' firmware. This is the main firmware for the emonTx V3 and has been tested and calibrated based on nominal component values. If better accuracy is required, and facilities are available, the unit should be re-calibrated to take account of variations present in the components used. You will need access to a programmer to reload the sketch.
 
If you ordered an emonTx V3 without a radio module, no firmware will be loaded, although there will be a bootloader present. You will need access to a programmer to load a sketch.
 
If you ordered an emonTx V3 without a radio module, no firmware will be loaded, although there will be a bootloader present. You will need access to a programmer to load a sketch.
  
Line 137: Line 129:
  
 
* Detection of AC-AC adapter sets Apparent Power / Real Power Sampling accordingly
 
* Detection of AC-AC adapter sets Apparent Power / Real Power Sampling accordingly
* Detection of battery / USB 5V or AC > DC power method and sets sleep mode accordingly
+
* Detection of battery / USB 5V or AC-DC power method and sets sleep mode accordingly
* Detection of CT connections and samples only from the channels needed
+
* Detection of CT sensors. Samples only from connected channels
* Detection of remote DS18B20 temperature sensor connection
+
* Detection of remote DS18B20 temperature sensor
This firmware is suitable for real power measurements in a single-phase installation only. If you have a three-phase installation and require to measure real power, you will need to replace it with the equivalent three-phase firmware.  
+
This firmware is suitable for real power measurements in a single-phase installation only. If you have a three-phase installation and need to measure real power, you will need to replace the sketch with the equivalent three-phase firmware.  
  
[Note: Detection of the inputs in use takes place at power-on. The sketch must be re-started (press the reset button) if any change is made to the input connections.]
+
Note: Detection of the connected senors use takes place at power-on. The sketch must be re-started (press the reset button) if any sensors are connected or disconnected '''after''' power-on.
  
The '''emonTxV3_RFM12B_Discrete Sampling''' firmware samples over 10 full AC cycles, so 200 ms per measurement on each CT. Within this measurement it samples rapidly at about 2500 samples per second. There is then an assumption that the power does not fluctuate significantly in the time it is asleep, which is usually good enough for typical household monitoring. If greater precision is required (as is the case with [http://openenergymonitor.org/emon/pvdiversion/pll PV Power Diversion] it is recommended that you use PLL or alternative continuous sampling, see RFM12B firmware examples folder on GitHub.
+
The '''emonTxV3_RFM12B_Discrete Sampling''' firmware samples 10 full AC cycles, i.e. 200 ms per measurement from each CT at a rate of approximately 2500 samples per second. It is assumed the power does not fluctuate significantly during the time the microcontroller is asleep, which is usually good enough for typical household monitoring. If greater precision is required (as is the case with [http://openenergymonitor.org/emon/pvdiversion/pll PV energy Diversion] it is recommended that you use a PLL or continuous sampling sketch. See the RFM12B firmware examples folder on GitHub.
  
 
==Standard Operation==
 
==Standard Operation==
Line 155: Line 147:
  
  
A DS18B20 digital temperature sensor can easily be connected by the emonTx V3 by connecting the sensor into the emonTx V3's screw terminal block or RJ45 connector. '''The default firmware (discrete sampling) supports auto-detecting one DS18B20 sensor'''. Many DS18B20's can be daisy-chained but this will require changes being made to the pre-installed emonTx firmware - you may also run into power draw issues depending on how you are powering the emonTx (see Power Supply Options above).  
+
A DS18B20 digital temperature sensor can easily be connected to the emonTx V3 by connecting the sensor to the emonTx V3 screw terminal block or RJ45 connector. '''The default firmware (discrete sampling) supports auto-detecting one DS18B20 sensor'''. Multiple DS18B20s can be daisy-chained, but this will require changes to the pre-installed emonTx firmware - you may also run into power draw issues depending on how you are powering the emonTx (see Power Supply Options above).  
  
In order to save power when running off batteries, the emonTx V3 supports switching off of the DS18B20 in-between readings and performing the temperature conversion while the ATmega328 is sleeping. To do this power (3.3 V) is supplied to the DS18B20's power pin from Dig19 (ADC5), this digital pin is switched off between readings. The data connection from the DS18B20 is connected to Dig5, this I/O pin has got a 4K7 pull-up resistor to 3.3 V on-board the emonTx V3's PCB, as required by the DS18B20.
+
In order to save power when running on batteries, the emonTx V3 supports switching off of the DS18B20 in-between readings and performing the temperature conversion while the ATmega328 is sleeping. To do this, power (3.3 V) is supplied to the DS18B20's power pin from Dig19 (ADC5), this digital pin is switched off between readings. (This facility is available only if the temperature sensors are connected via the terminal block.) The data connection from the DS18B20 is connected to Dig5, this I/O pin has a 4K7 pull-up resistor to 3.3 V on-board the emonTx V3's PCB, as required by the DS18B20.
  
  
 
====RJ45 Connection====
 
====RJ45 Connection====
A DS18B20 sensor can be connected directly into the RJ45 socket, or an RJ45 to terminal block breakout can be used to connect multiple sensors:  
+
A DS18B20 sensor can be connected directly to the RJ45 socket, or an RJ45 to terminal block breakout can be used to connect multiple sensors:  
  
 
[[file: EmonTx_RJ45_DS18B20.jpg ]]
 
[[file: EmonTx_RJ45_DS18B20.jpg ]]
  
 +
Note: The RJ45 socket does not support power supply switching via Dig19 (ADC5) as described above.
  
 
'''Shop Links'''
 
'''Shop Links'''
Line 175: Line 168:
  
  
Further RJ45 breakouts are available from [http://www.sheepwalkelectronics.co.uk/index.php?cPath=23 Sheep Walk Electronics]  
+
Additional RJ45 breakouts are available from [http://www.sheepwalkelectronics.co.uk/index.php?cPath=23 Sheep Walk Electronics]  
  
  
 
The emonTx V3.4 uses a standard RJ45 DS18B20 pin-out as used by Sheepwalk Electronics and others:
 
The emonTx V3.4 uses a standard RJ45 DS18B20 pin-out as used by Sheepwalk Electronics and others:
  
[[file: EmonTxV3_4_RJ45-Pin-out.png ]]
+
[[file: EmonTxV3 4 RJ45-Pin-out.png ]]
  
 
====Terminal Block Connection====
 
====Terminal Block Connection====
Line 204: Line 197:
 
====Optical Pulse Counting====
 
====Optical Pulse Counting====
  
'''The [http://openenergymonitor.org/emon/opticalpulsesensor vOpenEnergyMonitor optical pulse sensor] can be connected directly to the emonTx V3 via it's RJ45. As of March 2015 pulse counting has been integrated into the main emonTx V3 firmware and shipped as standard (Firmware V1.7+)'''
+
'''The [http://shop.openenergymonitor.com/optical-utility-meter-led-pulse-sensor/ OpenEnergyMonitor optical pulse sensor] can be connected directly to the emonTx V3 via its RJ45. As of March 2015, pulse counting has been integrated into the main emonTx V3 firmware and shipped as standard'''
  
Many meters have pulse outputs, including electricity meters (single phase, 3-phase, import and export), gas meters, water flow meters etc. The pulse output may be a flashing LED or a switching relay (usually solid state) or both. We recommend using the optical interface where available as this decouples the monitoring equipment from any high/mains voltages.  
+
Many meters, including single phase, 3-phase, import and export electricity meters, gas meters and water meters, have pulse outputs. The pulse output may be a flashing LED or a relay (typically solid state) or both. We recommend using the optical interface if one is available, as this decouples the monitoring equipment from the mains.  
  
In the case of an electricity meter, a pulse output corresponds to a certain amount of energy passing through the meter (kWh/Wh). For single-phase domestic electricity meters (eg. Elster A100c) each pulse usually corresponds to 1 Wh (1000 pulses per kWh).  For water and gas meters they will usually be marked to show the quantity of water (litres/gallons) or of gas (cubic meters/cubic feet) that each pulse represents.
+
In the case of an electricity meter, a pulse output corresponds to a certain amount of energy passing through the meter (kWh/Wh). For single-phase domestic electricity meters e.g. Elster A100c, each pulse typically corresponds to 1 Wh (1000 pulses per kWh).  Water and gas meters will usually be marked to show the quantity of water (litres/gallons) or gas (cubic meters/cubic feet) that each pulse represents.
  
  
'''The emonTx V3.4 has one spare interrupt input (IRQ 1, Dig3) which can be used for pulse counting. This is broken out on terminal block port 4 and RJ45 socket''
+
''The emonTx V3.4 has one spare interrupt input (IRQ 1, Dig3) which can be used for pulse counting. This is broken out on terminal block port 4 and RJ45 socket''
  
  
Pules are counted and the current pulse count transmitted via RF as the final variable in the JeeLib packet structure. The wh_accumulator input process in emoncms can be used to log the pulse count. The wh_accumulator input process detects when the pulse count gets reset to zero (after the emonTx is reset) and continues to accumulate ignoring the reset. An scaler input process can be used to convert number of pulses to Kwh. For example: my utility meter outputs 800 pulses per Kwh so each pulse is 0.8wh. I can multiple the number of pulses by 0.8 to get number of wh elapsed or by 0.0008 for number of Kwh elapsed.
+
Pulses and the most recent pulse count are transmitted via RF, as the final variable in the JeeLib packet structure. The emonCMS wh_accumulator input process can be used to log the pulse count. The wh_accumulator input process detects when the pulse count gets reset to zero (after the emonTx is reset) and continues to accumulate, ignoring the reset. A scaler input process can be used to convert number of pulses to kWh. For example: my utility meter outputs 800 pulses per kWh, so each pulse is 0.8Wh. I can multiply the number of pulses by 0.8 to get the number of Wh, or by 0.0008 for the number of kWh accumulated.
 
   
 
   
Read more about pulse counting [OpenEnergyMonitor pulse sensor documentation page http://openenergymonitor.org/emon/opticalpulsesensor].
+
Read more about pulse counting [https://guide.openenergymonitor.org/setup/optical-pulse-sensor/OpenEnergyMonitor pulse sensor documentation page].
  
 
   
 
   
 
'''emonTx V3 Hardware Connections'''
 
'''emonTx V3 Hardware Connections'''
 
   
 
   
You should connect the pulse input into emonTx V3.4 terminal block port 4 (IRQ 1 / Digital 3) or RJ45 socket pin 6, see below for pin-out.
+
Connect the pulse input into emonTx V3.4 terminal block port 4 (IRQ 1 / Digital 3) or RJ45 socket pin 6. Terminal connections shown below.
 
If you are connecting a hard-wired pulse output you may need to add a pull-down resistor.
 
If you are connecting a hard-wired pulse output you may need to add a pull-down resistor.
If you are using an optical counter (e.g [http://shop.openenergymonitor.com/tsl257-optical-pulse-sensing-kit/ TSL257]) you should connecting the power pin to the 3.3V or 5V (if running off 5V USB)
+
If you are using an optical counter (e.g [http://shop.openenergymonitor.com/tsl257-optical-pulse-sensing-kit/ TSL257]), connect the power pin to the 3.3V or 5V rail. (if powered from the 5V mini-USB conector)
 
   
 
   
 
{| class="wikitable"
 
{| class="wikitable"
 
|+emonTx V3.4 pulse-counting screw terminal connections
 
|+emonTx V3.4 pulse-counting screw terminal connections
 
|-
 
|-
|'''Screw terminal pin'''
+
|'''Screw Terminal'''
 
|'''Connection'''
 
|'''Connection'''
 
|-
 
|-
Line 244: Line 237:
 
|}
 
|}
  
 +
There is an pull-up resistor connected to the pulse (IRQ) input that is enabled in the standard sketch. Therefore, you can connect a volt-free contact or an SO output between screw terminal 4 / RJ45 pin 6 (IRQ input, SO+) and screw terminal 3 / RJ45 pin 5 (GND, SO-) without the need for an additional resistor. If you must connect your contacts between VCC (screw terminal 2 / RJ45 pin 2) and screw terminal 4 / RJ45 pin 6, then you must add a pull-down resistor of resistance low enough to overcome the internal pull-up resistor, or you can use a higher-value resistor and modify the sketch to disable the internal pull-up.
  
[[File:RJ45_emonTx_emonPi.png|400 px|RJ45 Pinout]]
+
We recommend powering the emonTx v3 from either a 5V USB or AC-AC adaptor when used for pulse counting operation. Due to the additional power requirements of the optical pulse sensor, battery life will be reduced significantly compared to an emonTx powered by 3 AA batteries for CT operation only.
 
+
[[File:RJ45_TSL257_emonPi.png|400 px|RJ45 TSL257]]
+
 
+
 
+
We recommend powering the emonTx V3 from either a 5V USB or AC-AC adapter when used for pulse counting operation. Due to the additional power requirements of the optical pulse sensor, battery life will be significantly reduced compared to running an emonTx from 3 x AA batteries for CT operation only.
+
  
 
====Direct Optical Interface====
 
====Direct Optical Interface====
Line 257: Line 246:
 
==Connectivity==
 
==Connectivity==
  
===RF Wireless===
+
===RF Link===
The emonTx communicates data back to a web-connected base station ([http://shop.openenergymonitor.com/base-stations/ Raspberry Pi with RFM12Pi / RFM69Pi]) via low power 433MHz / 868 MHz RF
+
The emonTx transmits data to a web-connected base station ([http://shop.openenergymonitor.com/base-stations/ Raspberry Pi with RFM12Pi / RFM69Pi]) via a low power 433MHz / 868 MHz radio.
 
+
  
 
====RFM12B====
 
====RFM12B====
See RFM12B Building Block documentation:
+
See the RFM12B Building Block documentation:
  
 
[http://openenergymonitor.org/emon/buildingblocks/rfm12b-wireless RFM12B - Part 1 - Hardware Overview]
 
[http://openenergymonitor.org/emon/buildingblocks/rfm12b-wireless RFM12B - Part 1 - Hardware Overview]
Line 269: Line 257:
  
 
====RFM69CW====
 
====RFM69CW====
Using latest [http://github.com/jcw/jeelib JeeLib library] the RFM69CW is backward compatible with RFM12B  
+
Using the latest [http://github.com/jcw/jeelib JeeLib library] the RFM69CW is backward compatible with RFM12B  
  
 
[http://openenergymonitor.org/emon/node/6005 See RFM69CW Building Block documentation for genral info on RFM69CW]
 
[http://openenergymonitor.org/emon/node/6005 See RFM69CW Building Block documentation for genral info on RFM69CW]
  
To enable RFM69CW ensure  
+
To enable RFM69CW, ensure that '''define RF69_COMPAT''' at the begging of the sketch is set to ''''1''''
  
''define RF69_COMPAT 1 ''
+
or
  
is set to '1' at the begging of the sketch. Or use a pre-compiled .hex with RFM69CW in the title, see [https://github.com/openenergymonitor/emonTxFirmware/tree/master/emonTxV3/RFM/emonTxV3.4/emonTxV3_4_DiscreteSampling emontx V3.4 GitHub repo]                                                             
+
use a pre-compiled .hex file with RFM69CW in the title. See [https://github.com/openenergymonitor/emonTxFirmware/tree/master/emonTxV3/RFM/emonTxV3.4/emonTxV3_4_DiscreteSampling emontx V3.4 GitHub repo]                                                             
  
See photo below showing RFM69CW module orientation when soldered onto emonTx V3.4:
 
  
 
[[File:Emontx34_RFM69CW.jpg|400px]]
 
[[File:Emontx34_RFM69CW.jpg|400px]]
 +
 +
RFM69CW module orientation as installed on an emonTx v3.4
  
 
===Wired Connectivity===
 
===Wired Connectivity===
Whilst the system was designed to transfer data via radio it is possible to link the emonTx and Raspberry Pi by wires. It should be noted that this is NOT the standard setup.
+
Whilst the system was designed to transfer data via radio it is possible to link the emonTx and Raspberry Pi by wires.
 +
 
 +
It should be noted that this is '''NOT''' the standard setup.
  
 
====Direct connection emonTx V3 > Raspberry Pi GPIO====
 
====Direct connection emonTx V3 > Raspberry Pi GPIO====
  
Both the Raspberry Pi and emonTx V3 run at 3.3V so the serial RX and TX lines can be directly connected. the 5V power rail from the Raspberry Pi can be supplied to the emonTx which is then stepped down to to 3.3V through the emonTx V3's voltage regulator. 5V is provided by the red wire (see photo). The ground connection is the black wire and the serial data going from the emonTx to the Raspberry Pi is the green wire. Wire for serial data going the other (Pi to emonTx) has not been connected in this example but could be added if two way comms is required.   
+
Both the Raspberry Pi and emonTx v3 run at 3.3V so the serial Receive and Transmit lines can be connected directly. The 5V power rail from the Raspberry Pi can be supplied to the emonTx which is then stepped down to to 3.3V by the emonTx voltage regulator. 5V is provided by the red wire (see photo). The ground connection is the black wire and the serial data going from the emonTx to the Raspberry Pi is the green wire. Wire for serial data going the opposite direction (Pi to emonTx) has not been connected in this example but could be added if two-way communication is required.   
  
''Note that on the PCB and on the Schematic, the Tx and Rx pins are labelled according to the connections on the Programmer, meaning that data is received by the emonTx on the Tx pin and transmitted by the emonTx on the Rx pin.''
+
''Note: on the PCB and schematic, the Tx and Rx pins are labelled according to the connections on the Programmer, meaning that data is received by the emonTx on the Tx pin, and transmitted by the emonTx from the Rx pin.''
  
 
[[File:Emontx_to_pi_serial.JPG|400 px|Emontx to pi serial]]
 
[[File:Emontx_to_pi_serial.JPG|400 px|Emontx to pi serial]]
 
[[File:Piplusemontx.JPG|400 px|emonTx Pi direct connection]]
 
[[File:Piplusemontx.JPG|400 px|emonTx Pi direct connection]]
  
 +
For emonTx V3 firmware V2.5+ then no firmware change is required, the directserial-serialtx3e emonhub interfacer can be used to decode the serial output see [https://github.com/openenergymonitor/emonhub/tree/emon-pi/conf/interfacer_examples/directserial-serialtx3e directserial-serialtx3e emonhub interfacer config guide]
  
 
+
If you wish to disable RF connectivity completely, the [https://github.com/openenergymonitor/emonTxFirmware/tree/master/emonTxV3/noRF/emonTxV3_DirectSerial emonTx V3 no RF FW] can be used together with [https://github.com/openenergymonitor/emonhub/tree/emon-pi/conf/interfacer_examples/directserial emonhub DirectSerial interfacer] .
 
+
[http://openenergymonitor.org/emon/node/3884 See this page for updated detailed documentation for emonTx Raspberry Pi direct serial interface]
+
  
 
==Electrical Characteristics - Absolute min / max==
 
==Electrical Characteristics - Absolute min / max==
Line 315: Line 305:
 
|'''Absolute Max'''
 
|'''Absolute Max'''
  
if exceeded damage might happen
+
if exceeded, damage may occur
  
 
|'''Notes'''
 
|'''Notes'''
Line 324: Line 314:
 
|23kW / 95.8A
 
|23kW / 95.8A
 
|60kW / 250A
 
|60kW / 250A
|Using 22R burden and  YHDC SCT-013-00 with 22 turns
+
|Using 22R burden and  YHDC SCT-013-00  
 
|-
 
|-
 
|CT 4
 
|CT 4
Line 331: Line 321:
 
|4.5kW / 19.2A
 
|4.5kW / 19.2A
 
|4.6kW max measure – 19.7kW / 82A Max dissipation
 
|4.6kW max measure – 19.7kW / 82A Max dissipation
|Using 120R burden and  YHDC SCT-013-00 with 22 turns
+
|Using 120R burden and  YHDC SCT-013-00  
 
|-
 
|-
|AC-DC half-wave supply
+
|DC half-wave power supply
 
|Current output
 
|Current output
 
|
 
|
 
|20mA
 
|20mA
 
|60mA
 
|60mA
|Current draw above 20mA AC sample signal will be effected
+
|Current draw above 20mA AC sample signal will be affected
 
|-
 
|-
 
|3.3V Rail current output
 
|3.3V Rail current output
|When powering with 5V USB
+
|When powered via 5V USB connector
 
|
 
|
 
|150mA
 
|150mA
Line 355: Line 345:
 
|-
 
|-
 
|Storage Temperature  
 
|Storage Temperature  
|Not programmed
+
|Temperature
 
|<nowiki>-50C</nowiki>
 
|<nowiki>-50C</nowiki>
 
|
 
|
Line 373: Line 363:
 
|3.3V
 
|3.3V
 
|3.9V RFM69CW
 
|3.9V RFM69CW
|*ADC readings will be incorrect if Vcc!=3.3V
+
|*ADC readings will be incorrect if Vcc is not 3.3V
 
|-
 
|-
 
|}
 
|}
 +
 +
Note 1: A higher voltage (up to 17.6V) can be used to power the emonTx if power is connected into the MCP1754 through the AC-DC enable jumper pin.
  
 
[http://wiki.openenergymonitor.org/index.php/EmonTx_V3#Design_Calculations See emonTx V3 Wiki for Design Calculations]
 
[http://wiki.openenergymonitor.org/index.php/EmonTx_V3#Design_Calculations See emonTx V3 Wiki for Design Calculations]
 +
 +
== Enclosure ==
 +
 +
* The emonTx V3 PCB is 100mm x 80mm and enclosed in an EBS80 enclosure sourced from Lincoln Binns, see [https://www.lincolnbinns.com/en/aluminium-electronic-enclosure-e-case-b-data data sheet]
 +
 +
=== Community contributed ===
 +
 +
* [http://www.thingiverse.com/thing:1355749 emonTx DIN-RAIL mount #1 fixing on Thingiverse]
 +
* [https://www.thingiverse.com/thing:208177 emonTx DIN-RAIL mount #2 fixing on Thingiverse]
 +
* [https://www.thingiverse.com/thing:2043784 emonTx > EmonESP > LCD]
 +
* [https://www.thingiverse.com/nduarte/designs emonTx 3D printed case design]

Latest revision as of 13:44, 18 December 2018

emonTx V3.4

The emonTx V3.4 is the latest version of the emonTx Low Power Wireless Energy Monitoring Node designed for monitoring AC electrical power on a maximum of 4 separate (household/building) circuits using non-invasive clip-on CT sensors and an AC-AC Voltage adapter to provide a voltage signal for Real Power calculations. The emonTx V3.4 is a minor update to the emonTx_V3

emonTx V3.4


Features

New features on emonTx V3.4 over V3 shown in bold

  • Measure AC Apparent Power, AC Real power* and AC RMS voltage*
  • 3 x single-phase CT current sensor inputs (100A / 24KW @ 240V max)
  • 1 x high sensitivity single-phase CT current sensor input channel (18.8A / 4.5KW @ 240V max)
  • 1 x RJ45 input for connecting DS18B20 temperature sensors
  • Single AC-AC adapter can power the unit and provide AC voltage measurement
  • An on-board 3x AA battery option with remote monitoring of battery voltage
  • Terminal block access to power rails, digital and analogue I/O and IRQ port for connecting pulse counting sensor / DS18B20 temperature / Aux sensors
  • DIP switch selection of RF node ID and 240V/120V AC adapter selection, see #DIP Switch Config

* when AC-AC voltage adapter is connected

Port Map

emonTx V3.4

emonTx V3 Port map

emonTx V3 Ports

A schematic diagram and PCB layout (Eagle CAD format) can be found on GitHub.

Note: The FTDI connector Tx and Rx pins are reversed on the PCB legend and on the Schematic. Data is received by the emonTx on the Tx pin and transmitted by the emonTx on the Rx pin.

Overview

Using an ATmega328 microprocessor, the emonTx V3.4 runs standard Arduino sketches. It is easy to customise and upload code using the Arduino IDE and a USB to UART cable.

The data from the emonTx V3.4 is transmitted via an RFM12B / RFM68CW 433/868 MHz radio to an emonBase web-connected base-station (we recommend a Raspberry Pi with an RFM12Pi) which then posts the data onto an emoncms server (e.g. http://emoncms.org) for logging, processing and graphing.

DIP Switch Config

The emonTx V3.4 has two DIP switches enabling selection of RF node ID and setting UK/EU or US AC-AC adapter choice without having to change the firmware. The unit must be restarted after changing DIP switch positions. Default DIP switch selection (both off) is node ID 10 and 240V AC.

Note: newer emonTx V3 firmware (V2.3+) use node ID 8 and 7, instead of 10 and 9 (shown below) see emonhub config guide for more info

Note#2: RF node ID can now be set using serial config. See forum post

EmonTx V3.4 DIP Switch.jpg

Power Supply Options

There are four ways to power the emonTx V3:

  1. USB to UART cable - only recommended for short periods while programming, it is recommended to remove all other power sources
  2. 5V DC Mini-USB cable - remove jumper JP2 when powering via DC if AC adapter is present
  3. 3 x AA Batteries - remove jumper JP2 when powering via DC if AC adapter is present
  4. 9V AC-AC power adapter - with jumper JP2 closed (If jumper 2 is left open then the AC-AC adapter will be used for power sampling but not to power the emonTx V3 - see Powering via AC below)

Powering via DC (1-3)

When powering the emonTx V3 via DC (1-3) and running the default emonTx firmware the emonTx V3 will take Apparent Power measurements, measuring only current, assuming the Power Factor of 1 and Vrms to be 230V, power saving mode will also be implemented, going into sleep mode between readings (default every 10s) to save battery power.

The red LED indicator will illuminate for a couple of seconds then extinguish never to flash again if powering from a DC source. If the LED flashes multiple times at startup this indicates the emonTx is detecting an AC waveform - this can happen if an AC adapter has just been removed, hit the reset button if this occurs. When powering the unit via 5V USB/battery it is advisable to remove the JP2 jumper if an AC-AC adapter is present.

Powering via AC (4)

A nice feature of the emonTx V3 is the ability to use an AC-AC adapter to power the unit while simultaneously providing an AC voltage sample. If the emonTx V3 detects the presence of an AC adapter at startup, it will automatically implement Real Power and Vrms measurements by sampling the AC voltage. Real Power is what you get billed for, and depending on the appliances connected to the circuit being monitored, can vary significantly from Apparent Power - see Building Blocks for more info on AC power theory. For best energy monitoring accuracy, we recommend powering the EmonTX with an AC-AC adapter whenever possible.

Using the AC voltage for reference also enables the emonTx to monitor the direction of current flow. This is important for solar PV monitoring. If you notice a negative reading when you were expecting a positive one, reverse the orientation of the CT on the conductor. The red indicator LED will flash at startup then flash once every 10 seconds to indicate an AC waveform has been detected. Sleep mode will be disabled to keep a more consistent power draw on the AC circuit.

Important note regarding powering with AC: powering via AC is recommended only for standard emonTx operation without auxiliary sensors (apart from a maximum of 4 DS18B20 temperature sensors) or equipment (e.g. relay modules) connected. Correct operation via the AC supply is critically dependent upon using the correct AC-AC adapter. If you are using the recommended AC-AC adapter and the current draw exceeds 10 mA and the mains supply is below the minimum allowable, then circuit operation will be impaired, adversely affecting the accuracy of the emonTx. To avoid damage to the emonTx V3 circuits, the current drawn from the AC circuit should never exceed 60mA - see the technical wiki for more info. If more than 10 mA of current is required, it is recommended to remove jumper 2 (JP2) and power the emonTx via the 5V mini-USB connector. When JP2 is removed, the AC-AC adapter (if connected) will be used only to provide an AC voltage sample, i.e. it will not power the emonTx.

Uploading Firmware

Latest firmware source code and compiling instructions can be found in the Firmware section of emonTx 3 Github:

https://github.com/openenergymonitor/emontx3

Also see compiling instructions are part of the user guide:

https://guide.openenergymonitor.org/technical/compiling

Flashing Pre-compiled .hex

The main emonTx v3.4 RFM69CW firmware as pre-loaded onto pre-build emonTx, is also supplied as a pre-compiled .hex file. Download from:

[https://github.com/openenergymonitor/emontx3/releases


Linux : use AVRdude

$ sudo apt-get install avrdude

$ avrdude -v -c arduino -p ATMEGA328P -P /dev/ttyUSB0 -b 115200 -U flash:w:emonTxV3_RFM69CW_DiscreteSampling_433.cpp.hexx

Specify the port your USB to UART programmer is connected to, and the path name of the .hex file

Windows :you might be able to use the the XLoader application to upload .hex files (we have not tested this, please update the wiki if you have)

Flashing the Bootloader

Not normally required

The OptioBoot Arduino Uno serial bootloader should be ready loaded onto the ATmega328 on the emonTx from the factory. If however, for any reason you need to reload the bootloader and set the fuses, here is the procedure:

The stock emonTx firmware including the bootloader, can be downloaded in pre-compiled .hex form from github. Look for a .hex file including the word "bootloader" in the title, on the emonTx V3 GitHub page.

The .hex file can be flashed, and the fuses set, on the ATmega328 using the following avrdude command:

$ sudo avrdude -v -p atmega328p -c avrispmkII -P usb -e -Ulock:w:0x3F:m -Uefuse:w:0x05:m -Uhfuse:w:0xDE:m -Ulfuse:w:0xFF:m -U flash:w:emonTxV3_4_RFM12B_DiscreteSampling_bootloader.cpp.hex:i  -Ulock:w:0x0F:m

or, to speed things up:

$ sudo avrdude -V -u -p atmega328p -c avrispmkII -P usb -e -Ulock:w:0x3F:m -Uefuse:w:0x05:m -Uhfuse:w:0xDE:m -Ulfuse:w:0xFF:m -U flash:w:emonTxV3_4_RFM12B_DiscreteSampling_bootloader.cpp.hex:i  -Ulock:w:0x0F:m

If, for any reason e.g to make a backup, you want to read the data from the ATmega328 this can be done with:

$ avrdude -v -p atmega328p -c avrispmkII -P usb -U flash:r:test_intel.hex:i
Note: if your USB to serial interface uses the CP2102 chip, change avrispmkII to arduino

Arduino Firmware Info

See the GitHub readme for firmware info:

All emonTx V3 firmware is available on Github:emonTxFirmware

All emonTx V3s sold pre-assembled with a radio module are shipped with Discrete Sampling firmware. This is the main firmware for the emonTx V3 and has been tested and calibrated based on nominal component values. If better accuracy is required, and facilities are available, the unit should be re-calibrated to take account of variations present in the components used. You will need access to a programmer to reload the sketch. If you ordered an emonTx V3 without a radio module, no firmware will be loaded, although there will be a bootloader present. You will need access to a programmer to load a sketch.

The Discrete Sampling firmware has the following features:

  • Detection of AC-AC adapter sets Apparent Power / Real Power Sampling accordingly
  • Detection of battery / USB 5V or AC-DC power method and sets sleep mode accordingly
  • Detection of CT sensors. Samples only from connected channels
  • Detection of remote DS18B20 temperature sensor

This firmware is suitable for real power measurements in a single-phase installation only. If you have a three-phase installation and need to measure real power, you will need to replace the sketch with the equivalent three-phase firmware.

Note: Detection of the connected senors use takes place at power-on. The sketch must be re-started (press the reset button) if any sensors are connected or disconnected after power-on.

The emonTxV3_RFM12B_Discrete Sampling firmware samples 10 full AC cycles, i.e. 200 ms per measurement from each CT at a rate of approximately 2500 samples per second. It is assumed the power does not fluctuate significantly during the time the microcontroller is asleep, which is usually good enough for typical household monitoring. If greater precision is required (as is the case with PV energy Diversion it is recommended that you use a PLL or continuous sampling sketch. See the RFM12B firmware examples folder on GitHub.

Standard Operation

CT Energy Monitoring

Extended Operation

Temperature Monitoring

A DS18B20 digital temperature sensor can easily be connected to the emonTx V3 by connecting the sensor to the emonTx V3 screw terminal block or RJ45 connector. The default firmware (discrete sampling) supports auto-detecting one DS18B20 sensor. Multiple DS18B20s can be daisy-chained, but this will require changes to the pre-installed emonTx firmware - you may also run into power draw issues depending on how you are powering the emonTx (see Power Supply Options above).

In order to save power when running on batteries, the emonTx V3 supports switching off of the DS18B20 in-between readings and performing the temperature conversion while the ATmega328 is sleeping. To do this, power (3.3 V) is supplied to the DS18B20's power pin from Dig19 (ADC5), this digital pin is switched off between readings. (This facility is available only if the temperature sensors are connected via the terminal block.) The data connection from the DS18B20 is connected to Dig5, this I/O pin has a 4K7 pull-up resistor to 3.3 V on-board the emonTx V3's PCB, as required by the DS18B20.


RJ45 Connection

A DS18B20 sensor can be connected directly to the RJ45 socket, or an RJ45 to terminal block breakout can be used to connect multiple sensors:

EmonTx RJ45 DS18B20.jpg

Note: The RJ45 socket does not support power supply switching via Dig19 (ADC5) as described above.

Shop Links

DS18B20 sensor on RJ45

RJ45 to Terminal Block Breakout

Encapsulated DS18B20 temperature sensor


Additional RJ45 breakouts are available from Sheep Walk Electronics


The emonTx V3.4 uses a standard RJ45 DS18B20 pin-out as used by Sheepwalk Electronics and others:

EmonTxV3 4 RJ45-Pin-out.png

Terminal Block Connection

To connect an external DS18B20 to the emonTx V3 screw terminal block connections are as follows

DS18B20 emonTx V3 screw terminal connections
Screw terminal pin DS18B20 Connection
3 - GND GND (Black)
5 - Dig19 Power (Red)
6 - Dig5 Data (White)

Utility Meter Interface

Optical Pulse Counting

The OpenEnergyMonitor optical pulse sensor can be connected directly to the emonTx V3 via its RJ45. As of March 2015, pulse counting has been integrated into the main emonTx V3 firmware and shipped as standard

Many meters, including single phase, 3-phase, import and export electricity meters, gas meters and water meters, have pulse outputs. The pulse output may be a flashing LED or a relay (typically solid state) or both. We recommend using the optical interface if one is available, as this decouples the monitoring equipment from the mains.

In the case of an electricity meter, a pulse output corresponds to a certain amount of energy passing through the meter (kWh/Wh). For single-phase domestic electricity meters e.g. Elster A100c, each pulse typically corresponds to 1 Wh (1000 pulses per kWh). Water and gas meters will usually be marked to show the quantity of water (litres/gallons) or gas (cubic meters/cubic feet) that each pulse represents.


The emonTx V3.4 has one spare interrupt input (IRQ 1, Dig3) which can be used for pulse counting. This is broken out on terminal block port 4 and RJ45 socket


Pulses and the most recent pulse count are transmitted via RF, as the final variable in the JeeLib packet structure. The emonCMS wh_accumulator input process can be used to log the pulse count. The wh_accumulator input process detects when the pulse count gets reset to zero (after the emonTx is reset) and continues to accumulate, ignoring the reset. A scaler input process can be used to convert number of pulses to kWh. For example: my utility meter outputs 800 pulses per kWh, so each pulse is 0.8Wh. I can multiply the number of pulses by 0.8 to get the number of Wh, or by 0.0008 for the number of kWh accumulated.

Read more about pulse counting pulse sensor documentation page.


emonTx V3 Hardware Connections

Connect the pulse input into emonTx V3.4 terminal block port 4 (IRQ 1 / Digital 3) or RJ45 socket pin 6. Terminal connections shown below. If you are connecting a hard-wired pulse output you may need to add a pull-down resistor. If you are using an optical counter (e.g TSL257), connect the power pin to the 3.3V or 5V rail. (if powered from the 5V mini-USB conector)

emonTx V3.4 pulse-counting screw terminal connections
Screw Terminal Connection
1 5V (if powered via 5V USB)
2 3.3V
3 GND
4 IRQ 1 / Dig3

There is an pull-up resistor connected to the pulse (IRQ) input that is enabled in the standard sketch. Therefore, you can connect a volt-free contact or an SO output between screw terminal 4 / RJ45 pin 6 (IRQ input, SO+) and screw terminal 3 / RJ45 pin 5 (GND, SO-) without the need for an additional resistor. If you must connect your contacts between VCC (screw terminal 2 / RJ45 pin 2) and screw terminal 4 / RJ45 pin 6, then you must add a pull-down resistor of resistance low enough to overcome the internal pull-up resistor, or you can use a higher-value resistor and modify the sketch to disable the internal pull-up.

We recommend powering the emonTx v3 from either a 5V USB or AC-AC adaptor when used for pulse counting operation. Due to the additional power requirements of the optical pulse sensor, battery life will be reduced significantly compared to an emonTx powered by 3 AA batteries for CT operation only.

Direct Optical Interface

if you have an Elster meter (tested with Elster 100C) the emonTx V3 with an IR TSL261R sensor can be used to interface directly with the meter protocol to read off the exact accumulated watt hours that you have generated or used. This reading can be used on its own or to cross-check and calibrate CT based measurement. See here for original blog post

Connectivity

RF Link

The emonTx transmits data to a web-connected base station (Raspberry Pi with RFM12Pi / RFM69Pi) via a low power 433MHz / 868 MHz radio.

RFM12B

See the RFM12B Building Block documentation:

RFM12B - Part 1 - Hardware Overview

RFM12B - Part 2 - Sending Data Between Modules

RFM69CW

Using the latest JeeLib library the RFM69CW is backward compatible with RFM12B

See RFM69CW Building Block documentation for genral info on RFM69CW

To enable RFM69CW, ensure that define RF69_COMPAT at the begging of the sketch is set to '1'

or

use a pre-compiled .hex file with RFM69CW in the title. See emontx V3.4 GitHub repo


Emontx34 RFM69CW.jpg

RFM69CW module orientation as installed on an emonTx v3.4

Wired Connectivity

Whilst the system was designed to transfer data via radio it is possible to link the emonTx and Raspberry Pi by wires.

It should be noted that this is NOT the standard setup.

Direct connection emonTx V3 > Raspberry Pi GPIO

Both the Raspberry Pi and emonTx v3 run at 3.3V so the serial Receive and Transmit lines can be connected directly. The 5V power rail from the Raspberry Pi can be supplied to the emonTx which is then stepped down to to 3.3V by the emonTx voltage regulator. 5V is provided by the red wire (see photo). The ground connection is the black wire and the serial data going from the emonTx to the Raspberry Pi is the green wire. Wire for serial data going the opposite direction (Pi to emonTx) has not been connected in this example but could be added if two-way communication is required.

Note: on the PCB and schematic, the Tx and Rx pins are labelled according to the connections on the Programmer, meaning that data is received by the emonTx on the Tx pin, and transmitted by the emonTx from the Rx pin.

Emontx to pi serial emonTx Pi direct connection

For emonTx V3 firmware V2.5+ then no firmware change is required, the directserial-serialtx3e emonhub interfacer can be used to decode the serial output see directserial-serialtx3e emonhub interfacer config guide

If you wish to disable RF connectivity completely, the emonTx V3 no RF FW can be used together with emonhub DirectSerial interfacer .

Electrical Characteristics - Absolute min / max

emonTx V3.4 Datasheet
Function Parameter Min Recommended

Max / typical

Absolute Max

if exceeded, damage may occur

Notes
CT 1-3 Monitoring Power @ 240V 23kW / 95.8A 60kW / 250A Using 22R burden and YHDC SCT-013-00
CT 4 Monitoring Power @ 240V 4.5kW / 19.2A 4.6kW max measure – 19.7kW / 82A Max dissipation Using 120R burden and YHDC SCT-013-00
DC half-wave power supply Current output 20mA 60mA Current draw above 20mA AC sample signal will be affected
3.3V Rail current output When powered via 5V USB connector 150mA 168mA Limitation SOT22 MCP1700 Ta=40C Vi=5.25V
Operating Temperature Temperature -40C +40C +85C
Storage Temperature Temperature -50C +150C
5V Input Voltage USB/FTDI/5V Aux +3.4V +6V +6.5V (see note 1) See note 1
3.3V Supply Voltage on 3.3V supply rail 2.6V * 3.3V 3.9V RFM69CW *ADC readings will be incorrect if Vcc is not 3.3V

Note 1: A higher voltage (up to 17.6V) can be used to power the emonTx if power is connected into the MCP1754 through the AC-DC enable jumper pin.

See emonTx V3 Wiki for Design Calculations

Enclosure

  • The emonTx V3 PCB is 100mm x 80mm and enclosed in an EBS80 enclosure sourced from Lincoln Binns, see data sheet

Community contributed