Op Amps - can you make a switchable x 3.3 and x 1 buffer (non inverting) amp out of the same amp ?

Rushy

Joined Apr 15, 2019
12
Good Day Guys,
A lot of fella's on here were very helpful last time i put up a thread so I thought i would give it another crack.

My question is can you make a switchable x 3.3 and x 1 buffer (non inverting) amp out of the same amp ?

The resistor that goes from inv i/p to Gnd I want to keep and just switch the feedback resistor.
I tried using a lower resistor in the feed back ( like 1/10th of the "to Gnd" resistor as you ad a 1 to the gain anyway - trying for a 1.1:1 gain, it didn't seem to like it.

Has anyone had any success with this type of Cct ?
I cannot just put a link as feedback because then i will kill my x 3.3 option.

At present i am switching between the two halves of an LM358 - using one amp for x 3.3 option and the other as a x 3 then dividing back down to get the 1 :1 option ( as opposed to a link)

Cheers,
Rushy

crutschow

Joined Mar 14, 2008
34,858
What is the signal range and the supply voltages?

Analog Ground

Joined Apr 24, 2019
460
This type of function would commonly be done with a switch which opens and closes the ground connection of the resistor to the inverting input and not switching the feedback resistance. The gain is 1+RF/RI when the switch is closed (3.3 in your case) and just 1 when when the switch is open and RI is an open circuit. This gets the switch off the summing junction which can be a sensitive spot for noise and stray capacitance.

If you must put the switch on the feedback, just setup for a gain of 3.3 and then short across the feedback resistor with the switch closed for the gain of 1. Again, gain is 1+RF/RI and with RF=0, the gain is 1. In this case, RI is a load on the op amp output in the gain of 1 case but this is typically not a problem other than increasing circuit power consumption.

Rushy

Joined Apr 15, 2019
12
What is the signal range and the supply voltages?
lower signal level = 300mv P- P
upper signal level = 1v P-P
Supply Rails + 12v, 0V
Converting 300mV P-P to 1 V P-P and
1V P-P straight through (buffered) and out as 1 V P-P

Rushy

Joined Apr 15, 2019
12
lower signal level = 300mv P- P
upper signal level = 1v P-P
Supply Rails + 12v, 0V
Converting 300mV P-P to 1 V P-P and
1V P-P straight through (buffered) and out as 1 V P-P

crutschow

Joined Mar 14, 2008
34,858
Converting 300mV P-P to 1 V P-P and
1V P-P straight through (buffered) and out as 1 V P-P
Does any portion of the signal go negative (below ground)?

Rushy

Joined Apr 15, 2019
12
This type of function would commonly be done with a switch which opens and closes the ground connection of the resistor to the inverting input and not switching the feedback resistance. The gain is 1+RF/RI when the switch is closed (3.3 in your case) and just 1 when when the switch is open and RI is an open circuit. This gets the switch off the summing junction which can be a sensitive spot for noise and stray capacitance.

If you must put the switch on the feedback, just setup for a gain of 3.3 and then short across the feedback resistor with the switch closed for the gain of 1. Again, gain is 1+RF/RI and with RF=0, the gain is 1. In this case, RI is a load on the op amp output in the gain of 1 case but this is typically not a problem other than increasing circuit power consumption.[/QUOTE

Yes, that makes good sense. Thanks mate

Rushy

Joined Apr 15, 2019
12

crutschow

Joined Mar 14, 2008
34,858
Below is the LTspice simulation of the first circuit AG discussed:
With Vg @ 0V, the gain is +1, and with Vg @ 5V, the gain is nominally +3.3.

Last edited:

Rushy

Joined Apr 15, 2019
12
Below is the LTspice simulation of the first circuit AG discussed:
With Vg @ 5V the gain is nominally +3.3, and with Vg @ 0V, the gain is +1.

View attachment 175967
Below is the LTspice simulation of the first circuit AG discussed:
With Vg @ 5V the gain is nominally +3.3, and with Vg @ 0V, the gain is +1.

View attachment 175967
Hi Mate,
First of all,thanks for the details you have provided - love your work !
OK, so if I vary the gate voltage ( to either 5v or 0v) I am effectively switching in (or out) R2 thereby creating the amplifier gain cct of x 3.3 (( 11.5 /4.99) + 1) So the 11.5K resistor looks just like a Short cct or link, is that correct ?
I take it those values were generated by a software program as they are unusual values.
Also, what is the CRO/software you are using ?
I have a cheap Hantek unit which is sad and has no dc coupling on lead - had to build up a plug in module to remove the DC from the input.
Ah, just saw it - "LTspice"

crutschow

Joined Mar 14, 2008
34,858
if I vary the gate voltage ( to either 5v or 0v) I am effectively switching in (or out) R2 thereby creating the amplifier gain cct of x 3.3 (( 11.5 /4.99) + 1) So the 11.5K resistor looks just like a Short cct or link, is that correct ?
Yes, when the MOSFET is off, the 11.5k resistor carries no current, so it basically looks like a short between the output and the (-) input.
I take it those values were generated by a software program as they are unusual values.
It's a little Visual Basic program I wrote many years ago to select the best 1% values for a given desired resistor ratio.
just saw it - "LTspice"
Several on these forums use the free LTspice program from Analog Devices (formerly Linear Technology).
It's probably one of the best, free Spice based programs for analog simulation.
The learning curve is a little steep, but there are tutorials, and many circuit examples to get you started.

Rushy

Joined Apr 15, 2019
12
Yes, when the MOSFET is off, the 11.5k resistor carries no current, so it basically looks like a short between the output and the (-) input.
It's a little Visual Basic program I wrote many years ago to select the best 1% values for a given desired resistor ratio.
Several on these forums use the free LTspice program from Analog Devices (formerly Linear Technology).
It's probably one of the best, free Spice based programs for analog simulation.
The learning curve is a little steep, but there are tutorials, and many circuit examples to get you started.
Thanks for all your help mate, just downloaded LTspice - it looks similar to a program I use - "PCB Artist"
A good way of looking at the problem.
Cheers and thanks again.
Rushy

AnalogKid

Joined Aug 1, 2013
11,209
I take it those values were generated by a software program as they are unusual values.
They are standard 1% (E 96) values. Normally, the resistors for a gain of 3 non-inverting circuit would be a 2:1 ratio, like 5K (4.99K) and 10K. However, when the 2N7000 is on its channel resistance (Rdson) is in series with R2. R1 is increased to maintain the 2:1 ratio.

Wally - 11.5K seems a bit large for this. Am I missing something?

ak

crutschow

Joined Mar 14, 2008
34,858
11.5K seems a bit large for this. Am I missing something?
The op wanted a gain of 3.3 not 3.
The ON resistance of the 2N7000 is only a couple ohms, thus does not significantly affect the gain resistor calculated values.

AnalogKid

Joined Aug 1, 2013
11,209

crutschow

Joined Mar 14, 2008
34,858
Converting 300mV P-P to 1 V P-P
Below is a slight revision:
I changed the resistors to give a gain close to 3.333 so the output with a 300mV input is nearer to 1V.
Edit: As before, those resistors are the closest 1% standard values to give the desired gain.

Last edited:

AnalogKid

Joined Aug 1, 2013
11,209
The little 200 mV output spike at the switch point is interesting. What happens if you slow the control signal transition to 10-20 ms?

ak

Analog Ground

Joined Apr 24, 2019
460
The little 200 mV output spike at the switch point is interesting. What happens if you slow the control signal transition to 10-20 ms?

ak
Possibly "charge injection" through the gate to channel capacitance. Most all analog switches have this "feature". Slowing down the control signal edge will lower the amplitude but the same amount of charge will still be transferred, just spread out over time. One way to combat this effect is to add an equivalent capacitance coupling the inverse of the control signal into the signal path to balance out the charge transfer. Perhaps this is also one way to verify with simulation? BTW, there should be an equivalent negative spike when the control signal goes back low. One more thing to really beat it into the ground. Given the bandwidth of the op amp circuit, it may be better to speed up the edge and have the circuit "naturally" filter it out.

Last edited:

crutschow

Joined Mar 14, 2008
34,858
Whether that spike during the gain change is a problem or not depends upon the application, of course.