1.
Student Scope Using NI USB Data Acquisition
2. IR Remote Control Lab
3. Diode IV Sweep Lab
4. LED Thermometer Lab
5. Sound Recorder Lab
6. Microphone FFT Lab
Student Scope Using NI USB Data Acquisition
LabVIEW Student Scope Using the NI USB Data Acquisition
The StudentScope is a software oscilloscope specifically designed to work
with the National Instruments USB-6009 data acquisition device. To
simulate the functionality of a scope, the StudentScope acquires analog
input data across two channels and then searches for a user-specified trigger
level. This allows periodic waveforms to be lined up and displayed as
standing waves. Controls to scale signals, apply vertical offsets, adjust the
timebase, and measure phase offsets are all meant to function similarly to a
benchtop oscilloscope. Several expanded features are also available,
including a option to log data to an Excel-compatible spreadsheet file or to
export a screenshot to a printable HTML report.
StudentScope Front Panel
Download the StudentScope
The StudentScope source code can be downloaded here: StudentScope
Source (1.0). The StudentScope source requires: LabVIEW 8.0 or later, and
NI DAQmx 8.0 or later.
The StudentScope stand-alone executable can be downloaded here:
StudentScope.exe (1.0). The StudentScope executable requires: LabVIEW
RunTime Engine 8.0, and NI DAQmx 8.0 or later. You must extract all files
from the zip distribution before attempting to use the source or executable
versions of this application.
Getting Started
First, be sure you have the LabVIEW Run-Time Engine version 8.0 and the
DAQmx driver version 8.0 or later installed under the default installation
options. Both can be downloaded free of charge from ni.com. The installer
included with the Student Scope includes the LabVIEW Run-Time Engine,
but DAQmx must be downloaded separately. Next, connect your National
Instruments USB-6009 to your PC. Windows should detect the device and
configure the appropriate driver. If this is the first time that a USB-6009
device is installed on your computer, you might be prompted to install a
USB-6xxx Firmware Loader. Please complete the Windows Hardware
Wizard prompts to completely install this device.
To run the StudentScope, you will need to determine the device number of
your USB-6009, which is how the hardware is identified by the scope
software. Find this by opening National Instruments Measurement and
Automation Explorer (MAX). In MAX, expand Devices and Interfaces.
Then expand NI-DAQmx Devices. If the DAQmx driver is installed
properly, and the USB-6009 is connected, you will see an item such as
USB-6009: "Dev1" where Dev1 indicates device # 1. Make a note of the
device number.
When you run the StudentScope, you will need to select the correct device
number. If the wrong device number is selected, you will receive an error
message. To fix this, be sure the USB-6009 plugged in, select the correct
device number, and press the reset button.
Hardware Connections
Connect input signals to differential channels 0 and 1 on the USB-6009.
Terminals 2 and 3 on the 6009 correspond to the positive and negative
inputs for differential channel 0. Terminals 5 and 6 the 6009 correspond to
the positive and negative inputs for differential channel 1. For more
information on terminals and connections, consult the help manual for the
device.
Controls
The following controls on the StudentScope front panel are used to control
the behavior of the scope. The controls are modeled after a traditional
benchtop oscilloscope.
Device: Specifies the Device Number of the 6009, which uniquely
identifies the hardware. This number can be found in Measurement
and Automation Explorer (MAX). If you adjust this input, you will
have to press reset for the changes to take effect.
Channels: Specifies the number of channels to scan. By acquiring only
a single channel of data, twice the sampling rate can be achieved over
acquiring two channels of data. If you adjust this input, you will have
to press reset for the changes to take effect.
Input Voltage Range: Sets the internal programmable gain amplifier on
the 6009. This applies an appropriate analog gain to the signal prior to
digitization. For best results, choose the smallest range setting that
completely encapsulates the expected signal. If you adjust this input,
you will have to press reset for the changes to take effect.
Reset: If Device, Channels, or Input Voltage Range values are
changed, the StudentScope needs to be reset for the changes to take
effect.
Display On: Toggles the visibility of each channel's trace. Note: This
does not change whether or not the data is actually being acquired by
the USB-6009; it merely allows the user to turn on or off the display of
that data.
Offset: Adjusts the vertical position of the trace on the display by
adding or subtracting a voltage offset.
Zero: Removes any offsets added with the Offset knob.
Center: Automatically adjusts the Offset knob so that the waveform is
centered vertically on the display.
Scale: Sets the Volts per division along the vertical axis in order to
"zoom" vertically.
Timebase: Sets the time per division along the horizontal axis in order
to "zoom" horizontally. This does not change the rate of acquisition of
the hardware.
Trigger Channel: Specifies which channel will generate the trigger.
Edge: Toggles between triggering off of a rising or falling edge of the
signal.
Level: Specifies the voltage level at which a trigger will be generated.
Note: If the level is never crossed by the periodic signal, the trigger
will not work properly and the waveform will not display correctly.
Also, the trigger is defined in software, and will only correctly display
periodic signals with a period of less than 1/8 second.
Cursors (On/Off): Toggles display of the cursors on or off.
Lock Cursors: Toggles whether cursors are free-floating or locked to a
channel trace. If cursors are free floating, the voltage level at each
cursor will not be displayed.
C1: If Lock Cursors is toggle on, this selects the channel to which
Cursor 1 is locked.
C2: If Lock Cursors is toggle on, this selects the channel to which
Cursor 2 is locked.
X Axis Scroll: Adjusts the center frequency of the Spectrum Analyzer.
Page Up and Page Down can fine tune this control left and right.
X Axis Zoom: Adjusts the min and max range of the X axis of the
Spectrum Analyzer.
IR Remote Control Lab
IR Remote Control Using National Instruments Low Cost Data
Acquisition
Introduction
Have you ever wondered how a typical remote control works? When the
user presses a button on the remote, an infrared signal is transmitted across
the room and detected by a sensor called a photodetector. You will create a
remote control of your own in this exercise.
In this lab, you will use a standard universal remote control to transmit an
infrared signal several feet. A detection circuit will then be constructed
using a specific type of photoreceiver known as a photodiode. Next, a Low
Cost USB DAQ device will be used to digitize the infrared signal. Finally,
this digitized signal will be analyzed using LabVIEW software to control
the popular iTunes application with the help of ActiveX controls.
Pre-Lab Assignment
1) Why can’t humans see the infrared light coming out of a remote control?
Look online or in a textbook to find the wavelengths of the visible light
spectrum as well as the wavelengths of the infrared light spectrum.
2) Write a short summary about how the photodiode works. You should be
able to find a variety of sources online; cite them in your response.
3) Search Google for “infrared photodiode datasheet” and see what you can
find. What specifications are common for photodiodes? Verify that the
photodiode detection range is within the infrared spectrum.
4) To generate the infrared signal, your remote control contains an infrared
LED. Find an infrared LED datasheet online. What specifications do you
see? Verify that the infrared LED emission range is within the infrared
spectrum.
5) Become familiar with the National Instruments USB 6008 and 6009 data
acquisition devices. These datasheets are available at www.ni.com.
Theory
Infrared signals are very similar to visible light, except they occupy a
section of the electromagnetic spectrum that makes them invisible to the
human eye. In scientific terms, the infrared spectrum contains wavelengths
ranging from approximately 1.0 mm to 0.7 um. It is convenient to use
infrared signals for remote control transmission, because their reception is
not strongly affected by the amount of ambient light present at the
photodetector.
One common method of converting an infrared remote control signal (0.7 –
0.9 um wavelength) into an electrical signal is using an infrared photodiode.
In addition, another method is using a phototransistor. For this laboratory
exercise, we will focus on an infrared photodiode transducer similar to the
one shown below:
Infrared
Photodiode
When used in a circuit, the photodiode will be reverse biased and, as with
an ordinary diode, no current will flow. However, any incident infrared light
will cause electron-hole pairs to form in the photodiode semiconductor, and
thus a current will flow. In this way, an infrared signal can be converted to
an electrical one.
Hardware and Software Required
1. Infrared photodiode
2. 100 kOhm resistor
3. Remote control (any infrared device should work)
4. National Instruments Low Cost USB DAQ
5. LabVIEW 8.20 software (LabVIEW 8.0 will work as well)
6. iTunes software
Laboratory Exercise
In this exercise, infrared data will be acquired from a photodiode and then
digitized using a Low Cost USB DAQ device. Once the infrared signal
exceeds a given threshold (meaning that a remote control button is being
pressed), LabVIEW will send an ActiveX command to make iTunes play a
song. Holding down a remote control button will result in iTunes skipping
to the next song in the current playlist. When finished, the LabVIEW front
panel will resemble the following:
IR Remote Control Front Panel in LabVIEW
1) Connect the following circuit to the Low Cost USB DAQ as shown. The
photodiode can be purchased cheaply at Radio Shack, etc. Note that the
+5V power supply can be obtained directly from the National Instruments
USB 6008 or 6009 devices.
IR Receiver
Schematic
2) Using the DAQ Assistant and Acquire Sound Express VIs, create the
following LabVIEW block diagram. Note that the false case of the outer
case structure simply passes through the ActiveX automation refnum.
IR Remote Control Block Diagram in LabVIEW
3) Run the VI and use any infrared remote control to test your application.
Pressing a button quickly on the remote control should cause iTunes to
play/pause the current song (iTunes will first open if currently closed).
Holding down a remote control button should cause iTunes to play the next
song in the current playlist.
4) Experiment to find out how far away you can use your remote control
before the infrared receiver no longer works. Try adjusting the detection
threshold to maximize transmission distance without false positives.
5) Though infrared photodiodes are not very responsive to visible light, the
signal produced could be slightly affected by the ambient light in your
room. Try operating the circuit in different lighting conditions and note how
the signal level changes.
Post-Lab Questions
1) What could be done to increase the working distance of your remote
control receiver? Would you implement changes in hardware or software?
2) As mentioned earlier, a phototransistor could have been used instead of a
photodiode to receive infrared signals. Reasearch some advantages and
drawbacks of using each kind of device. Which do you think would work
best? Which sensor costs the most?
3) Experiment with the ActiveX VIs in LabVIEW and see what other
applications you can control. How could you make a PowerPoint slideshow
advance when an infrared signal is received by your detection circuit?
Diode IV Sweep Lab
Diode IV Sweep Using National Instruments Low Cost Data
Acquisition
Introduction
The diode is a basic circuit element that possesses nonlinear IV
characteristics. In contrast to a simple resistor, doubling diode current does
not necessarily double the voltage across the diode. In order to visualize this
nonlinear relationship, it is common to plot diode current vs. voltage on a
2D graph. This graph can also be used at a later point to perform “load line”
calculations on circuits with diodes.
In this exercise, the experimenter will construct a simple circuit to measure
the IV characteristic of a diode. The Low Cost USB DAQ will be used as a
programmable voltage source as well as an analog measurement device.
The experimental data collected can be compared to expected theoretical
data to draw conclusions regarding measurement noise, model
shortcomings, and data acquisition.
Pre-Lab Assignment
1. Research the exponential diode model using textbooks, the internet, or
any other source. This model is more commonly referred to as the
“ideal diode model”. What other diode models can you find?
2. What formula(s) can you find relating diode current and voltage? Note
that the exponential, or “ideal diode model” should have an
exponential term.
3. Search Google for “Phillips 1N914” and open up the pdf datasheet.
Find the graph of diode forward current vs voltage and note your
observations. Does the forward IV curve look exponential? How does
the reverse IV curve look?
4. Use a simulation package such as Multisim to obtain the IV
characteristic of a simulated diode. Do this by sweeping either the
diode current or voltage, and measuring the other quantity.
5. Become familiar with the National Instruments USB 6008 and 6009
data acquisition devices. These datasheets are available on
www.ni.com.
Theory
One commonly used method of modeling a diode is the “ideal diode
model”. Using this model, diode voltage and current are related according
to the following formula:
Ideal Diode Model
Since Is is typically very small (1E-12), this equation is commonly
simplified to:
Simplfied Diode
Model Equation
Note that in the formula, Is stands for the saturation current which is around
1E-12 A, and Vt is a temperature dependent constant equal to 0.0259 V at
300 degrees K. Id and Vd represent diode current and voltage respectively.
Therefore, a theoretical diode IV curve can be plotted using LabVIEW:
IV Curve plotted using LabVIEW
Hardware and Software Required
1. 10 Ohm resistor
2. Diode
3. National Instruments Low Cost USB DAQ
4. LabVIEW 8.20 software (LabVIEW 7.1 or 8.0 will work as well)
Labratory Procedure
1) Construct the following circuit and connect to the USB 6008/6009. By
outputting a certain voltage at AO 0 and measuring the voltage at AI 3+, the
experimenter can obtain a data point containing diode voltage and current.
The diode voltage is simply the voltage at node AI 3+, and the diode current
is identical to the resistor current (Ohm’s Law).
Circuit for Measuring Diode IV Curve
2) Use a DMM to measure the actual resistance used for R1 in the circuit
above (take R1 out of the circuit for measurement). This will help to obtain
a more accurate current reading.
3) Using the DAQ Assistant Express VI, construct the following LabVIEW
block diagram. Note that the user will be able to select the number of IV
data points to collect, as well as the ending sweep voltage for AO 0. Select
this voltage low enough to ensure that resistor R1 does not exceed its power
specification.
LabVIEW Block Diagram Used to Measure Diode IV Curve
4) Run the VI several times using different values for the number of data
points and sweep ending voltage. Record your observations and print out
three diode IV curves with different numbers of data points.
Post-Lab Questions
1. Did the measured diode characteristic curve closely resemble what you
expected? How closely did this curve match the datasheet, simulation,
and theoretical data you researched earlier?
2. The measured IV curve may have contained some noise. Elaborate on
some possible sources of this noise (think about your surroundings).
Can you think of a way to eliminate some of the undesired noise from
the signal? Would you do this in hardware or software?
3. What real-world situations would require a designer to measure the
diode characteristic curve?
4. What quantities could you measure for a bipolar junction transistor
(BJT) using the low cost USB acquisition device? Explain how you
would make your measurements.
LED Thermometer Lab
LED Thermometer Lab Using National Instruments Low Cost
Data Acquisition
Introduction
One common measurement that scientists and engineers like to make is
temperature. For example, it may be necessary to record the temperature of
a biology experiment, a heat testing chamber for electronics, or a jet engine.
In order to convert temperature information into electrical form, a
transducer is needed. A temperature transducer is simply a sensor that will
allow the user a mechanism to detect a temperature change (increasing or
decreasing voltage, current, resistance, etc).
During this exercise, the experimenters will use the integrated circuit
LM34CZ temperature sensor to output a linear, temperature dependent
voltage. This voltage will be digitized by a Low Cost USB DAQ so that
measurements can be taken on a computer. Finally, a LabVIEW virtual
instrument (VI) will be created in order to visualize sampled data and
control several LEDs.
Pre-Lab Assignment
1) Many types of temperature sensors exist, including RTDs,
thermocouples, thermistors, and ICs. Use any resources available
(textbooks, the web, etc) to research each type of transducer and prepare a
short written summary of each.
2) Find and print the datasheet for the LM34CZ temperature sensor using
Google. By reading the datasheet, can you determine how we will measure
temperature with this IC? Write a formula relating temperature and sensor
output voltage (this should be fairly simple).
3) Suppose we were using the LM35 temperature sensor instead. Obtain the
datasheet and write a second formula relating temperature and sensor output
voltage for the LM35.
4) Become familiar with the National Instruments USB 6008 and 6009 data
acquisition devices. These datasheets are available at www.ni.com.
Theory
One method to measure temperature involves using an integrated circuit
transducer such as the LM34CZ. This IC will generate a voltage that is
linearly proportional to the measured temperature. Compared to other
measurement methods, ICs provide an extremely linear output with very
little error. They are also one of the simplest temperature sensors to connect
and use.
Below are several views of the LM34CZ in a TO-92 package:
LM34CZ Sensor Sensor Pinout
As the experimenter can see, the LM34CZ is a three-terminal device. Two
pins are used for power (+Vs and GND), while the third pin is used to
output a temperature dependent voltage.
Since the LM34CZ outputs a voltage that is linearly dependent with
temperature, it is easy to compute measured temperature from sensor output
voltage or vice versa. In fact, the LM34CZ ideally outputs exactly 10mV /
deg F.
Temperature - Voltage
Relationship
To visualize this relationship, a graph sensor output voltage vs. temperature
can be plotted using LabVIEW:
Output Voltage Vs. Temperature Data
Hardware and Software Required
1. (4) red LEDs
2. (4) 220 Ohm resistors
3. LM34CZ temperature sensor IC
4. National Instruments Low Cost USB DAQ
5. LabVIEW 8.20 software (LabVIEW 7.1 or 8.0 will work as well)
Laboratory Exercise
During this exercise, the experimenter will construct an LED thermometer
that resembles the following:
LED Thermometer Front Panel in LabVIEW
1) In order to create the LED thermometer output, Connect LEDs and
resistors to the digital output lines of the Low Cost USB DAQ as shown
below. Each LED will be programmed to light up when the temperature
exceeds a certain threshold.
LED Connection Schematic
2) To measure the temperature, connect the LM34CZ IC to the Low Cost
USB DAQ as shown below. Note that the +5V supply needed by the IC can
be obtained directly from the National Instruments USB 6008 or 6009.
Temperature Sensor Schematic
3) Using the DAQ Assistant Express VI, create the following LabVIEW
block diagram. In this virtual instrument (VI), temperature data is acquired
using the Low Cost USB DAQ, scaled, and displayed on a chart. The
temperature measurement is also compared with several thresholds. Once
the temperature exceeds each threshold, a corresponding physical LED and
front panel LED will light up.
LED Thermometer Block Diagram in LabVIEW
4) Run the VI and adjust the threshold levels so that several LEDs light up.
Warm up the temperature sensor by squeezing it with your fingers and
observe the rise in measured temperature on the front panel chart. You have
now succeeded in creating an LED thermometer!
Post-Lab Questions
1) Did the measured temperature levels match what you expected? If the
temperature is warmer or cooler than you expected, elaborate on possible
sources of error.
2) Look at the LED Thermometer VI created above, and determine how
often temperature measurements are being taken. Why wouldn’t you want
to take room temperature measurements at a faster rate such as 1 MHz?
3) If you were incorporating the LM34CZ temperature sensor into a
shipping product, what would you do to calibrate the sensor? Outline the
process you would go through to make your temperature measurements
more accurate.
4) How could you modify the LabVIEW virtual instrument above to output
a Centigrade or Farenheit temperature depending on user input? Assume
you are using the same LM34CZ temperature sensor.
Sound Recorder Lab
Sound Recorder Using National Instruments Low Cost Data
Acquisition
Introduction
Any signal, including a sound wave, can be thought of as the sum of
different frequency sine waves (where each frequency wave has a specific
amplitude and phase angle). In addition to the frequencies we expect to see
in a signal, some undesirable frequencies may also be present.
Filters allow us to select which frequencies we care about, and discard
certain frequencies that are undesirable (such as noise). Various types of
filters exist including low-pass, high-pass, band-pass, etc. There are also
many different ways of constructing each filter type with each filter
implementation having its own specific characteristics. More information
on filters will be provided in the theory section.
In this exercise, the experimenters will use a microphone element to convert
a sound wave into an electrical signal. This signal will then be digitized
using a Low Cost USB DAQ device. Finally, a LabVIEW application will
be constructed to filter undesired frequencies from the signal and play the
clarified signal back.
Pre-Lab Assignment
1) In your own words, describe what an ideal band-pass filter transfer
function would look like. You may research this by searching for “ideal
band pass filter” in google, or using a textbook.
2) When filtering an audio signal, what frequencies must be preserved? Do
some research to determine the frequency range produced by the human
voice, and the audible range of the human ear.
3) Elaborate on some possible sources of undesirable frequencies in a
signal. Where does signal noise come from?
4) Become familiar with the National Instruments USB 6008 and 6009 data
acquisition devices. These datasheets are available at www.ni.com.
Theory
Electret Microphone Elements
One way to convert sound pressure waves into an electrical signal is using
an electret microphone element. A picture of such an element is shown
below:
Electret
Microphon
e Element
Inside the electret microphone element, a dielectric material is made to hold
a permanent charge. When the element vibrates, the internal capacitance
changes and an electrical signal is produced. A variety of additional
components complete the microphone element circuitry by adding a small
amplifier to the output.
Band Pass Filters
The Fourier Transform tells us that it is possible to think of any signal as
being composed of various frequency sine waves (with each frequency
having an associated amplitude and phase angle)
Imagine that you have just used a microphone to convert a sound wave into
an electrical signal. If the sound wave consisted only of a human voice, then
only the frequencies that human vocal chords can produce should be
present. Therefore, the overall signal should roughly be composed of
frequencies between 80 Hz and 1.2 kHz.
Unfortunately, when playing back your audio signal, you may find that it
does not sound very good! Perhaps the lights in your room added some 60
Hz electrical noise to the signal that shouldn’t have been there. Maybe the
wind was blowing on your microphone, causing the signal acquired to be
fuzzy-sounding. There are an enormous number of factors that could affect
your sound signal.
Using a filter can help clarify the signal so that it sounds clear once again.
Since you know that any frequencies outside of the 80 Hz – 1.2 kHz range
are obviously noise, you can attempt to attenuate these frequencies as much
as possible. Specifically, a band-pass filter can be used to accomplish this
objective.
An ideal band-pass filter will completely attenuate any signals outside of a
desired range (known as the passband). In the real world, it is impossible to
construct an ideal filter, but with a large enough circuit or complex digital
filtering it is possible to obtain a fairly sharp cutoff.
Remember, all filtering is essentially “frequency selection”. By filtering a
signal, we are attempting to “choose” which frequency components can
pass through and which we want to discard.
Hardware and Software Required
1. 10 Ohm resistor
2. 4.7 uF capacitor
3. Electret microphone element
4. National Instruments Low Cost USB DAQ
5. LabVIEW 8.2 software (LabVIEW 8.0 will work as well)
Laboratory Exercise
During this exercise, the experimenter will acquire a sound signal from an
electret microphone element. This sound signal will then be run through an
optional band-pass filter and played back using speakers.
When completed, the completed sound recorder front panel will resemble
the following:
Completed Sound Recorder Front Panel in LabVIEW
1) Connect the following circuit to the Low Cost USB DAQ as shown. The
microphone element can be purchased cheaply at Radio Shack, etc. Note
that the +5V power supply can be obtained directly from the National
Instruments USB 6008 or 6009 devices.
Electret Microphone Circuit
2) Using an event structure in LabVIEW, replicate the following block
diagram for the “playback” event. Note that the “Bandpass Filter” Boolean
control allows the user to play back the filtered or original signal.
Sound Recorder Block Diagram Showing Playback Event
3) Using the DAQ Assistant Express VI, complete the block diagram for the
“record” event as indicated below:
Sound Recorder Block Diagram Showing Record Event
4) Experiment with the sound recorder VI by recording a simple voice
message. Attempt to play back both the original and filtered signals. Modify
the filter cut-off frequencies and see how narrow you can make the
passband before the played back signal is difficult to decipher.
Post-Lab Questions
1) What sample rate did you use when recording your sound signal?
Explain why you chose this rate and what issues could occur with too low
or high of a sample rate.
2) Could you have used any other filter types to clarify the sound signal?
Would a low-pass, high-pass, or other filter have accomplished the same
objective?
3) How can you tell if high frequency noise is present in your sound signal
without playing it back? Before filtering the signal, how could you have
determined what frequencies the signal contained?
Microphone FFT Lab
Microphone FFT Using National Instruments Low Cost Data
Acquisition
Introduction
Whenever a sound is made, a pressure wave travels through a medium
(such as air) and vibrates our eardrums. This same principle can be used to
convert sound information into an electrical form so that the experimenters
can visualize, interpret, and analyze the sound information.
In addition to visualizing the amplitude of a sound wave (electrically) over
time, we can also look at the frequency content of the sound signal. Simply
put, we can use the Fast Fourier Transform (FFT) algorithm to look at how
much of each frequency the sound signal contains. More information on the
FFT will be provided in the theory section.
During this exercise, the experimenters will use a microphone element to
convert a sound wave into an electrical signal. This signal will be then
digitized using a Low Cost USB DAQ device. Finally, the Signal Express
application will be used to quickly visualize the time domain sound signal
as well as compute its Fast Fourier Transform for viewing in the frequency
domain.
Pre-Lab Assignment
1) Find a microphone element datasheet by searching the internet for
“electret condenser microphone element.” Most detailed datasheets should
show the frequency response curve of the element. This curve shows how
much of each sound frequency makes it through to the electrical signal
produced. What does this curve look like for the element you found?
2) What frequency response would be ideal for a microphone element to
have? Would a flat curve be advantageous? What about a curve that rolls off
at 5 Hz? Hint: first determine which frequencies are audible to the human
ear.
3) Write a short summary about how the electret microphone works. You
should be able to find a variety of sources online; Wikipedia is a good
starting point.
4) Become familiar with the National Instruments USB 6008 and 6009 data
acquisition devices. These datasheets are available at www.ni.com.
Theory
Electret Microphone Elements
One way to convert sound pressure waves into an electrical signal is using
an electret microphone element. A picture of such an element is shown
below:
Electret
Microphon
e Element
Inside the electret microphone element, a dielectric material is made to hold
a permanent charge. When the element vibrates, the internal capacitance
changes and an electrical signal is produced. A variety of additional
components inside the microphone element act as a small output amplifier.
The Fast Fourier Transform (FFT)
It is very common in science and engineering to view a signal’s amplitude
vs. time. For example, imagine that a doctor is watching a patient’s
heartbeat on an electrical device. He might see peaks in the heartbeat signal
every 1 second if the patient’s heart beats 60 times a minute.
If the doctor wishes to calculate the patient’s heart rate (assuming it is
perfectly steady), he can try to measure the time between successive peaks
on the screen (1 second in this case) and calculate the heart rate from that
information. However, there is an easier way!
Any signal (electrical or otherwise) can be viewed as a number of sine
waves at different frequencies with various amplitudes and phase shifts.
Simply put, a graph can be made that shows amplitude vs frequency instead
of amplitude vs time. In the doctor’s case above, it would be very
convenient for him to have a graph of amplitude vs heart rate frequency. If
the patient’s heart rate is approximately 1 Hz as noted above, then the
amplitude vs frequency plot should show a peak somewhere near 1 Hz as
well. Now, the doctor can simply glance at the graph to see the heart beat
frequency.
In order to convert a time domain signal such as heart rate amplitude vs
time into the frequency domain to produce a plot such as amplitude vs
frequency, the Fourier Transform can be used. Several variations of this
transform exist, including the Fast Fourier Transform (FFT) algorithm that
is typically used by computers. For the purposes of this exercise, the low
level mathematical details of the transform will not be needed. The
experimenter does, however, need to remember the basic concept:
Remember, any signal can be thought of as being composed of sine waves,
where each frequency of sine wave will have a given amplitude and phase
shift.
Hardware and Software Required
1. 10 Ohm resistor
2. 4.7 uF capacitor
3. Electret microphone element
4. National Instruments Low Cost USB DAQ
5. Signal Express software
Laboratory Exercise
During this exercise, the experimenter will acquire a sound signal from an
electret microphone element. This sound signal will then be converted into
the frequency domain using the Fast Fourier Transform to produce a chart
similar to the following:
Frequency Domain Representation of Microphone Signal
1) Connect the following circuit to the Low Cost USB DAQ as shown. The
microphone element can be purchased cheaply at Radio Shack, etc. Note
that the +5V power supply can be obtained directly from the National
Instruments USB 6008 or 6009 devices.
Electret Microphone Circuit
2) Program steps in National Instruments Signal Express software to match
the sequence below. These steps will acquire a sound signal from the circuit
constructed above and compute the frequency domain representation using
the FFT.
Completed
Signal Express
Steps
3) Drag the acquired time domain sound signal as well as the frequency
domain (FFT) signal into the data view window. Choose “run continuously”
within Signal Express to loop the sequence.
4) Try generating various sounds by talking, whistling, etc. Make sure that
you are close to the microphone element. Observe the FFT signal when you
whistle different notes.
Post-Lab Questions
1) Do research in a textbook or online to determine the frequency range that
the human voice can produce. Did the FFT of your voice / whistling fall
within that range?
2) Imagine you tried to use the electret microphone element outside on a
windy day. What might happen if your tried to record your voice? How
does the frequency response of the microphone play a factor here?
3) How can you tell if high frequency noise is present in your sound signal
without playing it back? Hint: think about the concepts discussed in the
theory section above.
4) What could be added to the Signal Express sequence above in order to
attenuate any noise in your sound signal? What frequency ranges must
remain intact (assuming you are attempting to record a human voice)? What
frequency ranges do you not have to be concerned about at all?