Is this an effective way to quickly switch between two gain settings in an inverting amplifier configuration?
I want to be able to switch between unity gain and half the input gain (-6dB) for an inverting opamp. The easiest way I can think of to do this is to add another resistor of the same value in parallel to the feedback resistor.
This is part of an audio output stage, and I have read that floating pins can pick up unwanted noise. To mitigate this, I added a 1M pulldown so that the parallel feedback resistor isn't floating when the switch has disconnected it.
Is this an appropriate approach, and is there anything else I should consider? I'm trying to keep this as simple as possible. Thanks!
EDIT: Updated the design as per both comments - thank you! That helped me understand what to do (and why).
Flip the switch around, with pin 2 connected to R17, so that it switches between the output and ground. Then there's no need for R29.
This is part of an audio output stage, and I have read that floating
pins can pick up unwanted noise. To mitigate this, I added a 1M
pulldown so that the parallel feedback resistor isn't floating when
the switch has disconnected it.
The node isn't floating; it's connected to the 100 kΩ resistor so, providing your switch has low capacitance to ground your circuit should work just fine without R29.
Remember, this advice is for audio; as frequencies get into the hundreds of kHz and above things can change in that the open-circuit switch capacitance can come into play.