This tutorial Biasing op amp for output voltage range using straight line method is continuation of the tutorial general method to bias op amp - tutorial 1.

In the last tutorial we explained how an op-amp input/output equation can be generalized mathematically as a straight line equation. Example of inverting and non-inverting op amp input/output equation as straight line equation as explained. Also it was said that the DC offset is the intercept of a straight line equation. With inverting and non-inverting op amp general circuit we did not encounter any DC offset. Now in this op-amp biasing tutorial we will see how DC offset comes about, how to determine it and how to create the amplifier circuit.

In this tutorial we will create an inverting op amplifier biased with DC offset. In the next tutorial we will show an non-inverting amplifier biased with DC offset.

The first step is to decide which type of amplifier we want to build. The most basic selection is inverting or non-inverting amplifiers. As said earlier we choose an inverting amplifier design in this tutorial.

Next before building the circuit we need to determine the slope or Gain and intercept b or DC offset for the op amp amplifier. These allows us to calculate the resistor value for the inverting amplifier and the resistor values for the DC offset.

Suppose that our input signal is in the range -0.2V to 0.2V. So this ac signal has negative excursion. Also suppose that we have ADC with 3.3V supply. So we need to amplify the ac signal so that it falls within the range of the ADC. Let the output voltage from the op amp be 0.5V to 2.5V(2.5+0.5=3), so that the mid value is 1.5V. That means that if there is no input signal the output signal should be 1.5V. Any input signal in this case will be riding on the DC signal 1.5V(above and below).

Now using the straight line formula, we can calculate the value of m and b. The input signal Vin is -02 and 0.2 and the output signal is 0.5V and 2.5V. So our first equation is,

Vout = mVin + b

or, 0.5 = m(-0.2) + b

or, 0.2m - b = 0.5 ------------------(1)

Similarly,

Vout = mVin +b

or, 2.5 = m(0.2)+b

or, 0.2m+b =2.5 -----------------------(2)

Now solving (1) and (2) wet get value of m and b. We can use program like python to solve these linear equation(see Download Learn to Program Using Python PDF free). Using Python programming language with numpy based linear algebra module we can solve these equations for m and b. Below is such a program.

# solving linear equation

import numpy as np

a = np.array([[0.2,-1],[0.2,1]])

b = np.array([-0.5,2.5])

soln = np.linalg.solve(a,b)

The solution are,

G

5.0

Vbias

1.5

So the value of m(or G) is 5 and value of b(or Vbias) is 1.5.

That is the required gain is 5 and DC offset is 1.5V. As you can see the DC offset 1.5V is between the high and low output voltage level which are 2.5V and 0.5V.

For the inverting amplifier design we have the following circuit configuration.

Since the Gain(G) or slope m is 5 we can calculate the feedback resistor value R2 as follows,

R2= G*R1

Choosing R1 as 1KOhm we get R2 = 5KOhm

Similarly since the DC offset(Vbias) or the intercept b is 1.5V, we can calculate R4 by arbitrary choosing R3.

Vbias = Vin(R4/R3+R4)

Here, Vbias = 1.5V, Vin = 3.3V and R3= 1KOhm. This gives us R4 = 833KOhm.

Now we can see the graph of the input and output signal as shown below.

So in this way we can bias an inverting op-amp for specific input and output voltage range. In the next tutorial you will learn how to bias a non inverting op amp.

For book see Download Op Amp Applications Handbook pdf ebook free.

In the last tutorial we explained how an op-amp input/output equation can be generalized mathematically as a straight line equation. Example of inverting and non-inverting op amp input/output equation as straight line equation as explained. Also it was said that the DC offset is the intercept of a straight line equation. With inverting and non-inverting op amp general circuit we did not encounter any DC offset. Now in this op-amp biasing tutorial we will see how DC offset comes about, how to determine it and how to create the amplifier circuit.

### Choosing type of Amplifier

The first step is to decide which type of amplifier we want to build. The most basic selection is inverting or non-inverting amplifiers. As said earlier we choose an inverting amplifier design in this tutorial.

### Determination of slope m(Gain) and intercept b(DC offset)

Next before building the circuit we need to determine the slope or Gain and intercept b or DC offset for the op amp amplifier. These allows us to calculate the resistor value for the inverting amplifier and the resistor values for the DC offset.

Suppose that our input signal is in the range -0.2V to 0.2V. So this ac signal has negative excursion. Also suppose that we have ADC with 3.3V supply. So we need to amplify the ac signal so that it falls within the range of the ADC. Let the output voltage from the op amp be 0.5V to 2.5V(2.5+0.5=3), so that the mid value is 1.5V. That means that if there is no input signal the output signal should be 1.5V. Any input signal in this case will be riding on the DC signal 1.5V(above and below).

Now using the straight line formula, we can calculate the value of m and b. The input signal Vin is -02 and 0.2 and the output signal is 0.5V and 2.5V. So our first equation is,

Vout = mVin + b

or, 0.5 = m(-0.2) + b

or, 0.2m - b = 0.5 ------------------(1)

Similarly,

Vout = mVin +b

or, 2.5 = m(0.2)+b

or, 0.2m+b =2.5 -----------------------(2)

Now solving (1) and (2) wet get value of m and b. We can use program like python to solve these linear equation(see Download Learn to Program Using Python PDF free). Using Python programming language with numpy based linear algebra module we can solve these equations for m and b. Below is such a program.

# solving linear equation

import numpy as np

a = np.array([[0.2,-1],[0.2,1]])

b = np.array([-0.5,2.5])

soln = np.linalg.solve(a,b)

The solution are,

G

5.0

Vbias

1.5

So the value of m(or G) is 5 and value of b(or Vbias) is 1.5.

That is the required gain is 5 and DC offset is 1.5V. As you can see the DC offset 1.5V is between the high and low output voltage level which are 2.5V and 0.5V.

### Circuit and Resistor Value

For the inverting amplifier design we have the following circuit configuration.

Since the Gain(G) or slope m is 5 we can calculate the feedback resistor value R2 as follows,

R2= G*R1

Choosing R1 as 1KOhm we get R2 = 5KOhm

Similarly since the DC offset(Vbias) or the intercept b is 1.5V, we can calculate R4 by arbitrary choosing R3.

Vbias = Vin(R4/R3+R4)

Here, Vbias = 1.5V, Vin = 3.3V and R3= 1KOhm. This gives us R4 = 833KOhm.

Now we can see the graph of the input and output signal as shown below.

So in this way we can bias an inverting op-amp for specific input and output voltage range. In the next tutorial you will learn how to bias a non inverting op amp.

For book see Download Op Amp Applications Handbook pdf ebook free.

## No Comment to " Biasing op amp for output voltage range using straight line method - tutorial 2 "