0

Finding the correct op amp
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Finding the correct op amp

by jlamoree on Wed Sep 09, 2009 9:36 am

I'm hoping that someone can advise me on the correct op amp to use. My project is to read a voltage between 0-25 mV using an Arduino, and then do other stuff. I have tried four different op amps of various specifications. The one that works best, still isn't ideal. The issue is that the amplification is very non-linear. I'd like a nicely scaled and proportional value on the output, but what I see is a steep slope transitioning from min/max amplifications.

If you take a look at the graph on this page, you'll see what I mean. I'm sure some of you already know that I'm doing wrong without looking. http://tr.im/yfs7

If you could point me to the proper IC to use in this application, I would be very grateful. I've doing many, many searches on manufacturer websites, but I don't know enough to translate my application requirements into their product specifications.

-joseph

jlamoree
 
Posts: 8
Joined: Sat Aug 15, 2009 2:03 am

Re: Finding the correct op amp

by adafruit on Wed Sep 09, 2009 11:43 am

thats because nearly all op amps dont work down to within 20mV of the 'rails'
if you have a negative power supply that would help a lot
or if you can try to move your signal higher so maybe its between 1V and 1.02V

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm
Location: nyc

Re: Finding the correct op amp

by zener on Wed Sep 09, 2009 5:10 pm

You need rail-to-rail input and output. You can search on Digikey and find candidates.

zener
 
Posts: 4445
Joined: Sat Feb 21, 2009 2:38 am

Re: Finding the correct op amp

by adafruit on Wed Sep 09, 2009 5:52 pm

even rail to rails often dont work as low as 20mV :(

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm
Location: nyc

Re: Finding the correct op amp

by zener on Wed Sep 09, 2009 7:32 pm

adafruit wrote:even rail to rails often dont work as low as 20mV :(

That is not my experience.

zener
 
Posts: 4445
Joined: Sat Feb 21, 2009 2:38 am

Re: Finding the correct op amp

by adafruit on Wed Sep 09, 2009 8:11 pm

what we meant to say was...not -all- r2r opamps will work down to 20mV from ground
for example, the LM6152 will work full rail to rail, its a well known opamp
however, we were looking for opamps for a project and found a 'rail to rail' advertised that didn't
so
check your datasheets!!!

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm
Location: nyc

Re: Finding the correct op amp

by jlamoree on Wed Sep 09, 2009 8:21 pm

Thank you for the help. So, a quick fix might be to raise the input voltage? I'm not sure how I would do that. For reference, here's the circuit: http://tr.im/yipW

I thought that a DC shunt was the cheap way to get a fairly accurate measurement, but if it's going to require a lot of hacking to get that to function, I would probably be better off using a Hall effect sensor. I see the breakout board sold by SparkFun that has an Allegro ACS712. That might be the way to solve this problem -- unless it would raise new ones.

-joseph

jlamoree
 
Posts: 8
Joined: Sat Aug 15, 2009 2:03 am

Re: Finding the correct op amp

by zener on Wed Sep 09, 2009 8:36 pm

You are trying to measure current?

zener
 
Posts: 4445
Joined: Sat Feb 21, 2009 2:38 am

Re: Finding the correct op amp

by jlamoree on Wed Sep 09, 2009 8:46 pm

Ultimately, that is what I'm interested in -- determining the current through the wire connected to a 12 V battery bank. The typical range will be between 2-8 A. Unfortunately, the 5 A version of the ACS712 wouldn't be good enough, so I'll need to go with the 20 A model, if I go that route.

-joseph

jlamoree
 
Posts: 8
Joined: Sat Aug 15, 2009 2:03 am

Re: Finding the correct op amp

by jlamoree on Wed Sep 09, 2009 9:46 pm

I suppose I could construct a current divider, and run a portion of the charge/discharge circuit through an ACS712-5A. I ordered one of the ACS712 breakout boards from Spark Fun: http://tr.im/yiJL

I will lose resolution by sensing a portion of the true current, but I think I can accept that. On the Allegro web site, they have a paper discussing this technique, in which they mention using a pair of sensors, and then combining the voltage. I don't know how that would work in my situation. It'll require some experimentation.

If you have more suggestions, or another place I should look, I would appreciate your help. Thanks for being patient with a n00b.

-joseph

jlamoree
 
Posts: 8
Joined: Sat Aug 15, 2009 2:03 am

Re: Finding the correct op amp

by zener on Wed Sep 09, 2009 10:04 pm

INA193

zener
 
Posts: 4445
Joined: Sat Feb 21, 2009 2:38 am

Re: Finding the correct op amp

by fat16lib on Thu Sep 10, 2009 9:32 am

You can measure voltages in the 25 mv range with a single part added to the Arduino.

I have been using the ADC in my post here http://forums.adafruit.com/viewtopic.php?f=31&t=12269

For measuring voltages across shunts.

Here is an example of measurements across a 0.05 ohm shunt with a MCP3424 ADC, 18-bits with a PGA gain of 8.
The least significant bit is about 2 micro-volts at this gain and resolution.

The application is a dummy load for battery tests. I measured the current with a Fluke 179 meter, 400 mA scale.
I used the following linear fit to calculate the current.
Code: Select all | TOGGLE FULL SIZE
I = 0.2176 + 20.1194 * V

I used Excel's linest to fit the data.

Here are the results
Code: Select all | TOGGLE FULL SIZE
ADC     Fluke   Calc    Diff
mv      mA      mA      mA
0.054   1.31    1.30    0.01
0.496   10.17   10.20   -0.03
1.236   25.09   25.09   0.00
2.472   49.94   49.95   -0.01
4.964   100.1   100.09  0.01
7.447   150.1   150.05  0.05
9.937   200.1   200.14  -0.04
12.414  250.0   249.98  0.02
14.900  300.0   300.00  0.00
18.912  380.7   380.72  -0.02

The results are amazing. I will post the Arduino sketch that I used. See the above link.
fat16lib
 
Posts: 593
Joined: Wed Dec 24, 2008 1:54 pm

Re: Finding the correct op amp

by jlamoree on Fri Sep 11, 2009 6:40 am

@Zener: Thanks for the tip on the TI INA193. I'm going to order one of those and run some experiments. If I understand correctly, I can have the shunt on either side of the load, giving me more flexibility. It's not completely clear to me how the gain works. I see that they have 20 V/V, 50 V/V, and 100 V/V models. If I used the 20 V/V chip and fed it a 25 mV difference, it appears that the voltage out would be less than one volt. In order to hit the sweet spot of this chip's range, I would need to use a shunt that dropped more like 200 mV with the typical load. The output voltage for that differential would be 4 volts -- just right for using the Arduino's 5 volt supply. Is there something I'm not seeing correctly?

@fat16lib
Thank you for the information. Your work on this problem seems directly applicable to my application. I'll follow your other thread and try it out.

-joseph

jlamoree
 
Posts: 8
Joined: Sat Aug 15, 2009 2:03 am

Re: Finding the correct op amp

by fat16lib on Fri Sep 11, 2009 4:32 pm

The INA193 is a neat device but it doesn't fix the problem with the Arduino's ADC. As you noticed, even the x20 gain of the INA193 only brings 25 mv up to 0.5 volts.

I like the MCP342x ADCs for sensor apps like this because they are about 2500 times more sensitive than Arduino's ADC.

The least significant bit is 5 millivolts for the arduino but 2 micro-volts for the MCP342x (PGA gain 8 resolution 18-bits).

This means it is easy to read your shunt without an op amp if you use a MCP342x.

Also it has an on-board 0.05% voltage reference which is great.
fat16lib
 
Posts: 593
Joined: Wed Dec 24, 2008 1:54 pm

Re: Finding the correct op amp

by zener on Fri Sep 11, 2009 6:37 pm

jlamoree wrote:If I understand correctly, I can have the shunt on either side of the load, giving me more flexibility.

Yes!

You have the three gain choices, and you can then size your shunt/sensing resistor accordingly. The x100 gain should get you close.

zener
 
Posts: 4445
Joined: Sat Feb 21, 2009 2:38 am

Please be positive and constructive with your questions and comments.