Background
I am working on a project where I have a solar panel connected to two battery chargers.
One battery charger looks after an old car battery which powers some lights in my garage and a small circuit. The circuit turns the second battery charger on and off, and is used to charge a motorcycle battery.
In the second revision of my circuit I had hoped to use some ADC channels to measure the voltage of the solar panel, as well as the two batteries. Statistics of the voltages would be uploaded over LoRaWAN so I could graph them and keep an eye on things, while the solar panel voltage and motorcycle battery voltage would be used to determine when to turn on the second charger to top up that battery.
My problem
The chargers I am using have a common positive rail between their inputs and outputs with MOSFETs switching the ground instead - this is opposite to what I would ordinarily expect. I designed my circuit assuming that ground would be common, so when I measure voltages at the moment I am just getting the same reading for all 3 points in the system.
I need to redesign my circuit to be able to measure voltages at points where the ground is different.
I had thought about using an analogue multiplexer, like a 74HC4052, to change the ground reference presented to the ADC module of my microcontroller, but this is getting a bit beyond my knowledge, so I need some assistance to work this out.
My question
Does anyone have any suggestions for components that have a kind of isolated voltage input (something which can have its own independent ground reference for the input) which either act as an ADC themselves and could be read over SPI/I2C, or can produce an analogue voltage on the "digital side" which I could then read from my microcontroller?
I have seen some components that act as combined voltage/current sensors, but so far all of the ones I have looked at have only a single ground connection that is shared between the analogue and digital sides.
Any info would be appreciated, and I am happy to expand on any of the above as required.
Thanks