EE3300/EE5300 Electronics Applications
Week 2 Practical

Last updated 7 February 2025

Have you ever wondered why there are thousands of models of op-amp available to purchase? The aim of this lab is to see the impact of the non-ideal aspects of op-amps, so that you can understand why you might choose one op-amp over another for a given application.

Pre-lab preparation

Before the scheduled lab session, create a SPICE model of the oscillator circuit that you will be building. The idea is to use the simulation to turn on and off some of the op-amp non-idealities, so you can develop an understanding of how they affect the circuit.

Simulate the oscillator output stage

Use circuit simulation software (e.g. LTSpice) to analyse the circuit shown in Figure 1.

Figure 1
Figure 1:

Can you explain the behaviour of this circuit?

Zoom:

Build the simulation with a generic op-amp model. In LTSpice, one such model is the Universal Op Amp 5, which is useful as the offset voltage and bias current can be easily specified in the component’s properties.

Apply a 1 Vpp, 1 kHz triangular waveform to the input and observe the output waveform.

Answer the following questions:

  • What do you notice about the output by comparison to the input? Have you seen this behaviour before?
  • What is the role of the voltage supply applied through the 10 kΩ resistor to the non-inverting input terminal? What happens when you vary this voltage?
  • As we increase the frequency, real-life op-amps become limited by a parameter known as slew rate. Describe to your tutor how you might expect the slew rate to manifest in the output waveform at high frequencies.

Simulate the voltage-controlled oscillator

Next, extend the circuit to include the input and feedback stages shown in Figure 2. Again, use a generic ideal op-amp model.

Figure 2
Figure 2:

A voltage controlled oscillator, which produces periodic signals at and . The frequency depends on the input voltage . The second stage (on the right) is the same as that in Figure 1.

Zoom:

Apply a 10 V DC input voltage and observe the output waveforms from each of the op-amps ( and ).

Answer the following questions:

  • What is the role of the included op-amp stage with a feedback capacitor (highlighted with the red box)?
  • What is the role of the BJT section (highlighted with the blue box)?
  • What is the frequency of for the 10 V input voltage?
  • What happens to the frequency when you reduce ? You only need to choose a few values here (for example: 10V, 5V, 2V, 1V, 0.5V, 0.1V).
  • What did you notice about the duty cycle of the output waveform as the input voltage is varied? Ideally, a square wave should be evenly split between 50% high and 50% low. If you begin to notice a variation in this duty cycle, it is likely that our ideal op-amp model isn’t so ideal after all!
Show simulation hints
  • Run a transient analysis for long enough to ensure that you see multiple cycles of the output waveform.

  • You may want to use a small maximum timestep (e.g. 100 microseconds) to achieve a more consistent waveform.

  • In LTSpice, you have several options for measuring the frequency of a waveform:

    • You can use the cursor in the output plot window to click and drag horizontally measure the time period of a single cycle, then reading the “dx” frequency value from the taskbar in the bottom left.
    • A more sophisticated method is to use the .MEAS directive to calculate the frequency. For example, to measure the frequency of , place a net label Vout2 on the appropriate node, then add the following text as a SPICE directive:
    .meas tran T1 when V(Vout2)=0 rise=3 ;find time of 3rd rising edge
    .meas tran T2 when V(Vout2)=0 rise=4 ;find time of 4th rising edge
    .meas tran Frequency param 1/(T2-T1)
    .meas tran DutyCycle avg (V(Vout2)+12)/24 from T1 to T2

    After you have run the simulation, press Ctrl+L to open the SPICE output and see the calculated values.

    The equation for the duty cycle assumes +/- 12 V output levels. Adjust the equation if you change the supply voltages.

Simulate the impact of offset voltage

Next, we will model the impact of a non-ideal input offset voltage contributed by the leftmost op-amp. The worst-case voltage offset listed on the LM741 datasheet is Vos = 5 mV. To include this in your simulation, either add a voltage source of 5 mV at the non-inverting terminal, or more easily, open the parameters of the op-amp and change the Vos value, as shown in Figure 3.

Figure 3
Figure 3:

Setting the offset voltage in LTSpice.

Zoom:

Set the input voltage to 0.1 V and vary the offset voltage of the left-most op-amp between -5 mV and 5 mV, observing the transient response of the circuit as you go. Try between 5 and 10 values at different increments.

What do you notice about the waveform duty cycle in response to this offset voltage? What happens when the voltage offset is positive vs. when it is negative?

Next, set your input voltage to 10 V and repeat this process. Why do you think the voltage offset impacts the duty cycle more noticeably for low input voltages?

Demonstrate your simulation and discuss your answers to the questions above at the start of your lab session.

Equipment (per student)

  • 1 x LF411 JFET Input Op-Amp.
  • 2 x LM741 BJT Input Op-Amp.
  • 1 x 6V DC Motor.
  • 1 x 2N3904 NPN BJT.
  • 3 x 10k potentiometers, linear taper, preferably able to be mounted on a breadboard.
  • Various capacitors.
  • Various resistors.

Instructions to students

  • Work individually on these activities.
  • Focus on neat circuit breadboarding including power supply decoupling capacitors, as per last week.
  • Use ceramic (non-polar) capacitors for the feedback paths of today’s circuits. If you have time, you can substitute in electrolytic capacitors and observe the differences in output behaviour.

Motivation

In most of your prior analysis of op-amps, you have probably treated them as ideal. For example, an ideal op-amp has infinite slew rate, infinite input resistance , and outputs zero volts when the difference between the two input pins is exactly zero .

In last week’s lab, you built your own op-amp circuit and discovered some of the limitations of each of the internal stages. Today, we look at how these non-ideal effects impact circuits in practice.

We’ll start with an integrator circuit, because integrators are especially sensitive to non-ideal effects at the inputs. Later, we’ll extend the integrator to build a useful circuit (a voltage controlled oscillator), and demonstrate how the non-ideal effects degrade the performance of that circuit.

Exercise 1: Measure the input non-idealities of two different op-amps

Your task

Your task is to measure the input bias current and offset voltage of two different op-amp models, the LM741 and LF411, and then compare their behaviour to their respective datasheets. Careful measurement should result in values within the expected ranges.

  1. Construct the circuit shown in Figure 4. Don’t forget to include power supply decoupling.

    Apply various input waveforms (e.g. sine wave, square wave, triangular wave) and observe the output. It can be helpful to measure both the input and output waveforms on two oscilloscope channels. You should see that the output signal is the integral of the input signal.

    You may notice that the output signal drifts towards the rail voltages. Notice that the circuit has no feedback at DC, so the DC level of the output will eventually diverge to either the maximum or minimum level that the op-amp can supply. You can reset the circuit at any time by short-circuiting the feedback capacitor.

Figure 4
Figure 4:

The basic integrator circuit. The switch allows the charge on the capacitor to be reset. On a breadboard, you can use a piece of wire for this purpose.

Zoom:
  1. Introduce a feedback resistor as shown in Figure 5. Does this improve the signal drift in the output?

    The trade-off here is between integration fidelity and signal drift. That is, a higher feedback resistance will have less impact on signal drift but will not impact the quality of the integration too drastically. You might find it interesting to try replacing the 1 MΩ feedback resistor with a 22 kΩ resistor. What happens to the output signal?

Figure 5
Figure 5:

A “leaky” integrator that forgets earlier inputs by slowly discharging the capacitor.

Zoom:
  1. Remove the feedback resistor from the circuit and connect to ground. Hopefully, it’s clear to you that an ideal op-amp would maintain a perfectly constant output voltage. Therefore, if you observe any drift, then you have detected a departure from ideal.

    Reset the feedback capacitor and then carefully measure the drift rate (volts/sec) and direction of the output voltage towards the rail. You will need to adjust the oscilloscope time scale to read the rate of change of the output voltage as it slowly drifts.

    This drift is caused by the cumulative impact of the input bias current and offset voltage. The two effects may reinforce each other or one may subtract from the other. Therefore, you need more information to separate the two effects.

  2. Remove the contribution of the offset voltage by disconnecting (allowing it to float). Under this condition, does not force a current through the input resistor. Therefore the only current that acts to charge or discharge the capacitor is the input bias current at the op-amp’s inverting input.

    With only the bias current contributing to the drift, close the switch to reset the feedback capacitor, and record the drift rate and drift direction. (Hint: For JFET-input stage op-amps, we expect a very low input bias current. Therefore, you will likely need to bring the vertical scale to the range of 100mV and the horizontal scale to 1s or 2.5s increment to observe this drift).

  3. Use your measured drift rates to calculate the current contributions from the input bias current and the overall drift. Use these current calculations to infer the contribution just due to the input offset voltage operating over the 22k input resistor. The current can be calculated using the equation

    Compare your results to the ranges of values on the op-amp datasheet.

  4. Repeat the measurement of and for the LM741 op-amp. The LM741 is a BJT-input op-amp, so you should expect to see different behaviour. It’s also over 50 years old, so you should expect that there has been some improvement in the technology since then!

    You will notice that the LM411 and LM741 have the same footprint and can be directly interchanged on your breadboard.

    What do you notice about the relative contributions of offset voltage vs. bias current for the LM741 by comparison to the LF411? Which op-amp model do you think is better overall?

Make sure that you document your measurement results so that you can show them to your tutor later.

Exercise 2: Use a motor as a position sensor

Motivation

Some sensors/signals are provided as rates over time. A simple D.C. motor can be used as a generator by turning the shaft. The generated voltage is proportional to the speed of the rotor arm. Suppose that instead of speed, we would like to measure position. Position is the integral of speed, so this is where our op-amp integrator can be useful.

Your task

Your task is to connect a D.C. motor to your integrator circuit from Exercise 1.

  1. Based on your prior measurements, decide whether you prefer the LF411 or LM741 for this application.

  2. First, check the raw output from the D.C. motor when used as a generator. Connect the voltage terminals of your D.C. motor directly to the oscilloscope. Observe how the output responds as you rotate the arm of the motor. What happens when you spin fast vs. slow? How about if you rotate clockwise vs. anticlockwise?

  3. Connect the D.C. motor to your integrator circuit (Figure 6). Observe the output on your oscilloscope. What does the output look like as you rotate the motor arm? Are you satisfied that the integration is working as intended? What happens if you don’t move the motor arm for a short time?

Figure 6
Figure 6:

The integrator circuit with a D.C. motor connected to the input.

Zoom:
  1. Now include a feedback resistor to help compensate for integrator drift. Repeat your movement of the motor arm. What differences, if any, do you notice in your output signal? Is there a difference in how the circuit reacts to rest periods in between when you move the motor arm?.

Exercise 3: Construct a voltage controlled oscillator

Motivation

Voltage controlled oscillators (VCOs) are used in many applications, including frequency modulation (FM) radio transmitters, phase-locked loops, for trimming digital clocks, and in audio effects and musical instruments. Here, we use our op-amp integrator as a component stage to build a VCO.

To make the effects of non-ideal op-amp effects more apparent, we will use the LM741 for this exercise. We’ll also illustrate the use of the “offset null” pins that are provided on some op-amps to allow for compensation of the input offset voltage.

Your task

This circuit contains multiple stages and it is a good idea to test each stage as you go. This circuit requires several voltage sources to operate, but we will use potentiometers to generate reference voltages, so that the overall circuit can be built with just a dual-channel +/- 12 V bench supply.

  1. Set up your power rails including decoupling capacitors.

  2. Use one of your 10k potentiometers to build a voltage divider circuit to step-down your 12 V supply to a 5 V reference voltage.

    Hint: Only one of the divider resistors needs to vary to modify the ratio and subsequent output. You can use the alligator clip cables on your multimeter to measure the divider output voltage as you move the potentiometer into position. It is a good idea to design for 5V at the midpoint of your potentiometer, so that you can adjust this reference up and down and observe its effect on the output later.

    Note that this 5 V needs to be a stable reference, so you should decouple it with a capacitor.

  3. Construct the output stage as per Figure 7. You can test the performance of this stage by applying a triangular wave input, in the same way that you did during pre-lab simulations. What happens to your output signal as you vary the reference voltage using your potentiometer?

Figure 7
Figure 7:

The output stage of the VCO.

Zoom:
  1. Design another voltage divider with your second 10k potentiometer to provide the voltage reference as shown in the red box in Figure 8. You need to be able to control the voltage delivered to the integrating circuit to a resolution of 0.1 V, to be able to test against your pre-lab simulations.

    As before, apply a triangular waveform at . Measure the voltage at the point labelled “to integrating circuit.” This will form the input of the final circuit stage.

    What happens to this voltage as you vary the input using your input potentiometer? What function is the BJT performing?

Figure 8
Figure 8:

The input stage of the VCO.

Zoom:
  1. Finish the circuit by connecting the integrator, as shown in Figure 9.

    Observe the circuit output when is approximately 12 V. Notice we no longer need a periodic input signal to generate a periodic output!

Figure 9
Figure 9:

The complete VCO.

Zoom:
  1. Observe the frequency and duty cycle of the circuit as you sweep your input voltage from approximately 12 V down to approximately 0.1 V. Use steps similar to those you used in your pre-lab.

    Hint: Many oscilloscope models can show the frequency and positive and negative duty cycles on screen using the measurement features.

    What do you notice about the relationship between input voltage and output frequency? How is your duty cycle at the various input voltages? Does your circuit differ from your pre-lab simulations?

  2. Some op-amps have a feature that allows you to trim the offset voltage by using pins called “offset null”. Here, we will connect a third potentiometer to the offset terminals of our integrator op-amp. These terminals allow us to compensate for the non-ideal effects caused by the offset voltage.

    Construct the circuit demonstrated in Figure 10 on the integrating op-amp. The wiper (the middle pin) of the potentiometer connects to the negative rail (-12 V), while the two legs connect to the Offset Null pins on the LM741 op-amp. You will need to refer to the datasheet to confirm the location of these pins.

Figure 10
Figure 10:

How to use a potentiometer to tune the offset voltage of a single op-amp.

Zoom:
  1. Set your input voltage down to approximately 0.1 V. Vary the offset potentiometer while observing the circuit output. What do you notice about the voltage output behaviour? Does this align with your pre-lab simulation? What happens as you cross the mid-point of your potentiometer range?

  2. Increase your input voltage back up to approx. 12 V and repeat this process. What do you notice at this higher input voltage (and output frequency)? Can you use your new offset trimming setup to force the 50/50 duty cycle we would typically expect?

Show how offset trimming works in the LM741

Offset trimming works by adjusting how much of the current is steered down each side of the input differential pair.

Have a look at the LM741 schematic in its datasheet (section 7.2, page 7). You may be able to see some similarities to the op-amp we built last week.

Q1-Q2 are emitter followers that drive the common-base differential pair Q3-Q4. Using common-base amplifiers in the differential pair (rather than common-emitters, as we did last week) eliminates the Miller effect and therefore improves the bandwidth of the op-amp.

Last week, we used a collector resistor on one side of the differential pair to sense the current, and we ignored the current on the other side. Instead, the LM741 uses a current mirror as shown by Q5-Q6. This improves the gain of the differential pair, because both sides are now contributing to the output. To understand how this works, consider for example the case of more current flowing in Q4. More current in Q4 pushes more current into the second stage Q15. On the other side of the differential pair, since the total current is fixed, there must be less current flowing in Q3. Less current in Q3 is then mirrored across to Q6, and therefore the mirror steals less current from the second stage Q15. Current entering the mirror is current that doesn’t go to the second stage, so reducing the current in the mirror at Q6 is the same as increasing the current flowing to Q15. Therefore, this design allows both sides of the differential pair to contribute, increasing the gain of the first stage.

Q7 might look unusual; a basic current mirror would short Q5’s collector and base. Notice that Q7 means the base of Q5-Q6 will be one diode drop below the output of Q3. It should be clear to you that the current mirror of Q5-Q6 will still work because of their equal values. If Q7 isn’t part of the mirror, then what role does it serve? The reason for Q7 is to improve the symmetry of the differential pair. Q7 and Q15 will both have similar input base currents, therefore, errors caused by the base current of Q15 will be roughly cancelled by Q7.

Notice that the current mirror can be tuned by connecting to the offset null pins. There is a notional 1 kΩ resistor between the emitter and , but an external potentiometer can be used to adjust this resistor, and hence tune the current sharing between each side of the differential pair.

On the high side, Q8-Q9 plus the base connections to Q3-Q4 is called a Wilson current mirror, and acts to provide a fixed current to the differential pair, exactly as we did last week with the current source.

Similarly to last week, the output from the differential pair feeds a common-emitter amplifier, which here is the Darlington pair Q15-Q17. Instead of a collector resistor, there’s a current source load Q13. Finally, there’s a push-pull output stage, with biasing to reduce crossover distortion (the network around R7-R8) and current limiting protection (when the voltage on R9 reaches 0.6 V, the nearby transistor steals base drive from Q14 to turn it off).

Conclusion

Your tutor will mark you off for completing this activity and being able to discuss the results. If you do not finish on time, you have one week to complete it. Bring your completed circuit or evidence of your work to a subsequent lab session for marking.

When you leave, make sure that the lab is just as neat or even neater than when you arrived.

Acknowledgements

This activity was adapted from Lab 7 in Learning the Art of Electronics by Hayes and Horowitz, in combination with material from Section 4.6.4 from The Art of Electronics by Horowitz and Hill.