lab4_note
pdf
keyboard_arrow_up
School
University of California, Berkeley *
*We aren’t endorsed by this school
Course
16B
Subject
Electrical Engineering
Date
Feb 20, 2024
Type
Pages
4
Uploaded by SargentWorldDog35
EECS 16B
Designing Information Devices and Systems II
Spring 2024
UC Berkeley
Lab Note 4
Lab 4: Sensing Part 1
In the previous lab, you built the S1XT33N’s legs: the motor controller circuits that enable it to move around and
the encoder circuits to sense how far and fast S1XT33N has moved. However, you might have noticed that the range
of motion is quite limited when we are using the lab station’s DC power supply to power our circuits. We need a
portable way to power your circuits so that S1XT33N can freely roam on the ground. This is why in the previous lab
you also built voltage regulator circuits that enable us to power our circuits with batteries (a portable voltage source).
That way, S1XT33N’s legs were able to move on their own. Our end goal is to have S1XT33N be voice-controlled,
and in order to do that, we need a way for S1XT33N to listen to what you’re saying. Today we will be building
S1XT33N’s “ears”: the mic board circuit that will pick up your voice and convert it into an electrical signal, as well
as the surrounding biasing circuits that the mic board requires to function as desired for our circuit. We will also be
fine-tuning S1XT33N’s ears by building a low-pass filter, which will remove unwanted noise.
The goals of this lab are as follows:
• Build the biasing circuit with the mic board
• Tune the mic board and measure the frequency response
• Build a low pass filter to help the micboard attenuate high frequencies that can be picked up as noise
Part 1: Mic Board Circuits
Our biasing
1
circuits will provide signals for the OS1 (DC Offset) and OS2 (Level Shift) pins of the mic board so
that the mic board can function properly. Before we build the biasing circuit with the mic board, let’s discuss the mic
board’s circuit below (this is the schematic of what is on the mic board PCB, or printed circuit board):
There are a few key stages and components to the mic board:
•
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 we turn
that into a voltage signal using the resistor in the Mic Gain part of the circuit. If you would like to learn more
about these electret microphone after doing the lab, please read the (optional)
extra lab reading note
.
1
“Biasing” a circuit means establishing predetermined voltages or currents at various points of the circuit in order to construct the proper
operating conditions for the components [
Wikipedia
].
1
Lab Note 4 — Sensing Part 1 (v4.1)
EECS 16B
Designing Information Devices and Systems II
Spring 2024
UC Berkeley
Lab Note 4
•
Buffer:
This buffer helps keep the amplifier and the capacitor from loading (affecting) the microphone by
preventing the rest of the circuit from drawing current from the Mic Gain stage. It looks a little different from
the buffers we usually use (there’s a resistor in the feedback loop, whose purpose is beyond the scope of this
class), 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
.
Think about the impedance of a capacitor: What happens as
ω
hits 0? What happenns to the impedance? You
might notice that the impedance goes to infinity, which means that signals with 0 frequency, or DC signals,
are blocked. The microphone naturally has a lot of low frequency drift that is hard to predict, so we use this
coupling cap to remove any DC offset and low frequency 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. To add in a DC offset, we cannot directly
connect the output of the buffer to the DC value since these two voltages are not equal but would be in the same
node - hence why we need the coupling cap.
•
DC Offset:
For this project,
you will not have a negative power source
, since the Arduino cannot take negative
voltage inputs. If you center your signal around ground, then you will lose the negative half of the signal as
soon as you send it through the op-amp because your op-amp won’t be able to output those negative voltages
(since all your op-amps’
V
SS
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 which is 2.5V. Here is where we will connect OS1 from our
biasing circuit via a 100
k
Ω
resistor in order to accomplish this goal. The reason the resistor is 100
k
Ω
is because
we create an unintentional high pass filter with this resistor and the coupling capacitor in the previous stage. In
order to minimize the effects of this unwanted high pass filter, we set the resistor value to 100
k
Ω
so that the
filter’s cutoff frequency is 10 rad/s, or 1.59 Hz, effectively passing virtually all of the signals we pass into the
mic board without attenuation.
Note that you will have to be careful and remember that a DC offset exists or it could become troublesome
later on in the amplifier stage of the mic board. 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 when we discuss the off-board biasing circuit below.
•
Amplifier:
Finally, the mic board uses a non-inverting amplifier (with a potentiometer) to amplify the micro-
phone signal. Note that OS2 is on the inverting terminal of the op-amp - we use this to help us deal with our DC
offset problem.
Now, let’s move
off
the mic board and onto our biasing circuits. The schematic is reproduced below for your
convenience.
•
OS1: DC Offset
Because we need our signal to be centered in our target range (0 - 5 V), we will need to set the DC offset to the
midpoint of this range: 2.5 V. This can easily be accomplished with a voltage divider of two equal resistors from
the 5 V rail to ground.
2
Lab Note 4 — Sensing Part 1 (v4.1)
EECS 16B
Designing Information Devices and Systems II
Spring 2024
UC Berkeley
Lab Note 4
•
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?
If you guessed 2.5 V, congratulations! This is the key idea to a level-shifter.
We connect OS2 to 2.5V when building the mic board circuits - this is how we tell the non-inverting amplifier
to use 2.5V as a reference. If you would like a review of how to add a reference/virtual ground to an amplifier
circuit, see
lab note 1
.
Part 2: Frequency Response of the Speaker-Microphone System
The system you are building in this lab consists of the microphone on the mic board as well as the speaker you’re
using to play music. You must consider the ability of your speaker to reliably reproduce the desired frequency at a
volume large enough to excite the microphone, and the ability of your microphone to pick up and record the desired
frequency. Ideally, your speaker will be able to play all frequencies at the same volume, and your microphone will
pick up all frequencies equally.
However, due to the physical limitations of your speaker and microphone, for some frequency ranges, the signal
your speaker-microphone system generates will be highly attenuated. You will be filtering the output of the mic board
circuit to partition the frequency spectrum for this and next week’s lab and to extract specific frequency ranges to better
sample voice commands later in the project, so you must consider the non-ideal frequency response when designing
your filters.
How can I add gain to some frequencies and not others? Which frequencies should I choose?
In order to
design effective filters, we must answer these questions, and to do so, we must first identify the speaker-microphone
system’s frequency response.
We will do this empirically: as detailed in the lab ipynb, you will play a range of
frequencies on your speaker and record the peak-to-peak of the microphone’s received wave at that frequency.
Part 3: Low-Pass Filter
Some definitions that you should familiarize yourself with for this lab are:
•
Gain
: The ratio of the output signal to the input signal. In the case of the low pass filter, the ratio between the
output at the capacitor to the input before the resistor.
•
Cutoff Frequency
: When plotting the AC response, the cutoff frequency is defined as the frequency where the
magnitude of
|
H
(
j
ω
)
|
is at
1
√
2
. For a first-order RC filter, the cutoff frequency is always at
1
2
π
RC
. In lab, we will
be working in Hertz, rather than radians.
•
Angular frequency
: Angular frequency is given in radians, while frequency is given in hertz.
To convert
between the two, use the formula
ω
=
2
π
f
, where
ω
is the angular frequency and
f
is the frequency in hertz.
Generalizing the first-order filter
The general first-order (or
bilinear
, since it is linear in both the numerator and denominator) transfer function is as
follows. Transfer functions convert us from the time domain to the frequency domain, and are used in circuit analysis
when we have sinusoidal / non-DC inputs:
H
(
j
ω
) =
a
1
j
ω
+
a
0
j
ω
+
ω
0
You might see transfer functions written in terms of
H
(
s
)
, which is the general form of transfer functions across
the entire complex frequency spectrum in the context of Laplace Transforms (out of scope for EECS 16B) where
3
Lab Note 4 — Sensing Part 1 (v4.1)
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
EECS 16B
Designing Information Devices and Systems II
Spring 2024
UC Berkeley
Lab Note 4
s
=
σ
+
j
ω
. In this class, we are focused on steady-state frequency domain analysis, so we substitute
s
=
j
ω
and
ignore the real part.
Think: What is the gain at j
ω
=
∞
? What about at j
ω
=
0
?
The gain at
j
ω
=
0 is the DC gain, and the gain at
j
ω
=
∞
is the high frequency gain. In this case, the high-frequency gain approaches
a
1
, and the DC gain is
a
0
/
ω
0
.
The coefficients
a
0
and
a
1
determine what kind of filter we have. As an exercise, think of the relationships among the
numerator coefficients that result in different kinds of filters.
The first filter you will build in this lab will be a first-order low-pass RC filter to isolate the frequencies below the
desired cutoff frequency, as detailed in the lab ipynb. In addition to serving as part of the color organ filter in next
week’s lab, this filter will eventually be used to better sample voice commands in later phases of the project. This
is because human speech is typically below 2500 Hz, so the filter would pass through frequencies corresponding to
human speech while attenuating higher frequency noise.
Let’s try to build a RC Low-pass filter using the knowledge we have. You may also refer to Example 1, AC response
of an RC, from
lecture 4b
for the derivation of the phasor response seen in the image below.
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.
Written by Mia Mirkovic (2019)
Edited by Steven Lu, Yi-Hsuan Shih (2021). Version 2.0, 2021.
Edited by Megan Zeng, Steven Lu (2022). Version 3.0, 2022.
Edited by Jessica Fan (2023). Version 4.0, 2023.
Edited by Venkata Alapati, Ryan Ma, Junha Kim (2024). Version 4.1, 2024.
4
Lab Note 4 — Sensing Part 1 (v4.1)
Related Documents
Related Questions
Define FACTS and write its necessity and benefits. With neat diagrams, briefly describe different type of FACTS controllers. Describe SVC and STATCOM and compare their performance.
arrow_forward
In motor control of train, IGBT control AC motor save more energy than GTO due to less switching loss. State THREE more reasons why IGBT use in motor control has many advantages over GTO.
If one of the freewheeling diode in your single phase inverter in above settings has reverse recovery failure. Describe what would happen to the circuit.
arrow_forward
Q4
Table Q4 shows the mode and task that need to be implemented using
PIC18F452.
(a)
Mode Switch (SW1)
1
Press 1 time
2
Press 2 times
Table Q4
Task
Move the LED right to left and continue
back from left to right.
Control the duty cycle of PWM for the
period of 2 ms.
You are given 1 switch, 1 potentiometer and 8 LEDs, sketch the interface
between the components and PIC microcontroller.
(b)
Construct a C18 program to control the tasks in Table Q4.
(4 marks)
arrow_forward
Solve all part plz or don't attempt.
arrow_forward
8:37 4 A M
Vo)
Gt LTE1
You
Just now
i) Analyse and execute the following 8051 Instructions and specify the output
and explain the contents of the registers with comments
MOV A, #92H
SWAP A
In the absence of a SWAP instruction, how would you exchange the
nibbles? Write an 8051 ALP to show the process
ii) Analyse and execute the following 8051 Instructions and specify the output
and explain the contents of the registers with comments.
CLRC
MOV A, #4FH
SUBB A#6DH
JNC NXT
CPL
A
INC
A
NXT: MOV RI,A
ADD A,RI
arrow_forward
A) List and describe 10 features of the Atmel ATmega 2560 AVR microcontroller (use the
ATmega 2560 complete reference manual for help).
B) List and describe two AVR instructions. As part of your description make sure that you list
the operation for each instruction that is provided in the instruction set summary.
arrow_forward
i need the answer quickly
arrow_forward
Explain the importance of VRM (Voltage Regulator Module) on a motherboard and how it affects CPU stability and power delivery.
arrow_forward
P. 2. Consider a proposed new instruction named rpt. This instruction combines a loop's
condition check and counter decrement into a single instruction. For example rpt x29, loop
would do the following:
if (x29 >0) {
x29 = x29 -1:
goto loop
a) If this instruction were to be added to the RISC-V instruction set. what is the most appropriate
instruction format?
b) What is the shortest sequence of RISC-V instructions that performs the same operation?
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
Electricity for Refrigeration, Heating, and Air C...
Mechanical Engineering
ISBN:9781337399128
Author:Russell E. Smith
Publisher:Cengage Learning
Related Questions
- Define FACTS and write its necessity and benefits. With neat diagrams, briefly describe different type of FACTS controllers. Describe SVC and STATCOM and compare their performance.arrow_forwardIn motor control of train, IGBT control AC motor save more energy than GTO due to less switching loss. State THREE more reasons why IGBT use in motor control has many advantages over GTO. If one of the freewheeling diode in your single phase inverter in above settings has reverse recovery failure. Describe what would happen to the circuit.arrow_forwardQ4 Table Q4 shows the mode and task that need to be implemented using PIC18F452. (a) Mode Switch (SW1) 1 Press 1 time 2 Press 2 times Table Q4 Task Move the LED right to left and continue back from left to right. Control the duty cycle of PWM for the period of 2 ms. You are given 1 switch, 1 potentiometer and 8 LEDs, sketch the interface between the components and PIC microcontroller. (b) Construct a C18 program to control the tasks in Table Q4. (4 marks)arrow_forward
- Solve all part plz or don't attempt.arrow_forward8:37 4 A M Vo) Gt LTE1 You Just now i) Analyse and execute the following 8051 Instructions and specify the output and explain the contents of the registers with comments MOV A, #92H SWAP A In the absence of a SWAP instruction, how would you exchange the nibbles? Write an 8051 ALP to show the process ii) Analyse and execute the following 8051 Instructions and specify the output and explain the contents of the registers with comments. CLRC MOV A, #4FH SUBB A#6DH JNC NXT CPL A INC A NXT: MOV RI,A ADD A,RIarrow_forwardA) List and describe 10 features of the Atmel ATmega 2560 AVR microcontroller (use the ATmega 2560 complete reference manual for help). B) List and describe two AVR instructions. As part of your description make sure that you list the operation for each instruction that is provided in the instruction set summary.arrow_forward
- i need the answer quicklyarrow_forwardExplain the importance of VRM (Voltage Regulator Module) on a motherboard and how it affects CPU stability and power delivery.arrow_forwardP. 2. Consider a proposed new instruction named rpt. This instruction combines a loop's condition check and counter decrement into a single instruction. For example rpt x29, loop would do the following: if (x29 >0) { x29 = x29 -1: goto loop a) If this instruction were to be added to the RISC-V instruction set. what is the most appropriate instruction format? b) What is the shortest sequence of RISC-V instructions that performs the same operation?arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Electricity for Refrigeration, Heating, and Air C...Mechanical EngineeringISBN:9781337399128Author:Russell E. SmithPublisher:Cengage Learning
Electricity for Refrigeration, Heating, and Air C...
Mechanical Engineering
ISBN:9781337399128
Author:Russell E. Smith
Publisher:Cengage Learning