Prevent ground loop from separately derived power source with differential input

I wish to measure the voltage of a battery battery bank for an inverter. The negative side of the bank is not grounded (left floating to reduce chances of a battery cable shorting when it touches a grounded object). The arduino is powered by the AC side of the inverter suppled power by the battery bank. The AC side has normal grounding (neutral bonded to equipment ground in the panel and connected to an earth driven ground.)
When I measure battery voltage with my voltmeter between:
[the positive battery terminal] and [the negative battery terminal], it reads 13.5 volts.
[the positive battery terminal] and [equipment ground on the ac side], it reads 8.5 volts.
[the negative battery terminal] and [equipment ground on the ac side], it reads -5.0 volts.
Thus, the normal single ended analog input on the arduino should read 8.5 volts. Additionally, connecting the negative battery terminal to ground on the arduino should introduce a high current ground loop, which would be bad. Especially since the arduino is currently powered thru the USB cable on my computer.

So I'm thinking that the solution is to use the Mega2560 ability to make differential analog measurements. Forum user afanasyevich kindly posted a AnalogDiff library that measures the differential signal between two analog input pins:
http://forum.arduino.cc/index.php/topic,147830.msg1110852.html
http://sekarlangit.com/arduino-differential-gain.php
I would connect the positive battery terminal thru a voltage divider to pin A0, and the negative battery terminal thru a voltage divider to pin A1. depending on where the battery terminals are floating, one or the other pin will see a negative voltage.
Is this the answer to my problem?

Is this the answer to my problem?

No.

So I'm thinking that the solution is to use the Mega2560 ability to make differential analog measurements.

It can only measure differential voltages with respect to ground.

Additionally, connecting the negative battery terminal to ground on the arduino should introduce a high current ground loop

I can't see that. Have you a schematic your explanation is not easy to follow.

One way to measure a floating voltage would be to use an opto isolator with two receivers so you can use an op amp on the send side as a linear transfer isolator.
Another way would be to have a voltage to frequency converter on what you want to measure coupled by a transformer / op amp / capacitors int the Arduino.

What you ask is multiple floating grounds, and not very common.

sonnyyu:
...
3. add 5V wireless power supply module to power ADC, Use it to measure the voltage drop across a resistor in the 4-20mA loop, and use 2 or 3 opto isolators to pass the signals between the ADC and the Arduino.

Basic use wireless power supply module provide isolate power and use opto isolators provide isolate input.

Basic use wireless power supply module provide isolate power

A wireless supply is not the only way, there is an old fashioned thing called a transformer that isolates power rails.

Sure, Plan C;-

Insulated dc-dc converter, now is flyback transformer.

Plan D;-

Multiple iphone ac adaptors, one for one ADC.

turgo:
...
I would connect the positive battery terminal thru a voltage divider to pin A0, and the negative battery terminal thru a voltage divider to pin A1. depending on where the battery terminals are floating, one or the other pin will see a negative voltage.
Is this the answer to my problem?

As described, it isn't the answer to your problem. The Arduino is only able to measure positive voltages, and one of the two voltages you want to measure is negative, i.e. about -5v.

If the voltages you want to measure are offset by a more-or-less constant voltage with respect to ground, then you can use a slightly different arrangement. Make your voltage dividers from three resistors instead of two: a resistor R from Ain to ground, a resistor R from Ain to +5V, and a resistor nR to the input you want to measure. Then the Arduino will be able to handle voltages between +2.5 * (2n + 1) volts and -2.5 * 2*n volts.

However, this will only work if the common-mode voltage doesn't change significantly between reading the two analog inputs. A better solution is to use a digital isolator chip such as the ADUM6401 to connect an isolated SPI ADC to the Arduino.

Thanks for the replies all. dc42 indicated that the Arduino could not measure a negative voltage. Both the author of AnalogDiff, and the ATmega 2560 manual suggest that this is not true. Here (attached file below), on page 379, it shows that the minimum input voltage is -VREF/gain, which is a negative voltage.

Would everyone who has kindly taken time to reply please look the ATmega 2560 manual over Smart | Connected | Secure | Microchip Technology, and examine the AnalogDiff library HugeDomains.com with respect to my application?

You're looking at the figure for Input differential voltage which is the maximum voltage difference between 2 differential inputs that you can measure. Both of those inputs still need to be within the range for Input voltage, which is specified in the same table.

However, if you are using the ADC in differential mode then my comment "this will only work if the common-mode voltage doesn't change significantly between reading the two analog inputs" does not apply, because the two inputs are sampled at the same time.

Thanks for your kind replies. I now see that the Arduino doesn't measure negative voltages. I'll solve this problem by grounding the floating battery.