Introduction:
In this lab, you will build several basic
op-amp circuits to learn about the signal conditioning of sensor
signals.
Teaching Objectives
- Understand how an op-amp works.
- Learn about different types of op-amp circuits and their
uses.
- Gain practical experience in implementing op-amp
circuits.
- Build a voltage divider, an inverter, a differential
amplifier, a gain circuit, and low-pass filter circuits.
- Demonstrate the filtering capability of the low-pass filter
and its use to prevent aliasing of sampled data.
Preliminary Reading
Figliola and Beasley
Analog Signal Conditioning: 211-226 (Sections
6.6-6.8)
Component Identification
In this lab, we will be using several types of
electronic components: resistors, capacitors, trim potentiometers,
and op-amps.
Resistors
Resistors come in a wide range of resistances.
For op-amp circuits, values in the range of 10 k ohm to 250 k ohm
work best. For this lab, we will use primarily 10 k ohm and 100 k
ohmresistors and maybe a few others. Resistors are color coded so
that with some practice you can decipher resistance values from the
color bands on the resistors you are using.
Capacitors
Capacitors also come in a wide range of values
and are made using a variety of techniques. The capacitors that we
will use for signal conditioning are fairly small and have
capacitances measured in Pico farads or microfarads. Some
capacitors are polarized and care must be taken to ensure that they
are connected to a circuit with the proper orientation.
Trim Potentiometers
A trim potentiometer is a variable resistor.
It has three leads.
- Positive power supply
- Wiper
- Reference power
The resistance of the trim pot is measured
between the wiper and one of the other two leads. A trim-pot is
depicted schematically in Figure 1. An adjustment screw moves the
wiper along the length of a coil resistor. The resistance between
lead 1 and the wiper increases or decreases as the wiper moves
further or closer.
The output voltage (Vout ) is related to the
input voltages by the following relationship:
Operational Amplifier (Op-Amp)
For this lab, we will use the LM741 op-amp.
The LM741 is a very common op-amp package, with one op-amp per
integrated circuit (IC). (Many op-amp packages have two or four
op-amps per IC.) A schematic representation of the LM 741 is shown
in Figure 3. The semi-circular depression on the chip marks the top
of the chip and the pins are numbered counterclockwise around the
chip. The highest number pin is always opposite pin 1.
LM741 Pinout:
- Null offset adjustment (not used)
- Inverting (-) input
- Non-inverting (+) input
- Connect to -12 V
- Null offset adjustment (not used)
- Output
- Connect to +12 V
- Not used
Data sheets for this and other integrated
circuits (IC's) can be obtained from the National Semiconductor web
site (www.national.com).
The Prototyping Board
You will build circuits for this lab using a
solderless prototyping board known as a proto-board or breadboard.
Breadboards allow us to connect circuits by plugging in components
and wires. No soldering is required. A drawing of a breadboard is
shown in Figure 4 below. As indicated by the gray lines, horizontal
rows of connectors in areas B and C are internally connected. When
a chip is plugged into the board as shown, these strips give you
four connections to each of the IC pins. The connections in regions
A and D are intended as power and ground buses. As indicated by the
gray lines, the columns in these regions are tied together
vertically.
The breadboards are fairly robust; however
they are susceptible to damage from wires that are too large. Do
not use wires larger than 28 gauge. Components with leads that are
too large can damage the breadboard as well.
Procedure
Part 1: Set Up the Power Supply
You will use a Tektronix triple-output power
supply. The power supplies should be set up when you come to lab.
For your reference, set-up instructions are given below. Perform
the following steps before you turn the power supply on.
The power supply has three dc-power outputs;
one capable of 0-5 V, and two capable of 0-15 V. To power the
electronic components for the lab, we will need a +12 V supply, a
–12 V supply, and a ground connection. We will use the two 0-15 V
outputs in series and adjust them to output approximately 12 V
each.
- Switch the power supply to “series”.
- Adjust the “A” power to ~ 12 V (the “B” output will match the
“A” output).
- Connect a red cable to the “+” terminal for the “A” power
output.
- Connect a black cable to the “–“ terminal for the “B” power
output.
In this configuration, the negative side of
the “B” output is a –12 V source. The positive side of the “A”
output becomes the +12 V source. The positive side of the “B”
output and the negative side of the “A” output are the
ground.
Incorrectly connecting an op-amp to the power
supply will destroy the op-amp. Make sure that the op-amp is
connected with correct polarity.
Part 2: Preparing the Breadboard
- Connect the +12 V supply to one of the strips in the A
region.
- The other strip in the A region should be tied to
ground.
- In the D region, one of the strips should be the –12 V
bus.
- The other D region strip should be used as a ground
bus.
Your breadboard is now configured to power the
circuits for this lab.
Part 3: Generate a Simulated Signal
Use the function generator to create a sine
wave with the following characteristics:
- 50 Hz
- amplitude of 80 mV
- offset (bias) of approximately 800 mV
For such a small signal, the Attenuator button
on the function generator must be depressed. This signal will be
treated as the output of a sensor. We will condition this "sensor
output" with a signal conditioning circuit.
Part 4: Modify Existing VI for Multiple Inputs
- Open the VI named Lab3 that you saved during Temperature Measurement and First-Order Dynamic Response.
- Open the DAQ Assistant Configuration Box.
- Delete the Voltage channel.
- Add a voltage channel for module 1, analog input 0.
- Add a voltage channel for module 1, analog input 1.
- For the Terminal Configuration, select Differential.
- For Acquisition Mode, select Continuous.
- Click File>>Save As…>>Substitute Copy for
Original to save your VI with a new name.
Part 5: Op-Amp Circuits
Before building a circuit to condition the
signal, you will build a couple of simple op-amp circuits to get a
feel for what to do.
5.1 Inverting Circuit
The inverter is one of the simplest op-amp
circuits. This circuit simply changes the sign of a signal. The
schematic diagram of an inverter is shown in Figure 6.
- Build the inverter using two 10 k ohm resistors and an LM741
op-amp.
- Input the signal from the function generator to the
circuit.
- Branch the input cable with a BNC T-connector. Connect this
input to Channel 0 on Module 1 of the SCXI.
- Connect the output signal from the circuit to the Channel 1
on module 1 of the SCXI.
- When you run the VI, you may need to adjust the scales on the
X and Y axes.
You should see that the output is an inverted
version of the input.
5.2 Inverting Gain Circuit
The inverting gain circuit changes the sign of
the signal and multiplies the amplitude. Increasing the amplitude
of a signal can be very important in distinguishing subtle signal
characteristics. Quantization errors result when a signal
characteristic is too small to be detected by a measurement system.
(You will learn more about quantization errors in lecture, and on
pages 249-250 in your text.)
- Replace the feedback resistor (R2 as shown in Figure 5) in
your inverter circuit with a 100 k ohm resistor. This will cause
the input signal to be inverted and amplified by a factor of
ten.
- Run the VI again.
With the amplification, the input offset of
800 mV has increased to an 8 V output.
Note: Using the data acquisition card to view
the signal, you may saturate the ADC with the amplified signal. All
you will be able to see is a flat line near +5 V or –5 V.
Part 6: Bias Correction
For the amplified signal to be read correctly,
the 800 mV bias must be removed. A two step process will be used to
remove the bias:
- A Trim Potentiometer will be used to step down a 12V DC
signal to 800 mV.
- A Differential Amplifier circuit will be built to subtract
this stepped down voltage from the sine wave.
The result will be an 80 mV sine wave with
zero mean.
6.1 Trim Potentiometer Adjustment
Use the 10 k ohm trim potentiometer provided to
build a voltage divider as shown below.
- Connect one end lead of the potentiometer to the +12 V
bus.
- Connect the other end lead to the –12 V bus.
- Connect a voltmeter across the wiper lead and ground to
measure the output.
- Adjust the potentiometer resistance until the voltage on the
wiper lead is 800 mV.
6.2 Differential amplifier
You will build a differential amplification
circuit to subtract 800 mV from the sensor signal. A differential
amplifier is shown in Figure 8 below.
- Use four 10 k ohm resistors to subtract the voltage divider
output from the sensor signal. It is unlikely that the resulting
output signal will be a zero-mean sine wave as desired.
- Adjust the screw on the potentiometer to "trim" the offset of
the sine wave to zero.
- Amplify the difference between the signals by replacing the
R2 resistors so that R2 > R1. Replace the R2 resistors with 100
k ohm resistors.
The resultant signal should be an 800 mV sine
wave with minimal offset.
Using the inverting gain circuit shown in
Figure 8, amplify the output of the differential amplifier circuit
by an additional factor of ten. This can be done with another
op-amp and a 10 k ohm resistor and a 30 k ohm resistor. The
resultant output signal should have a mean of zero and amplitude of
~2.4 V. Adjust the potentiometer to remove any offset.
Part 7: Low-Pass Filtering
A low pass filter can be used to attenuate
high-frequency noise in an analog signal and to minimize the
portion of the signal that will be aliased. Later in this lab, you
will see a demonstration of the damaging effects of
aliasing.
7.1 Build an Active Low-Pass Filter
- Build the first-order filter shown in Figure 9 with R1 = R2 =
10 k ohm and C2 = 0.1 micro F. First order filters are so-called because
their dynamics are modeled by first-order differential
equations.
- Connect the output of the circuit to Channel 1 on your DAQ
system.
- The filter’s time constant is equal to R2C2. Calculate values
for the cut-off frequency and the time constant.
7.3 Modifying Existing VI to Measure Magnitude Ratio
By measuring the magnitude of the input and
output of a filter, you can determine the how much the filter
attenuates the signal.
- Delete the Amplitude and Frequency constants from the Block
Diagram.
- Hold Ctrl as you drag the Tone Measurements icon to make a
copy.
- Place a Split Signals icon to the left of the Tone
icons.
- Place a Divide function to the right of the Tone
icons.
- Create a numeric indicator at the x/y output terminal of the
Divide function.
- Rename the numeric indicator Magnitude Ratio. (The Magnitude
Ratio represents the output amplitude divided by the input
amplitude.)
- Wire the Block Diagram as shown in Figure 10.
- Save the VI.
7.2 Testing a Filter
We expect that the filter will allow
frequencies below the cut-off frequency to "pass", and will
attenuate signals at higher frequencies. The Magnitude Ratio will
be recorded as the output magnitude divided by the input
magnitude.
- Connect the signal going into your filter to Channel 0 of
module 1 of the SCXI.
- Connect the signal coming out of your filter to Channel 1 of
module 1 of the SCXI.
- Input a 1 V sine wave with zero offset into the low-pass
filter circuit.
- Starting with a frequency of about 10 Hz, slowly increase the
frequency of the input signal. What happens to the output
signal?
- Increase frequencies to 2 kHz.
- Using the table below, determine the magnitude ratio at
several frequencies.
Table 1: Magnitude Ratio Data for First-Order
Low-Pass Filter (Active)
| frequency (Hz) |
Input magnitude (V) |
Output magnitude (V) |
Magnitude ratio |
| 10 |
1V |
|
|
| 18 |
1V |
|
|
| 32 |
1V |
|
|
| 58 |
1V |
|
|
| 110 |
1V |
|
|
| 190 |
1V |
|
|
| 340 |
1V |
|
|
| 620 |
1V |
|
|
| 1100 |
1V |
|
|
| 2000 |
1V |
|
|
- Using Excel, plot the following two sets of data on a single
log-log chart.
-
- Calculated magnitude ratio vs. frequency.
- Measured magnitude ratio vs. frequency
Do the magnitude ratio and phase difference
between the input and output behave as you would expect?
- Input a 30 Hz square wave into the low-pass filter. Record
your observations.
- Measure the time constant from the oscilloscope
screen.
Does it correlate with your calculated values
based on resistor and capacitor values?
7.3 Build a Passive Low-Pass Filter
The filter described in step 6.1 is an active
filter, meaning it requires an external power source. Since it uses
an op-amp, it must have a ±12 V power supply. Active filters can
have a static gain greater than one. Active filters also have low
output impedance, which means that they can pass up to 10 mA of
current without any effects on the operation of the filter.
A passive low-pass filter does not require an
external power source. A passive filter can be constructed with
simply a resistor and capacitor as shown in Figure 11.
- Build a filter using a 10 k ohm resistor and a 0.1 micro F
capacitor.
- Repeat section 6.2 (steps 4-11). Record your results in your
lab book. You may use Table 2 to organize your data.
Table 2: Magnitude Ratio Data for First-order
Low-pass Filter (Passive)
| frequency (Hz) |
Input magnitude (V) |
Output magnitude (V) |
Magnitude ratio |
| 10 |
1V |
|
|
| 18 |
1V |
|
|
| 32 |
1V |
|
|
| 58 |
1V |
|
|
| 110 |
1V |
|
|
| 190 |
1V |
|
|
| 340 |
1V |
|
|
| 620 |
1V |
|
|
| 1100 |
1V |
|
|
| 2000 |
1V |
|
|
7.4 Build a Second-Order Butterworth filter
Figure 12 below shows a second-order
Butterworth low-pass filter. A second-order filter is superior to a
first-order filter in many respects, as we will investigate.
- Build the Butterworth filter circuit using R = 10 k
ohm and C = 0.1 micro F.
- Perform the sine wave and square-wave input tests from step
6.2. Record your results in your lab book. You may use Table 3 to
organize your data.
How is the response of this filter different
from that of the first-order filter?
Table 3: Magnitude Ratio Data for Second-Order
Low-Pass Filter
| frequency (Hz) |
Input magnitude (V) |
Output magnitude (V) |
Magnitude ratio |
| 10 |
1V |
|
|
| 18 |
1V |
|
|
| 32 |
1V |
|
|
| 58 |
1V |
|
|
| 110 |
1V |
|
|
| 190 |
1V |
|
|
| 340 |
1V |
|
|
| 620 |
1V |
|
|
| 1100 |
1V |
|
|
| 2000 |
1V |
|
|
Part 8: Aliasing
Aliasing is a generally undesired phenomenon
that results when periodic signals are sampled too slowly. Aliasing
causes high frequency periodic signals to be recorded as signals
consisting of lower frequencies, as will be apparent in the
following steps.
8.1 Non-Filtered Signal
You will cause a signal to be aliased as it is
converted from an analog to a digital signal.
- On the block diagram, create Numeric Indicators to display
Frequency and Amplitude.
- Wire the Numeric Indicators to the Tone Measurements icon for
the second channel.
- Change the sample rate of the DAQ Assistant to 1000 S/sec
(samples per second).
- Calculate the Nyquist Frequency for this sample rate.
- Connect the output of the Function Generator directly to the
second input channel on the SCXI.
- Adjust the function generator to create a sine wave with a
frequency of 50 Hz and amplitude of 1 V.
- Slowly increase the frequency of the sine wave until you
reach 400 Hz. Observe what happens to the sampled version of the
sine wave.
- Increase the frequency to 500 Hz. What is the measured
frequency and amplitude?
- Why doesn’t LabVIEW display a “true” image of the wave
form?
- Continue to increase the frequency of the sine wave to 1000
Hz.
- Describe what happens to the amplitude and the frequency of
the sampled signal as the frequency increases.
- Why is the frequency displayed in LabVIEW different from the
frequency supplied by the function generator? How are the two
frequencies related?
8.2 Anti-Aliasing Filter
Low pass filters are frequently employed to
minimize the portion of a signal that is aliased.
- Input the signal from the function generator to the
second-order Butterworth filter from Section 6.2.
- Connect the output of the filter to channel 2 of the
SCXI.
- Set the sample rate to 1 kS/sec (as before).
- When used in this way, the filter is called an anti-aliasing
filter. Comment on what you observe. How are your observations
different from those in step 10 without the filter?
Bonus
Estimate the damping ratio of the second-order
Butterworth filter through experimentation. To do this, you will
probably need to take more measurements near the expected cut-off
frequency of the filter (which is near the natural frequency).
Support your result with plots and discussion as necessary.
Lab Report
For this lab, you will write up the
Introduction and Objective sections of a full formal report. You
will be provided handouts with further instruction regarding what
is expected.
"This course is the lab portion of ME 363, an instrumentation class in the Mechanical Engineering Department at Brigham Young University. This course covers the use of oscilloscopes, function […]"