Simplified emonTx Arduino Shield + Ethernet Shield - Guide

Hi all,

Recently like many of you wanted to start monitoring the energy in our house. Given all points where I wanted to measure had ethernet connections available I wanted to alter the EmonTx Arduino shield to remove all unnecessary components and only use the Arduino Ethernet Shield for communication to make the total cost lower. And then solder all components myself. I added all this to a GIT repository so I can remember it all in the future if I have to do it again and perhaps it can help someone else here in the future. Figured I make a post here so it can be found if somebody was searching for something similar.

I also had a hard time finding the proper arduino code for the ethernet data sending so added that as well to the repository. And also made an altered 3D case for the entire module. Plus a quick guide on how to set up a OpenHab module with MQTT.

I take no credit for anything given it was all based on work of others, which is always listed in the ReadMe files. But it is sometimes hard to find it so I added it all together for easy access.

You can find the repository here: GitHub - WouterJansen/emonTXethernet: Based on the OpenEnergyMonitor systems, a small variation with communication over Ethernet.

I hope this post is in the right place and allowed :slight_smile:

Have a great day!


Nice work @Wouter_Jansen and thanks for sharing!

Could you confirm that you used version 2 of the Ethernet Shield?

Based on what I see in his code, I’d guess he used a v1 Ethernet shield.
The version 2 shield uses a library named EthernetV2_0.h whereas
version 1 of the Enet shield library is Ethernet.h
(he uses the v1 library in his code, but it’s possible the file could have been renamed)

This isn’t positive proof, but all of the examples I’ve seen that dealt with v1 and v2
of the Ethernet shield, followed that naming convention.

1 Like

Does that mean the project cannot be transferred to v2 without difficulties? (I’m just getting started with both Emon and Arduino, so I’m having difficulties seeing these things.)

Also, if I may: I’m wondering how far off the beaten track I would be putting myself if I chose to go the Arduino + EmonTX shield + Ethernet Shield way?

It would be the best solution for me technically, but as a newbie, I’m also dependent on a a support community…

I tend to think not.
I have a v2 Ethernet shield, and was able to make it work with code written for a v1 shield.
If I recall correctly, I had more trouble finding the v2 library, than I did getting the code to run.

It sounds as if you may be a bit confused. If you’re going to use an Arduino Uno, you’ll need
the emonTx Shield, as it contains the signal conditioning electronics needed by the Uno.

While perusng the arduino website, I ran across this:

According to the info on the page at the link above, the built-in Ethernet library, IDE v1.8.10 as of
this writing, supports W5100/W5200/W5500-based devices which - as I understand it - include both v1 and v2 shields. So it’s possible he did use a v2 shield. Either way, you should be good to go.

1 Like

That is entirely possible but what you say seems in line with what I was thinking, which is the following: Starting from my liking of the EmonTX, I’m trying to figure out how I can get it (or something like it) to communicate over ethernet (since my ethernet switch for the whole house will be right next to it). Since I couldn’t find anything about adding ethernet to the EmonTX (wifi yes, but not ethernet) I figured that putting an EmonTX shield on an Arduino with an Ethernet shield is probably the way to go.

Does this make sense, so far? Now, my concern about being too far off the beaten track then has to do with the fact that there is a large community for the EmonTX and perhaps also for the EmonTX shield, but probably not for the EmonTX shield used together with an ethernet shield.

It does. (I may have misunderstood you) :wink:

I’d say that’s a safe bet. Lots of RF (to include WiFi) and some direct connect serial,
but not much in the way of Ethernet connectivity. As Brian suggested in another thread,
it may be easier to use a Pi or Pi clone that has WiFi, via a direct serial connection.
The PiZeroW comes to mind here. Low cost and has WiFi.

1 Like

Well, if WiFi is the (only) way to go, I’d probably go for the wifi solution for the EmonTX, no? But my device will sit in a metal box with an ethernet switch right next to it. Going over the air just seems unworthy for a so called smart home… Another reason I prefer ethernet is that it would (potentially) allow me to use POE (but that’s a whole new can of worms).

See also:

You can connect directly via serial to a Pi (or Pi clone) and then ethernet.

EmonTX - Serial - Pi - EmonHub - HTTP API or MQTT - Emoncms Server (not necessarily on local Pi).

Any old Pi will work.

1 Like

I’d forgotten that you mentioned the two would be co-located.
As Brian said, any Pi will do. Even a Pi 1. (the oldest version)
Pi clones are cheap, so that may be the way to go so save $$$

One point I’d mention against the Ethernet Shield - many years ago there was a problem with some Ethernet shields conflicting with the analogue inputs of the emonTx Shield - if my memory serves. It’s not been mentioned for years, so maybe those particular ones are no longer available. There should be some information on the archived forum.

Ok, I’ll keep that option in mind, but it seems to open up a whole different can of worms by introducing a second device (an entire computer!) into the picture and I don’t really see the point. Not aesthetically (another box that uses space and needs to be powered) and not technically (after all: this topic is about a solution that uses the emonTX shield with the Ethernet shield). Am I missing something?

Just to recap:

  1. Here are the instructions for running an emonTx Arduino Shield + Ethernet Shield.
  2. These instructions seem to assume a version 1 Ethernet shield but this seems unlikely to be a problem for anyone using version 2. So it’s worth trying out.
  3. Another concern with using this setup is that it may not be supported in the future or that there are few users with this setup to discuss issues. But this would surely also apply to the
    EmonTX - Serial - Pi - EmonHub setup.

So based on that information I’m thinking I’ll give @Wouter_Jansen’s setup a try, starting with the Arduino Ethernet Shield 2 with POE and working my way down in case of failure…

While neither of the two (emonTx shield with Ethernet shield and direct serial connect) are
as popular as the UHF radio module (RFM) or the WiFi module (emonESP), if memory serves,
the direct serial connect method has received much more attention than the Tx shield/Ethernet shield combo.

Searching the forum for “direct serial connect” returns quite a few threads.

1 Like