Thanks for the help with this project so far.
I got my boards back and they work just fine. I tested them at first with a 24VAC sprinkler transformer, then I went up to an isolated mains transformer, and eventually with direct mains, taking the load all the way up 1500W. No smoke!
I know you guys know a lot about this sort of project, but here are some of my thoughts/learnings:
* I decided to use the ISOW7841 because of the simplicity of only one part, and it works fine and required zero debugging. Though I will be making a bunch (maybe a few tens) of these, the number is not so high that the price is that important.
* My AFE is an ATM90E26. I stuck with the reference design concept, in that they put the mains "live" onto the "ground" for the AFE chip. I understand that I could have just let the CPU ride the mains along with the AFE, but I decided to isolate it, mostly because of ease during debugging. If I want to probe something on the CPU side of things, there's no fuss. Same with programming headers, etc.
The uC side of things, by the way, is alternatively an Atmega328P which bridges between the AFE and a Raspberry Pi Zero W, or I can leave the atmega out entirely and talk to the the RPi directly. I thought I'd have the uC there in case I needed to do any real-time processing, but because the AFE integrates energy for me, there's little need for it, so I think I will spin the board again without the uC
* If you want to get close to the promised accuracy, I need better tools for calibration. I used a single Fuke 87V to calibrate the voltage and current, with various "handy" loads, I had laying around: 800 ohm WW resistors, 40 W lightbulb, 150 W lightbulb, and 1500W space heater. All those loads have imperfect power factor and also change with their temperature, which obviously changes. One thing I noticed is that as I varied the loads, the voltage would change, so I really needed to voltage and current simultaneously, which I could not do. Also, mains voltage just varies a bit minute by minute on its own. Complicating matters further, I really need good measurements directly across the shunt in order to calibrate the energy metering (as opposed to just the Irms and Vrms measurement) and that's also not easy. One mistake I made was not putting test points for the shunt.
So now I want a programmable AC load and a programmable AC source. Too bad I don't have funds for that!
* In my boards, I only did the shunt measurement and left the CT measurement off entirely. I'm thinking of putting the CT onto a new board, probably use a CSE187L. But I'm not sure I need it. The AFE chip is designed to measure a voltage across a current shunt and from a CT. This is for tamper protection, mostly. You can put it in a mode where it alerts if one is missing, or it chooses whichever is larger. I don't need this. My main reason to consider the CT is that maybe it's more accurate than the shunt? Maybe not?
Okay, enough for now.