CARE, IIT Delhi CRP718 - 2015-16/1 Semester Experiment On PC Based Multi-Channel Data Acquisition. 1. Objectives
CARE, IIT Delhi CRP718 - 2015-16/1 Semester Experiment On PC Based Multi-Channel Data Acquisition. 1. Objectives
CARE, IIT Delhi CRP718 - 2015-16/1 Semester Experiment On PC Based Multi-Channel Data Acquisition. 1. Objectives
1. Objectives
Understand the principles of operation and limitations of the data acquisition system
including:
1. Single channel data acquisition.
2. Multi-channel data acquisition.
3. Data acquisition at different sampling rates.
4. Effects of quantization.
2. Overview
There are several ways in which the data can be exchanged between a computer and
electronic systems or instruments. Many electronic systems / instruments have a serial
port, which can exchange data with a computer or other electronic systems /
instruments. The use of GPIB (General Purpose Instrumentation Bus) interface board
allows electronic systems / instruments to transfer data in a parallel format to a
computer.
One way to interface computers with sensor signals is through Data Acquisition
(DAQ) system. A typical DAQ system can perform analog-to-digital conversion
(ADC) that allows the input of analog sensor signals to a computer in digital data
form, and digital-to-analog conversion (DAC) that allows the output of digital data by
converting it to analog signal. In addition, DAQ systems also contain several digital
input/output channels that provide digital interface between electronic systems.
3. Sampling
The data is acquired by an ADC using a process called sampling. Sampling an analog
signal involves taking a sample of the signal at discrete times. The rate at which the
signal is sampled is known as sampling frequency. The process of sampling generates
values of the signal at equal time intervals as shown in figure 1 below.
1
The sampling frequency determines the quality of the conversion from analog to
digital. A higher sampling frequency achieves better conversion of the analog
signals. The minimum sampling frequency required to represent the signal should
be greater than twice the maximum frequency of the analog signal under test (this is
called the Nyquist rate). If the sampling frequency is equal to or less than twice the
frequency of the input signal, a signal of lower frequency is generated from such a
process (this is called aliasing). Once the signal has been sampled, one needs to
convert the analog samples into a digital code. This process is called analog-to-
digital conversion, as illustrated in figure 2 below.
Most DAQ systems also have a multiplexer that acts like a switch between the
different channels of input and the ADC. Therefore with 1 ADC, it is possible to have
a multichannel input DAQ board. The system available in the lab can support up to 8
channels of analog input. This makes it possible to acquire up to 8 analog sensor
signals in parallel (however, the sampling frequency will be divided by the number of
parallel channels being used).
The resolution of the digital format signal (or data) converted from analog input
signal is dependent upon the number of bits the ADC uses. The higher the resolution,
the higher the number of divisions the voltage range is broken into, and therefore, the
smaller the detectable voltage change. An 8-bit ADC gives 256 levels (2^8) compared
to a 12-bit ADC that has 4096 levels (2^12). Hence, a 12-bit ADC will be able to
detect smaller increments of the input signals than an 8-bit ADC. The LSB or least
significant bit is defined as the minimum increment of the voltage that an ADC can
convert. If the full scale of the input signal is 10V, then the LSB for a 3-bit ADC
corresponds to 10/2^3=1.25V. However, for a 12-bit ADC, the least significant bit
will be 10/2^12=10/4096 = 2.44mV. If one needs to detect smaller changes, one has
to use a higher resolution ADC. Clearly, the resolution is an important characteristic
of the ADC.
2
board to generate analog signals, both dc and ac voltages. Like the ADC, the DAC's
performance is limited by the number of samples it can process per second and the
number of bits that are used in converting the digital data into an analog signal.
5. LabVIEW
LabVIEW programs are called Virtual Instruments, or VIs, because their appearance
and operation imitate physical instruments, such as oscilloscopes and multimeters.
LabVIEW delivers a powerful graphical development environment for signal
acquisition, measurement and analysis. It can acquire data at a specified sampling
rate. It acquires data in the background while processing in the foreground. A DAQ
system can comprise of several PCB boards that can be integrated according to user
requirements. LabVIEW integrates the different DAQ system boards in a computer
and uses various functions of a board from a single user interface. Refer to the
LabVIEW manual for more details. The driver software is a lower level driver that
interfaces the LabVIEW software with the DAQ boards. As a user of LabVIEW one
does not have to worry about configuration and control of components within the
DAQ boards. LabVIEW identifies each board by a device number and therefore one
can have as many devices (as many as the computer can accept on its expansion
slots). LabVIEW can also combine and display inputs from various sources like
inputs from serial and parallel port, data acquisition board(s), and GPIB boards on a
single interface. The user interface which is called a vi consists of two parts- a front
panel and a block diagram. This is similar to that of an instrument where a front
panel is used for input and output controls, and to display the data whereas the circuit
resides on the circuit board. Similarly, you can bring the buttons, indicators and
graphing, and display functions on the front panel. When data acquisition is
performed, the software needs to know the following information:
1. Device number
2. Channel that is being used
3. Sampling Rate.
First make sure that you can access the various palettes needed in the front panel and
block diagram as well as the areas to find the tools, controls, and functions. It should
be noted that the Controls pallet is only accessible in the Front Panel window and
the Functions Palette is only accessible in the Block Diagram window while the
Tools Palette can be used in both. The palettes can be selected while in the Front
Panel or Block Diagram window at anytime from the Window menu item. To start a
new program:
1. Open the labview software.
2. Press the New << Blank VI button with the left mouse button. Two windows
appear, one with the name Untitled 1 at the top, which is the Front Panel window,
and the other with Untitled 1 Diagram at the top, which is the Block Diagram
window. The Tools palette also appears when the program is started. To begin writing
the LabVIEW program the tasks in the Front Panel window should first be
completed followed by the tasks in the Block Diagram window.
3. If it is not already displayed, the Controls palette can be brought up by
selecting it from the Window menu item at the top of the Front Panel with
the left mouse button.
3
5.2 Writing a Waveform Acquisition Program
C. Changing some of the titles and values of some items on the Front Panel
1. Select the Edit Text tool from the Tools palette.
2. All of the following changes can be made in the same way as that used for
changing the maximum value of the x-scale with the waveform graphs above.
- Select the value or text to be changed
-Type in the new value or text and press the enter key on the keyboard,
or press the left mouse key on a blank region of the panel.
3. Change the text and values as indicated in Table 1.
4. The Front Panel Diagram window should appear as in figure 3 below. Items
can be moved by placing the cursor over the item holding down the left mouse
button and dragging the item to the new location. In order to make the current
values as the default values for this experiment, select Operate>>Make
Current Values Default and press the left mouse button.
5. The work at this point should be saved.
4
Table 1. Changes to the values or text of various items
Figure
3:
Final
arrangement
of
front
panel
controls
and
displays.
D. Programming the Block Diagram
Items in the Block Diagram window allow the program to control and access channels
on the multi-channel DAQ board, to conduct calculations on the data, and to save the
data to a text file.
1. Access the Block Diagram window.
2. Bring up the Functions palette by selecting “Show Functions Palette” from
the Window menu item at the top of the Block Diagram window.
3.
Create
a
While
Loop
by
selecting
Exec
Ctrl>>While
Loop
from
the
Functions
palette
using
the
left
mouse
button.
Place
the
mouse
cursor
at
the
position
on
the
block
diagram
where
you
want
to
anchor
the
top-‐left
corner
of
the
While
Loop
and
press
and
hold
down
the
left
mouse
button.
When
the
button
is
released
it
will
define
the
lower
right
corner
of
the
While
Loop.
Everything
inside
the
While
Loop
will
be
executed
continuously
until
stopped
by
pressing
the
Stop
button.
Notice
that
a
Stop
button
now
appears
both
on
the
Block
diagram
and
the
Front
panel.
4.
Use
the
Up
navigation
button
on
the
Functions
palette
to
navigate
back
to
the
main
Functions
palette
using
the
left
mouse
button.
5. Select Input<<DAQ Assist vi and drag it inside the While Loop. The DAQ
assistant menu will automatically appear to configure the DAQ Assist vi:
a. Select Measurement << Analog Input.
b. Select Measurement<< Voltage.
5
c. Select Physical Channel<< (the one you have chosen). Then select
Finish.
d. A window will then appear with information about the measurement
task. In the Task Timing menu select Acquire N Samples and set the
Samples to Read to 1,000. Also set the (sample) Rate at 10,000 Hz.
The click OK to end the DAQ configuration.
6. Use the Up navigation button on the Functions palette to navigate back to the
main Functions palette with the left mouse button.
7. Create an FFT analyzer by selecting Analysis>>Spectral from the Functions
palette and drag inside the While Loop. The Spectral Measurements menu
will automatically appear to configure the FFT vi:
a. Select Spectral Measurement<< Measurement (RMS), and Result
<<Linear.
b. Select Window<<None. Then click OK to end the FFT analyzer
configuration.
8. Use the Up navigation button on the Functions palette to navigate back to the
main Functions palette with the left mouse button.
9. Create a vi to save the data in a text file by selecting Output<<Write LVM
(Write LabVIEW Measurements) from the Functions palette and drag it onto
a position outside and to the right of the While Loop on the block diagram.
The Write LVM menu will automatically appear to configure the
Measurements File (if it does not right click on the Write LVM icon and
select Properties):
a. Note and (modify) the path of the File Name.
b. Check Action<<Ask user to choose file<< Ask only once.
c. Check one of the options as desired in If a file already exists.
d. Ckeck Segment Headers<<One header per segment or as desired.
e. Check X Value Columns<< One column per channel
f. Check Delimiter<<Tab and then OK to end Configuration
g. Look at Figure to see what the block diagram should look like at this
point.
10. Close the Functions palette by selecting the X in the upper right corner of the
palette with the left mouse button.
11. Select the Connect Wire tool (spool of wire) on the Tools palette (if the
Tools palette is not visible select Window>>Show Tools Palette.
12. Now the components can be wired.
6
Figure 2: Final arrangement of the block diagram
7
6. Experiment Objectives
Objective 2: Generation of sine wave from function generator and acquiring with
DAQ using two different sampling rates (2 kHz, 8 kHz).
Function DAQ PC
Generator
Step 2: Program Labview to acquire and store the signal in a notepad at a specified
sampling frequency. The signal spectrum is also plotted. The steps to be followed are
given below.
1. Verify that there is a BNC cable connected to the analog input channels on
BNC 2110.
2. Verify that the switch below the channel BNC is all the way to the right in
GS position.
Step 3: Repeat the above steps again by using the input amplitude of 1V.
Step 4: Note down the clipping and noise level.
Step 5: Comment on the results.
Objective 3: Loop back test: Generation of signal on PC and acquiring the signal
from sensor at PC again with different sampling rate.
PC DAQ PC
Step 1:
1. Program Labview to generate a sine wave of 1.3 kHz at 10V.
2. Plot the spectrum of the generated signal.
3. Program Labview to output this sine wave using out port of DAQ
8
4. Also program to receive it back using in port of DAQ.
5. Use the previous programs to acquire it at different sampling rates.
6. Plot the spectrum of the acquired signal.
7. Note down the clipping and noise level.
8. Comment on the results.
9. Repeat the above steps at a lower input voltage of 1V.
Step 2:
1. Generate square waves of 30% duty cycle.
2. Repeat the above loop-back test with specified sampling frequencies.
3. Plot the spectrum.
4. Comment on the results.
Objective 4: Generation of sine wave from function generator and acquiring the
signal from the sensor with a DAQ onto a PC using different sampling rates.
Function Power
u Pre- DAQ PC
Generator amplifier
amplifier
Tx-Rx
Steps:
1. Generate sine wave of 25 kHz at 10V using function generator.
2. Propagate this signal to the transmitter using a power-amplifier and
amplify the received signal appropriately using a pre-amplifier.
3. Acquire the signal in the PC using DAQ with sampling rate of 30kHz, and
150kHz.
4. Plot the spectrum of the output. Label the x-axis in kHz.
5. Comment on the results.
Objective 5: Measure and plot the magnitude spectrum of the transducer, using the
above approach. Use sampling rate of 150 kHz. The band under test can be swept at
intervals of 10 kHz with finer sampling of 5 kHz near the peak of the spectrum.
Self-study Component