Need help choosing right op-amp for shunt resistor

Mad Professor

Senior Member
Good day all.

As per the title I am looking for help chossing the right op-amp for a shunt resistor.

I have never used op-amps before, so op-amps are very new to me, and I don't know alot about them.

I am looking to monitor & log the current on my microcontroller.

The current load is 0-5amps, and the current shunt resistor is a 0.010ohm 1% 3w resistor.

From what I have read it looks like I need a non-inverting low-offset rail-to-rail op amp.

I had a look on RS's web site, and there are loads to choose from, and I am way in over my head.

I see that some op-amps need more then one power rail, one above ground, and one below ground.

I need an op-amp that will be able to work on 5dcv or 12vdc.

Can someone please advice.

Thanks for your time.

Best Regards.
 

Goeytex

Senior Member
Before an op amp can be properly and intelligently selected, the load must be characterized. Is the load inductive or resistive? What is the rate of rise of the load current and the frequency that the load switches? How is the load switched or controlled ?

A schematic would be quite helpful.
 

Mad Professor

Senior Member
Goeytex: There is not yet a schematic as I am in the design stage trying to find out what parts I need, the load type would be resistive, there is no load frequency.

rossko57: I have looked at current sencing IC's, but it seems they cost more then using a shunt & op-amp.
 

JimPerry

Senior Member
What are you trying to do? As suggested a Hall Effect sensor may be the way - shunt resistors are not "state-of-the-art" :rolleyes:
 

Pongo

Senior Member
What are you trying to do? As suggested a Hall Effect sensor may be the way - shunt resistors are not "state-of-the-art" :rolleyes:
Halls have their place, but they aren't a panacea.

Maxim has some very nice current monitor chips which do what I'm guessing you want, ground reference the voltage across a high side current sense resistor. See the MAX4080/81 for example.

Or here's an Op amp circuit
 

JimPerry

Senior Member
Lets sort out definitions -- a SHUNT resistor goes across the measurement device (as in Ammeters) a SENSE resistor is in series with the load to produce a measureable signal -and Hall Effect sensors just measure (bit like a SENSE resistor with brains) - which do you need :confused:
 

Jeremy Harris

Senior Member
This isn't as easy a task as it may look for an op amp, as the critical requirements are:

- the ability of the input to work right down to the 0V rail (assuming you don't want the hassle of dual power supplies)

- low offset drift (so that the calibration stays reasonably OK)

My favourite, completely fool proof, and dead easy to use solution to current sensing like this is to use a sense resistor and an INA122 instrumentation amp. The downside is that these aren't that cheap, but the ease with which they can be used for this particular job makes them my first choice every time.

Best of all, you can run one from a 5V supply, like the Picaxe, you only need to add a single resistor to set the gain you need, and this amp will happily work right down to 0V on the input, even on a single supply of 5V.

I've used these amps a few times for current sensing and have yet to find a better way to do it when you already have a sense resistor in place. I've also used Hall current sensors, and they are equally easy to use, but usually more expensive than a sense resistor and an INA122.
 

Pongo

Senior Member
Lets sort out definitions -- a SHUNT resistor goes across the measurement device (as in Ammeters) a SENSE resistor is in series with the load to produce a measureable signal -and Hall Effect sensors just measure (bit like a SENSE resistor with brains) - which do you need :confused:
I don't think the post is confusing. A SENSE resistor in series with a load, is a SHUNT resistor from the point of view of the device that's measuring the voltage across it.
 

Jeremy Harris

Senior Member
Assuming that the output from the amp is to be read by a Picaxe analogue input, at, say, 0 to 5V, then the amp needs a gain of 100 for a 0 to 50mV input, which is well within the range where an INA122 will give pretty good performance.

Reducing the gain to 40 and using the Picaxe option of using a 2.048V reference for the analogue input might be very slightly better in terms of slightly reduced drift, but it depends on the level of accuracy needed. My guess is that with a gain of 40 the limit would be the 10 bit resolution of the analogue input, rather than the amp drift.
 

BeanieBots

Moderator
In order to choose your op-amp you need to know what accuracy you want.
Errors are introduced by two main sources, the input current and the input offset.
When configured in a simple gain circuit, these errors are multiplied by your overall gain.

Don't worry too much about finding a rail-to-rail op-amp. NONE will ever do it perfectly.
You can use the op-amp to correct itself for this problem.
Look up a circuit that will give you the gain you require to get the shunt volyage into the range needed for the PICAXE ADC input.
Now modify that circuit as follows.
Insert two diodes in series directly on the op-amp output anodes towards op-amp.
Add a 10k resistor from cathode of second diode to 0v.
The op-amp will need about 3v higer supply than the highest output voltage you want but when arranged as described it will give an output right down to 0v even if the op-amp can only get to within 1.2v of the negative rail.
 

Jeremy Harris

Senior Member
Don't worry too much about finding a rail-to-rail op-amp. NONE will ever do it perfectly.
The INA122 is fine right down to the -ve rail, I've used it maybe half a dozen times like this and never had a problem. It's specced to work like this, even when run on a single 5V rail, which is why I suggested it. In fact the CMR goes to -0.1V below the -ve rail OK. Take a look at the spec if you think I'm making this up: http://www.ti.com/lit/ds/symlink/ina122.pdf

For those who don't want to bother with the datasheet, it has a 3uV/deg C offset drift, input bias current of 25nA, works from a 2.2V to 36V single supply, draws 60uA quiescent current and has the gain set with a single external resistor, over a range from a gain of 5 to a gain of 10,000.

Couldn't really be much easier to use as a solution to this problem, and one reason why I've been using them for the same task (in my case measuring current used by electric bikes) for the past two or three years.
 

mrburnette

Senior Member
Hall Effect current modules

WARNING:
I just characterized one of these for a project and while the internal IC conductor is 0.0012 mOhm, the total resistance including the cheap screw-down connectors and the PC foil made the overall resistance more like 0.006+ mOhm. For example, pumping just 1A through a 30A rated module created a Vdrop of 0.0066V .

Removing the connector (19 gauge wire pins BTW) and replacing with a length of solid 12 gauge copper directly up to pins 1+2 and 3-4, dropped the Vdrop back to exactly 0.0012 Volts. (I used the original pin-pads as stress relief and used a layer of polyimide tape as an insulator/solder mask.)

These modules are so cheap that if you plan on using above 1 or 2 amps, you are going to have to modify them significantly or you may wish to consider paralleling them with a real ol' style busbar or metallic strip rated in the 30A/50mV range. You can then easily compensate for the current diversion through the physical shunt by applying a simple multiplier in the PICAXE software.

For automotive loads (I using one for an Europa), something like this is quiet adequate (you may wish to not run the starter motor through the shunt, however!) Paralleling with another shunt is also a safety-net ... the physical shunt can take the entire load should the Hall Effect unit fail.

The deciding factor to use such an arrangement (the Hall Effect current module) is that the solution presented by this device creates a Charge/Discharge monitoring capability automatically. That is, the output voltage will be approximately 2.5V and will swing higher and lower from this midpoint. So an AD10 command with a 5V reference will swing around the 512 count midpoint.


IMG00406_1.jpg50A50mV.jpg
Ray
 
Last edited:

Goeytex

Senior Member
The attached circuit uses a common LM358 Op-Amp. The output offset is only about 20mv above Gnd with an input of 0v. This can easily be dealt with in code. I reduced the gain to 50 to allow the use of 5v to supply the op amp. The op-amp could just as well be supplied with 12v and the gain increased to 100. But if the current were to exceed 5 amps the Picaxe would see > 5 volts on the ADC pin. The internal ESD clamp in conjunction with the 10K resistor could probably handle that, but in that case I would probably add an external clamping diode just to be sure. R1 could be a 20K 10 turn pot to allow fine adjustment of the gain.

Yeah, I know that there are better (and more expensive) solutions. However the OP asked for an op-amp solution based upon a .01 ohm sense resistor and that's what I have given him.
 

Attachments

Mad Professor

Senior Member
Thanks for everyone's replies.

As always lots of help, and advice, but I must admit alot of it went over my head this time, with this being the 1st time I have used op-amp's.

I only picked the 0.010ohm 1% 3w resistor, as I have lots of them in my spare parts bin.
 

Mad Professor

Senior Member
Yes, sure. I thought I did say, but reading over my posts, looks like I forgot to say. :(

I am looking to build a lithium cell capacity test bench, I have a range of 3.7v lithium cell from 1ah to 5ah, that I need to test and graph the capacity.

I am looking at using the Picaxe to output the data to a laptop and make the graphs in excel.

So I need to read the lithium cell voltage in real time and push that data into the laptop.

I am also using the picaxe and a mosfet to put a constant current on the cell that I am testing, so I need to monitor the current load, so the picaxe can keep the constant current.

I hope this makes more sence of what I am trying to do now.

Best Regards.
 

Dippy

Moderator
"better way" - if you are referring to current sensing I would imagine there must be dozens of op-amp based circuit on nerdynet?

If you are struggling with op-amps then consider a ready-made solution; search, for example, Farnell's site for current sensing.
You will find dozens of chips where the op-amping is done for you and you plonk it on a shunt and Bob's yer uncle.
As they tend to use differential designs this allows you to measure current high or low side AND they are dead easy to use - and pretty cheap.

There really are loads of them so trawl your way through data sheets to see which is most appropriate and note any limitations.
A 20 minute wrestling match should be very productive and educational :)
 
Top