I am trying to use a Raspberry Pi to measure the amperage used by a boat's electrical system. The boat has a shunt pre-installed just before the battery ground. I have a Pi with an ADC installed behind the main DC panel reading other battery voltages. I'd like to use the Pi to measure the voltage across the shunt to check amperage. The problem I have is that because the shunt is right next to the batteries (no load in between) its voltage is lower than the ground where the Pi is installed. The Pi's ground needs to run through about 20' of load carrying wire before getting to the shunt. Typical voltage across the shunt that I want to measure is 1 to 50 mV. The low end of the shunt sits about 60mV below the Pi ground. I've fried an op-amp and an ADS1115 that worked fine on my workbench where the shunt is not lower than the ground. I would tie the pi ground to the shunt directly but I'm not sure if that would affect some of the other things I'm reading with it. Can I use a separate IC with its ground at the shunt level and still have it communicate via I2C with the Pi, or would the different ground levels break something? Or is there some other circuit I could use? Attached is a schematic of what I need to measure.
An ordinary inverting amplifier does this for you. Because of the virtual earth effect, the inputs do not go below 0. Actually most opamps whose inputs work to zero, will work to 0.5V below ground i.e. until input protect diodes start to conduct
Using a low-drift, low offset amplifier simplifies life, but you can use a port pin to zero the amplifier and calibrate offset and drift out in software. Again, as long as the voltage is clear of 1 diode drop, output ports work below zero - they are just an NFet