### Author Topic: Op-amps and gain potential  (Read 2303 times)

0 Members and 1 Guest are viewing this topic.

#### krappleby

• Contributor
• Posts: 29
• Country:
##### Op-amps and gain potential
« on: January 18, 2017, 03:38:25 pm »
Hi all,

How do you decide what resistors to use for an op amp to get a set gain?? is there a mathematical formula.

res a = from output to input(b)
res b = from input b to ground

Now, is the formula b/a

for example..

if there is a 100 ohm resister in a, and a 1 ohm resister in b then do you get a 100x gain
if there is a 100 ohm resister in a, and a 50 ohm resister in b do you get 2x gain

in the above process, putting a 100 ohm resister in a and a 10 ohm resister in b would give a 10x
or
putting a 50 ohm resister in a and a 5 ohm resister in b would also give you a 10x

is this right, or is it some other formula that is used.

cheers keith

#### rstofer

• Super Contributor
• Posts: 6944
• Country:
##### Re: Op-amps and gain potential
« Reply #1 on: January 18, 2017, 03:46:27 pm »
The gain on an op amp is indeed computed from the resistor values but there is a difference between the cases where feedback signal is applied to the (-) input or the (+) input (inverting or non-inverting configuration):

ETA:  Misstated, the feedback is always connected to the (-) terminal.  The difference is where the signal is connected.

For the situation where the feedback signal is connected to the (-) (inverting amplifier), the gain is Rf / Rin  (feedback resistor divided by input resistor).
For the non-inverting condition, the gain is 1+(Rf/Rin)

« Last Edit: January 18, 2017, 08:21:15 pm by rstofer »

#### krappleby

• Contributor
• Posts: 29
• Country:
##### Re: Op-amps and gain potential
« Reply #2 on: January 18, 2017, 03:49:25 pm »
Thanks,

that is somewhat what I assumed..

cheer
keith

#### macboy

• Super Contributor
• Posts: 2005
• Country:
##### Re: Op-amps and gain potential
« Reply #3 on: January 18, 2017, 05:17:33 pm »
The gain on an op amp is indeed computed from the resistor values but there is a difference between the cases where feedback is applied to the (-) input or the (+) input (inverting or non-inverting configuration):

For the situation where the feedback is connected to the (-) (inverting amplifier), the gain is Rf / Rin  (feedback resistor divided by input resistor).
For the non-inverting condition, the gain is 1+(Rf/Rin)

Feedback is never applied to the + input.
What you meant, I think, is that the gain calculation is different depending on whether the input signal is applied to the - or + input, which is to say, inverting or non-inverting configuration.

#### Zero999

• Super Contributor
• Posts: 13454
• Country:
• 0999
##### Re: Op-amps and gain potential
« Reply #4 on: January 18, 2017, 06:17:43 pm »
Feedback is never applied to the + input.
I'm being picky here: not in a linear op-amp circuit but a in a comparator, feedback is applied to the + input to create hysteresis.

#### rstofer

• Super Contributor
• Posts: 6944
• Country:
##### Re: Op-amps and gain potential
« Reply #5 on: January 18, 2017, 07:47:38 pm »
The gain on an op amp is indeed computed from the resistor values but there is a difference between the cases where feedback is applied to the (-) input or the (+) input (inverting or non-inverting configuration):

For the situation where the feedback is connected to the (-) (inverting amplifier), the gain is Rf / Rin  (feedback resistor divided by input resistor).
For the non-inverting condition, the gain is 1+(Rf/Rin)

Feedback is never applied to the + input.
What you meant, I think, is that the gain calculation is different depending on whether the input signal is applied to the - or + input, which is to say, inverting or non-inverting configuration.

Yup!  Misstated the situation.  The feedback is usually negative.  The difference is where the signal is applied.
« Last Edit: January 18, 2017, 08:22:36 pm by rstofer »

#### eblc1388

• Regular Contributor
• Posts: 121
• Country:
##### Re: Op-amps and gain potential
« Reply #6 on: January 18, 2017, 11:53:33 pm »
putting a 50 ohm resister in a and a 5 ohm resister in b would also give you a 10x
is this right, or is it some other formula that is used.

You have got the ratio correct.

Unfortunately, you still have to decide on one resistor value in order to get the other value. A (50 ohm + 5 ohm) combination might not work in most of the cases. The choice of these resistor values depends on many parameters such as opamp types, speed, noise consideration, input source impedance etc...

#### rstofer

• Super Contributor
• Posts: 6944
• Country:
##### Re: Op-amps and gain potential
« Reply #7 on: January 19, 2017, 12:08:09 am »
putting a 50 ohm resister in a and a 5 ohm resister in b would also give you a 10x
is this right, or is it some other formula that is used.

You have got the ratio correct.

Unfortunately, you still have to decide on one resistor value in order to get the other value. A (50 ohm + 5 ohm) combination might not work in most of the cases. The choice of these resistor values depends on many parameters such as opamp types, speed, noise consideration, input source impedance etc...

Typically, the resistor values will be much higher.  Something like 10k and 1k.  Watch Dave do KCL at the input (Kirchoff's Current Law).  Take the 1k resistor and an inverting configuration:  If the input signal is 1V to the input resistor then the current going toward the summing junction is 1 mA (1V / 1k) because the summing junction is at 0V because the (+) input is grounded.  That same 1 mA goes through the 10k resistor (because it can't flow into the op amp (-) input) and that requires the output voltage to be -10V.  Hence the gain of -10 (inverting amplifier).

Now, think about what happens to that 1V signal with a 5 Ohm resistor.  The current flowing toward the summing junction is 200 mA.  That's a LOT!  The op amp has to sink that same current from the 50 Ohm feedback resistor to get the -10V output.  Not many op amps can drive/sink that much output current.

If noise can be controlled, the resistors can be even bigger.  There's no reason not to use 100k and 1M to get the same gain.

#### rstofer

• Super Contributor
• Posts: 6944
• Country:
##### Re: Op-amps and gain potential
« Reply #8 on: January 19, 2017, 12:42:17 am »
BTW, that example with the 1V on the 5 Ohm input resistor showed a need for 200 mA flowing through the resistor.  That assumes that the signal source, whatever it might be, can provide that much current.  For small signal projects, this isn't likely.

You need to think about where the current is coming from, where it is going and how much there is.  KCL will help a lot.  Just assume the (-) input pin is 0V (because the (+) pin is grounded) and the rest is easy.

#### krappleby

• Contributor
• Posts: 29
• Country:
##### Re: Op-amps and gain potential
« Reply #9 on: January 19, 2017, 10:46:35 am »
Thanks guys..

I'm asking because I'm working on a  new project, in which (I think there has been one done before) you can hear emf through the use of pickups. the current but I want to make a few modifications to it in order to provide a wider market.

I'm looking to (using the Arduino) incorporate a screen where the signal from the Dual pickups (stereo) will show exactly where the signal is coming from, ie if the left pickup is generating more than the right the screen will show that its originating from the left.. etc. when both are roughly the same then the source is in the center.. this would mainly be for electricians, who can exactly pinpoint wires with the device.. they would know exactly where the wire is. at the moment I believe they have a machine that just beeps to tell them the general location of the wires.. not sure though

To do this, I would need to increase the voltage coming from the pickups, so that the Arduino can pick it up with reasonable accuracy, so am looking to amplify the signal slightly. 5X or 10X, not sure as yet.. need to test.

anyway, I am also looking to add extra features to it also.

so my question was based on increasing the voltage. in order to work with more easily used figures for the Arduino. etc..

cheers
keith

#### rstofer

• Super Contributor
• Posts: 6944
• Country:
##### Re: Op-amps and gain potential
« Reply #10 on: January 19, 2017, 01:30:44 pm »
You will also have to deal with the issue that the input signal is AC (presumably symmetric above and below 0V).  Your op amp can handle an AC signal if is is dual supply so you could amplify and then rectify before feeding the ADC.  The ADC can only handle DC (above 0V).  Otherwise, you need to scale and offset the AC voltage so that it is no longer symmetric about 0V but symmetric around Vdd/2.  See section 4.3 when thinking about single supply op amps and offset/scale.

http://web.mit.edu/6.101/www/reference/op_amps_everyone.pdf

#### Zero999

• Super Contributor
• Posts: 13454
• Country:
• 0999
##### Re: Op-amps and gain potential
« Reply #11 on: January 19, 2017, 10:29:41 pm »
The gain on an op amp is indeed computed from the resistor values but there is a difference between the cases where feedback is applied to the (-) input or the (+) input (inverting or non-inverting configuration):

For the situation where the feedback is connected to the (-) (inverting amplifier), the gain is Rf / Rin  (feedback resistor divided by input resistor).
For the non-inverting condition, the gain is 1+(Rf/Rin)

Feedback is never applied to the + input.
What you meant, I think, is that the gain calculation is different depending on whether the input signal is applied to the - or + input, which is to say, inverting or non-inverting configuration.

Yup!  Misstated the situation.  The feedback is usually negative.  The difference is where the signal is applied.
Well the feedback can be applied to an op-amps non-inverting input and still be negative, if the op-amp is preceded with an inverting amplifier in the feedback loop.

Attached is an example. Q1 forms another inverting amplifier, which will swap the positions of the op-amps inputs.

Note this is for educational purposes only. I'm not recommending this circuit, which will quite likely be unstable.

Smf