# Non-Inverting Amplifier ```circuitjs $ 64 0.000005 1.0312258501325766 50 5 50 5e-11 a 192 240 304 240 9 15 -15 1000000 4.9999000019999595 5 100000 r 192 320 192 400 0 1000 r 304 320 192 320 0 1000 w 192 320 192 256 0 w 304 240 304 320 0 O 304 240 368 240 1 0 g 192 400 192 432 0 0 v 96 352 96 224 0 0 40 5 0 0 0.5 w 96 224 192 224 2 g 96 352 96 432 0 0 b 144 288 289 401 0 x 264 386 278 389 4 24 β x 240 345 252 348 4 12 Rf x 160 363 176 366 4 12 Rg ``` What is the closed loop gain of this circuit? $$ \begin{flalign} &V_- = V_+ = V_s&\\\ &V_- \text{is the output of a voltage divider}\\ \end{flalign} $$ Because $V_-$ is equal to $V_+$ and $V_- = V_s = V_o (\frac{R_g}{R_G+R_F})$ If we solve that equation for $\frac{V_O}{V_s}$ we get the following formula: ## Formula $\displaystyle Gain =\frac{V_o}{V_s} = 1+\frac{R_F}{R_G}$ # Buffer (Voltage-Follow) This circuit is useful, because the output always replicates the voltage at the input. For example if you connect the output of a voltage divider you can drive a load wth $V_o$ and the impedance in the Load will not change the $V_o$ ```circuitjs $ 64 0.000005 1.0312258501325766 50 5 50 5e-11 a 192 240 304 240 9 15 -15 1000000 4.999950000499995 5 100000 w 192 320 192 256 0 w 304 240 304 320 0 O 304 240 368 240 1 0 v 96 304 96 224 0 0 40 5 0 0 0.5 w 96 224 192 224 2 g 96 304 96 352 0 0 w 192 320 304 320 0 ``` # Inverting Amplifier When the output of the op-amp is connected to its own inverting input, and the non-inverting input is connected to ground then it is in a closed loop inverting configuration. Because the op-amp tries make sure that the voltage of both its inputs pins are the same, it will try to create a voltage which cancels out the voltage on the inverting input. This means if the input is $5V$ then the output voltage is $-5V$. Another way to think about this is, that we know that the op-amp inputs do not consume current. So all the current goes through $Ri$ and $Rf$ that means that they both have the same exact current flowing through them. Through ohms law we can then figure out the voltage drops across them. ```circuitjs $ 64 0.000005 1.0312258501325766 50 5 50 5e-11 v 64 304 64 192 0 0 40 5 0 0 0.5 r 176 192 112 192 0 1000 w 176 224 176 272 0 g 176 272 176 320 0 0 g 64 304 64 320 0 0 r 176 128 288 128 0 1000 w 288 128 288 208 0 w 176 192 176 128 0 g 288 272 288 320 0 0 p 288 208 288 272 1 0 0 x 230 94 242 97 4 12 Rf x 129 166 141 169 4 12 Ri a 176 208 288 208 8 15 -15 1000000 0.00004999900001999959 0 100000 w 112 192 64 192 2 ``` $$ \begin{flalign} &A_V = -\frac{R_F}{R_I}&\\\ \end{flalign} $$ # Single Ended Inverting Amplifier When we connect $V_-$ of the op-amp to ground, the output signal can't go below $0V$ this means that if the input signal goes below $0V$ it is cut of to fix this problem, we need to raise the signal by half of the $V_+$ voltage so that it does not get cut off. ```desmos-graph y=\sin(x*5)|5>x>0|y>0 y = \sin(x*5)|x<0 y=\sin(x*5)+1|5