New Open Source Split Phase Energy Meter that uses EmonCMS

Tags: #<Tag:0x00007f880d6a6d90>
(dBC) #28

Yep, it does. And that’s with the ESP in full power wifi tx mode? That’s probably your worst case current drawer.

(John) #29

Actually, I should have had an ESP connected. The only load in that case was the IC itself. With the ESP connected and transmitting wifi and SPI signals, it looks more like the first graph I posted. I’ll be adding some bypass caps on the 3v3 output. The good news is the IC is able to filter out any noise regardless.

(Robert Wall) #30

That’s what I too suspected would happen. The source of the problem is the non-zero impedance of your 9 V transformer, which means that the charging current for the 220 μF reservoir capacitor creates a voltage drop inside the transformer (and in the connecting cable too), and it’s that which puts the step in the waveform you’re trying to measure.

Does that mean you ignore any power in the harmonics, or just the high-order ones?

(John) #31

Hi Robert - thanks for chiming in! I would imagine a more expensive AC transformer wouldn’t have this problem. Do you think some extra bypass caps and/or a ferrite bead on the 3V3 out would help with this?

Yeah, it would only be high frequency filtering. There is a way to calibrate an offset if interference is too much.

(Bill Thomson) #32

Sounds like you might be a tad confused, John.

The flattening seen at the waveform peaks is caused by the transformer.
But the “gouge” (for lack of a better term) that’s in the waveform (near the positive peak)
is caused by the 220µF cap you’re using. Replace it with a 10µF cap and you should
see an improvement.

The emonTx does use the same power supply to meet the DC needs of the device as well
as provide an AC waveform sample, BUT, the max current draw from that power supply is very limited.
IIRC, the absolute max is 60 mA, but the recommended max is 10 mA.

From the wiki page:

  • Important note regarding powering with AC: Only recommended for standard emonTx operation without auxiliary sensors (apart from a max of 4 DS18B20 temperature sensors) or equipment (e.g. relay modules) connected. Correct operation via the AC supply is critically dependant upon using the correct AC-AC adapter. If you are using the recommended adapter, the current draw exceeds 10 mA, and mains voltage is below the allowed minimum, 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 10mA of current is required, it is recommended to remove jumper 2 (JP2) and power the emonTx via the 5V USB connector. If an AC-AC adapter is connected it will be used only to provide an AC sample when JP2 is removed.*

A better solution would be to use a separate DC power supply.

(Robert Wall) #33

This is a property of all transformers, so I’m afraid you’re likely to be stuck with it. The magnitude of the impedance might be somewhat less with a higher-rated transformer, but other factors, like phase shift, could easily spoil everything.

Not really. If you do filter (excessively), you’ll end up not measuring the power in the harmonics, which will introduce a deliberate error. It ought not to be a large error, because the power in the harmonics should, if your loads obey the rules, be small. But you don’t know that they do and whether it is or it isn’t negligible.

(Robert Wall) #34

In part, also by every other Tom, Dick & Harry who has exactly the same sort of power supply (except probably using a full-wave rectifier) hung on the system and all pulling current just at the peaks.

If I look at my UK mains waveform directly (×10 'scope probe), then I see pretty much the same degree of flattening as I do from the TDK a.c. adapter.

[Picture is below.]

(Bill Thomson) #35

Here’s a scope pic of my mains. (10x probe) How does it compare with your mains waveform?

(John) #36

Thanks Bill. You’re right, I read that incorrectly, thanks for explaining. That makes sense, but I probably cant go with that low of a cap without causing other problems with the SMPS.

(Robert Wall) #37

Here you are:

The yellow trace is the raw mains, the blue is a standard TDC UK a.c. adapter, unloaded.

It is very clearly “flat-topping” on the mains supply itself.

(Bill Thomson) #38

Given we typically have 1 to 6 houses on a single transformer vice the 100 or more you have in the UK, would you say that’s why my waveform isn’t flat-topped? (although it clearly is distorted)

(Bill Thomson) #39

Application note Basic Calculation of a Buck Converter’s Power Stage (Rev. B) says:

6 Input Capacitor Selection

The minimum value for the input capacitor is normally given in the data sheet. This minimum value is
necessary to stabilize the input voltage due to the peak current requirement of a switching power supply. The best practice is to use low-equivalent series resistance (ESR) ceramic capacitors. The dielectric material must be X5R or better. Otherwise, the capacitor loses much of its capacitance due to dc bias or temperature. The value can be increased if the input voltage is noisy.

The data sheet says: Input Capacitor

For most applications, 10 μF is sufficient and is recommended, though a larger value reduces input current ripple further. The input capacitor buffers the input voltage for transient events and also decouples the converter from the supply. A low ESR multilayer ceramic capacitor is recommended for best filtering and should be placed between VIN and PGND as close as possible to those pins.

(Bill Thomson) #40

Why not use the third channel for PV monitoring?

(John) #41

I know, but I have a half rectifier before the SMPS input, so anything less than 100uf and theres not enough current to power everything.

I actually designed a 3 channel that can fit an esp32 on top, and a 6 channel:

That can have add-on boards stacked

(Kobuki) #42

This looks nice. A few questions:

  • What is the expected accuracy of the device? Will it support calibrated CTs?
  • Is it applicable to a single phase + inverter system on 230V?
  • Will there be an option to add a separate supply for powering electronics (so the transformer is only for waveform capture)?
(Robert Wall) #43

That is likely to be a significant factor. The fewer disturbing influences where the fault level is the lowest, the better (from the point of interference and waveform purity, etc.).

(And I think it could be hundreds in some cases.)

(Bill Thomson) #44


Oh, BTW, that’s half wave rectifier, vice half rectifier. :wink:

(John) #45

This looks nice. A few questions:

  • What is the expected accuracy of the device? Will it support calibrated CTs?
  • Is it applicable to a single phase + inverter system on 230V?
  • Will there be an option to add a separate supply for powering electronics (so the transformer is only for waveform capture)?
  1. Assuming it’s calibrated to the CTs that are being used, it is 99% accurate.
  2. For 230V you’ll need to use an AC transformer that can bring down the voltage at least 12v
  3. I don’t currently have a plan to add an option to power electronics only. However, if you really want to you could just take off the diode right next to the power jack, and hook up the 3V3 pin to power.
(Kobuki) #46


  1. I think you meant 1% accuracy :slight_smile:
  2. The transformer is not an issue, the question is, will it support a 230V system? That would need other calibration values, etc.
(John) #47

Yes, it’ll support a 230V system. It would need to be calibrated for the transformer, correct. That procedure is outlined here

There is a parameter in the library for 50hz power as well.