My question relates to the circuit in the image below. I have a non-inverting amplifier that generally will need to operate as a buffer (voltage follower) after a low pass filter to give a low impedance output that I can use elsewhere. In certain situations, the input to this op amp (U4) is low enough that it would be beneficial to amplify this signal (around x10 based on resistors chosen below). To accomplish this, I had the idea to put an N-channel MOSFET in the feedback loop that I can switch on and off with a digital control (from uC, button press, etc.). When switched on, the Rds is low (140 mOhms for the specific FET I'm looking at using) resulting in a gain of essentially 1. When switched off, the Rds is very high, making the feedback resistance nearly equal to R13 and changing the gain to approximately 10x.
Is this an acceptable way to accomplish this? Is there a better way to do it? Potentiometers or switches are out of the question as I need a way to control with a microcontroller output in some instances.
Then there's a follow up question to the circuit. What if instead of merely turning FET on and off, I sent a PWM signal into the gate? With a low pass filter after the output of the op amp, changing the duty cycle would give me a variable gain between 1 and 10. As simulated in LTspice, this seems to work, with a few caveats:
- Cutoff frequency of the low pass filter after the output looks like it needs to be about 100 times lower than the PWM frequency in order to get a low-ripple output. PWM frequency is limited by my microcontroller speed. In my particular case, this isn't a problem at all. If I can pass through even 50 Hz, that's plenty.
- The input signal can't be larger than 1/10 (less a bit) of the positive rail of the op amp to get consistent results.
I thought it was a kinda cool idea, and it simulates well enough in LTspice, but didn't know if there was maybe a better way to accomplish this, or maybe there's something I'm missing that would come back to get me later when I actually tried to implement it. I appreciate any and all feedback that you have.