Author Topic: Operational Amplifier for Current Sense  (Read 6578 times)

0 Members and 1 Guest are viewing this topic.

Offline girishvTopic starter

  • Regular Contributor
  • *
  • Posts: 114
  • Country: in
Operational Amplifier for Current Sense
« on: May 05, 2021, 01:26:20 pm »
I want to design a high side current sense amplifier with the following specifications

Load Current: 2A (Maximum)
Load Voltage: 5V (DC)
Sense Resistor: 50 mΩ

I want to use an op-amp in my inventory with the following specifications for the job.

Supply Voltage: 1.6 to 6.0V
Rail-to-Rail: Input/Output
Common-Mode Input Range: VSS –0.3V to VDD +0.3V
Input Offset Voltage: ± 5mv

The Op-Amp in question is MCP6232

https://www.microchip.com/wwwproducts/en/MCP6232

Will MCP6232 fit the requirement?
« Last Edit: May 05, 2021, 01:28:56 pm by girishv »
 

Offline Andree Henkel

  • Regular Contributor
  • *
  • Posts: 74
  • Country: de
Re: Operational Amplifier for Current Sense
« Reply #1 on: May 05, 2021, 01:55:18 pm »
better use a dedicated current sense amplifier like: https://www.ti.com/product/INA180
 

Offline Marco

  • Super Contributor
  • ***
  • Posts: 6720
  • Country: nl
Re: Operational Amplifier for Current Sense
« Reply #2 on: May 05, 2021, 01:56:37 pm »
It can work, but dealing with the offset voltage will be a bit of a pain.

You probably don't want the offset to clamp to zero, so you need to get a bit tricky, for instance connect a 1k resistor to the sense resistor and pull 5mA through it and use the resulting voltage offset by 5mV instead, the offset in current then goes from 0-200 mA (but the drift is much smaller, so you can correct for this).

Taking that into account and with a opamp+PNP high side current sense configuration, yes it can work.

PS. 1k * 5m = 5m? I need sleep.
« Last Edit: May 05, 2021, 04:59:01 pm by Marco »
 

Offline girishvTopic starter

  • Regular Contributor
  • *
  • Posts: 114
  • Country: in
Re: Operational Amplifier for Current Sense
« Reply #3 on: May 05, 2021, 02:05:03 pm »
better use a dedicated current sense amplifier like: https://www.ti.com/product/INA180
Of course I could have done that. I am exploring the possibility of making use of the op-amp's I have in stock and learning few tricks in the process.
 

Offline girishvTopic starter

  • Regular Contributor
  • *
  • Posts: 114
  • Country: in
Re: Operational Amplifier for Current Sense
« Reply #4 on: May 05, 2021, 02:12:30 pm »
It can work, but dealing with the offset voltage will be a bit of a pain.

You probably don't want the offset to clamp to zero, so you need to get a bit tricky, for instance connect a 1k resistor to the sense resistor and pull 5mA through it and use the resulting voltage offset by 5mV instead, the offset in current then goes from 0-200 mA (but the drift is much smaller, so you can correct for this).
Thanks for the suggestion. I will explore.

Taking that into account and with a opamp+PNP high side current sense configuration, yes it can work.
I am not looking for a perfect solution. I am trying to build the best possible solution with the given op-amp.

 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19513
  • Country: gb
  • 0999
Re: Operational Amplifier for Current Sense
« Reply #5 on: May 05, 2021, 02:16:21 pm »
What are the accuracy requirements? You have an op-amp with an offset voltage of up to 5mV, measuring a voltage of up to 100mV, so the tolerance will be ±5mV, assuming a unity gain. The offset will be multiplied by the gain, so if it's 40, to give 4V at full range, then it will be ±200mV. Note that this is irrespective of the input current. If the current is zero and the offset is 5mV, the output will be 200mV, whilst if the offset is -5mV, the output will be zero, for currents below 100mA, as it can't be negative, without a dual power supply.
« Last Edit: May 05, 2021, 02:23:28 pm by Zero999 »
 

Offline girishvTopic starter

  • Regular Contributor
  • *
  • Posts: 114
  • Country: in
Re: Operational Amplifier for Current Sense
« Reply #6 on: May 05, 2021, 02:28:31 pm »
What are the accuracy requirements? You have an op-amp with an offset voltage of up to 5mV, measuring a voltage of up to 100mV, so the tolerance will be 5±mV, assuming a unity gain. The offset will be multiplied by the gain, so if it's 40, to give 4V at full range, then it will be ±200mV. Note that this is irrespective of the input current, which could be zero and the output might still be up to 200mV.
This is for measuring the charge/discharge current in a battery charger. So, I can live with lower accuracy.

What are the pitfalls of taking a reading with no load (or known load as suggested by @Marco) and use the same to correct the output with load?

Here is the diagram of charge circuit I am using.



« Last Edit: May 05, 2021, 02:31:39 pm by girishv »
 

Offline voltsandjolts

  • Supporter
  • ****
  • Posts: 2298
  • Country: gb
Re: Operational Amplifier for Current Sense
« Reply #7 on: May 05, 2021, 02:49:11 pm »
This is for measuring the charge/discharge current in a battery charger.

If that is the application, why not just use low-side current sensing, which is much simpler?
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19513
  • Country: gb
  • 0999
Re: Operational Amplifier for Current Sense
« Reply #8 on: May 05, 2021, 03:02:35 pm »
What are the accuracy requirements? You have an op-amp with an offset voltage of up to 5mV, measuring a voltage of up to 100mV, so the tolerance will be 5±mV, assuming a unity gain. The offset will be multiplied by the gain, so if it's 40, to give 4V at full range, then it will be ±200mV. Note that this is irrespective of the input current, which could be zero and the output might still be up to 200mV.
This is for measuring the charge/discharge current in a battery charger. So, I can live with lower accuracy.

What are the pitfalls of taking a reading with no load (or known load as suggested by @Marco) and use the same to correct the output with load?

Here is the diagram of charge circuit I am using.
I'm not sure what you're asking. It looks like you replied, as I was edting my post. Read it again to check you've not missed anything.

Basically the error will be equal to the offset, multiplied by the gain, whatever the input current is. Obviously the output voltage can't go below zero, assuming it's run off a single rail, so if the offset is negative, the output voltage will be near 0V, until the input voltage exceeds the offset.
 

Offline girishvTopic starter

  • Regular Contributor
  • *
  • Posts: 114
  • Country: in
Re: Operational Amplifier for Current Sense
« Reply #9 on: May 05, 2021, 03:14:42 pm »
Basically the error will be equal to the offset, multiplied by the gain, whatever the input current is. Obviously the output voltage can't go below zero, assuming it's run off a single rail, so if the offset is negative, the output voltage will be near 0V, until the input voltage exceeds the offset.

As suggested by @Marco, What if I used a resistor to draw a current through sense resistor to make sure there is always a drop of 5mv?
 

Offline Marco

  • Super Contributor
  • ***
  • Posts: 6720
  • Country: nl
Re: Operational Amplifier for Current Sense
« Reply #10 on: May 05, 2021, 03:26:13 pm »
Better to pull it through a separate higher value resistor which just branches off, requires less current/power.
 
The following users thanked this post: girishv

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19513
  • Country: gb
  • 0999
Re: Operational Amplifier for Current Sense
« Reply #11 on: May 05, 2021, 03:27:46 pm »
Basically the error will be equal to the offset, multiplied by the gain, whatever the input current is. Obviously the output voltage can't go below zero, assuming it's run off a single rail, so if the offset is negative, the output voltage will be near 0V, until the input voltage exceeds the offset.

As suggested by @Marco, What if I used a resistor to draw a current through sense resistor to make sure there is always a drop of 5mv?
Because the offset voltage can be anywhere in between +5mV and -5mV.
 
The following users thanked this post: girishv

Offline girishvTopic starter

  • Regular Contributor
  • *
  • Posts: 114
  • Country: in
Re: Operational Amplifier for Current Sense
« Reply #12 on: May 05, 2021, 03:42:54 pm »
Basically the error will be equal to the offset, multiplied by the gain, whatever the input current is. Obviously the output voltage can't go below zero, assuming it's run off a single rail, so if the offset is negative, the output voltage will be near 0V, until the input voltage exceeds the offset.

As suggested by @Marco, What if I used a resistor to draw a current through sense resistor to make sure there is always a drop of 5mv?
Because the offset voltage can be anywhere in between +5mV and -5mV.
I am trying to learn and understand the limitations of using op-amp for current sense applications. I could always use an op-amp with lower offset or even switch to a current sense amplifier. But, I want to see if I can do with op-amp in question.

As suggested by @Marco in his last post, I could use a higher value resistor and add to sense voltage and ensure the output stays positive?
 

Offline Marco

  • Super Contributor
  • ***
  • Posts: 6720
  • Country: nl
Re: Operational Amplifier for Current Sense
« Reply #13 on: May 05, 2021, 04:07:26 pm »
I mean something like this.
 

Offline girishvTopic starter

  • Regular Contributor
  • *
  • Posts: 114
  • Country: in
Re: Operational Amplifier for Current Sense
« Reply #14 on: May 05, 2021, 05:36:29 pm »
I mean something like this.
Thank you very much. If you have got time, could you post a note describing the circuit? It would very educative for uninitiated people like me.
 

Offline schmitt trigger

  • Super Contributor
  • ***
  • Posts: 2222
  • Country: mx
Re: Operational Amplifier for Current Sense
« Reply #15 on: May 05, 2021, 06:03:10 pm »
If you would like to educate yourself about current sensing, a very worthwhile endeavor in my opinion, please download App Note 105 “Current Sense Circuit Collection”, from the analog.com website.

It is 118 pages of pure current sensing joy, with every every conceivable permutation: picoamps to amps, high side and low side, AC or DC, high speed, high voltage, negative voltage, unidirectional or bidirectional.

Something that will keep your brain working for a long time.
 
The following users thanked this post: girishv, fullmoon6661, prosper

Offline exe

  • Supporter
  • ****
  • Posts: 2562
  • Country: nl
  • self-educated hobbyist
Re: Operational Amplifier for Current Sense
« Reply #16 on: May 05, 2021, 06:20:32 pm »
"Input Offset Voltage: ± 5mv" -- that's imho too much  for current sensing. There are many opamps trimmed to better than 1mV offset.

What's your full-scale output voltage? (ie voltage when battery drains/charges at 2A).
 

Offline SuzyC

  • Frequent Contributor
  • **
  • Posts: 792
Re: Operational Amplifier for Current Sense
« Reply #17 on: May 05, 2021, 07:44:47 pm »
If  you can correct your readings (Errors will be most evident only at low charge currents), the opamp you have will work perfectly fine.

What you are doing with the output of the opamp is what which will  make sense of your current sensing.

 
« Last Edit: May 05, 2021, 07:48:59 pm by SuzyC »
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19513
  • Country: gb
  • 0999
Re: Operational Amplifier for Current Sense
« Reply #18 on: May 05, 2021, 08:46:05 pm »
I mean something like this.
That will only work if the offset voltage is known, which isn't the case. It might be +4mV, 1mV, -5mV etc. What happens if it's negative? Your circuit would've just made it worse. In the real world, that current source would need to be trimmable and capable of positive, as well as negative currents.
 

Offline Marco

  • Super Contributor
  • ***
  • Posts: 6720
  • Country: nl
Re: Operational Amplifier for Current Sense
« Reply #19 on: May 05, 2021, 10:44:09 pm »
It's is intended to make it worse, just unipolar. It fixes the potential clamping to 0, handling the offset is for a downstream circuit or software.
 

Offline girishvTopic starter

  • Regular Contributor
  • *
  • Posts: 114
  • Country: in
Re: Operational Amplifier for Current Sense
« Reply #20 on: May 06, 2021, 12:04:52 am »
"Input Offset Voltage: ± 5mv" -- that's imho too much  for current sensing. There are many opamps trimmed to better than 1mV offset.

What's your full-scale output voltage? (ie voltage when battery drains/charges at 2A).
Full scale output voltage will be 3V. The output is fed to ADC of an MCU operating at 3.3V.
 

Offline girishvTopic starter

  • Regular Contributor
  • *
  • Posts: 114
  • Country: in
Re: Operational Amplifier for Current Sense
« Reply #21 on: May 06, 2021, 12:20:55 am »
If  you can correct your readings (Errors will be most evident only at low charge currents), the opamp you have will work perfectly fine.

What you are doing with the output of the opamp is what which will  make sense of your current sensing.
I wanted to explore the possibility of using the output of current sense amplifier to control the duty cycle of charge/discharge.

I come from applications/software domain and have very little knowledge in analog electronics. I was hoping to correct the error in software using the reading with no load. The discussion in this thread is highlighting the limitations of an op-amp with large offset voltage.
 

Offline Marco

  • Super Contributor
  • ***
  • Posts: 6720
  • Country: nl
Re: Operational Amplifier for Current Sense
« Reply #22 on: May 06, 2021, 12:51:15 am »
With software, pure offset isn't a problem as long as it doesn't decrease dynamic range of the ADC too much. With full scale being 2A and max offset 200 mA (with a circuit like I posted and a 50 mOhm shunt) that's only 10% of the dynamic range ... that's not too bad.

It's the drift you've got to worry about, but 60 uA per degree Celsius doesn't seem a problem to me.

There can be good reason to just use a jelly bean opamp with a PMOS or PNP transistor instead of a specialized current sense amplifier BTW. You might have a spare opamp in a multichannel package for instance, or because it's cheaper and good enough.

The true downside of going discrete is that you can run into problems which the designers of the integrated solution already solved for you. For instance stability wise the circuit "Is Not So Simple". Although as the article concludes in the end, a 100 Ohm gate resistor will likely do fine ... in this case because the opamp is a very low power opamp, I'm not sure the gate resistor is even necessary though, the Rmatch in the circuit they give certainly isn't necessary here.
« Last Edit: May 06, 2021, 01:12:50 am by Marco »
 
The following users thanked this post: girishv

Offline girishvTopic starter

  • Regular Contributor
  • *
  • Posts: 114
  • Country: in
Re: Operational Amplifier for Current Sense
« Reply #23 on: May 06, 2021, 01:25:50 am »

The true downside of going discrete is that you can run into problems which the designers of the integrated solution already solved for you. For instance stability wise the circuit "Is Not So Simple". Although as the article concludes in the end, a 100 Ohm gate resistor will likely do fine ... in this case because the opamp is a very low power opamp, I'm not sure the gate resistor is even necessary though, the Rmatch in the circuit they give certainly isn't necessary here.
Thank you very much for the link. I will read through the document.

Furthermore, I am grateful to everyone for sharing their knowledge through this thread. I am sure whoever reads this thread in future will be as thankful as I am.
 

Offline exe

  • Supporter
  • ****
  • Posts: 2562
  • Country: nl
  • self-educated hobbyist
Re: Operational Amplifier for Current Sense
« Reply #24 on: May 06, 2021, 06:54:50 am »
With software, pure offset isn't a problem as long as it doesn't decrease dynamic range of the ADC too much. With full scale being 2A and max offset 200 mA (with a circuit like I posted and a 50 mOhm shunt) that's only 10% of the dynamic range ... that's not too bad.

10% is horrible if you ask me :). Although, chances are that the actual opamp is much better than 5mV. For one-off circuit it's also possible to just select an opamp with the best offset.

The maximum supply voltage is only 7V, which is too low for my liking. I'd would use something with more voltage headroom to account for potential problems, such as user mistakes.

Question to OP: do you already have MCP6232 or you only plan to buy it? If you didn't buy, I'd suggest buy something else. I think such applications are perfect for zero-drift opamps, what do you guys think?
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf