Using the ATM90E32 to sample voltage and current on split phase

I plan on using the ATM90E32AS IC as the core of a smart energy meter. Dynamic Product Page | Microchip Technology

Then hooking that up to an esp32 or similar to get data back to emoncms. I had some questions hopefully someone more experienced than me can answer

  1. In the application notes, the diagrams do not separate AC and DC ground, but I’m pretty sure they should be separate, correct?

  2. I’m going to be measuring a split phase 120v 200a line. To accurately measure voltage, should I connect to both hot legs to measure them?

  3. Since I’m putting AC voltage into this board, is there any other protection that should be on the hot lines besides varistors?
    I don’t plan on powering the DC components from the AC line, but with a separate 5v transformer.

Thanks for your help!

Can you supply a link to the particular app. note, please?

Ideally, yes.

You most certainly must not have a direct galvanic connection between the incoming mains supply and your board. In the event that the neutral falls off, inside or outside your property, the whole lot could become live to 120 V a.c. You must use one (or two if you monitor both legs) isolating voltage transformers (e.g., or if the 0.333 V output of that is a problem, you could use our US a.c. adapter.

Thanks for replying Robert.

My current schematic looks very similar to the 3rd example (page 9) in the application notes:

In the application notes it shows a series of 7 240k resistors for each hot wire. In mine I replaced these with 4 220k resistors and a MOV varistor for each hot wire to earth ground. I thought that would be a sufficient replacement for transformers, but is that not the case?

Consider what happens if one leg and neutral fall off outside your house, between the house and the local transformer (where the main earth is), but you have some loads connected (as you’d expect!). The “ground” is then connected to the remaining live line through your load, and the whole circuit is live to 120 V. Unless you have complete galvanic isolation further down the chain, everything connected to what you think is ground will in fact be live. Even if you do, you must treat the whole circuit as ‘live’ while you’re working on it.

I’ll find that note and look, but that’ll be a bit later.


I think that depends on what you mean by ‘separate’. No, I don’t think you should separate them such that a significant voltage can exist between the two grounds, but it’s normal practice to keep the two grounds generally separate and join them at one point only, such that currents flowing in the digital ground - by inference noise that you don’t want to enter the ADCs - don’t generate a voltage that the ADC can see. But then, if the ground is sufficiently solid, that shouldn’t matter.

If you do decide to keep your dropper resistor chain for the voltage, then you can only use the opto-isolated pulse outputs, and you must dedicate the power supply to the non-isolated side of that circuit only, and not share it with anything else. You cannot use any of the other outputs or inputs (e.g. serial data) unless those too pass through opto-isolators.

And of course the withstand voltage must be adequate to cope with spikes on the mains plus the neutral failure.

Funny, my power wires have actually been knocked down 2 times due to a tree breaking in my back yard, so that’s not too far fetched.

What if I don’t have the neutral connected and only have earth ground connected though? Same situation?

By separate I mean not using a single ground and only connecting the two in one place, yes. The IC itself has a digital and analoge ground as well. They are setup exactly the as in the application note.

Not quite, but then you’re measuring Line-earth voltages and not line-neutral. They should be the same, but won’t be.
Then of course you’ll have what will be seen a leakage path from line to earth when your installation is tested, and that should show up as a fault and cause questions to be asked.

I’m afraid everyone thinks it won’t happen to them, and in the main, they’re right. But sometimes it does. If you’re lucky, it might just blow up a computer. If you’re not, lives can be lost.

The IC measures differential voltage on the hot lines only though, so it doesn’t use the neutral for anything. Maybe I’m not understanding correctly though.

Yeah, all kinds of weird stuff happens when only one wire is connected to your house. Luckily I turned off the main breaker each time it happened.

'Fraid so. The diagram shows the “B” voltage connection to the ground symbol. That’s not the protective earth, it’s the common “ground” within the apparatus.

If it was the PE, then it would be reading values that would depend for accuracy on the neutral voltage being indistinguishable from earth.

I saw someone run the i2c bus though an isolator ic for the same reason. The only problem is those chips are more expensive than the main IC.

What price safety?

Wait, I don’t get it. Its ground but not ac neutral.

It’s circuit ground, not the protective earth.

All the points with the “earth” symbol on that diagram connect to the “digital ground” of the i.c. If you want to measure the line to neutral voltages, then you must connect that to the supply neutral, which is what I think is shown by the terminals UA, UB & UC on the left-hand edge. It’s even clearer on the 3-phase diagram, where the 4 terminals are UA, UB, UC & UN.

But note, you must not connect that ground to the protective earth. If you do, any current arising from a fault elsewhere in your house will be shared between the neutral-earth link at the transformer and that connection on you circuit board. That’s dangerous.

No protective earth is shown on the drawing, but unless the equipment is double-insulated, you should have one and you should connect all exposed metalwork, and the transformer inter-winding screens (if they exist) to the protective earth.

Thanks again for all the feedback Robert.

Rather than rock messing something up with AC voltage, I’ve redesigned everything to use a 12v AC/AC transformer to read the voltage, and then some diodes and an LDO to convert that to a usable DC 3.3v

Now I just have to get everything to work properly with the SPI interface, which, so far is not going well.

Just curious why you are using a part designed for polyphase AC on a split-phase circuit. I don’t believe you will find it easy to get the right answer with the part you selected.

In the product line, ATM90E26 would the better choice.

Be aware that using a potential transformer for the voltage source means you will need to quantify the phase error it introduces to the measurement.

Or a little more precisely, as any transformer will introduce a phase error, the difference between the phase errors of the voltage and current transformers.

Magnelab make the 120 V P.T. that I’ve previously mentioned, claiming a phase error of less than 1 degree.

But that won’t double as a power supply. The plug top transformers generally have a lot more distortion all round, phase, linearity and saturation.

You are correct about the phase difference. That’s a really nice PT. They seem proud of it at a price of $60 each :grinning:. I guess that puts a price on accuracy.

It seems many people are not willing to pay that much. Some even use the same transformer to power the device, which as you stated is going to make the accuracy even worse.

I guess we all need to decide just how accurate we need vs want it to be and for how much accuracy we are willing to pay.

Indeed. But then, quality instrumentation - which is what that is - has never been cheap.

Every now and then they show up on FleaBay. I snagged one for 25 bucks.

Cost and complexity, mainly. I would need to use 2 26 ICs. With the 32, I can just turn off one set of channels and configure it the way I want.

So far I’ve gotten things calibrated the way I want them, I just need to make a couple more adjustments to things like the voltage divider, the LDO, one of the voltage rectifiers, and make sure it works with a different brand of current sensor.

Here’s the second iteration: