Measuring current on a negative supply rail. - Page 1
Forum section: electronics / projects

author: PhillHS
author_rank: Newbie
timestamp: July 21, 2020, 09:36:50 pm
content: Hi all,I'm developing a power monitor for a retro computer that will sit in between it's PSU and logic board to measure voltage / current of it's power supply lines.The logic board runs on 3 voltages, +5V, +12V and either -5V or -12V (some versions use -5V some versions use -12V).My monitor is based around an Arduino pro-mini (mostly because they are cheap and are a convenient way to get an AVR plus crystal, reset switch and resistorsas an all in one package). However though I'm using the arduino bootloader I'm programming it in plain AVR-GCC.Measuring the current / voltage on the +5V and +12V lines is easy I've got a couple of INA219 IIC voltage / current sensors hooked up whcih do the job without problems.However the INA219 will not cope with voltages below 0V.I have used an LM358 opamp in differential inverting mode to measure the -ve voltage with the ADC as this provides a +ve voltage directly proportional to the -ve voltage at the input.Measuring the current is proving to be a bit involved. The -5V / -12V line is only expected to draw between 0 and -100mA. I have treid using an ACS712 Hall sensor, but it seems thatthe output in mV / A is way too small to detect at the the current levels that I will have flowing.Does anyone have any suggestions as to how to measure the current in the -ve rail. Quite happy to considder a sensor module that can be controlled by IIC/SPI or provide an analogvoltage that the AVR can read.Cheers.Phill.

author: namster
author_rank: Regular Contributor
timestamp: July 21, 2020, 10:31:16 pm
content: to measure a DC current you have to use a shunt resistor for a 0.1A you can use a 1 Ohm wich give you a 0.1Volt for Voltage Resistor , according to connection of your shunt ( High or low side ) you can use a diffirential or inverting Amplifier !

author: Vovk_Z
author_rank: Super Contributor
timestamp: July 22, 2020, 04:42:29 pm
content: Linear Technology. Application Note 105. Current Sense Circuit Collection.

author: OM222O
author_rank: Frequent Contributor
timestamp: July 22, 2020, 08:06:09 pm
content: Any integrated ICs with shunt and digital programmable gain array, with over current warning, etc. I personally used a bunch of T.I. parts before and they all worked very well. Go to T.I. website and go to amplifier section and then select current sense amplifiers. You can choose from them. Other manufacturers like analog devices, microchip, maxim, etc definetly should have similar options too but I haven't used them so I'm not sure which ones to recommend.

author: mikerj
author_rank: Super Contributor
timestamp: July 22, 2020, 08:41:11 pm
content: You could power the INA219 from the negative rail so the common mode is within the allowable range, your headache then becomes level shifting the I2C lines. An SPI device would likely be easier as you don't have to deal with a bi-directional line.Depending on your accuracy requirements you may be able to use one of the Allegro hall effect sensors, though be aware of drift and the influence of external magnetic fields.This app noteshows how a Maxim instrumentation amp could be used for sensing negative rail currents. The same technique could be applied to other amplifiers.

author: David Hess
author_rank: Super Contributor
timestamp: July 22, 2020, 11:06:37 pm
content: Quote from: PhillHS on July 21, 2020, 09:36:50 pmThat points to a more general solution. Using a single operational amplifier with transistor to measure high side current is simple and you can find it in the Linear Technology application note linked earlier; the operational amplifier and transistor create a high side current source which can then drive a ground connected resistor to create a ground referenced voltage proportional to the high side current.This solution works just as well for the low side except that the voltage is negative, but this is easily fixed by driving an operational amplifier configured as a transimpedance amplifier to convert the negative current to a positive voltage, and all of the math remains the same.If the analog-to-digital converter has differential inputs then no inversion is necessary.

author: MarkL
author_rank: Unknown
timestamp: July 23, 2020, 11:45:47 am
content: Quote from: PhillHS on July 21, 2020, 09:36:50 pmTake a look at the MAX9918/MAX9919/MAX9920 current sense amplifier. Its common mode input range goes down to -20V, so you can measure directly across a sense resistor on the negative rail with a single-ended, positive input ADC like on the AVR. Variants include adjustable/fixed gains and sense voltage ranges.https://www.maximintegrated.com/en/products/analog/amplifiers/MAX9920.htmlDepending how you wire it, you can have it provide a unidirectional output (sounds like what you want), or a bidirectional output offset from a reference voltage so you can measure bidirectional current flow (for example, 1.0V +/-100mV).