You are on page 1of 12

Data Acquisition Using LabVIEW

Summary
Most research today is done with the aid of computers. The computer is used to control the
experiment, measure the data, and analyze the results. In this experiment, principles of data
acquisition and equipment control are introduced. Specifically, LabVIEW is used to interface
the computer with programmable measuring instruments such as the digital multimeter
(DMM), power supply, function generator and digital oscilloscope.

Objectives
• Describe the elements of data acquisition.
• Use the power supply, function generator, DMM, and oscilloscope LabVIEW instrument
drivers.
• Explain how to use the LabVIEW instrument drivers.

Background Information
Data acquisition consists of the elements shown in figure 1. The physical phenomenon may
be electrical (voltage, current or resistance), optical (light intensity), mechanical (strain, speed,
pressure, etc.), thermal (temperature), or anything else to be measured.

The sensor reacts to changes in the phenomenon and produces a relative signal that may be
transmitted, recorded, and analyzed.

Signal Conditioning involves amplifying and filtering the signal in order to prepare it for
analog-to-digital (A/D) conversion.

An A/D Converter samples the analog (continuous) signal and converts the amplitude at
each sample time to a digital value suitable to the computer. In the laboratory, the digital
multimeter and digital oscilloscope perform this operation.
Physical Signal Analog to Digital Computer
Phenomenon Sensor Conditioning Conversion

Gain Filter 10110011

Figure 1: Elements of data acquisition.

In order to automate the process of acquiring data, a computer program must be written to
control the hardware, collect the data, analyze the data, and present the results. Traditional
programming languages (like Basic and C) may be used to accomplish this task, but they
require a great deal of programming. Furthermore, traditional programming languages do not
provide an easy way to produce and display graphs.

Figure 2: Icons of laboratory instrument drivers and write-data-to-spreadsheet subroutine.

LabVIEW
LabVIEW solves the limitations of the traditional programming languages. LabVIEW
(Laboratory Virtual Instrument Engineering Workbench) is a powerful and flexible
instrumentation and analysis software system. LabVIEW features a graphical programming
environment with tools necessary for data acquisition, analysis, and presentation.

2
As mentioned in the LabVIEW introduction, LabVIEW programs are called Virtual
Instruments (VIs) since the final program resembles an instrument with buttons, switches,
and graphical output.

A Virtual Instrument consists of a front panel and a block diagram. The front panel specifies
the inputs and outputs which make up the user interface. The block diagram consists of icons
which represent subroutines and program control structures. Figure 2 displays icons of the
laboratory instrument drivers and write-data-to-spreadsheet subroutine.

Procedure
Build each of the following LabVIEW Virtual Instruments using the instrument drivers for the
power supply, digital multimeter, function generator and oscilloscope.

10
7
6
8
5
3

4
2
9

Figure 3: VI for setting either the positive or negative side of the power supply.

1. Power Supply

The power supply driver controls the voltage and current limit settings of the power supply.

In this procedure, a LabVIEW VI is built to supply either positive or negative voltage from the
power supply. The case structure of the VI is used to choose either the positive or negative
terminals of the power supply in accordance to the entered voltage.

1.1. Build the VI shown in figure 3. Note that there is only one case structure in the VI.
Figure 3 displays both the True and False options of the same case structure.

1.2. Record the purpose of each numbered icon.

3
1.3. Run the VI and ensure it operates properly by completing the following table. Use the
DMM to measure the power supply output.

Power Supply Measured Output Percent


Setting (Volts) (Volts) Error
-20
-10
0
10
20

1.4. Connect the negative, neutral and positive terminals of the power supply to the L.E.D.
(Light-Emitting-Diode) board. Record the minimum required voltage to light each
L.E.D.

LED Voltage
Right Light

Left Light

2
3

Figure 4: VI to control and read from the digital multimeter.

2. Digital Multimeter

The input to the DMM instrument driver is an integer value specifying the type of
measurement: 0 for DC Volts, 1 for AC Volts, 2 for DC Amps, 3 for AC Amps, 4 for Ohms, 5
for frequency and 6 for period. The DMM driver first selects the type of measurement and
then reads the measurement.

In this procedure, a LabVIEW VI is built to measure the resistance of a potentiometer


(adjustable resistor).

2.1. Build the LabVIEW VI shown in figure 4. The DMM Function custom control is found
in the 'User Controls' section of the Control menu.

4
2.2. Record the purpose of each numbered icon in the VI.

2.3. Connect the potentiometer board to the DMM using banana to banana cables.

2.4. Set the VI to measure Ohms (value of 4) and execute the program. Ensure the VI is
operating correctly by comparing several resistance measurements to the values shown
on the the DMM.

VI Front Panel DMM Percent


Reading Reading Error

2.5. Adjust the potentiometer knob and measure the maximum and minimum resistance
values.

Potentiometer Resistance
Minimum

Maximum

3. Function Generator and Digital Oscilloscope Capture

The function generator instrument driver is used to control the settings of the function
generator. Specifically, the driver controls the wave type, frequency, amplitude (peak to peak),
and offset voltage.

The digital oscilloscope has two instrument drivers. One driver captures the signal displayed
on the screen of the oscilloscope. The other driver takes measurements from the signal
displayed on the screen. For this procedure, use the oscilloscope capture driver to display the
function generator signal.

3.1. Build the LabVIEW VI shown in figure 5. Note that there is only one sequence structure
in the VI. Figure 5 displays two panels of the same structure.

3.2. Adjust the x-axis precision of the waveform graph to have two decimal places to
enhance the display of the waveform.

3.3. Record the purpose of each numbered icon in the VI.

3.4. Connect the output of the function generator to channel 1 on the oscilloscope using a
BNC to BNC cable.

3.5. Set the function generator to output a triangle wave with a 5 Volt amplitude (peak to
peak) and frequency of 25Hz.

5
3
4

Figure 5: VI to set the function generator output and display it using the digital oscilloscope.

3.6. Execute the VI and ensure it works properly by completing the following table.

In order to measure the signal parameters, display the waveform graph cursor and record
the appropriate values. Compare these measured values to the settings of the function
generator by computing the percent difference between them.

Parameter Function Generator Oscilloscope Percent


Setting Reading Error
Period (ms)
Amplitude (VPP)

4. Function Generator and Digital Oscilloscope Measure

The function generator instrument driver is used to control the settings of function generator.
Specifically, the driver controls the wave type, frequency, amplitude (peak to peak), and offset
voltage.

The digital oscilloscope has two instrument drivers. One driver captures the signal displayed
on the screen of the oscilloscope. The other driver takes measurements from the signal
displayed on the screen. For this procedure, use the oscilloscope measure driver to measure
parameters of the function generator signal.

4.1. Build the LabVIEW VI shown in figure 6. Note that there is only one sequence structure
in the VI. Figure 6 displays several panels of the same structure.

4.2. Record the purpose of each numbered icon in the VI.

4.3. Connect the output of the function generator to channel 1 on the oscilloscope using a
BNC to BNC cable.

6
4.4. Set the function generator to output a triangle wave with a 2 Volt amplitude (peak to
peak), 2 Volt DC offset, and frequency of 20Hz.

3
4
1

Figure 6: VI to set the function generator output and measure it using the digital oscilloscope.

4.5. Execute the VI and ensure it works properly by completing the following table.
Compare the measured values to the settings of the function generator by computing the
percent difference between them.

Parameter Function Generator Oscilloscope Percent


Setting Reading Error
Frequency (Hz)
Amplitude (VPP)
Offset (VDC)

7
Presentation Question 1
An engineering company has contracted your group to write a LabVIEW VI to automatically
determine the current-voltage characteristic for a light bulb. Their plans are to use the VI
program to ensure the quality of newly manufactured light bulbs.

The current-voltage characteristic of the light bulb is to be determined from 0 to 10 Volts. For
quick analysis, the current-voltage characteristic is plotted on an XY graph with no less than
20 samples. Also, note that a time delay is often required between the setting of the power
supply and reading the measurement of the DMM.

The company wants your group to present the answers to the following questions about the
project.

• In theory, how is the current-voltage characteristic of an object determined?


• What instruments are required to measure the current-voltage characteristic?
• How are the instruments and light bulb connected in order to measure the current-voltage
characteristic?
• What are the details of the LabVIEW VI program? How does it work?
• What is current-voltage characteristic of a light bulb?
• Explain any and all anomalies in the VI graph.
• Is the bulb resistance constant?
• What is the approximate bulb resistance for 2 Volts?
• What is the approximate bulb resistance for 8 Volts?
• Were there any problems faced in writing the program?
After the presentation, the company may have a few additional questions for you.

8
Presentation Question 2
An engineering company has contracted your group to write a LabVIEW VI to control the
brightness a light bulb. Their plans are to use the VI program in a larger program that controls
the light, temperature, and airflow of a high-rise building.

The light bulb to be controlled can have a maximum applied power of 3 Watts. The VI
program allows the user to adjust the light from off to maximum brightness without exceeding
the 3-Watt limit of the bulb. The VI program should continue to execute until it is terminated
by the user.

The company wants your group to present the answers to the following questions about the
project.

• What is the theory of how to measure wattage?


• What instruments are required to control the light the bulb?
• How are the instruments and light bulb connected together for use with the VI program?
• What are the details of the LabVIEW VI program? How does it work? How does your
program ensure the bulb wattage is less than 3 Watts?
• Could the VI program be modified to check if the light bulb is burned out?
• Were there any problems faced in writing the program?
After the presentation, the company may have a few additional questions for you.

9
Presentation Question 3
A research company has contracted your group to write a LabVIEW VI to control the lighting
of a light bulb for studying light effects on plant growth. Specifically, the company wants to
be able to set the amount of time the bulb is lit and the amount of time the light is off.

The light bulb must be powered by the power supply. The VI program allows the user to set
the light on time in seconds and light off time in seconds. The VI program continues turning
the bulb on and off until it is terminated by the user.

The company wants your group to present the answers to the following questions about the
project.

• What is the purpose of writing a program to turn on and off the light bulb?
• What is the necessary voltage to light the bulb?
• What instruments are required for the experiment?
• How are the instruments and light bulb connected together for use with the VI program?
• What are the details of the LabVIEW VI program? How does it work?
• Were there any problems faced in writing the program?
After the presentation, the company may have a few additional questions for you.

10
Presentation Question 4
An engineering company has contracted your group to write a LabVIEW VI to control two
LEDs and output a light pattern. If this project is successful, they plan to contract you to build
a large LED screen for advertising products.

The VI program outputs the following light pattern: Left LED on for two seconds, both LEDs
off for two seconds, right LED on for two seconds, both LEDs off for two seconds, both LED
on for two seconds, and finally, both LEDs off for two seconds. The VI program operates
continually until it is terminated by the user.

The company wants your group to present the answers to the following questions about the
project.

• What is the voltage required to light each LED?


• What instruments are required for the experiment?
• How are the instruments and LED connected together for use with the VI program?
• What are the details of the LabVIEW VI program? How does it work?
• Could the VI program be modified to allow the user to adjust the timing? How?
• Were there any problems faced in writing the program?
After the presentation, the company may have a few additional questions for you.

11
Presentation Question 5
An engineering company has contracted your group to write a LabVIEW VI to monitor and
display the output of a potentiometer (variable resistor). Specifically, the VI displays the
potentiometer knob and indicator on the computer screen. As the knob is turned, the
corresponding indicator position is changed on the computer screen.

Additionally, the company wants the VI to display four lights indicating if the knob indicator
is in the first quarter, second quarter, third quarter, or fourth quarter of the knob range.

The company wants your group to present the answers to the following questions about the
project.

• What is the maximum and minimum range of the potentiometer?


• What instruments are required for the experiment?
• How are the instruments connected together for use with the VI program?
• How did you determine when the knob indicator is in the first, second, third or fourth
quarter of the potentiometer range?
• What are the details of the LabVIEW VI program? How does it work?
• Could the VI program be modified to display eight lights? How?
• Were there any problems faced in writing the program?
After the presentation, the company may have a few additional questions for you.

12

You might also like