I'm thinking about controlling analog circuits with a micro controller and lots of tiny relays (Omron G6L). For signal routing this is fine but gain control is troubling.
Obviously I could do something like this:
But this requires a relay for each step. I'm thinking there has to be a better way.
Is there a clever resistor network arrangement that can yield the voltage dividers found in inverting and non-inverting op amp circuits, panning controls, etc?
More specifically, is there a parallel and / or series network of relay controlled resistors that can yield the ratios necessary to control gain in op amp circuits (both inverting and non-inverting), pan controls, etc?
With 2 relays that is 4 possible ideally. With 3 relays that's 2 x 2 x 2 = 8 steps. With 8 steps of 3dB each that would give me a 21dB range from say -9 to +12 or whatever. As the gain is increased or decreased, the microcontroller would just iterate through a predefined sequence of binary codes.
Surely this has been studied before but I'm not an EE (I'm just doing this for fun) so any pointers would be greatly appreciated.