I was looking for a clever way to automatically scale voltages from, say, 0-50V with a mux to an ADC (0-5V) without worry of damaging my inputs.
My thought a simple amplifier with selectable gains would work: Select the lowest gain ratio first (i.e. 0.1x), and then raising that to eventually have the voltage fall nicely within my desired range, and of course I know which ratio is selected on the mux.
I stumbled across this clever circuit when looking for a solution, but it is confusing to me:
I gather that this is more or less what I am sort of looking for: I assume the DC offset of 2.5 is to allow negative voltages to be scaled (with protections diodes in place before that point) and read as a multimeter would do maybe, of which is my intended project.
The formulas given do not lay up very well however:
i.e. 0.1x gain, Rf/Rin (100k:10k), with Vin of 10 = 1V (or 3.5V I suppose with the offset?) - this is nice, however in the formula provided:
\$2.5V - (10 - 2.5V) * \frac{10k}{100k} = 1.75\$
And to me of course that does not make sense!
Will ignoring the formula and simply assuming it divides evenly and I know by how much work? (if it is just some strange "on paper" formula, and not something meant to be done on the processor, since \$V_{out}-2.5gain\$ or whatnot is a looot easier..) What is that given formula and how does it work if it does? Will the mux add any downsides (leakage current?) and should I choose lower resistors in that case to swamp that? Can you suggest any alternative circuits that simplify what I am trying to do if this is just a bad idea in general?