Author Topic: Measuring current on a negative supply rail.  (Read 1874 times)

0 Members and 2 Guests are viewing this topic.

Offline PhillHSTopic starter

  • Newbie
  • Posts: 1
  • Country: gb
Measuring current on a negative supply rail.
« on: July 21, 2020, 09:36:50 pm »
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 resistors
as 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 that
the 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 analog
voltage that the AVR can read.

Cheers.

Phill.


 

Offline namster

  • Regular Contributor
  • *
  • Posts: 58
  • Country: dz
Re: Measuring current on a negative supply rail.
« Reply #1 on: July 21, 2020, 10:31:16 pm »
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 !
 

Offline Vovk_Z

  • Super Contributor
  • ***
  • Posts: 1453
  • Country: ua
 

Offline OM222O

  • Frequent Contributor
  • **
  • Posts: 768
  • Country: gb
Re: Measuring current on a negative supply rail.
« Reply #3 on: July 22, 2020, 08:06:09 pm »
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.
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3306
  • Country: gb
Re: Measuring current on a negative supply rail.
« Reply #4 on: July 22, 2020, 08:41:11 pm »
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 note shows how a Maxim instrumentation amp could be used for sensing negative rail currents.  The same technique could be applied to other amplifiers.

 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 17016
  • Country: us
  • DavidH
Re: Measuring current on a negative supply rail.
« Reply #5 on: July 22, 2020, 11:06:37 pm »
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.

That 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.
 

Online MarkL

  • Supporter
  • ****
  • Posts: 2189
  • Country: us
Re: Measuring current on a negative supply rail.
« Reply #6 on: July 23, 2020, 11:45:47 am »
...
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 analog
voltage that the AVR can read.
Take 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.html

Depending 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).
« Last Edit: July 23, 2020, 11:48:31 am by MarkL »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf