Multiple emonTx Shields?

Can emonTx shields be stacked or connected to a single Uno/mega/stm32 board? If not - why? Is it a hardware limitation? is it a software issue? I would like to create a big managed power brick (8 sockets) for my aquarium and would like to add a feature to track who much and if power is consumed.
Can a single 9V AC reference adapter be used for 3 shields?

Edit: since this would be in box build - can I use simple raw cts like CT104A Micro precision current transformer current transformer 5A/5mA sensor|Transformers| - AliExpress
All those jacks would and use friendly-movable split core design is extra wasted space.

1 Like

hardware limitation as there are only so many analog inputs and the first shield uses them-- you could build and adaptor plate for a mega 16 analogs and you could probably handle 3 boards could not stack them but side by side

1 Like

Sorry if this is a dumb question - but can I compile emonTx lib to SMT32F4 controller (they seem to have plenty of ADC channels STM32F411 - STMicroelectronics)

you just need to add and point the other CTs to to the analog port you have connect too in the sketch just add another CT and point to the Analoge port here - example from base sketch

  if (CT1) ct1.current(1, 60.606);                                     // Setup emonTX CT channel (ADC input, calibration)
  if (CT2) ct2.current(2, 60.606);                                     // Calibration factor = CT ratio / burden resistance
  if (CT3) ct3.current(3, 60.606);                                     // emonTx Shield Calibration factor = (100A / 0.05A) / 33 Ohms
  if (CT4) ct4.current(4, 60.606);

No, the emonTx Shield is the interface circuitry for the ADC inside the Arduino, so you can have only one Shield for each Arduino.

Yes it can, and you can use the same d.c. supply to power 3 Arduinos too - provided it has an adequate current output.

Ring-core c.t’s are of course generally smaller and more accurate too. The problem you are likely to have with that one is its power rating. That is not specified directly, but in terms of the burden (100 Ω). Using the recommended 100 Ω burden (you’d need to change one resistor per channel in the emonTx Shield), at 5 mA you will have 500 mV rms. The Shield’s maximum input with a 5 V Arduino is 1.6 V rms, so you’ll be losing ⅔ of the input range and accuracy at low currents will suffer. If you’re always using nothing or say 2 - 3 A, it might not be a major concern. Below 1 A, it could be.

If you want to make the interface circuitry yourself, look at Home Energy Monitoring System
You would still need to change to the correct value of burden resistor for your c.t.

“Below 1 A, it could be.” biggest load is heaters at 500W and Lights, the rest is in 10-150W range. So I would need to tune the burden resistor value one for heaters/lamps one for small loads?
Thanks for the link btw - I’ll go read it.

It might be acceptable to use a higher value burden resistor than 100 Ω, but there is not enough information available for that c.t. to know. It would need to be tested and the properties with various burdens measured before I could give a proper answer.

It is difficult to believe a page that says “Uses: accurate measurement of voltage and power” for a current transformer.

Your biggest problem with measuring 10 W ( ~40 mA) will be electrical noise that makes its way into the ADC - most likely it will come from the Arduino and the d.c. power supply, so a good quality power supply that gives you a clean, smooth output will be essential. It is quite possible that you will see a “current” of that or more even when no genuine current is flowing.

1 Like

Robert tell me if I’m wrong :slight_smile:
Let’s forget the shield. As i understand all I really need is:

  • n of these input circuits:
  • 1 of these reference circuits:
  • Connect them to any microcontroller that can handle n+1 ADC channels.
  • Use “EmonLib.h”(its C/C++ and there is no hardware specific magic going on is there?) to calculate accurate power values from input and reference circuit values
  • Use data somewhere - an exercise to readers imagination

Yes, that is close.

The 22 Ω becomes 100Ω or greater for the c.t. you specified.

The 100 kΩ and 6k6 Ω can be changed to suit the transformer you use (ask if you need help with new values).

You don’t need all those 100 kΩ resistors and 10 µF capacitors - see

If you can get a processor/microcontroller that has an analogue input that goes from 0 to less than 3.3 V, then use that - ideally 0 - 1.5 V. You can always reduce the voltage across the burden resistor by reducing the value of that resistor - and the c.t. will be more accurate (but any electrical noise that gets in will be greater in proportion).

Yes, there is a small bit of AVR magic, in emonLib.cpp.
ADC_COUNTS should be obvious, the deeper magic is at the end. Look at lines 228 - the end:
long EnergyMonitor::readVcc() {

This measures the voltage of the (stable) internal 1.1 V reference against the supply voltage (the ADC reference) and therefore calculates the (3.3 V) supply voltage. It was put there for when batteries are used to power the emonTx, and the supply varies as the batteries age.

If you have a stable 3.3 V (or whatever) supply voltage, you can
#define emonTxV3"
in your sketch and it assumes exactly 3.3 V, or you can change line 70 in emonLib.cpp to tell it your ADC reference voltage exactly.

My imagination says have a serial connection to a Raspberry Pi EmonTx V3.4 - OpenEnergyMonitor Wiki and run emonCMS on that - you can record everything, view graphs etc.

My imagination also says that if the processor you choose has a 1-wire input, you could measure tank temperatures etc with a few DS18B20 temperature sensors, and monitor & record those too.

1 Like

:slight_smile: the idea is to route data from “power brick” to master controller and then to a RaspbegryPi that acts as a webserver.
This is a DIY reef tank controller project its in initial planning and parts ordering phase still :slight_smile: Because I’m cheap and I’m bored.
There is a master controller because I’m planning a couple of modules more (another power brick, water chemistry probe box) + a couple of switches, and water level triggers and I want minimal UI/info screen so need it visible while all others will be hidden

Back to power - I plan on using a battery backed up ~50W 12V meanwell psu to power all arduinos/smt32/microcontrollers. And then use dc step down converters if I need 9, 5 or 3.3V … how good an idea is that?
That 9AC reference input will work perfect as no power alert trigger.
Thanks for temp probe link - all I found were metal ones … not great in saltwater :slightly_smiling_face:

Oh and I found this thing: 5A Range Single Phase AC Active Output Onboard Precision Micro Current Transformer Module Current Sensor For Arduino ZMCT103C|Transformers| - AliExpress
I think it has a proper description:

Noise on the output might be a problem - you may need good filtering to remove it.

Ours are stainless steel. Or you could encapsulate the sensor itself in glass, using silicone heat sink compound or silicone grease to transfer the heat between the glass and the sensor.

That would give you more output voltage to feed into the ADC, but it needs a 5 V supply, and presumably the output is centred on 2.5 V, so it requires a 0 - 5 V ADC input range. Again, if the 5 V is not clean, then noise on that will get onto the output and appear as a current.

That appears to be a different device (5 A : 2 mA), and less suitable for what I think you need.

Thanks for the info.
I guess I just have to get myself some controllers CT modules and start testing :slight_smile:

If some of the loads he wants to measure are in the aforementioned range,
he could pass multiple turns through the CTs connected to said loads, could he not?
(the thinking here is the wire for loads of that size should be fairly small)

Of course. I keep forgetting that this won’t be obvious, or already known, to most people.

Most of the ATMEGA and ATTINY ranges can use an external voltage reference, so that could be used to give you the 1.5V reference.

I think I found the one stop solution: 220V 50A Single Phase AC Current Sensor Electric Parameters Detector Current Voltage Power Frequency Capacity Measuring Module|Integrated Circuits| - AliExpress
But … its very pricey. And TTL MODBUS-RTU is UART isn’t it? i would still need alot of Uart connections. SPI expander boards?
Also I found a nice practical l demonstration of the Aliexpress parts that I mentioned in previous posts: AC Power Measurement Using Arduino | Code | Circuit | PCB | Module ZMCT103C Micro Current Transformer | 5A / 5m | Arduino Code
As i understand ZMPT107 acts as a 9VAC reference adapter - that would be a nice space saver but a bit scary to connect 220V to the same board :scream:

I took a peek at my local electronics online stores :frowning: no CT’s no VAC adapters … I’ll go to a local store and ask directly but it seems like for these things it’s international shipping :frowning: … Covid-19 … bad timing

The spec sheets I’ve looked at say the device has a max voltage rating of 1000 Volts and
an isolation rating of 3000 Volts. Here’s a couple of links:

But the main issue with the module is it’s rated at 50 Amps. Given the fairly small rating
of the loads you want to monitor, you’d be better served by using something like this:

I didn’t see any reference to Modbus on the page the device is listed on.
What was it that made you think it’s a Modbus device?

Thanks for interest bull but I think you have things mixed up:
As you correctly noted ZMCT103C is much better for my application and that is why
AC Power Measurement Using Arduino | Code | Circuit | PCB | Module uses it for ac current sensing.
if you scrolled down on the article you will find that there are images of a device that uses both ZMCT103C and ZMPT107 (can’t find aliexpress link … I’m pretty sure i saw it on aliexpress) - as I understand ZMPT107 provides the same functionality (reference AC signal) as an 9VAC adapter for Arduino emonTx Shield.

:slight_smile: that would be for this thing 220V 50A Single Phase AC Current Sensor Electric Parameters Detector Current Voltage Power Frequency Capacity Measuring Module|Integrated Circuits| - AliExpress

At this point my plan is to get an arduino mega, 10 pieces of ZMCT103C, 1 unit: ZMPT107 + relevant passive components.
Are there any reason I could not use a ADC expander modules?
Are there any benefits of using higher precision ADC?

Ah, I see it now. I didn’t scroll down the page far enough. :frowning_face:
Yes, you will need a Modbus to TTL interface to use it with an Arduino.
Something like this:

As far as I can tell, the ZMPT107 is a current transformer, with a ratio of 2 mA : 2 mA.

To use it to measure voltage, you must use a multiplier resistor in the primary circuit to convert the mains voltage to a current, and you must use a burden resistor (or a current-input op.amp) to convert the output current into a voltage.

I have seen modules using this, my concern with those is they appear to rely on a single component for the multiplier resistor, so that single component must have an adequate voltage rating for the peak value of your mains voltage.