You are on page 1of 4

Session T1D

AN INTRODUCTION TO LABVIEW EXERCISE


FOR AN ELECTRONICS CLASS
Melanie L. Higa1 , Dalia M. Tawy2 , and Susan M. Lord3
Abstract National Instruments LabVIEW has become a
popular programming environment for data acquisition in
academia and industry. Most LabVIEW reference materials
require a significant investment of time. At the University of
San Diego (USD), we wanted to provide an introduction to
LabVIEW for all electrical engineering majors without
adding additional classes or laboratories to the curriculum.
During a summer research experience, two electrical
engineering juniors at USD wrote a tutorial on LabVIEW
and designed a one-hour exercise to introduce students to
LabVIEW. The exercise allowed students to obtain the
amplitude frequency response of a simple RC circuit using a
function generator and an oscilloscope. Students had
previously done this experiment manually in their
sophomore circuits class. Thus the concepts of the lab were
familiar and they could focus on the advantages of having
LabVIEW automate the data acquisition and analysis.
Twenty-one students in a junior-level Electronics course
performed the Introduction to LabVIEW exercise in Fall
2001.

INTRODUCTION
LabVIEW (Laboratory Virtual Instrument Engineering
Workbench) is a graphical programming language which
was developed in 1986 by National Instruments.[1]
LabVIEW has become a vital tool for engineers and
scientists in research throughout academia, industry, and
government labs. Although many reference books [2] exist
to help one learn to program using LabVIEW, most of these
require a significant investment of time. At the University
of San Diego (USD), we wanted to provide an introduction
to LabVIEW for all electrical engineering majors without
adding additional classes or laboratories to the curriculum.
During a summer research experience, two electrical
engineering juniors at USD wrote a tutorial on LabVIEW
and designed a one-hour exercise to introduce students to
LabVIEW.
The exercise that was chosen examined the behavior of
simple RC filters.[3] Students had previously performed this
experiment in their sophomore circuits class.

Index Terms circuits, electronics, frequency response,


LabVIEW, student-designed laboratories.

FIGURE 1
LabVIEW FRONT PANEL OF AMPLITUDE FREQUENCY RESPONSE PROGRAM
1
Melanie L. Higa, University of San Diego, Department of Engineering, 5998 Alcala Park, San Diego, CA 92110 mhiga@sandiego.edu
2
Dalia M. Tawy, University of San Diego, Department of Engineering, 5998 Alcala Park, San Diego, CA 92110 dtawy@sandiego.edu
3
Susan M. Lord, University of San Diego, Department of Engineering, 5998 Alcala Park, San Diego, CA 92110 slord@sandiego.edu

0-7803-7444-4/02/$17.00 2002 IEEE


November 6 - 9, 2002, Boston, MA
32 nd ASEE/IEEE Frontiers in Education Conference
T1D-13

Session T1D
In this exercise, frequency is incremented on the
function generator by one student while another student
records the frequency and the corresponding output voltage
and input voltage readings from the oscilloscope into an
Excel spreadsheet.
Then the students calculate the magnitude of the voltage
gain using equation (1).
Gain = A = (Vo / Vin )

(1)

When all the gains are calculated, an amplitude


frequency response (gain versus frequency) graph is
generated in Excel. Even after all the work of collecting
data, students did not always obtain a satisfactory gain
versus frequency graph.
In designing the LabVIEW
exercise, we decided to eliminate as much human interaction
as possible and reduce the time it takes to obtain the graph.
We hoped this would result in better data and the possibility
of having students obtain more data and focus more on data
analysis rather than collection. We chose to use the
available equipment since this exercise would be performed
by all students. Our departments budget (and that of many
others) does not permit buying specialized equipment for
each station to obtain these measurements. Frequency
response is a common measurement in electrical engineering
and there are several reports in the literature of student
projects resulting in a system that can provide such
data.[4],[5] Note that the latter project also provided phase
versus frequency data and considerable effort was devoted to
that. Our project had a smaller scope than either of these
and was intended to be used by all electrical engineering
majors but only as an introduction to LabVIEW. Figure 1
shows the front panel of the amplitude frequency response
program which acts as a user interface between the students
and the equipment. The front panel includes the collected
data points and the amplitude frequency response graph.

LABORATORY EXERCISE
In order for students to become acquainted with LabVIEW,
we decided that they would need a brief tutorial. Of the
LabVIEW reference books considered, those by Beyon [1]
and Bishop [6] proved to be the most useful in developing
this.
One of the authors (MLH) wrote a 5 page
Introduction to LabVIEW which summarized the main
features that students would need to know to make some
simple modifications to an existing program. Students were
given this tutorial to read before performing this laboratory
exercise. Copies of the tutorial as well as the LabVIEW
code are available from one of the authors (SML).
The equipment used consisted of a Wavetek 148
Function Generator, an HP 54600A Oscilloscope with GPIB
interface, an HP 34401A Digital Multimeter, and a personal
computer with LabVIEW 6i. A picture of the complete setup is shown in Figure 2. The two students who designed the
exercise began the summer with no experience in LabVIEW.
They used various reference books and were able to write a
program to interface to the oscilloscope [7], obtain Vo and
Vin, calculate gain, generate a frequency response graph in
real time, and allow for error detection. Since the function
generators available at USD did not have GPIB capability,
the frequency had to be swept manually. The two students
who worked on the program gained considerable experience
with LabVIEW over the course of the summer. The
experience was beneficial in several ways.
LabVIEW is a completely new to me, so just being able
to learn enough about it to write a functional program
was a huge challenge for me. I also learned to be
resourceful. When things didn't work out with the
program, and I couldn't figure it out on my own, I had to
get on the phone and find someone who could help. It
was really neat to see the design process, which I
learned about freshman year, implemented in a real life
project that would be tested by my peers and hopefully
other classes that may follow.

FIGURE 2
0-7803-7444-4/02/$17.00 2002 IEEE COMPLETE SET -UP OF LABVIEW EXERCISE November 6 - 9, 2002, Boston, MA
32 nd ASEE/IEEE Frontiers in Education Conference
T1D-14

Session T1D
The laboratory exercise was designed to be performed
in one hour by students in groups of two. The students
examine the behavior of a simple high-pass RC filter whose
schematic circuit diagram is shown in Figure 3.
OUTPUT
0.01uF
V2
INPUT
V1

15kOhm

FIGURE 3
HIGH - PASS RC FILTER USED IN LABVI EW EXERCISE

After reading the LabVIEW tutorial, students


performing the exercise write a simple LabVIEW program
to calculate the cut-off frequency of their RC filter using
equation (2). This program, shown in Figure 4, is written
directly in the larger main program that is provided for them.
fc =1/(2RC)

(2)

where R is the value of the resistor in ohms and C is the


value of the capacitor in Farads.

FIGURE 4
CUT OFF FREQUENCY PROGRAM. LEFT SIDE SHOWS THE
FRONT PANEL (USER INTERFACE) AND RIGHT SIDE SHOWS THE
DIAGRAM (LabVIEW CODE)

In the second part of the exercise, students


experimentally produce the amplitude frequency response
graph of the circuit in Figure 3. They begin by setting
parameters of the oscilloscope and function generator and
then run the LabVIEW program. The frequency sweep is
done manually on the function generator. After hearing a
beep, the student increments the frequency. LabVIEW
directly grabs the frequency and corresponding voltages

from the oscilloscope and then generates the gain versus


frequency graph on the computer while data is being taken.
If a bad data point is obtained, it may be removed before the
user exits the program.
Once they obtain their frequency response graph,
students use cursors to mark their cut-off frequency on the
graph. They can then compare their measured value with
that calculated at the beginning of the lab. Before leaving
the lab, the students were required to print the frequency
response graph they obtained. They then submitted
individual brief laboratory reports describing the advantages
and disadvantages of LabVIEW and any other comments
they had on the existing program.
After the LabVIEW program was completely written
and the experiment was designed, several volunteer students
tested it in the summer of 2001. Modifications to the
experiment and the LabVIEW program were made
according to the students feedback. These included
providing the experimental set-up, editorial changes, and
changes to the user interface (LabVIEW front panel) to point
out specific items such as the run and pause buttons.

RESULTS AND STUDENT FEEDBACK


In the fall of 2001, twenty-one junior electrical engineering
majors in Engr 130 Electronics I successfully performed this
lab. The exercise was divided into three stations with two
students to a station. Each station examined the same RC
circuit. During the entire lab we had three instructors
available, although two instructors would be sufficient. This
exercise was done as the first experiment in Engr 130
because that fit well into the USD curriculum. It would be
beneficial earlier in the curriculum and would be suitable for
use in a sophomore circuits class as well.
Student response to the laboratory exercise was
generally positive. From the students reports, we found the
most important thing students learned is the power and
efficiency of using LabVIEW. Several students pointed out
the advantages of LabVIEW over other data analysis tools
they have worked with.
LabVIEW, in my opinion, has advantages over both
PSpice and using the function generator and
oscilloscope by hand. It is better than PSpice because
PSpice is just a simulationit is not as accurate as
physically setting up the circuit.
When you use LabVIEW, you would not have to
conduct any measurements or worry about not being
exact when trying to produce certain measurements
because the computer would do all of it for you.
I find myself using one program to simulate the
experiment, another to develop the mathematical model
and yet another to record and display experimental
results. LabVIEW can do all three adequately, saving a
lot of time.

0-7803-7444-4/02/$17.00 2002 IEEE


November 6 - 9, 2002, Boston, MA
32 nd ASEE/IEEE Frontiers in Education Conference
T1D-15

Session T1D

LabVIEW can eliminate the repetitious work of


collecting data and entering, sometimes reentering, it
into some spreadsheet or graphing program.

The LabVIEW program overwhelmed some students.


The flowchart and wiring was very involved and students
were intimidated by it. Given the fact that many of the
students have not had prior experience with LabVIEW these
feelings are to be expected.

I dont understand how it works and feel we would need


a lot more educating on this system before it would be
helpful to me. It was almost too overwhelming for me
to see the possible benefits from it.
It is overwhelming, often confusing. It required a threepage booklet and three additional pages of step-by-step
instructions just to alter some parts of the program.

SUGGESTIONS FOR IMPROVEMENT


In their reports, students gave a few suggestions for
improving the lab. Several students mentioned eliminating
all human intervention i.e. instead of having to adjust the
frequency on the function generator manually, have
LabVIEW do the sweep automatically. By having the sweep
done automatically by function generator, the time it would
take to obtain a graph would be significantly less. However,
this requires GPIB capability on the function generator,
which was not available at USD at the time of the
experiment.
Since the experiment was performed, an
Agilent function generator with a GPIB interface was
purchased and modifications have been made to the
LabVIEW program to allow for an automatic sweep of the
frequency. This results in much faster data acquisition.
Note that it does require a more expensive function
generator, which is not currently available at every lab
station.

ACKNOWLEDGMENTS
NSF Career Grant ECS-9796220 provided partial support for
this work. The authors gratefully acknowledge Brandon
Decker, Derek Maxwell, Michael Spencer, Patrick Weed for
help in testing the exericse as well as the cooperation and
suggestions of the students in Engr 130 at USD in Fall 2001.
We appreciate the loan of two GPIB boards by National
Instruments for the week that the exercise was performed in
Fall 2001. Finally, the assistance of National Instruments
Representative Jorge Noguera with the real time plotting and
error detection is gratefully acknowledged.

REFERENCES
[1] Beyon, J. Y., LabVIEW Programming, Data Acquisition and Analysis,
Prentice Hall PTR (Upper Saddle River, NJ), 2001.
[2] For example, Wells, L.K. and T. Jeffrey, LabVIEW for Everyone:
Graphical Programming Made Even Easier, Prentice Hall PTR,
(Upper Saddle River, NJ), 1996.
Jamal, J. and H. Pichlik, LabVIEW Applications and Solution, Prentice
Hall, (Upper Saddle River NJ), 1999.
[3] Introduction to RC filter Lab for Engr 60 at USD by one of the
authors (SML) based on a lab by Thomas F. Schubert, Jr.
[4] Beams, D. M., Project TUNA The Development a LabVIEW
Virtual Instrument as a Class Project in a Junior-Level Electronic
Course Session 22259, Proceedings of the 2000 ASEE Annual
Conference, St. Louis, MO, June 2000.
[5] M.G. Guvench, S. Gile and S. Qazi, "Automated Measurement of
Frequency Response of Electrical Networks Filters and Amplifiers",
Session 1359, Proceedings of the 2001 ASEE Annual Conference,
Albuquerque, NM, June 2001.
[6] Bishop R. H., LabVIEW Student Edition 6i, Prentice Hall, (Upper
Saddle River, NJ), 2001.
[7] Instead of rewriting a program that could communicate with the
oscilloscope, we based our LabVIEW program on one written by USD
student Michael Hawkins in Summer 1998.

SUMMARY
Two electrical engineering juniors wrote a tutorial and onehour exercise to introduce their classmates to LabVIEW
during a summer research experience at USD. The exercise
focused on obtaining the amplitude frequency response of a
simple RC filter using an oscilloscope and function
generator. Twenty-one juniors successfully performed the
exercise in Fall 2001. There was a mix of feelings from the
students reports. Some of the students found LabVIEW
very handy while others were overwhelmed by the program
they were given. Overall, students were able to learn a few
programming techniques in LabVIEW, were impressed with
its capabilities, and gained an appreciation for LabVIEW as
a data acquisition tool.

0-7803-7444-4/02/$17.00 2002 IEEE


November 6 - 9, 2002, Boston, MA
32 nd ASEE/IEEE Frontiers in Education Conference
T1D-16

You might also like