Ground coupling a high voltage source with the A_GND and D_GND
Optocoupler could be quite small, but a magnetic current sensor could be an alternative to provide isolation. Having a flowting transformer powersupply for the complete electronic would allow also to connect both grounds.