You are on page 1of 12

EE40, Spring 2015, Pre-Lab 5

Amplifiers: Comparator, Speaker Driver,


and Microphone Front End

Logistics
You should submit your prelab assignments on Gradescope before your lab section. This will be different
than the Gradescope page of the course where you submit your homework and you should already be
able to see the page of your lab in addition to the main course in your Gradescope account. If not, you
can email your lab GSI to do that for you.
You will complete the lab assignments during the lab sessions. You should ask your GSI to verify it and
check you off the list at the end of each lab session before you leave.
If you complete your lab at home before beginning of the session, please show up to your lab session and
make sure your GSI verifies that you have completed all the required tasks correctly and checks you off.
Objectives of Lab 5
For prelab you will simulate various amplifier circuits using Multisim. You will also build these circuits in
lab 5. Below are the tasks you should complete for lab 4.

Prelab assignment (to be completed before your lab session)


o Simulations: S.1, S.2, S.3, S.4, S.5
o Questions: Q.1, Q.2, Q.3, Q.4
Lab assignment (to be completed during your lab session)
o Build the comparator front-end
o Build the speaker driver circuits
o Build the microphone front-end

Outline
1. Prelab Assignment
2. Lab guidelines

1. Prelab Assignment
You should complete your prelab assignment and submit it to the Gradescope account of your lab
section before beginning of your lab session.
Your prelab assignment consists of two parts. In the first part you will do a simulation using Multisim
and in the second part you should answer a few intuitive questions about the simulation.
1.1. Amplifiers
In this lab, we introduce amplifiers, active circuit elements that provide gain. Amplifiers are
actually comprised of many circuit elements, primarily transistors, and are commonly found on
integrated circuit chips. Your kit contains op amps in the form of either LMC series chips.
Amplifier applications form the bedrock of analog electronics and we will just scratch the surface
in this course.
On the robot, we first use amplifiers to strengthen the signal from our photocell-Wheatstone
bridge circuit by using an open-loop amplifier known as the comparator. We then discuss the
model further and learn how to close the amplification loop with feedback, an essential idea in
modern engineering systems with many applications. We will use the idea of feedback to simplify
our analysis of two more circuits: a speaker driver and a microphone amplifier. This lab will
introduce the most complex circuits in the course so start working on it early and take your
time to understand these circuits!
1.2. Comparators
Comparators are the first sort of amplifier we will study in this course. A comparator has a very
high gain and is our first element capable of amplifying electrical signals. Comparators are active
devices, meaning that they must be powered to function. We will implement these comparators
by using the op amps included in your kit.
In the most general sense, a comparator compares two voltage inputs and outputs a high or low
voltage (digital 1 or 0) depending on which voltage input is larger. These circuits are useful when
we are only concerned with binary sensor information (i.e. is the robot in a dark room, did the
robot hit something) rather than analog information (i.e. how dark is the room, how hard did the
robot hit something).
Please refer to Edge-edx module 3.1 to learn more on how they work.

1.3. Comparator Front-End Simulation


Recall that the Wheatstone bridge was designed so that the output voltage was either positive
or negative. When the output voltage is positive, the voltage across the bridge is higher at the
positive output terminal. When the output voltage is negative, the voltage across the bridge is
higher at the negative output terminal.
We can connect this signal to the input of our comparator; each side of the bridge connects to
one input of the comparator. The resulting output voltage should either be high or low,
converting the small voltage changes across the bridge into a high-swing digital signal.
Incidentally, you can think of the comparator as a one-bit analog to digital converter (ADC). That
is, the comparator reads an input voltage and outputs either a high voltage or low voltage (1 or
0).
Please build the following Wheatstone bridge/comparator circuit. This circuit will represent the
photocell front end which can be used to notify your microcontroller of the presence of light.

The amplifier used in this simulation is a model of the quad amplifier chip in your kit and can be
found in Multisim directory: Place/Component/Group:Analog/OPAMP/LMC6484AIN
Now were going to do a parameter sweep on the variable resistor RVar. In our case, were
interested in measuring (Vp-Vn) and Vout while sweeping RVar from 1k to 10k. Sweeping
this value will simulate the state of the photocell (going from bight to dim).
To run a DC sweep, go to Simulate -> Analyses -> Parameter Sweep. Fill out the information as
is applicable to your circuit:

S.1 Please run the DC sweep and include the resulting plot in your prelab writeup. You should
plot Vout on the Y axis and the resistance value on the X axis. Make sure to sweep with
enough points such that the general curve is easily visible. We wont care about any exact
values just the general shape of the curve. On that note, please use a linear sweep for
simplicity (should be the default setting).

1.4. Non-Inverting Amplifier Simulation


The purpose of a non-inverting amplifier is to take a voltage input and amplify it by a predictable
amount to a typically larger voltage. Please see Edge-edx module 3.5 to better understand this
circuit topology.
Heres our non-inverting amplifier circuit:

LMC6482
Dual Opamp
AC voltage
source

Place/Component/Group:Analog/OPAMP/LMC6482IN
Place/Component/Group:Sources/SIGNAL_VOLTAGE_SOURCES/AC_VOLTAGE

For this simulation we will apply a 100mV 800Hz sine wave with a 500mV DC offset to the input
of the non-inverting amplifier and measure the resulting output using a transient analysis. Double
click the source and change items in the Value tab to configure the AC_Voltage source.
A transient analysis is used to look at signals in the time domain over a given window of time. For
this Prelab, a 10mS window will suffice. To setup the transient analysis click Simulate->Analyses>Transient analysis and configure the analysis as follows:

S.2 Run a transient analysis on the non-inverting amplifier above and include the resulting
plot in your prelab writeup. Your plot should include both the input and output voltages

1.5. Speaker Driver Circuit


Another opamp circuit topology we are concerned with in this lab is the voltage follower. This
circuit simply takes an input voltage and duplicates this voltage at the output. While at first glance
this may seem like this circuit is useless because it produces a gain of 1, in our application as a
speaker driver this circuit will serve to buffer the microcontroller from the large current draw of
the piezoelectric buzzer.
The voltage follower circuit is as follows:

Again we are interested in looking at a transient analysis of this circuit. This time, the
AC_VOLTAGE source should be configured to be 3Vpk, 800Hz, and a DC offset of 1.65 V
S.3 Run a transient analysis on the voltage follower above and include the resulting plot in
your prelab writeup. Your plot should include both the input and output voltages. Run the
simulation again with R1 set to 8. It may be possible for the output voltage in both cases
to be different from the input voltage. Keep this in mind when answering Q3
1.6. Inverting Amplifier Simulation
Like the non-inverting amplifier discussed previously, the inverting amplifier takes a voltage input
and amplifies it to a typically larger output. This time the gain (Vout/Vin) will actually have a
negative sign which corresponds to a 180 phase shift from output to input.
Please see Edge-edx module 3.5 to better understand this circuit topology.
Our circuit of interest is as follows:

Once again we are interested in looking at a transient analysis of this circuit. This time, the
AC_VOLTAGE source should be configured to be 0.01Vpk, 800Hz, and a DC offset of 1.65 V
S.4 Run a transient analysis on the circuit above and include the resulting plot in your prelab
writeup. Your plot should include both the input and output voltages. Run the simulation
again with a DC offset of 0V. Keep these simulations in mind when answering Q4
1.7. Microphone Front End Simulation
For our microphone front end we wish to use a non-inverting amplifier similar to the circuit
simulated in the previous section, however we will need to add a few extra components to get it
to play nicely with our microphone.
Please see Edge-edx module 3.6 to better understand this circuit topology.
Our circuit of interest is as follows:

Once again we are interested in looking at a transient analysis of this circuit. This time, the
AC_VOLTAGE source should be configured to be 0.01Vpk, 800Hz, and a DC offset of 1.65 V
S.5 Run a transient analysis on the circuit above and include the resulting plot in your prelab
writeup. Your plot should include both the input and output voltages. Run the simulation
again with a DC offset of 0V. Keep these simulations in mind when answering Q4

1.8. Questions
Q.1 We wire the Wheatstone bridge to a comparator as follows:

Here RVar represents our photocell which can swing from 1k in a bright room to 10k
in the dark.
a) Will the LED be turned on if the circuit is operated in dark room?
b) How can the circuit be rewired without changing resistor values to flip the LEDs
reaction to light?
Q.2 Refer to the circuit below:

a) What is the voltage gain (Vout/Vin) of the circuit?


b) Would the gain change if R2 and R3 were replaced with 100 resistors?

Q.3 Refer to simulation S3 results and the voltage follower circuit schematic below:

a) With R1 set to 300 did the output voltage perfectly follow the input? If not explain.
b) With R1 set to 8 did the output voltage perfectly follow the input? If not explain.

Q.4 Refer to simulation S4 and S5 results and the circuit schematic below:

a)
b)
c)
d)

What is the DC voltage on the negative input terminal of the opamp?


What is the purpose of the capacitor C1
What is the purpose of Resistors R3 and R4
What is the gain (Vout/Vin)?

2. Lab Guidelines
Build the following circuits on your breadboard to interface with your MSP430. At each step run
the Energia sketches provided by your GSI or on Edge-edx. Feel free to experiment with your own
Energia codes along the way.
a) Comparator Front End
Build the following circuit and use the data you read to the MSP430 (P1.2 or P1.7) to turn
on the green LED on the launchpad. The LED should turn on when you cover the photocell.

b) Buffer circuits
As you learned from the simulations, based on design, the buffer circuits may or may not
provide gain to your signal. Generate a tone at P1.3 of your MSP430 microcontroller and
use the two of the following circuits to drive your speaker. Compare the output sound
that you hear for the two cases.
1. Non-Inverting Amplifier (Buffer with gain)

2. Unity-gain buffer

c) Microphone Front End


Build the following circuit to bias your microphone and amplify its output signal. You can
connect the amplified signal to the P1.5 pin of MSP430 to process it. For now, just to test
your amplifier, try to observe its output using oscilloscope while you are speaking to the
microphone.

You might also like