Oscillators
Please Log In for full access to the web site.
Note that this link will take you to an external site (https://shimmer.mit.edu) to authenticate, and then you will be redirected back to this page.
Over the past couple of days, we've seen a few applications involving operational amplifiers (op-amps), in particular viewing them as comparators. In today's lab, we'll do some review and build a neat little circuit that makes use of those ideas.
1) A First Circuit
For our first circuit of the day, we'll take a look at the following topology (remember that the symbol that looks like a resistor with an arrow pointing into it represents a potentiometer):
Go ahead and lay this out on the breadboard (use one of the little 30-row breadboards today). The particular value of R is up to you, but something in the range of maybe tens of kiloOhms is reasonable.
DO NOT BEND THE LEGS OF THE POTENTIOMETER!!!! IT SHOULD FIT INTO ONE SIDE OF THE BREADBOARD WITHOUT BENDING THE LEGS AT ALL.
For today, we're going to use an L272 op-amp, which is packaged so that two op-amps fit in one package, as shown below:
The spacing of the pins is such that the package can be conveniently inserted into the breadboard across the gap in the middle without bending the pins too much, as shown above. Notice that the pins all have distinct meanings, and a little groove (or a little dot) tells you which side is the pin 1 side.
Note that the packages are labeled with "L272" so you can tell that you've got the right component.
We're going to use a 9-Volt battery to power our circuit for today. You can grab yourself a connector and a battery while you're grabbing your op-amp. The easiest way to hook things up is to plug the battery into the red and blue rails on one side of the board, and then connect those up to pins 2 and 4 of the op-amp, respectively.
You should be able to orient the op-amp so that short wires can be used to make these connections, like so (and we have the little pre-cut wires in the cabinet with the resistors so that you don't need to cut them yourself):
It is important that pin 2 is going to the + side of the battery and pin 4 is going to the - side of the battery.
Once you've done that, go ahead and make the rest of the connections indicated in the schematic above. Note that you will only need to use one of the two op-amps in the little chip for now.
Then hook up your scope probes to measure v_+, v_-, and v_{\rm out}. Zoom in and out and slide the signals around until you can clearly see all three signals, on the same scale and with the same reference voltage (i.e., we want to see all three of these signals on the same axes).
Try turning the pot. How do v_+, v_-, and v_{\rm out} change as you do so? What kind of function is this circuit performing? How can we think about this behavior in terms of our op-amp models?
Discuss the results of your experiments so far with a
staff member. Demonstrate your working circuit and explain its function.
2) Oscillator
Even though we're going to tear apart that circuit in just a few minutes and replace it with something else, let's make a solemn promise never to forget the lessons we've learned from it (they'll be important for the later parts of the lab).
But before we tear that circuit apart and build a new one, let's analyze the next circuit we're going to work with.
The next circuit we'll look at today is a neat little circuit that generates an oscillatory signal from a constant ("DC") input (this circuit should look familiar from Tuesday's lecture). When we actually get to building this, we'll again power everything from a single 9V battery. But for now, let's just think about the circuit in theory land.
2.1) A Slight Shift of Perspective
As we've seen throughout the subject, because voltages are differential measurements, we have our choice of what we consider to be our 0-Volt reference node when solving circuits. In the example above, we (somewhat arbitrarily) chose the negative terminal of the battery to be our 0-Volt reference. But that's not the only choice we could have made.
With this change, what values would v_1, v_2, and v_3 need to
have in order to be consistent with our original drawing?
With this change, what would values would v_4, v_5, and v_6 need to
have in order to be consistent with our original drawing?
2.2) Analyzing the Circuit
For the rest of the lab, we're going to take this last viewpoint, choosing the midpoint between the + and - terminals of the battery to be our 0V reference voltage:
Now let's turn our attention to analyzing the circuit. We'll spoil a bit of the surprise by describing the end-to-end behavior of the circuit: if we've chosen our reference voltage as described above, then after letting the circuit run for a little while, the output voltage v_{\rm OUT} will settle in to a steady-state behavior of alternating between \pm4.5V (relative to that reference point) at a fixed frequency, like so:
Let's try to dig a little bit deeper and think about why the circuit behaves this way. The questions below are intended to help guide you through that process.
v_+ (in Volts) =~
v_+ (in Volts) =~
How must they be related to each other when v_{\rm OUT}=-4.5{\rm V}? At some point, v_{\rm OUT} will switch between these two values. In the
instant where that switch occurs, how must v_+ and v_- be related to each
other?
If you're having trouble or want someone to double-check your thought process, let us know.
C
, R_1
, R_2
, and any other constants you may need? You may use exp(x)
or e**x
to represent e^x, and ln(x)
to represent \ln(x).
T =~
3) Building Our Oscillator
Alright; now that we understand how this circuit is going to operate, we can start thinking about building it. We still won't build it quite yet (there's more thinking to be done first), but we'll get closer.
3.1) Tuning the Oscillator
Once we have this circuit built, we're going to use the output of this circuit to drive an LED to make it blink at a fixed rate. But before we get to adding the LED, let's choose appropriate values of R_1, R_2, and C to set that oscillation frequency.
C =~
3.2) Creating a Stable Reference Voltage
One complication with our current circuit is that we not only need to access the potentials at the + and - terminals of the battery, but also the midpoint voltage (which we're going to call our 0V reference point). And we need this reference point to be a stable value, regardless of what is hooked up to it.
Hopefully by now we already know a way that we could make a circuit to take those terminal voltages and find their midpoint: a voltage divider!
But unfortunately, that strategy only works if the resistors we use are connected in series, i.e., with no current flowing out from in between them, which means we can't just hook that circuit directly up to spots labeled 0V in our circuit diagram.
Fortunately, though, op-amps give us a way to resolve this issue as well (as we mentioned in recitation, op-amps are super versatile!). For now, we'll just use the op-amp in this way; and in next Tuesday's lecture we'll talk through how this works in more detail (as well as some other neat circuits involving op-amps). If we hook up the op-amp as follows, we create a buffer that serves the purpose of isolating the circuit that makes our reference voltage from the circuit that uses that voltage.
A small buffer circuit is shown below. We will learn a lot more about this circuit next week; for now, though, it suffices to understand a few basic properties:
-
the currents into the + and - inputs (called the "non-inverting" and "inverting" inputs, respectively) are small enough that they are essentially zero, and
-
when connected as shown below (with its output pin connected to its inverting (-) input), the relationship between the output and the input (using the VCVS model we discussed this week) will cause the voltage at the op-amp's output terminal to be approximately equal to the voltage at its + input:
Putting this all together, the following circuit gives us a way to create a stable reference voltage (the voltage halfway between the + and - terminals of the battery) for ourselves:
How does the buffer help us avoid this problem?
If you have any questions, or if you want us to double-check your schematic, just let us know!
3.3) Build It (For Real This Time)
Go ahead and build this using the values you chose above. Note that you should only need one L272AM chip even though your schematic should have two op-amps in it (one for the buffer and one for the oscillator); the L272AM package has two op-amps in it, so you should only need one of them.
Use the scope to measure v_+, v_-, and v_{\rm OUT} all relative to the spot we're calling 0V in the diagram from above (not relative to the - terminal of the battery). Put everything on the same scale and with their grounds at the same point so that you can compare them easily.
One you're sure it's working as expected, let's use it to drive an LED. Grab yourself an LED and a small-ish resistor (maybe around 200\Omega), and connect those up in series, between the op-amp's output and our 0V reference point (not the - terminal of the 9V battery).
Use the scope to verify that it's flashing at around 5Hz.
Demonstrate your working circuit to a staff member, and
talk through your analysis of the circuit. How do your theoretical results
compare against what you see on the scope, and how do those results explain the
operation of the circuit?
4) Optical Theremin
For our last experiment of the day, we'll tweak our circuit a little bit to make ourselves a little musical instrument. Our instrument will be a (dramatically-simplified) variant of a theremin, which is a musical instrument that you play without touching it. Real theremins work by using antennas to measure changes in capacitance as a performer moves their hands around, effectively measuring the position of their hands in the air and using that to control pitch and volume of an output wave.
We'll do something substantially simpler than a real theremin, but it will still be a neat little instrument that we can play by moving our hands around in the air. Our little "theremin" will work by using a photoresistor to detect changes in light as we move our hand closer or farther from it.
Replace R_1 in your circuit with a photoresistor, and choose a value of C such that the frequency in ambient light will be about 800Hz. Do this with theory, not by just trying stuff until something works (we'll expect you to be able to talk about your process during the checkoff).
Use the scope to measure the output wave as you move your hand up and down above the photoresistor. You should see its frequency change.
Then, instead of our 200\Omega resistor and LED from before, we're now going to use the op-amp to drive a speaker. When you've done this, you should hear a sound, and the pitch should change as you move your hand nearer or closer to the photoresistor.
If that sound is too loud for you, make a voltage divider (using the speaker as one of the resistors) to decrease the voltage drop across the speaker until it's at a comfortable volume (or just feel free to leave it; whatever works).
You should also connect a button in series with your battery (between the battery and your circuit) so that the circuit is only powered—and thus, sound only plays—when the button is pressed.
Try playing a little tune with your theremin, and then you're ready for the checkoff!
You can keep your little theremin if you want (including the battery and the
speaker and everything). If you don't want to keep it, you can throw away any fixed resistors and
capacitors and return everything else to the cart.
Show your working circuit to a staff member and maybe like
talk about how you chose the capacitance. Describe the principles of operation
here, and why the pitch changes as you move your hand around the photoresistor.