1
\$\begingroup\$

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. ADC Schematic

\$\endgroup\$
  • \$\begingroup\$ Have a look at current sense amplifiers. TI and Analog both have multiple PNs. Most can measure differential voltages well above their positive rails and a few (the ones you want) can measure below their negative rails. \$\endgroup\$ – The Photon May 7 '18 at 1:23
1
\$\begingroup\$

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

schematic

simulate this circuit – Schematic created using CircuitLab

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

\$\endgroup\$
  • \$\begingroup\$ +1 (that was a quick edit!) Might be worth mentioning that output should work down to close to zero too if you want it to read correctly for low current. \$\endgroup\$ – Spehro Pefhany May 7 '18 at 3:47
  • \$\begingroup\$ Indeed. The LM358 works, but there are far lower-offset and drift amps available. If you know current goes to 0 (or in fact X), at some time, you can compensate for drift in software \$\endgroup\$ – Henry Crun May 7 '18 at 3:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.