Help me modify this level-shifting circuit
I decided to keep \$R_{22}\$ at the same value, along with the output divider resistors. Just changed \$R_{17}\$ and \$R_{21}\$ and assumed a new rail voltage for the pair.







simulate this circuit &ndash; Schematic created using CircuitLab

You can refer to an answer I made elsewhere to see how to make the calculation for those two resistors. It's here. So you can do your own computation if you like.

$$\begin{align*}
R_{17} &amp;= \frac{20\:\textrm{k}\Omega\cdot\left(10\:\textrm{V}-5\:\textrm{V}\right)\cdot\left(0\:\textrm{V}-12\:\textrm{V}\right)}{0\:\textrm{V}\cdot\left(\left(10\:\textrm{V}-0\:\textrm{V}\right)-\left(10\:\textrm{V}-5\:\textrm{V}\right)\right)-5\:\textrm{V}\cdot 10\:\textrm{V}+10\:\textrm{V}\cdot 0\:\textrm{V}}=24\:\textrm{k}\Omega \\ \\
R_{21} &amp;= \frac{20\:\textrm{k}\Omega\cdot\left(10\:\textrm{V}-5\:\textrm{V}\right)\cdot\left(12\:\textrm{V}-0\:\textrm{V}\right)}{12\:\textrm{V}\cdot\left(\left(10\:\textrm{V}-0\:\textrm{V}\right)-\left(10\:\textrm{V}-5\:\textrm{V}\right)\right)-5\:\textrm{V}\cdot 10\:\textrm{V}+10\:\textrm{V}\cdot 0\:\textrm{V}}=120\:\textrm{k}\Omega
\end{align*}$$

The output of the opamp should be from \$0\:\textrm{V}\$ to \$10\:\textrm{V}\$ and, with the added divider, result in \$0\:\textrm{V}\$ to \$5\:\textrm{V}\$ at the \$V_o\$ point in the schematic above. The output impedance will be the same, the loading on the opamp output will be the same, and this is now at \$12\:\textrm{V}\$ operation. I didn't bother worrying here about input bias/offset issues. The divider's Thevenin resistance is obviously different. And I don't know what's driving your circuit, either. But this is the best I could do with the information at hand.



Despite your comments, the above circuit will still generate the output you want. A level-shifted result that is in phase with the input. An inverter circuit would be trivial to design to do the level shift, too. But the output would be inverted from the input. And there are still other methods for just performing a level-shift (as unexpected perhaps as using a current source through a resistor with your signal driving one end and the output picked up from the other end.)

But the above matches up with your "I want to modify this circuit to ..."