Note 5
Note 5
• Microphone Gain: The electret microphone behaves as a variable current source depending on the size of the
sound waves hitting it. Current signals are generally more difficult to work with than voltage signals, so you
will turn that into a voltage signal using the Mic Gain part of the circuit.
• Buffer: This buffer helps keep the amplifier and the capacitor from affecting the microphone (see Note 4 for a
review of loading). It looks a little different from the buffers we usually use (there’s a resistor in the feedback
loop), but it functions just the same.
• Remove Mic Drift: A capacitor placed between one circuit stage and the next is usually called a coupling cap,
but it really just a high pass filter with a very low cutoff frequency. The microphone naturally has a lot of low
frequency drift, so we use this coupling cap to remove any DC offset and noise. This allows us to ignore
whatever DC value the mic gain stage had, and add in a suitable DC value in the next stage.
1 “Biasing” a circuit means establishing predetermined voltages or currents at various points of the circuit in order to construct the proper
• DC Offset: For this project, you will not have a negative power source, only your 5V rail and ground (since
the Launchpad cannot take negative voltage inputs). If you center your signal around ground, like we did in
previous labs, then you will lose the negative half the signal as soon as you send it through the op-amp because
your op-amp won’t be able to supply those negative voltages (since all your op-amps’ VSS pins will be set to
ground). To get around this problem, we want to center our signal in the center of our available voltage range.
However, you will have to be careful and remember that a DC offset exists or it could become troublesome.
Think of a 0.1V DC signal. Now put that signal through a non-inverting op-amp with a gain of 100 and a
reference voltage of 0V. Suddenly that 0.1V DC signal becomes 10V!
• Level Shift: When we introduce the DC offset at OS1, we have to adjust our amplifier to expect signals
centered around that offset. We will explain this further in the next part.
• Amplifier: Finally, the mic board uses a non-inverting amplifier (with a potentiometer) to amplify the
microphone signal. Note that OS2 is on the inverting terminal of the op-amp - we can use this to help us deal
with our DC offset problem.
Now, let’s move off the mic board and focus on our biasing circuits.
• OS1: DC Offset
Because we need our signal to be centered in our usable range (0 - 3.3 V), we will need to set the DC offset to
the midpoint of this range: 1.65 V. This can easily be accomplished with a voltage divider of two equal
resistors from the 3.3 V rail to ground.
• OS2: Level Shift
When we introduce the DC Offset, we will encounter a problem when the signal passes through the
non-inverting amplifier: that DC offset will be amplified along with the rest of the signal! This is because the
amplifier will amplify the signal as referenced from ground. This is the key problem here.
If we want to avoid amplifying the DC offset, what value should we use for the amplifier’s reference
voltage?
R2
A −
in
R1 B out
+
+ VREF
−
From the first golden rule, we know the fact that node B is at VREF means that node A is as well. From the
second, we have the equation
Vout −VREF VREF −Vin
=
R2 R1
Let’s perform a change of coordinates. Let Vin* = Vin −VREF and let Vout* = Vout −VREF . Then, we have
Vout* −Vin*
=
R2 R1
Vout* Vin −VREF R2
= =−
Vin* Vout −VREF R1
Therefore, we’re amplifying the difference between Vin and VREF with respect to the difference between Vout and
VREF , which is what we wanted to achieve: we have essentially set the virtual ground for the amplifier to VREF .
The process for the noninverting amplifier is similar.
+
in
A out
−
R2
R1
+ VREF
−
You are now ready to start Part 2! Go to the Jupyter Notebook and complete parts 2 and 3 of the
lab.
The PWM pin from the Launchpad is connected via a resistor to the base of an NPN BJT (bipolar junction
transistor). This transistor behaves differently from the NMOS with which you are familiar, but you can still consider
it a switch in this application. The low-power, low-voltage signal from the Launchpad switches the BJT on and off:
when the Launchpad signal is HIGH, the BJT is on and the motor circuit is grounded so that we have 9V from the
power supply (or later, the motor battery) across the motor and current can flow through the motor and BJT, whereas
when the Launchpad signal is LOW, the BJT is off and the motor is not connected to ground, so the circuit is open
and no current flows through the motor. Therefore, the motor driver circuit supplies the motor with a high-power
PWM signal.
You are now ready to start Part 4! Go to the Jupyter Notebook and complete the rest of the lab.
• Electret microphone: First, we will address the term “electret,” and then we will discuss how the electret’s
properties are exploited to make a microphone.
An electret is a permanently3 charged material (usually a piece of plastic). The term “electret” comes from the
fact that an electret is the electrostatic equivalent of a permanent magnet: while in a permanent magnet, the
magnetic field is generated by the natural alignment of the electrons’ spins within the atoms of the material, the
electrostatic field generated by the electret is created either by embedding additional negative charges within
the material or by melting a suitable dielectric material and cooling it inside a strong electric field: while the
material is liquid, the polar molecules (dipoles) align themselves with the electric field so that when the
material cools, they are “frozen” in position, producing a dipole electret with a permanent electrostatic
alignment or “bias”. Just as there exist natural magnets, there also exist natural electrets: for example, quartz is
a naturally-occurring electret.
The electret microphone is a variation of the condenser microphone. A condenser microphone is essentially a
sound-sensitive capacitor: it consists of a pair of charged plates (one flexible, one rigid) that can be forced
closer by variation in air pressure. A sound wave is a pressure wave, so when the sound wave hits the flexible
plate, it is pushed back toward the rigid plate, thereby changing the capacitance (recall, from physics, that the
capacitance C of a parallel plate capacitor is given by the equation C = κεd0 A , where d is the distance between
the plates, A is the area of one plate (assuming both plates have the same area), ε0 is the permittivity of free
space, and κ is the dielectric constant of the material between the plates.) and therefore the voltage between the
plates.
While the condenser microphone requires an external voltage source to charge the diaphragm (the flexible
plate), the electret microphone does not (because the electret has a permanent charge). In traditional electret
microphones, the diaphragm is replaced by the electret, but this makes the diaphragm heavier and therefore less
sensitive to sound waves, so most modern electret microphones attach the electret to the conductive backplate
instead. Most electret microphones have a small transistor amplifier built into their packages, and this amplifier
(like an op-amp) needs to be powered to work, so even though electret microphones do not require active
biasing, most of them are still active components.
• Bipolar Junction Transistor (BJT): We will give a very minimal introduction to the BJT. This material is
VERY out-of-scope, and the device physics is greatly simplified; the version of this material taught in EE 105
is much more in-depth/nuanced, so take that course if this piques your interest :).
Like a FET (field-effect transistor, e.g. CMOSFET, JFET), a BJT can act as a switch or an amplifier. In this
introduction, we will only address the switch application (but you can learn about the amplifier application in
EE 105, EE 140, etc.).
The BJT is a three-terminal (base, collector, emitter) device in which applying a small current to the base
allows a larger current to flow between the collector and emitter. Like the MOSFET, it comes in two types,
except for instead of NMOS and PMOS, those types are NPN (negative-positive-negative) and PNP
(positive-negative-positive). These names come from the fact that a BJT is essentially made of three layers of
semiconductor material: in the NPN case, one layer of positively-doped (p-type) material is sandwiched
between two layers of negatively-doped (n-type) material.
3 Technically, quasi-permanently: see the Wikipedia article on electrets for more explanation.
When a hole diffuses from the p-side to the n-side, it quickly recombines with one of the majority electrons on
the n-side and disappears; as this continues to happen, the n-side depletion region loses its free electrons. When
an electron is freed from its parent atom and then neutralized by a hole, the parent atom becomes positively
charged: therefore, the depletion region on the n-side is positively charged. Similarly, the depletion region on
the p-side becomes negatively charged. This creates a potential difference across the depletion region, known
as the barrier voltage, which the carriers must overcome to continue to diffuse across the depletion region. As
the depletion region grows, so does the barrier voltage, making it more and more difficult for more carriers to
diffuse across the depletion region. With no voltage source connected across the terminals, the currents of
electrons and holes are equal in magnitude and opposite in direction.
So, did we just break the first law of thermodynamics? Didn’t we just generate a voltage out of thin air? Not
quite. The voltage we have been discussing is the voltage across the depletion region, not across the junction
terminals. Actually, the contact voltages at the metal-semiconductor junctions at the device’s terminals
perfectly balance out the barrier voltage so that when you measure the voltage across the open-circuited diode’s
terminals, you will read a voltage of 0V.
Now that we have explored the p-n junction diode’s open circuit behavior, we are ready to see how it performs
under an applied voltage. If we apply the voltage across the diode so that the p-side terminal is more positive
than the n-terminal, the diode is said to be forward-biased, whereas if we apply the voltage so that the n-side
terminal is more positive than the p-terminal, we say the diode is reverse-biased.
4 It is important to note that not all diodes are made this way; however, this is the classical example.
5 If you would like some additional background on this abstraction, see here.
In the reverse-biased case, the external voltage is applied in the same direction as the barrier voltage, so it adds
to the barrier voltage, making the effective barrier voltage the sum of the open-circuit barrier voltage and the
applied voltage. This makes it much more difficult for electrons and holes to diffuse across the depletion
region, so the device allows only a very small amount of current to flow: for the ideal diode abstraction, we
consider this current to be 0.
In the forward-biased case, the external voltage is applied in the opposite direction as the barrier voltage, so it
subtracts from the barrier voltage, greatly reducing the effective barrier voltage. This allows electrons and
holes to diffuse more freely across the depletion region and therefore enables a substantial current to flow
through the device. Since our voltage/current convention says that current flows from high voltage to low, we
conclude that the current flows from the p-side to the n-side.
Back to BJTs
Now that we’ve been introduced to the underlying physics of the p-n junction diode, we can see that an NPN
BJT is essentially two diodes connected back-to-back, where the base is connected to the p-region (shared by
both diodes) and the emitter and collector are each connected to one of the n-regions:
Let’s now explore how we can bias this component so we can use it as a switch. We want the current between
the collector and the emitter to be controlled by the current between the emitter and the base.
Let’s see how we can bias the BJT so that it does not conduct; i.e., so that the switch is off6 . We will set the
voltage at the base to be equal to the voltage at the emitter, and we will set the collector voltage to a
significantly greater value. This reverse-biases the collector-base diode so that essentially no current can flow
through it. Even though the base-emitter diode is not technically reverse-biased, (1) the fact that the
collector-base diode is reverse-biased means essentially no current reaches the base anyway, and (2) the fact
that the base and the emitter are at the same voltage means that there is no potential difference between them to
incite current flow.7
Now, let’s see how we can bias the BJT to turn it on8 . We want both diodes to be forward-biased, so we will set
the base voltage to be higher than both the emitter and the collector. Notice that the collector in our circuit is
not connected to 9V but rather to the motor: almost all of the 9V is dropped across the motor, so even though
the 3.3V at the base is much lower than 9V, the base voltage is still higher than the voltage at both the emitter
and the collector, so both diodes are still forward-biased.
References
Original Project Part 1 notebook written by Nathaniel Mailoa and Emily Naviasky (2016).
Horowitz, P. and Hill, W. (2015). The Art of Electronics. 3rd ed. Cambridge: Cambridge University Press, ch 4.
Horowitz, P. and Hill, W. (2015). The Art of Electronics. 3rd ed. Cambridge: Cambridge University Press, ch 2.
Sedra, A. S. and Smith, K. C. (2015). Microelectronic Devices and Circuits. 7th ed. Oxford: Oxford University
Press, ch 3.
Sedra, A. S. and Smith, K. C. (2015). Microelectronic Devices and Circuits. 7th ed. Oxford: Oxford University
Press, ch 6.
Neumann.com. (2019) True Condenser vs. Electret Condenser - What’s the Difference?. [online] Available at:
https://www.neumann.com/homestudio/en/what-is-the-difference-between-electret-condenser-and-true-condenser-
microphones [Accessed October 6,
2019].
Nave, R. (2000). Electret Microphones. [online] Hyperphysics.phy-astr.gsu.edu. Available at:
http://hyperphysics.phy-astr.gsu.edu/hbase/Audio/mic2.htmlc4 [Accessed 6 Oct. 2019].
6 If you look this up to explore further, we are trying to operate the BJT in cutoff mode.
7 Note that technically, the condition for the BJT to be in cutoff is that both the collector-base and base-emitter diodes are reverse-biased. We
used the example of reverse-biased collector-base diode and unbiased base-emitter diode because that is how our actual motor controller circuit
works.
8 If you look this up to explore further, we are trying to operate the BJT in saturation mode.