physics 219 – fall, 2007 labnotes 6 – op amps friday...

35
page 1 Last modified on 11/13/07 Physics 219 – Fall, 2007 LabNotes 6 – Op Amps Friday, November 2 ............................................................................................. 2 Differential Amplifiers ....................................................................................... 2 Introduction to Op amps ..................................................................................... 3 Open Loop Gain .............................................................................................. 4 Student Manual Section 8-1 ......................................................................... 4 Feedback ......................................................................................................... 5 Op Amp Golden Rules .................................................................................... 6 Some Op Amp Circuits....................................................................................... 7 Inverting Amplifier ......................................................................................... 7 Student Manual Section 8-2 ......................................................................... 9 Non-Inverting Amplifier ................................................................................. 9 Student Manual Section 8-3 ........................................................................10 Op Amp Follower ..........................................................................................10 Student Manual Section 8-4 ........................................................................11 Op Amp Current Source .................................................................................11 Student Manual Section 8-5 ........................................................................12 Current-to-Voltage Converter.........................................................................12 Student Manual Section 8-6 ........................................................................14 Friday, November 9 ............................................................................................14 Summing Amplifier .......................................................................................14 Summing Amplifier as a Digital to Analog Converter ....................................15 Student Manual Section 8-7 ........................................................................16 Op Amp Buffer for Push-Pull Amplifier ........................................................16 Student Manual Section 8-8 ........................................................................20 Op Amp Limitations ..........................................................................................21 Student Manual Section 9-1 ........................................................................23 Op Amp Integrator .........................................................................................23 Student Manual Section 9-2 ........................................................................25 Audio Amplifier .............................................................................................26 Student Manual Section 9-4 ........................................................................27 Sound Sensor ..............................................................................................27 Comparator ........................................................................................................27 Schmitt Trigger ..............................................................................................28 Student Manual Section 10-1 ......................................................................30 RC Relaxation Oscillator ................................................................................30 Student Manual Section 10-2 ......................................................................33 Stabilizing the length of a laser cavity to a part in 10 8 with a 40 cent op amp 33

Upload: others

Post on 08-Jul-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Physics 219 – Fall, 2007 LabNotes 6 – Op Amps Friday ...academics.wellesley.edu/Physics/Rberg/logochip/...Physics 219 - Fall, 2007 LabNotes 6 - Op Amps page 4 Last modified on

page 1 Last modified on 11/13/07

Physics 219 – Fall, 2007

LabNotes 6 – Op Amps Friday, November 2 ............................................................................................. 2

Differential Amplifiers ....................................................................................... 2

Introduction to Op amps ..................................................................................... 3

Open Loop Gain.............................................................................................. 4

Student Manual Section 8-1 ......................................................................... 4

Feedback ......................................................................................................... 5

Op Amp Golden Rules .................................................................................... 6

Some Op Amp Circuits....................................................................................... 7

Inverting Amplifier ......................................................................................... 7

Student Manual Section 8-2 ......................................................................... 9

Non-Inverting Amplifier ................................................................................. 9

Student Manual Section 8-3 ........................................................................10

Op Amp Follower ..........................................................................................10

Student Manual Section 8-4 ........................................................................11

Op Amp Current Source.................................................................................11

Student Manual Section 8-5 ........................................................................12

Current-to-Voltage Converter.........................................................................12

Student Manual Section 8-6 ........................................................................14

Friday, November 9 ............................................................................................14

Summing Amplifier .......................................................................................14

Summing Amplifier as a Digital to Analog Converter ....................................15

Student Manual Section 8-7 ........................................................................16

Op Amp Buffer for Push-Pull Amplifier ........................................................16

Student Manual Section 8-8 ........................................................................20

Op Amp Limitations..........................................................................................21

Student Manual Section 9-1 ........................................................................23

Op Amp Integrator .........................................................................................23

Student Manual Section 9-2 ........................................................................25

Audio Amplifier .............................................................................................26

Student Manual Section 9-4 ........................................................................27

Sound Sensor ..............................................................................................27

Comparator........................................................................................................27

Schmitt Trigger ..............................................................................................28

Student Manual Section 10-1 ......................................................................30

RC Relaxation Oscillator................................................................................30

Student Manual Section 10-2 ......................................................................33

Stabilizing the length of a laser cavity to a part in 108 with a 40 cent op amp33

Page 2: Physics 219 – Fall, 2007 LabNotes 6 – Op Amps Friday ...academics.wellesley.edu/Physics/Rberg/logochip/...Physics 219 - Fall, 2007 LabNotes 6 - Op Amps page 4 Last modified on

Physics 219 - Fall, 2007 LabNotes 6 - Op Amps

page 2 Last modified on 11/13/07 12:27 PM

Friday, November 2

Differential Amplifiers

Amplifiers such as the common emitter have a single input terminal into which one

feeds a voltage Vin measured with respect to ground. The output voltage, Vout also

measured with respect to ground is given by

Vout = G Vin

Now, often we’d like to measure the difference between two input signals. Here’s

one important reason why:

signal

signal + 60 Hz "pick-up"

Vout=G VinVinVsource long lead

Ordinary Amplifier - subject to "pick-up" of unwanted signals

signal

signal + 60 Hz "pick-up"

Vout=Gdiff ( V+ - V-)

Vin

Vsource

long lead

-

+

"pick-up" is approximately the same for this lead

Differential Amplifier – minimizes unwanted “pick up”

Vout = Gdiff V+ V( )

Page 3: Physics 219 – Fall, 2007 LabNotes 6 – Op Amps Friday ...academics.wellesley.edu/Physics/Rberg/logochip/...Physics 219 - Fall, 2007 LabNotes 6 - Op Amps page 4 Last modified on

Physics 219 - Fall, 2007 LabNotes 6 - Op Amps

page 3 Last modified on 11/13/07 12:27 PM

where Gdiff is the differential mode gain of the amplifier.

In the case of the differential amplifier, both the "signal lead" and the "ground

lead" are subject to the same pick up; the differential amplifier "rejects this

common mode signal."

(Section 6-4 of the Student Manual shows how to build a simple differential

amplifier using two transistors. You can build this circuit as an optional exercise.)

Introduction to Op amps

An "ideal" differential amplifier would have the following characteristics:

• very large (nearly infinite) differential mode gain

• zero common mode gain; that is if you feed identical non-zero voltages

into the two inputs, ideally you’d expect zero volts at the output

• infinite input impedance

• zero output impedance

So-called operational amplifiers (“op amps”) are a class of amplifiers that come

amazingly close to satisfying this ideal. They are available as integrated circuits

(ICs) typically consisting a 10 -20 transistors and related resistors, capacitors and

diodes, all etched into a single slice of silicon. They are cheap, selling for as little

as 20 cents.

The schematic symbol for an op amp looks like:

+

-

The (+) and (-) symbols on the inputs do not mean that one in put is necessarily

more positive than the other. Rather they denote the "non-inverting" and

"inverting" inputs respectively. The output voltage of the op amp is given by

Vout = Gdiff V+ V( )

Page 4: Physics 219 – Fall, 2007 LabNotes 6 – Op Amps Friday ...academics.wellesley.edu/Physics/Rberg/logochip/...Physics 219 - Fall, 2007 LabNotes 6 - Op Amps page 4 Last modified on

Physics 219 - Fall, 2007 LabNotes 6 - Op Amps

page 4 Last modified on 11/13/07 12:27 PM

where Gdiff is the differential mode gain and V+ and V are the voltages applied

to the non-inverting and inverting inputs respectively.

The op amps we will use come packaged in 8–pin Dual In-line Packages (DIPs).

The pinout diagram for the (now obsolete) 741 and the 411 op amp is shown

below. By convention, the "notch" in the package serves to identify pin #1.

1

2

3

4 5

6

7

8offset null

inverting input

�non-inverting input

V(-) (-15 V) offset null

output

V(+) (+15 V)

no connection

-+

(The major difference between these op amps is that the input stage of the 411 uses

field effect transistors (FETs) whereas the 741 uses bipolar transistors. This results

in the 411 having a substantially high input impedance than the 741.)

Note that these op amps require both a positive and a negative power supply.

Open Loop Gain

Like all op amps, the 741 and 411 both have an extremely large differential mode

gain (also called "open loop gain", for reasons that will become clear shortly).

Student Manual Section 8-1

• Complete Lab 8–1 in the Student Manual on the Open Loop Test Circuit.

Here you’ll get a feel for what is meant by a large open loop gain by building

the following circuit:

Page 5: Physics 219 – Fall, 2007 LabNotes 6 – Op Amps Friday ...academics.wellesley.edu/Physics/Rberg/logochip/...Physics 219 - Fall, 2007 LabNotes 6 - Op Amps page 4 Last modified on

Physics 219 - Fall, 2007 LabNotes 6 - Op Amps

page 5 Last modified on 11/13/07 12:27 PM

+

-

63

2

+15 V

-15 V

+15 V

-15 V

• Use a “potentiometer” for the variable resistor.

• Adjust the voltage divider so that the input voltage is ±1 mV.

• Due to the very large differential gain (Gdiff for the 411 is greater than

2 105!), you should see the output switch between + 15 V and -15 V just

as the input voltage changes sign.

Feedback

Feedback can roughly be defined as when one "feeds" some portion of an output

back into the input of a system. For example:

microphone

speaker

Feedback

The above is an example of positive feedback, meaning that the output is fed back

in such a manner as to add to, or reinforce the input. The result is that the sound

gets louder and louder. On the other hand, it is possible to have negative feedback,

where the output is fed back so as to partially "cancel" some of the input.

Page 6: Physics 219 – Fall, 2007 LabNotes 6 – Op Amps Friday ...academics.wellesley.edu/Physics/Rberg/logochip/...Physics 219 - Fall, 2007 LabNotes 6 - Op Amps page 4 Last modified on

Physics 219 - Fall, 2007 LabNotes 6 - Op Amps

page 6 Last modified on 11/13/07 12:27 PM

+

-

RFBRload

Positive Feedback

Negative feedback tends to act as a "correcting" influence, stabilizing the system

at the expense of lowering the gain of the system. A good everyday example of

negative feedback is the act of driving a car on the highway. If we view the "output

signal" of this system as how far your eyes tell you that you've deviated from the

center of your lane, then the driver can be thought to be feeding this output back

into the "input" (angular position of the steering wheel) in order to achieve stable,

straight driving.

+

-

RFB

Rload

"virtualground"

Negative Feedback

Real op amp circuits (almost) always use some form of feedback:

At first we'll use mainly negative feedback (Student Manual Labs 8 and 9) and

then later (Student Manual Lab 10) we'll see some of the uses of positive feedback.

Op Amp Golden Rules

Assume negative feedback is in place as shown above. Now, suppose that V , the

voltage at the inverting (-) input, begins to drift slightly below ground. The large

differential gain of the op amp will generate a much larger positive voltage at the

input. This will cause current to flow through the feedback resistor RFB back to

the inverting input, thus raising V back toward ground. A similar argument holds

for the case where V starts drifting above ground. Thus we are lead to the first of

Page 7: Physics 219 – Fall, 2007 LabNotes 6 – Op Amps Friday ...academics.wellesley.edu/Physics/Rberg/logochip/...Physics 219 - Fall, 2007 LabNotes 6 - Op Amps page 4 Last modified on

Physics 219 - Fall, 2007 LabNotes 6 - Op Amps

page 7 Last modified on 11/13/07 12:27 PM

two Golden Rules for op amps:

Op Amp Golden Rule I

With negative feedback in place, the output of the op amp will try to do

whatever is necessary to keep the voltage difference between the inputs equal

to zero.

The second Golden Rule follows as an immediate consequence of the very high

input impedance of op amps:

Op Amp Golden Rule II

Due to their very high input impedance, the inputs of an op amp will neither

source nor sink appreciable currents.

Some Op Amp Circuits

Inverting Amplifier

The op amp circuit shown below is an inverting amplifier.

Vin R1

+

-

R2

Vout

IR1

IR2

virtual�ground

The analysis of this circuit is simplicity itself:

1) Op Amp Golden Rule I implies:

V = 0

2) Ohm's Law implies:

IR1=VinR1

Page 8: Physics 219 – Fall, 2007 LabNotes 6 – Op Amps Friday ...academics.wellesley.edu/Physics/Rberg/logochip/...Physics 219 - Fall, 2007 LabNotes 6 - Op Amps page 4 Last modified on

Physics 219 - Fall, 2007 LabNotes 6 - Op Amps

page 8 Last modified on 11/13/07 12:27 PM

3) Op Amp Golden Rule II implies:

IR1= IR2

4) Ohm's Law implies:

Vout = 0 IR2R2 =

VinR1

R2

That is,

Vout =R2R1

Vin

This is closely analogous to the result we obtained for the common emitter

amplifier. The gain in this case is given by:

G =R2R1

independent of the differential gain of the amp.

A few notes:

1) The minus sign appearing in the gain indicates that the output is inverted

(180o out of phase) relative to the input. This is why this circuit is called an

inverting amplifier.

2) As is always the case with amplifiers, the "output swing" is limited by the

supply voltages. The maximum output voltage will ~ 1volt less than the

positive supply voltage and the minimum output voltage will ~ 1volt greater

than the negative supply voltage.

3) The input impedance of this configuration is given by:

ZinVinIin

= R1

Note that even though the op amp itself has a very high input impedance, the input

impedance of the inverting amplifier configuration is not particularly high. This is

a drawback of this design, but in most other ways the amplifier performs

Page 9: Physics 219 – Fall, 2007 LabNotes 6 – Op Amps Friday ...academics.wellesley.edu/Physics/Rberg/logochip/...Physics 219 - Fall, 2007 LabNotes 6 - Op Amps page 4 Last modified on

Physics 219 - Fall, 2007 LabNotes 6 - Op Amps

page 9 Last modified on 11/13/07 12:27 PM

wonderfully, so if you don't need a very high input impedance this circuit is highly

recommended.

The output impedance can be found experimentally to be very low (fractions of an

ohm!!) for small signals. This is a big advantage in using this op amp-based design

as opposed to a common emitter amplifier. However, op amps are usually limited

in the amount of load current they can supply, so the output impedance effectively

increases for larger signals.

Student Manual Section 8-2

• Complete Lab 8–2 in the Student Manual on the Inverting Amplifier.

Non-Inverting Amplifier

The op amp circuit shown below is a non–inverting amplifier.

Vin

R1

+

-

R2

Vout

IR1IR2

V-

V+

The analysis is once again pretty simple:

1) Op Amp Golden Rule I implies:

Vin = V+ = V

2) Ohm’s Law implies:

IR1=V

R1=VinR1

Page 10: Physics 219 – Fall, 2007 LabNotes 6 – Op Amps Friday ...academics.wellesley.edu/Physics/Rberg/logochip/...Physics 219 - Fall, 2007 LabNotes 6 - Op Amps page 4 Last modified on

Physics 219 - Fall, 2007 LabNotes 6 - Op Amps

page 10 Last modified on 11/13/07 12:27 PM

3) Op Amp Golden Rule II implies:

IR1= IR2

4) Ohm's Law implies:

Vout = V + IR2( )R2 = Vin +VinR1

R2

or

Vout = 1 +R2R1

Vin

Thus the gain of this configuration is given by:

G = 1 +R2R1

Here the output signal is in phase with the input signal. (Hence the name “non–

inverting amplifier”.) Like the inverting amplifier this configuration has a very low

output impedance (for small signals). Also, since the input signal is connected

directly to the input of the op amp, the input impedance of this configuration is

very high, which is a very attractive feature of this design. However, this

configuration tends not to be quite a stable as the inverting amplifier when

operated at high gain.

Student Manual Section 8-3

• Complete Lab 8–3 in the Student Manual on the Non–Inverting Amplifier.

Op Amp Follower

If we consider the non-inverting amplifier in the limit that R2 0 and R1

we see that we now have an amplifier with a gain of one, very high input

impedance, and very low output impedance. It is a nearly ideal follower, save for

its inability to supply large currents. (This is not an insignificant drawback, since

often the main point of a follower is to supply large currents.)

Page 11: Physics 219 – Fall, 2007 LabNotes 6 – Op Amps Friday ...academics.wellesley.edu/Physics/Rberg/logochip/...Physics 219 - Fall, 2007 LabNotes 6 - Op Amps page 4 Last modified on

Physics 219 - Fall, 2007 LabNotes 6 - Op Amps

page 11 Last modified on 11/13/07 12:27 PM

Vin+

-

VoutV-

V+

Student Manual Section 8-4

• Complete Lab 8–4 in the Student Manual on the Op Amp Follower.

Op Amp Current Source

Let’s calculate the current in the variable resistor R2 for the configuration shown

below:

Vin

R1

+

-

R2

Vout

IR1IR2

V-

V+

A

1) Op Amp Golden Rule I implies:

V = V+ = Vin

which remains constant in this case.

2) Ohm’s Law implies:

IR1=V

R1=VinR1

Page 12: Physics 219 – Fall, 2007 LabNotes 6 – Op Amps Friday ...academics.wellesley.edu/Physics/Rberg/logochip/...Physics 219 - Fall, 2007 LabNotes 6 - Op Amps page 4 Last modified on

Physics 219 - Fall, 2007 LabNotes 6 - Op Amps

page 12 Last modified on 11/13/07 12:27 PM

3) Op Amp Golden Rule II implies:

IR2 = IR1 =VinR1

Thus the current flowing through R2 is independent of the value of R2 over a wide

range of resistances. Thus we have an excellent current source, noticeably better

than the one–transistor–based current source that you built in Lab #4.

Student Manual Section 8-5

• Complete the first part of Lab 8–5 in the Student Manual on the Op Amp

Current Source. You can skip the part that involves adding a transistor.

Current-to-Voltage Converter

Photodiodes - You are already very familiar with light emitting diodes (LEDs):

When current flows through a light emitting diode, one photon of light is emitted

for every electron of current. The reverse process is also possible: When light is

absorbed at the p-n junction of a diode, a “photo-current” is generated. Since the

size of the photo-current is approximately linearly proportional to the intensity of

the illuminating light, a diode can serve as a light detector. In this case it is called a

photodiode. (The infra-red beam emitted by your remote control unit is detected

by a silicon photodiode located inside your TV set.) Surprisingly, the direction of

the photo-current is in the direction opposite to the normal direction of current flow

in a diode. Why this is so requires a reasonable amount of solid state physics to

explain. I’ll resist the temptation and ask you to simply accept this for now as a

rule handed down in the spirit of our other golden rules. (The phototransistor that

you encountered previously can be thought of as a “photodiode with gain”.)

In order to “detect” the induced photo-current we would like to “convert” the

photocurrent into a voltage. The simplest I-to-V converter is the humble resistor.

However in this case it has two major disadvantages: 1) the photodiode is not a

very compliant current source, the biggest output voltage it can sustain is about 0.5

V and 2) As a voltage is allowed to develop across the photodiode, the "response"

varies, thus diminishing the linearity of the device.

Page 13: Physics 219 – Fall, 2007 LabNotes 6 – Op Amps Friday ...academics.wellesley.edu/Physics/Rberg/logochip/...Physics 219 - Fall, 2007 LabNotes 6 - Op Amps page 4 Last modified on

Physics 219 - Fall, 2007 LabNotes 6 - Op Amps

page 13 Last modified on 11/13/07 12:27 PM

I

Rhν

The following op amp circuit makes for a simple, but vastly improved I-to-V

converter.

Ihν

Vout

1MΩ

An ordinary light emitting diode can be used as a photodiode (The light detection

process described above is exactly the inverse of the way light is generated in an

LED, where an “injected” current of electrons and holes meet up at the p-n

junction and “recombine”, resulting in the emission of photons.) (If you want the

best performance you wouldn’t use an LED as a light detector, the materials used

to make efficient LEDs, such as gallium arsenide, don’t work as well as silicon-

based photodiodes.)

If the photodiode is replaced by a phototransistor, the current gain of the

phototransistor makes for a much more sensitive light detector. (We need to now

use a smaller feedback resistor; otherwise the circuit is too sensitive.)

I

Vout

10 kΩ +15 V

The figure above shows how to wire an npn phototransistor with an op amp

configured as a current to voltage converter. Note that in this case, in contrast to

Page 14: Physics 219 – Fall, 2007 LabNotes 6 – Op Amps Friday ...academics.wellesley.edu/Physics/Rberg/logochip/...Physics 219 - Fall, 2007 LabNotes 6 - Op Amps page 4 Last modified on

Physics 219 - Fall, 2007 LabNotes 6 - Op Amps

page 14 Last modified on 11/13/07 12:27 PM

the situation with a photodiode, the current flow is in the direction of the arrow.

When you get this working, make sure to check out the suggestion on page 182 of

the Student Manual where you make an oscilloscope “part of the feedback loop”.

(But you’ll have to use an old–style analog oscilloscope.) By simply aiming the

phototransistor at an oscilloscope trace that is monitoring the output of the above

circuit you should see the trace move to “avoid”, or deflect around, the

phototransistor. This trick, which shows off some of the power (and magic) of the

feedback principle, will work best in a darkened room.

Student Manual Section 8-6

• Complete Lab 8–6 in the Student Manual on the Current to Voltage

Converter.

Friday, November 9

Summing Amplifier

The name “op amp”, short for “operational amplifier”, derives from the ability of

these amplifiers to be configured to perform various mathematical operations. The

simplest of these, addition, can be performed by the circuit below.

Vout

Rfb

summing�junction

Ifb

R1

R2

V1

V2

I1

I2

The currents through the input resistor add at the summing junction and flow

through the feedback resistor:

I fb = I1 + I2

The summing junction is a virtual ground so

Vout = 0V I fbRfb = I1 + I2( )Rfb

Page 15: Physics 219 – Fall, 2007 LabNotes 6 – Op Amps Friday ...academics.wellesley.edu/Physics/Rberg/logochip/...Physics 219 - Fall, 2007 LabNotes 6 - Op Amps page 4 Last modified on

Physics 219 - Fall, 2007 LabNotes 6 - Op Amps

page 15 Last modified on 11/13/07 12:27 PM

Vout =V1R1

+V2R2

Rfb

If R1 = R2 = R then

Vout =RfbR

V1 + V2( )

so the output voltage is proportional to the sum of the input voltages.

• Question: Can you design a circuit using op amps that subtracts two

voltages?

Summing Amplifier as a Digital to Analog Converter

You can use an op amp to build an “digital to analog converter”, along the same

lines as the one you previously built to control the brightness of an LED. Suppose

we let 6 V represent a binary "1" and 0 V represent a binary "0". The following

"weighted summing amplifier" produces an analog output voltage that is

proportional to a 4-bit input number:

Vout

Rfb = 1.6 kΩ

summing�junction

R3 = 1 kΩ

R2 = 2 kΩ

R1 = 4 kΩ

R0 = 8 kΩ

+5V

0 V

+5V

+5V

D3

D2

D1

D0

1

0

1

1

MSB

LSB

I3

Ifb

I2

I0

I1

I fb = I3 + I2 + I1 + I0

Vout = 0V I fbRfb = I3 + I2 + I1 + I0( )Rfb

Vout = I3 + I2 + I1 + I0( )Rfb

Page 16: Physics 219 – Fall, 2007 LabNotes 6 – Op Amps Friday ...academics.wellesley.edu/Physics/Rberg/logochip/...Physics 219 - Fall, 2007 LabNotes 6 - Op Amps page 4 Last modified on

Physics 219 - Fall, 2007 LabNotes 6 - Op Amps

page 16 Last modified on 11/13/07 12:27 PM

Vout =V3R3

+V2R2

+V1R1

+V0R0

Rfb

Note that:

R3 =R08

, R2 =R04, R1 =

R02

so that

Vout = 8V3R0

+ 4V2R0

+ 2V1R0

+ 1V0R0

Rfb

Vout =RfbR0

8 5V + 4 0 V + 2 5 V + 1 5V( )

Vout =RfbR0

5 V 10112( )

Thus the circuit acts as a digital to analog converter.

Student Manual Section 8-7

• Complete Lab 8–7 in the Student Manual on the Summing Amplifier.

Op Amp Buffer for Push-Pull Amplifier

Recall the push-pull amplifier:

Page 17: Physics 219 – Fall, 2007 LabNotes 6 – Op Amps Friday ...academics.wellesley.edu/Physics/Rberg/logochip/...Physics 219 - Fall, 2007 LabNotes 6 - Op Amps page 4 Last modified on

Physics 219 - Fall, 2007 LabNotes 6 - Op Amps

page 17 Last modified on 11/13/07 12:27 PM

+15 V

-15 V

Vin Vout

Rload

Advantages:

useful for supplying large currents to low impedance loads

can follow both positive and negative input voltages

no large quiescent currents

Disadvantages:

crossover distortion

provides no gain; must rely on another "stage" to provide gain

Goal: Use relatively high impedance small signal source (e.g. a microphone) to

provide a lot of current to a low impedance load (e.g. a loud speaker). Specifically,

suppose we try to design a circuit that can take a 50 mV signal produced by

microphone (source impedance = 2.2 k ) and produce an 2 volt signal into a 8

load. Obviously we need a circuit with an overall gain of 40.

Page 18: Physics 219 – Fall, 2007 LabNotes 6 – Op Amps Friday ...academics.wellesley.edu/Physics/Rberg/logochip/...Physics 219 - Fall, 2007 LabNotes 6 - Op Amps page 4 Last modified on

Physics 219 - Fall, 2007 LabNotes 6 - Op Amps

page 18 Last modified on 11/13/07 12:27 PM

First try:

Vin

+

-

+15 V

-15 V

Vout

Rload

Vint

400 k

20 k

+5V

2.2μF

mic.

ac coupled�microphone

2.2k8Ω

This works except you can see (and hear?) the crossover distortion:

t

V(t)Vin(t)

Vout(t)�

0.6V

crossover distortion

Page 19: Physics 219 – Fall, 2007 LabNotes 6 – Op Amps Friday ...academics.wellesley.edu/Physics/Rberg/logochip/...Physics 219 - Fall, 2007 LabNotes 6 - Op Amps page 4 Last modified on

Physics 219 - Fall, 2007 LabNotes 6 - Op Amps

page 19 Last modified on 11/13/07 12:27 PM

Second try:

Vin

+

-

+15 V

-15 V

Vout

Rload

Vint

400 k

20 k

+5V

2.2μF

mic.

ac coupled�microphone

2.2k8Ω

If you were to look at Vout with your oscilloscope you would find that the

crossover distortion gas disappeared! What happened!?

Analysis:

1) From Golden Rule I:

V = 0

2) From Ohm's Law and Golden Rule II:

IR1=VinR1

=Vin20 k

= IR2

3) From Ohm's Law:

Vout = IR2R2 =

Vin20 k

400 k

or

Vout = 20 Vin

We see from this analysis that the output voltage should always equal -20 times the

input voltage, whatever the input voltage is! Thus this result confirms that there

Page 20: Physics 219 – Fall, 2007 LabNotes 6 – Op Amps Friday ...academics.wellesley.edu/Physics/Rberg/logochip/...Physics 219 - Fall, 2007 LabNotes 6 - Op Amps page 4 Last modified on

Physics 219 - Fall, 2007 LabNotes 6 - Op Amps

page 20 Last modified on 11/13/07 12:27 PM

should be no crossover distortion, yet one can't help feeling that a swindle has just

taken place. We still haven't really answered the question "Where did the crossover

distortion go?"

The answer is that, according to Golden Rule I, the output of the op amp (labeled

Vint in the drawing above) will try to do whatever it takes to keep the inputs at the

same voltage. In the present case this apparently includes compensating for the

crossover distortion:

t

V(t)

Vout(t)Vint(t)

0.6V

0.6V

Whenever Vout > 0 the circuit is "sourcing" current into the load resistor.

(Note that very little current flows into the load via the 400 k resistor.)

This means the npn transistor in the push-pull amplifier in "on" and

Vint = Vout + 0.6 V .

Whenever Vout < 0 the circuit is "sinking" current from the load resistor.

This means the pnp transistor in the push-pull amplifier in "on" and

Vint = Vout 0.6 V .

Therefore, whenever Vout crosses through 0 V, the op amp must abruptly change

Vint between +0.6 V and - 0.6 V. Real op amps cannot change their output voltages

instantly; they have a limited "slew rate", as we shall soon see. This limits the

ability of a real op amp to fully compensate for the crossover distortion.

Student Manual Section 8-8

• Complete Lab 8–8 in the Student Manual on the Push Pull Buffer.

Page 21: Physics 219 – Fall, 2007 LabNotes 6 – Op Amps Friday ...academics.wellesley.edu/Physics/Rberg/logochip/...Physics 219 - Fall, 2007 LabNotes 6 - Op Amps page 4 Last modified on

Physics 219 - Fall, 2007 LabNotes 6 - Op Amps

page 21 Last modified on 11/13/07 12:27 PM

• Save your circuit. Shortly you’ll construct a microphone circuit that you can

use with this circuit to amplify your voice.

Op Amp Limitations

Real op amps do not quite behave in the idealized manner that we have assumed.

For example, there are mild violations of the two Golden Rules. Corrected

versions of the Golden Rules would look like:

Modified Golden Rule I

With negative feedback in place, the output of the op amp will try to do whatever is

necessary to keep the voltage difference between the inputs equal to a very small

voltage difference, called the offset voltage Vos .

Typical offset voltages for the op amps that we use in the lab are ~ a few mV.

Modified Op Amp Golden Rule II

Due to their very high input impedance, the inputs of an op amp will sink a very

small current, called the input bias current Ibias.

Because of their FET input stage, the typical input bias currents for a 411 op amp

are extremely low, ~ 3 pA (That's picoamps. 1 pA =10-12 A.) The 741 op amps

have input bias currents of a few nanoamps.

Another op amp limitation is relatively small amount of output current that they

can supply. The 411 can supply at most 25 mA to a load.

(There exist specialized op amps for delivering more substantial currents. We have

for example in our parts shelf the “386” op amp which is designed for audio

applications and is capable of directly driving a small 8 ohm speaker.)

Perhaps the most noteworthy op amp limitation is the fact that the open loop gain

of the op amp "rolls off" at high frequencies. The gain curve for a 411 op amp is

shown below:

Page 22: Physics 219 – Fall, 2007 LabNotes 6 – Op Amps Friday ...academics.wellesley.edu/Physics/Rberg/logochip/...Physics 219 - Fall, 2007 LabNotes 6 - Op Amps page 4 Last modified on

Physics 219 - Fall, 2007 LabNotes 6 - Op Amps

page 22 Last modified on 11/13/07 12:27 PM

Gain�(dB)

Frequency (Hz)1 10 1k 10k 100k 1M

20

40

60

80

100

This drop in gain limits the op amps ability to respond to high frequency signals,

resulting in a limited slew rate for the op amp. The slew rate is defined as the

maximum rate at which the output of the op amp's output can change. The 411 has

a slew rate of about 15 V/_s while the 741 has a slew rate of about 0.5 V/_s.

(This roll off in gain is actually intentional. In effect the output of the op amp is fed

through a low pass filter with a f3dB of about 100 Hz. The reason for doing this

has to do with op amp stability. Without this roll-off the op amp would be subject

to spontaneous high frequency oscillations. These high frequency oscillations

result when stray capacitance causes phase shifts in the feedback loop, so that the

feedback unintentionally becomes positive for high frequency signals. See

Horowitz and Hill section 4.33 for more on this.)

The effect of the slew rate can easily be seen by observing how an op amp follower

responds to a square wave input:

Vout

10k �

Vin = ?

(The 10 k resistor serves to limit the input current in the event that a clumsy user

allows Vin to exceed the supply voltages.)

Page 23: Physics 219 – Fall, 2007 LabNotes 6 – Op Amps Friday ...academics.wellesley.edu/Physics/Rberg/logochip/...Physics 219 - Fall, 2007 LabNotes 6 - Op Amps page 4 Last modified on

Physics 219 - Fall, 2007 LabNotes 6 - Op Amps

page 23 Last modified on 11/13/07 12:27 PM

Note that as the amplitude of the square wave increases, the distortion will become

more apparent. As noted previously, the slew rate limits the ability of the op amp

to compensate for the crossover distortion in the push-pull buffer circuit.

Student Manual Section 9-1

• Complete Lab 9-1 in the Student Manual on the Op Amp Limitations.

Op Amp Integrator

We’ve already seen how an op amp can sum two voltages. Integration is another

mathematical operation that an op amp can perform with aplomb.

Recall the simple RC integrator. It worked well only when Vout << Vin For low

frequency signals ( << (RC)-1), where the capacitor has time to charge, problems

arise:

The op amp integrator shown below removes the restriction Vout << Vin .

Vout

Vin

R

CI(t)

It's operation is simple to analyze:

From Golden Rule I we see that V = 0 so that

I t( ) =Vin t( )

R

independent of Vout t( ) . Also we have

Vout t( ) =q t( )C

the negative sign arising because for the currents we have defined as positive,

negative charge will build up on the output side of the capacitor.

Page 24: Physics 219 – Fall, 2007 LabNotes 6 – Op Amps Friday ...academics.wellesley.edu/Physics/Rberg/logochip/...Physics 219 - Fall, 2007 LabNotes 6 - Op Amps page 4 Last modified on

Physics 219 - Fall, 2007 LabNotes 6 - Op Amps

page 24 Last modified on 11/13/07 12:27 PM

Golden Rule II implies that this current flows entirely onto the capacitor so that

I t( ) =dq t( )dt

and also

Vout t( ) =I t( ) dt

C

Vout t( ) =

Vin t( )

Rdt

C

Vout t( ) =1RC

Vin t( ) dt

One problem is that because that op amp works so well, if the input signal has even

a small dc offset component, over time this will integrate to give a very large

result, causing the op amp to slowly "drift to one of the supply rails":

V(t)

t

Vout(t)

� Vin(t)

A solution is to roll off the integrating action for the dc component by putting a

large by-pass resistor into the feedback loop:

Page 25: Physics 219 – Fall, 2007 LabNotes 6 – Op Amps Friday ...academics.wellesley.edu/Physics/Rberg/logochip/...Physics 219 - Fall, 2007 LabNotes 6 - Op Amps page 4 Last modified on

Physics 219 - Fall, 2007 LabNotes 6 - Op Amps

page 25 Last modified on 11/13/07 12:27 PM

Vout

Vin

RC

10M

The dc current will flow through the resistor; it will not accumulate on the

capacitor.

Student Manual Section 9-2

• Complete Lab 9-2 in the Student Manual on the Op Amp Integrator.

Page 26: Physics 219 – Fall, 2007 LabNotes 6 – Op Amps Friday ...academics.wellesley.edu/Physics/Rberg/logochip/...Physics 219 - Fall, 2007 LabNotes 6 - Op Amps page 4 Last modified on

Physics 219 - Fall, 2007 LabNotes 6 - Op Amps

page 26 Last modified on 11/13/07 12:27 PM

Audio Amplifier

The circuit below is an audio amplifier than can takes a signal from a microphone

and amplify it by a variable amount. (That is, it’s got a “volume” knob!)

+

+4.7µF

0.1µF

0.1µF

1M1k

10k to100k

3.3M

1M

2.2k

Voutmic

case

+6V +6V

+6V

+6V

LM3582

3

1

4

8

The circuit uses a LM358 op amp, wired in a non-inverting configuration and

powered by a single 6 V battery pack. The LM358 can produce output voltages

from just above ground (the voltage on pin 4) and about 1.5 V below the positive

power supply voltage on pin 8 (6V 1.5V = 4.5V in this case). A voltage divider is

used to position the dc offset near the middle of these two limits and the audio

signal from the microphone is capacitively coupled to the amplifier.

The gain for ac signals is

G = 1 +1 M

1 k + Rvar

where Rvar is determined by the setting on a potentiometer. The dc gain is 1,

owing to the presence of the 4.7 μF capacitor.

Page 27: Physics 219 – Fall, 2007 LabNotes 6 – Op Amps Friday ...academics.wellesley.edu/Physics/Rberg/logochip/...Physics 219 - Fall, 2007 LabNotes 6 - Op Amps page 4 Last modified on

Physics 219 - Fall, 2007 LabNotes 6 - Op Amps

page 27 Last modified on 11/13/07 12:27 PM

Student Manual Section 9-4

• Complete Lab 9-4 in the Student Manual on the Microphone Amplifier. By

using battery power you should avoid the oscillations described in this section.

Sound Sensor

• Connect the output of your amplifier circuit to a LogoChip’s analog input.

Can you get your LogoChip to flash (or do something else that’s interesting)

whenever it hears a loud enough sound?

• Try connecting your microphone to the input of Push Pull Amplifier you built

previously. Connect the output of the Push Pull Amplifier to a speaker. Can you

hear your voice?

Comparator

A comparator is a device which, as the name implies, compares two different

voltages and indicates which of the two voltages is larger. A simple op amp

without any feedback can serve as a comparator:

Vout

input #1 �

input #2

The output of the op amp will swing to one of the two supply voltages, depending

on which of the inputs is larger. (In other words, the output "changes state",

depending on which of the two input voltages is larger.)

While any garden variety op amp (e.g., the 411) can serve as a comparator, chips

that are especially designed to act as comparators (e.g., the 311) offer improved

performance. For example, for the above application, as well as many others, it is

desirable for the comparator to have as fast a slew rate as possible. To achieve a

fast slew rate, comparators such as the 311 make use of an open collector output,

as shown below. With an external, user-supplied pull-up resistor connected to +5

V, the comparator output will switch between near ground and 5 V, depending on

whether the output transistor is "on" or "off":

Page 28: Physics 219 – Fall, 2007 LabNotes 6 – Op Amps Friday ...academics.wellesley.edu/Physics/Rberg/logochip/...Physics 219 - Fall, 2007 LabNotes 6 - Op Amps page 4 Last modified on

Physics 219 - Fall, 2007 LabNotes 6 - Op Amps

page 28 Last modified on 11/13/07 12:27 PM

Vin

Vout

+5V

4.7k

When Vin > 0, the output transistor is "off" and Vout = +5 V.

When Vin < 0 , the output transistor is "on", the transistor saturates, and

Vout +0.3V .

Thus the two output states of the comparator correspond to digital "1" and "0"

states.

Schmitt Trigger

A weakness in the above comparator circuit is that noise in the input signal can

lead to multiple transitions at the output. If you think about an application like the

clap sensor you can see why this might be a problem:

V(t)

V-(t)

V+(t)

t

t

Vout(t)5V

0V

An elegant solution is the Schmitt trigger, which makes use of positive feedback

Page 29: Physics 219 – Fall, 2007 LabNotes 6 – Op Amps Friday ...academics.wellesley.edu/Physics/Rberg/logochip/...Physics 219 - Fall, 2007 LabNotes 6 - Op Amps page 4 Last modified on

Physics 219 - Fall, 2007 LabNotes 6 - Op Amps

page 29 Last modified on 11/13/07 12:27 PM

to largely eliminate the multiple transitions:

Vin

Vout

+5V

4.7k

100k10k

The voltage at the non-inverting input, V+, determines the "threshold" voltage. The

key point is that because of the positive feedback provided by the 100 k resistor in the above circuit, the value of the threshold voltage V+ will depend on the output

state Vout .

When Vout = +5 V then V+ 0.5V

When Vout = 0 V then V+ 0 V .

Page 30: Physics 219 – Fall, 2007 LabNotes 6 – Op Amps Friday ...academics.wellesley.edu/Physics/Rberg/logochip/...Physics 219 - Fall, 2007 LabNotes 6 - Op Amps page 4 Last modified on

Physics 219 - Fall, 2007 LabNotes 6 - Op Amps

page 30 Last modified on 11/13/07 12:27 PM

V(t)

V+(t)

t

t

Vout(t)5V

0V

lower threshold (0V)

upper threshold (+5V)

This means that there are two different thresholds in the circuit, the one which

determines when the output will switch from "high" to "low" is equal to +0.5 V

while the one which determines when the output will switch from "low" to "high"

is equal to 0 V.

As you can see from the drawing above, this scheme avoids the multiple transitions

problem.

Student Manual Section 10-1

• Complete Lab 10-1 in the Student Manual on the Comparator.

RC Relaxation Oscillator

Ever wonder how your function generators can “generate” a periodically varying

voltage signal? Here is a simple way to generate a square wave with a user-

determined frequency:

Page 31: Physics 219 – Fall, 2007 LabNotes 6 – Op Amps Friday ...academics.wellesley.edu/Physics/Rberg/logochip/...Physics 219 - Fall, 2007 LabNotes 6 - Op Amps page 4 Last modified on

Physics 219 - Fall, 2007 LabNotes 6 - Op Amps

page 31 Last modified on 11/13/07 12:27 PM

Vout

+15V

4.7k

100k10k

-15V

100k

0.01uF

V+

V-

Note that in this RC relaxation oscillator circuit both positive and negative

feedback are used and there is no input signal. Assume that when the power to the

circuit is first turned on the op amp output goes into positive saturation (it's

actually a toss-up which way it will go, but as you'll see, it doesn't matter.) The

voltage at the non-inverting input V+ will thus be at about +1.3 volts due to the

voltage divider formed by the 100k and 10 k series resistors.

Page 32: Physics 219 – Fall, 2007 LabNotes 6 – Op Amps Friday ...academics.wellesley.edu/Physics/Rberg/logochip/...Physics 219 - Fall, 2007 LabNotes 6 - Op Amps page 4 Last modified on

Physics 219 - Fall, 2007 LabNotes 6 - Op Amps

page 32 Last modified on 11/13/07 12:27 PM

V-(t)

t

t

Vout(t)+15V

-15V

+1.3V

-1.3V

The capacitor (and hence V ) begins charging up toward +15 V, through the 100k

feedback resistor with time constant

RC =105 10 8s =10 3s

When the voltage on the capacitor reaches the threshold voltage of about +1.3 V,

the op amp's output will quickly swing towards the negative power supply voltage

(-15 V in this case), changing the voltage at the non-inverting input V+ to about

+1.3 volts. The capacitor (and hence V ) begins discharging down toward -15 V,

again with a time constant RC. Switching will now occur at the new threshold

voltage of -1.3 V. By varying the RC time constant the frequency of the square

wave can be adjusted.

Oscillators based on this principle are known as relaxation oscillators. They are

inexpensive and simple, and with careful design they can be made quite stable in

frequency. They can be used for example to provide a simple very tiny “clock” for

a microcontroller. Microcontrollers these days are becoming quite small and

inexpensive (much smaller than a single 3904 transistor and costing about 80 cents,

which is great if you want to start building computation into everyday objects.) A

“crystal-based clock” circuit can end up being larger (and more expensive) than the

microcontroller itself, so simple RC based relaxation oscillators, which can be

microscopic in both size and cost when built directly into the microcontroller IC,

can be quite useful at times.

Page 33: Physics 219 – Fall, 2007 LabNotes 6 – Op Amps Friday ...academics.wellesley.edu/Physics/Rberg/logochip/...Physics 219 - Fall, 2007 LabNotes 6 - Op Amps page 4 Last modified on

Physics 219 - Fall, 2007 LabNotes 6 - Op Amps

page 33 Last modified on 11/13/07 12:27 PM

Student Manual Section 10-2

• Complete Lab 10-2 in the Student Manual on the Relaxation Oscillator.

Stabilizing the length of a laser cavity to a part in 108 with a 40 cent op amp

The next page shows the circuit used to stabilize the length of a diode laser cavity

to a part in 108 as part of the laser cooling experiment that we are working on

down in the laser lab. It features 3 garden variety op amps housed inside a 40 cent

op amp package. You should be able to recognize a lot of familiar features in this

circuit.

Page 34: Physics 219 – Fall, 2007 LabNotes 6 – Op Amps Friday ...academics.wellesley.edu/Physics/Rberg/logochip/...Physics 219 - Fall, 2007 LabNotes 6 - Op Amps page 4 Last modified on

Physics 219 - Fall, 2007 LabNotes 6 - Op Amps

page 34 Last modified on 11/13/07 12:27 PM

+6.95 V

-6.95 V

100k100k

5k

+15V

-15V

10k

5k

3M 0.05uF

0.005uF

0.1uF

5k

RA

MP IN

ER

RO

R SIG

NA

L

PZT

OU

T

5k

FEE

DB

AC

K

DA

MPIN

G

SAT

UR

AT

ED

�A

BSO

RPT

ION

�IN

�SE

T-POIN

T

OU

TPU

T�

GA

IN

RA

MP�

GA

IN

OU

TPU

T�

OFFSE

T

LO

CK

SLO

PE

12

3

Virtual G

ound

V0

Locking C

ircuit for�L

aser Stabilization�using a�Saturated A

bsorption�Signal��

Page 35: Physics 219 – Fall, 2007 LabNotes 6 – Op Amps Friday ...academics.wellesley.edu/Physics/Rberg/logochip/...Physics 219 - Fall, 2007 LabNotes 6 - Op Amps page 4 Last modified on

Physics 219 - Fall, 2007 LabNotes 6 - Op Amps

page 35 Last modified on 11/13/07 12:27 PM

Lase

rLoc

k 2.

0

Dec

embe

r, 2

004

Bas

ed o

n W

eim

an-J

ILA

des

ign

Mod

ifed

by R

obbi

e B

erg

+ +

GN

D

-15V

+15V

2 31

IC1A

6 57

IC1B

9 108

IC1C

13 1214

IC1D

4 11

2 31

IC2A

6 57

IC2B

9 108

IC2C

13 1214

IC2D

4 11

2 31

IC3A

6 57

IC3B

9 108

IC3C

13 1214

IC3D

4 11

1 2

3 4

U$8

1 2

3 4

U$9

C9

C10

R1 R2

R3R4

R5

R6

R7

R8

R10

R11

R12

R13

R14

R15

R16

R17

R18

R19

R20

C4

C5

C3

C8

C2

C1

R21 R22

R23

R24

R25

R26

R27

R28

R29

SETPOINT-COARSE SETPOINT-FINE

PZT-BIAS

ATTEN

PZ

T-L

OO

P-G

AIN

CU

RR

EN

T-L

OO

P-G

AIN

RAMP-GAIN

CU

RR

EN

T-O

UT

CU

RR

EN

T-M

OD

AT

TE

N-O

UT

AT

TE

N-I

N

PZ

T-O

UT

PZ

T-M

ODS

AT

-IN

SE

TP

OIN

T-M

ON

CU

RR

EN

T-P

OLA

RIT

Y

AT

TE

N-P

OLA

RIT

Y

CU

RR

EN

T-G

AIN

-ON

/OF

F

RA

MP

-ON

/OF

F

PZ

T-P

OLA

RIT

YP

ZT

-LO

OP

-ON

/OF

F

PO

WE

R-J

AC

KC

6

R9

RA

MP

-IN C7

C11

TL0

74T

L074

TL0

74T

L074

TL0

74

TL0

74T

L074

TL0

74

TL0

74

TL0

74

TL0

74T

L074

LM39

9H

LM39

9H

100u

F

100u

F

+15V -15V

1k 1k

10k10k

10k

GN

D

GN

D

10k

10k

10k

10k

10k

10k

10k

300k

220k

10k

10k

100

1k

10k

GN

D

GN

DG

ND

GN

D

GN

D

GN

DG

ND

GN

D

GN

D

GN

D

GN

D

0.1u

F0.

1uF

0.1u

F

0.01uF0.1u

F0.

1uF

GN

D

GN

D

GN

D

1k 51

10k

10k

10k

100

10k

10k

GN

D

GN

D

GN

DG

ND

GN

D

100

GN

D

10k500

20k

20k

50k

50k

20k

GN

D

0.1u

F

1k

1uF

1uF

+15V

+15V

-15V

-15V

GN

DG

ND

GN

D

GN

DG

ND

GN

D

+15V