Some doubts about direct connection between emonTx and RaspberryPI

I’m a newbie and I’m planning the setup of my first system based on OpenEnergyMonitor.

  1. I want connect the emonTx directly to the RaspberryPI via serial.
  2. I want Real Power and Irms measurements by sampling the AC waveform. This implies making use of an AC-AC 9V power adapter.

The first doubt is whether connecting the emonTx directly to the RaspberryPI via serial, is equivalent to the case of using RF in terms of quantities measured and sent to emoncms (power, Vrms, etc ). I hope yes.

The second doubt is whether powering emonTx through RaspberryPI’s 5V supply (removing JP2) or AC-AC 9V (JP2 inplace).
The first case should be avoided, isn’t it? (Powering Up : 1) USB to UART cable - recommended only for short periods while programming. ) or am i wrong?

In the second case I should connect only:

  • ground between emonTx and RaspberryPI
  • and data going from emonTx to RaspberryPI
    is this ok?

thank you

Hi Roberto

There is no problem with running an emonTx connected via the RPi’s GRIO for both serial comms and power long term.

Yes you should remove JP2 if using a 9vac adapter for voltage reference too.

The direct serial connection is actually superior to the RF option as it is not subject to range and interference that can cause RF packets to be lost or dropped.

The power consumption of the emonTx is minimal and unlikely to put strain on the RPi or it’s power supply (unless using an undersized PSU that is already struggling)

There is even a minute chance of better accuracy as not using the AC:AC to power the emonTx means the consumption of the emonTx or more so, the rfm69cw cannot impact the monitored waveform.

I believe that type of warning applies to programming a device normally (and currently) powered by a 9vAC adapter as there is no reason that I can think of that prevents the emonTx being permanently powered via the programming header (unless the the USB programmer device itself is the weak link)

I’ve connected many emonTx’s this way and I usually connect 5 wires, 5v, gnd, rx, tx and a reset line, this allows firmware to be uploaded directly from the Pi to the emonTx, 2 way serial comms and also the ability to reset the emonTx remotely if required.

You will need a minimum of 2 wires, gnd and 1x data (emonTx’s TX => Pi RX) for the emonTx to communicate whilst powered via an AC:AC or add a 5v wire and remove JP2 to power via the RPI, the 2nd data wire and reset wires are optional in either case.

The stock emonTx firmwares are not set up specifically for “serial direct” comms so you may need to find one that is (those sketches intended for serial-direct or emonESP will have better serial output) or modify a sketch for your own use.

How are you going to use the data within the RPi? Are you using the emonSD or emonHub or something else?

thank you Paul for your very clear reply.

I intend to install emonSD and to use the data within the RPi (local emoncms).

I had not raised the issue, according to what described Here :
“It’s worth noting the standard emonTx firmware which has all the rfm12b radio packet sending code, also prints a space separated string to its serial port which should work the same as the cut down serial only example above, although you’ll still be transmitting radio packets.”
Not yet decided whether using or not custom sketch. I’ve not heard about them , I’ll will look into the theme

How? Is there a project?

thank you again

No not really, this isn’t something that is documented that well, but the uploading of sketches is pretty much the same as uploading an RFM2Pi sketch or even the emonPi sketch so the info is all out there but not specifically for a GPIO connected emonTx.