I'm working on a product that will have several STPM32 metering ICs measuring voltage/current/power/energy consumption of several relay-controlled circuits. I am designing such that the relay and analog front end of the measuring IC can control/measure either a 0-40 V DC or a 230 Vrms AC source.
The DC source is either a battery bank and the AC source is an inverter. The measuring IC is configured to measure the differential voltage across a shunt resistor located on the PCB as well as the differential voltage between the DC + or AC "hot" wire and a yet-to-be-determined reference point.
I am trying to figure out how to implement a grounding scheme between the analog front ends of the measuring ICs, and the voltage sources to be controlled/dispatched.
I've taken a crack at drawing a couple of rough schematics of what I'm talking about.
The 1st schematic shows two channels (hence 2 metering ICs). The first channel I have drawn showing the inverter connected (230 Vrms source), with another 12 V source shown as an available alternative (by switching SW1 and SW2). This is intended for illustration purposes only (to really knock home that it could be a DC source feeding channel 1 just as easily as an AC source). There is also a 24 V DC source that is feeding the 2nd channel at the bottom of the schematic. The problem with this topology is that the voltages on the input pins to the metering IC will go above the max of 0.3V. Another problem with this setup is that if the neutral wire gets unplugged while the relay is closed, the metering IC will get 230 Vrms on its I+, I-, and V- pins.
This 2nd schematic shows my original idea. I was originally just going to tie all the grounds of the channels together on the PCB. This works in terms of keeping the voltages on the metering IC pins within spec, but then I realized that the GFCI of the inverter would trip due to some current returning to the inverter via ground instead of via its neutral conductor. Other than that it seems to be a good design.
If I simply switch to an inverter without a GFCI on its output, can I proceed and just tie all the grounds together on the PCB as shown in the second schematic (i.e. tie neutral to earth ground on the PCB?).
I'm starting to think that the only viable option is to have each channel galvanically isolated from the other channels. That way, I can "float" each measuring IC to the neutral/DC- voltage, ensure that none of the pins will go above 0.3V (if neutral gets unplugged while relay is closed, the local metering IC ground will simply float up to 230 Vrms), and all the while ensure that all the current from the AC source returns via the neutral line.