Searching \ for '[EE] Problems using a differential amplifier to me' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/index.htm?key=problems+using+differential
Search entire site for: 'Problems using a differential amplifier to me'.

Exact match. Not showing close matches.
PICList Thread
'[EE] Problems using a differential amplifier to me'
2005\05\08@122151 by Chrisegroup

flavicon
face

Hi,

I'm working on a current measurement circuit. I'm using a 0.1 ohm
current sense resistor in-line and measuring the voltage drop across
this resistor. Eventually I want to use a PIC A/D to monitor the current
so I am attempting to build a differential amplifier using an LF351
OpAmp.

The problem is the circuit is not working correctly. I expect to see a
gain of about 200x and a linear output relative to the differential
input. I've simulated my circuit using a spice tool and it's working as
expected in simulation.

** During testing I used a multimeter for all measurements. There is no
PIC on my breadboard at this time. **

In the real circuit I am seeing a relatively fixed voltage output that
jumps to about 5V when the differential input reaches some value (I can
graph this if anyone is interested).

To simplify things for testing, I built another amplifier circuit and I
am feeding the differential inputs using two variable resistor based
voltage dividers. I'm seeing the same inconsistent results (a relatively
fixed output that jumps to V+ depending on the differential input).

Some other things I've tied include shorting both inputs to ground which
shows about 1.1 volts on the output (probably due to variations in the
feedback resistors in the OpAmp circuit). I've also tried adjusting both
inputs to get a zero volt output but it's not possible.

A schematic of my amplifier can be found at:
http://www.rocklizard.org/webdownloads/difamp.bmp. This is the *exact*
circuit that I am testing. The inputs are fed from 2 adjustable voltage
dividers. I monitor the inputs and the output with a Fluke 75
multimeter.

It's been a long time since I've had to design and build with OpAmps so
I'm assuming that I've forgotten something here. Does anyone have any
ideas or suggestions?

Thanks!
Chris




------------------------------------
12x2 LCD displays & serial LCD
interface chips available.
Visit http://pic.rocklizard.org
------------------------------------


2005\05\08@123817 by Byron A Jeff

face picon face
> A schematic of my amplifier can be found at:
> http://www.rocklizard.org/webdownloads/difamp.bmp. This is the *exact*
> circuit that I am testing.

> The inputs are fed from 2 adjustable voltage dividers.

This may be your problem. If you are create resistor based voltage dividers
then the impeadance of the resistors could be impacting your circuit.

To ensure you have low impeadance voltages sources stick a couple of
opamp based voltage followers in front of your inputs. Something like:

http://hyperphysics.phy-astr.gsu.edu/hbase/electronic/opampvar2.html

The voltage followers will drive the inputs hard, giving you more
accurate measurements.

BAJ

2005\05\08@124832 by Spehro Pefhany

picon face
At 10:22 AM 5/8/2005 -0600, you wrote:
{Quote hidden}

You need to think about the common-mode range of the inputs and the
range of the output. This circuit should work if you use +/-5V supply
on the op-amp, but also note that the input common mode range is
not guaranteed to include the +ve supply on the LF351 (though it typically
might, unlike many other op-amps). So, if you're trying to measure the
current on the 5V supply, it's marginal at best, even at room temperature.

With a +/-15 V supply, the input common mode range is only guaranteed
to be +/- 11V over temperature (0 <= Ta < = 70°C), also the output voltage
swing in only guaranteed to be +/-12V. That 3-4V difference can cause some
major difficulties.

Also, the schematic you show only has a gain of 10, not 200. If you want
decent common mode rejection you will need very close matching on the resistors
at a gain of 200. You need to pull out your quadrille paper and calculator
and figure this out. The offset voltage of the op-amp will enter into it too.
But none of this much matters until you've dealt with the gross problems I
mentioned in the preceding paragraph.

Best regards,

Spehro Pefhany --"it's the network..."            "The Journey is the reward"
spam_OUTspeffTakeThisOuTspaminterlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com



2005\05\08@130913 by res0qrqr

picon face
A couple of fairly obvious things come quickly to mind:

1) Your differential gain is going to be 10x, not 200x

2) I assume your power supply is a single +5 volts and
ground.  An LF351 won't have much space within its I/O
constraints with which to operate in a linear fashion.
You'll need at least an LM358/LM324 type opamp here;
better yet, one with rail-to-rail inputs and outputs.

3) What is the common-mode potential at your current sense
resistor?  If it strays outside of the 0 to +5V range,
you'll be out of luck!

Brian Aase

{Quote hidden}

2005\05\08@133102 by olin_piclist

face picon face
ChrisEGroup@rocklizard.org wrote:
> A schematic of my amplifier can be found at:
> http://www.rocklizard.org/webdownloads/difamp.bmp. This is the *exact*
> circuit that I am testing. The inputs are fed from 2 adjustable
> voltage dividers. I monitor the inputs and the output with a Fluke 75
> multimeter.

What is the range of input voltages?  What do the unused pins on the opamp
do?


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

2005\05\08@133157 by Eric Jorgensen

picon face
One of the huge problems with this list is the
incredible time sink produced by certain links.

Byron's link to HyperPhysics made most of my morning
evaporate as I followed link after link. Incredible
web site. I had the will-power to pull away before
trying the HyperMath link from HyperPhysics. Maybe
after lunch...

Thanks, Byron.

Eric
KE6US
--- Byron A Jeff <.....byronKILLspamspam@spam@cc.gatech.edu> wrote:
{Quote hidden}

hyperphysics.phy-astr.gsu.edu/hbase/electronic/opampvar2.html
>
> The voltage followers will drive the inputs hard,
> giving you more
> accurate measurements.
>
> BAJ
> --

2005\05\08@135155 by Chrisegroup

flavicon
face
Hi Everyone,

Thanks for the feedback. I'm getting some good information.

Below are answers to all the questions posted plus some additional
information.

* I made an error on the schematic. The gain is 100x. I am using 10K/100
Ohm resistors in each OpAmp voltage divider.

* The circuit OpAmp is being powered from +5v/0v. From the posted
comments it looks like this is too low for the range I need. I have a
+12 volt supply available on my "real" circuit for a greater range.

* The OpAmp inputs range from 0V TO 50 mV - My goal is to measure
current in the 0mA to 500mA range (possibly lower since I see the issue
with such a large range) with the 0.1 ohm resistor at 5 volts this is a
differential measurement range of 0V to 50 mV. I want to scale this to a
0V to 5V range (or as close as possible) so that I can use a PIC A/D to
measure the current flowing into the circuit.

*** So What Is This For? ***

This OpAmp circuit will be used in a PIC controlled power supply. I'm
using a PIC to control an adjustable voltage regulator and I figured
that since there is going to be a PIC in the power supply why not add
voltage and current monitoring.

My power supply design has 2 5V @ 1A outputs and 1 adjustable output (0V
to 12V @ 1A). I have planned an additional regulated output to power the
PIC and the OpAmp.

I will be monitoring all 3 voltage outputs and the current output of at
least one of these supplies. I may decide to monitor all 3 or to provide
a switching mechanism to monitor one of the three. I'm sill
experimenting and designing so everything is open to change at this
point.

This is a "junk box" supply. I'm using a surplus switcher that outputs a
clean 14V at 3A. I feed this output - with additional filtering - into
the three voltage regulators. The PIC is for control of the variable
supply and for monitoring the outputs.


*** Some additional information and questions: ***

* The circuit we are discussing in this thread is not meant to be my
final circuit. It's sole purpose is to help me understand the design
issues - I'm trying to keep it as simple as possible at this point. Once
it's working I'll use all I've learned to build the real thing.

* I'm using this OpAmp because I had it on hand and I'm using these
resistor values because the math is simple. I do have other OpAmps -
including some LM358s.

* The OpAmp does need to be driven from a single sided supply since my
power supply design does not have any negative voltages available. I can
power the OpAmp with 12 volts instead of 5 volts to increase it's linear
range.

* My desired current measurement range is 0A to 1A total. I figure I
will need to use multiple OpAmp circuits to acheive this range and
that's not a problem.

* The unused OpAmp pins are floating.

*** Questions ***

* I did some research on current measurement and I'm wondering if it
would be better to use a Hall Effect current sensor? I don't know
anything about these and I'd like to know if anyone has used these
before. What do they cost, where can I get them and how would I buffer
the output? From the bit of reading I did it looks like a simple
non-inverting OpAmp would do the job just fine. If these sensors are not
too expensive and work well I might just take that route.

* Is a differential amplifier the only way to scale the output from the
sense resistor? I was thinking that a standard non-inverting amp with
the input on the high side of the resistor and the ground on the low
side of the resistor might work. I'm building one now to take some
measurements.


I've just broken out my "Art of Electronics" book and I'm going to read
the OpAmp chapters again.

Thanks for all the help so far. Please keep sending feedback!

-Chris



2005\05\08@155317 by olin_piclist

face picon face
ChrisEGroup@rocklizard.org wrote:
> * I made an error on the schematic. The gain is 100x. I am using
> 10K/100 Ohm resistors in each OpAmp voltage divider.

That's a lot for a single stage.  It will be difficult to get the resistors
matched well and get good common mode rejection.

> * The OpAmp inputs range from 0V TO 50 mV

This sounds like your current sense resistor is on the return leg with one
side ground.  If so, why do you need a differential amplifier in the first
place?


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

2005\05\08@161953 by Harold Hallikainen

face picon face
I have not been following the thread closely, so please excues me if the
comments are off point or redundant.

Making a differential amplifier with good common mode rejection is quite
difficult due to the resistor matching required. Even if you get them to
match at 25C, carbon film resistors have a pretty high temperture
coefficient, so they won't stay matched for long. I really like just
buying a diff amp when I need one. The chip manufacturer has done all the
work for you, putting the precision and tempco matched resistors on the
chip.

>From the subject line, I see the application is current sensing. It is, of
course, much simpler to do low side sensing, since you then don't need a
differential amplifier (you'd be subtracting zero from the sense voltage).
If you need to do high side sensing, there are chips made for that
purpose. I've used one from Maxim. I think LTC also has some. Some have
internal sense resisitors and some use an external sense resistor.

Good luck!

Harold

--
FCC Rules Updated Daily at http://www.hallikainen.com

2005\05\08@175626 by Chrisegroup

flavicon
face

Olin wrote: This sounds like your current sense resistor is on the
return leg with one side ground.  If so, why do you need a differential
amplifier in the first place?

-----

I had originally planned to place the sense resistor between +5v and the
load. Now I am considering placing it between the load and ground. I
chose the first method out of habit. This is how I usually use an amp
meter when taking measurements.

I have never made a current sensor before so I'm looking for some best
practices to do this. Some of the posts here have lead me to think that
the ground side current sense might be the best. I have not had time yet
to build up a standard non-inverting amp so I'm not sure of the issues
with this method.

How do you guys build current sensors? Douglas Wood mentioned that there
are chips designed to do this. I might investigate one of these as a
solution but for now I'd like to learn how to solve this problem by hand
before going to a pre-built solution.

I'd still like to hear comments on the Hall Effect current sensors if
anyone here has used them.

Thanks again.
Chris


{Original Message removed}

2005\05\08@181221 by Spehro Pefhany

picon face
At 03:56 PM 5/8/2005 -0600, you wrote:
>
>Olin wrote: This sounds like your current sense resistor is on the
>return leg with one side ground.  If so, why do you need a differential
>amplifier in the first place?
>
>-----
>
>I had originally planned to place the sense resistor between +5v and the
>load. Now I am considering placing it between the load and ground. I
>chose the first method out of habit. This is how I usually use an amp
>meter when taking measurements.
>
>I have never made a current sensor before so I'm looking for some best
>practices to do this. Some of the posts here have lead me to think that
>the ground side current sense might be the best. I have not had time yet
>to build up a standard non-inverting amp so I'm not sure of the issues
>with this method.

You can do this. You have to take care with latch-up gotchas on the
op-amp. The LM358 is prone to this. Also the input common-mode voltage range
and output range must include ground and the Vos should be much lower than
your signal (50mV?).


{Quote hidden}

>{Original Message removed}

2005\05\08@190758 by Mark Rages

face picon face
On 5/8/05, ChrisEGroupspamKILLspamrocklizard.org <.....ChrisEGroupKILLspamspam.....rocklizard.org> wrote:
> Hi Everyone,
>
> Thanks for the feedback. I'm getting some good information.
>
> Below are answers to all the questions posted plus some additional
> information.
>
> * I made an error on the schematic. The gain is 100x. I am using 10K/100
> Ohm resistors in each OpAmp voltage divider.
>
> * The circuit OpAmp is being powered from +5v/0v. From the posted
> comments it looks like this is too low for the range I need. I have a
> +12 volt supply available on my "real" circuit for a greater range.
>

I don't  think the LF351 includes the - supply in its common-mode
range.  so +12 and 0 won't work.  +5 and -5 might.

> * The OpAmp inputs range from 0V TO 50 mV - My goal is to measure
> current in the 0mA to 500mA range (possibly lower since I see the issue
> with such a large range) with the 0.1 ohm resistor at 5 volts this is a
> differential measurement range of 0V to 50 mV. I want to scale this to a
> 0V to 5V range (or as close as possible) so that I can use a PIC A/D to
> measure the current flowing into the circuit.

The LF351 has a 10mV offset voltage.  This is really going to affect
linearity when your signal is 0 to 50 mV... that's 20% of full range!

I suggest you get a better-suited op-amp, with low input offset
voltage and the negative supply in its common-mode input range. (input
offset current isn't critical).  And get one rated to run from a
single 5V supply.  A bipoplar-input amp is more suited to this circuit
than a JFET amp, in my opinion.

Regards,
Mark
markrages@gmail

--
You think that it is a secret, but it never has been one.
 - fortune cookie

2005\05\08@192538 by Douglas Wood

picon face
No, I was suggesting a using a small 7508 and a 7660 inverter chip to
generate -8 VDC to give your op amp a bipolar supply (did this recently for
a 4-20 mA sense circuit for a project that I'm working on). There are chips
designed to 1) sense current and output a voltage, and 2) 4-20 mA current
chips as well, but they are all pretty expensive and don't drive the 4-20 mA
down to 0.5 mA (it's a requirement for this project; 0.5 mA indicates a
sensor fault to the PLC).

----- Original Message -----
From: <EraseMEChrisEGroupspam_OUTspamTakeThisOuTrocklizard.org>
To: <piclistspamspam_OUTmit.edu>
Sent: Sunday, May 08, 2005 4:56 PM
Subject: RE: [EE] Problems using a differential amplifier to measure
current.


{Quote hidden}

> {Original Message removed}

2005\05\08@193418 by Harold Hallikainen

face picon face

I think the Hall Effect devices (such as those from
http://www.allegromicro.com) are great when you indeed need isolation
between the input and output. If you do not, I think their a bit expensive
for the job.

Harold

> I'd still like to hear comments on the Hall Effect current sensors if
> anyone here has used them.
>

--
FCC Rules Updated Daily at http://www.hallikainen.com

2005\05\09@044011 by Electron

flavicon
face
At 12.38 2005.05.08 -0400, you wrote:
>> A schematic of my amplifier can be found at:
>> http://www.rocklizard.org/webdownloads/difamp.bmp. This is the *exact*
>> circuit that I am testing.
>
>> The inputs are fed from 2 adjustable voltage dividers.
>
>This may be your problem. If you are create resistor based voltage dividers
>then the impeadance of the resistors could be impacting your circuit.
>
>To ensure you have low impeadance voltages sources stick a couple of
>opamp based voltage followers in front of your inputs. Something like:
>
>http://hyperphysics.phy-astr.gsu.edu/hbase/electronic/opampvar2.html
>
>The voltage followers will drive the inputs hard, giving you more
>accurate measurements.

At this point I think he better use an instrumentation amp rather than
3 opamps, at least to get more "integration".


>
>BAJ
>-

2005\05\09@044018 by Electron

flavicon
face
At 12.53 2005.05.08 -0400, you wrote:
{Quote hidden}

That's why using an instrumentation amp seems ideal (Burr-Brown comes to
mind).

Or he could directly use an instrument-amp made just for this purpose:
INA198 (or INA193,INA194,INA195,INA196,INA197, each one with its own
configuration).



>Best regards,
>
>Spehro Pefhany --"it's the network..."            "The Journey is the reward"
>@spam@speffKILLspamspaminterlog.com             Info for manufacturers: http://www.trexon.com
>Embedded software/hardware/analog  Info for designers:  http://www.speff.com
>
>
>
>
>
>

2005\05\09@125245 by David Minkler

flavicon
face
INA138 - Hi side current shunt monitor.  Designed specifically for this
application.  We use them regularly to good effect.  Ideal for one-off
or low volumes.  If you insist on rolling your own, take a look at the
schematic on the front page of the datasheet  <
http://focus.ti.com/lit/ds/symlink/ina138.pdf > and pay attention to
common mode range as others have suggested (a rail to rail amp should
keep you out of trouble).  Taken literally, that schematic errs by the
base current of the transistor and minor opamp mismatches but you won't
even notice that compared to trying to match resistors for a homebrew
differential amplifier (with x100 gain).

Dave

Electron wrote:

{Quote hidden}

More... (looser matching)
- Last day of these posts
- In 2005 , 2006 only
- Today
- New search...