Department of Physics, Stanford University Physics 105, Analog Electronics (Pam) Lab 8.12 DRAFT Page 1 Lab 8: Positive Feedback: Oscillators and Comparators (this lab will count as half of a lab) Read: Meyer, Chapter 6, Section 6.8 PRELAB -Practice: The comparator circuit in Figure 3 has a pull up resistor on the output so that Vout = +15 V (Q is off) when Vin < 0 ( “input low”), and Vout = 0 (Q is on) when Vin > 0 . (“input high”) Design the output circuit so that instead, the output state for a “high” input is -15 volts, and the output for a “low” input state is 0V. Part 3.1 Predict the thresholds and output voltages of the Schmitt trigger comparator in Figure 5. Part 3.2 Now connect the “Ground” pin #1, the emitter of the output transistor, to -15V instead of ground. Predict the threshold and output voltages again. Comparator Background: A comparator is a specialized version of the op amp, where the output is either “high” (binary 1) or “low” (binary 0) depending on the relative size of the inputs. You have already constructed a kind of comparator in Part 1 of Lab 7: this first opamp circuit performed as a simple “polarity detector”. However, in Lab 7 you used negative feedback and threw away most of the opamp’s gain to achieve good linearity. For switching, one always uses positive feedback in the Schmitt trigger configuration to achieve stability during the switching operation. Always use positive feedback—a Schmitt trigger—with a comparator. Comparators are much better suited to fast switching demands than linear opamps such as the 411. The 311 is one such device, but in addition to its faster response time, be aware of the following significant features. The 311 has (a) a different pinout than the 411, and (b) an “open collector” output. Warning: do NOT think of the 311 comparator as an opamp. The output behaves very differently from that of an opamp, and the opamp “golden rules” do not apply: the output only switches on/off, it does not amplify. The open collector output means there is a transistor connected to the output and to a “ground pin”—an NPN in the drawing below—but it provides no signal output. It is up to you, the user, to provide an external voltage source with two voltage states. The comparator’s output simply switches your external source between two voltages. The output algorithm is: V- is the input to be compared to a reference at V+. When the input is higher than the reference, V- > V+ , the output transistor is turned on, i.e., a signal is applied to its base and it operates as a switch with VCE = 0. When V- < V+, the output transistor is turned off. This open collector is a useful output mode for many integrated circuits with 2-state outputs because it allows the user to control the voltage levels representing “high” and “low” for the IC. These are typically chosen to be ground (0 volts) and +5 or +3.3 volts for standard digital logic. Department of Physics, Stanford University Physics 105, Analog Electronics (Pam) Lab 8.12 DRAFT Page 2 Open collector outputs require a “pull up” resistor at the collector to link the output to the upper voltage level. In Figure 2, the 1 k is the pull up. Some IC’s have pull ups built into the chip; others require a user-provided pull up resistor. The figures below contrast the output stages of the ‘311 and ‘411 Figure 1 Figure 2 LAB Part 1 Opamp Comparator LF411 7 in 10k 2 - 3 6 out + 4 Drive the opamp of Figure 3 with a 100kHz sine wave, and look at the output on the scope. 1. Compare the output amplitude with the “Output Voltage Swing” on the LF411 spec sheet: 2. Submit the output waveform, and explain why it’s not so square. +15V -15V Part 2 Comparator with no feedback Figure 3 Build the same circuit (Figure 4) with the LF311 comparator; note that the pinout is different from the LF411 opamp, and that it requires a 1k “pullup” resistor at the output. +15 8 +15 3 2 1k - 311 + 7 out 1 1. Drive the circuit with a 100kHz sine wave, and submit the output waveform. Compare the waveform, in shape and amplitude, with that of Part1. 2. Drive the circuit with a low frequency sine wave until you see output oscillations. Submit the output waveform. 10k 4 in -15 Figure 4 Department of Physics, Stanford University Physics 105, Analog Electronics (Pam) Lab 8.12 DRAFT Page 3 +15 Part 3 Positive Feedback: Comparator with Schmitt Trigger 10k 3 2 4.7k - 311 + 7 out 1 Add positive feedback in the form of a Schmitt trigger to the 311 circuit as in Figure 5. Drive with a low-frequency sine wave, and look at the output and both inputs on the scope. in 100k 1. Look at both inputs on the scope, and measure the two thresholds. Compare with Prelab calculations. 2. Submit waveforms for input (-), reference (+), and output pins. Now connect the “ground” pin, Pin 1, to -15V 3. Repeat steps 1 and 2 above. 10k Figure 5