Chapter 4 Computerized Data-Acquisition Systems
Chapter 4 Computerized Data-Acquisition Systems
Chapter 4 Computerized Data-Acquisition Systems
Lecture Notes
Computers so facilitate the process of data acquisition that they are the appropriate tool for
a very broad spectrum of experiments. In this chapter we describe the basic components and
operation of computerized data-acquisition systems.
1
4.1. INTRODUCTION
As in other aspects of technology, computers have had a major impact on the field of data
acquisition. Since the late 1950s, computers have been used to monitor, and in many cases to
control, the performance of large process plants such as refineries and chemical plants and to
acquire data in major testing programs such as the space pro gram. These systems were
extremely expensive and required highly skilled personnel to set them up. In the late 1960s,
lower-cost computer data-acquisition systems became available for smaller tests, but since
they were still difficult to set up and program, their use was limited. The appearance in the
late 1970s of the simple and reliable Apple II personal computer led to inexpensive and simple
data-acquisition systems that could readily be used for small experiments. Personal computer
systems (mostly using the Windows® operating system) are now so capable that they can be
used for a significant fraction of all engineering testing.
Computers significantly enhance the process of data acquisition, largely because of their
versatility and speed. Computers manage the acquisition of data from multiple sensors (at
high sampling rates if desired), save the data, manipulate and display the data, and, if
required, make use of the results to perform control functions. Figure 4.1 shows a block
diagram of a typical computerized data-acquisition system (DAS or DAQ) with eight channels
for the input signals. Although most transducers produce an analog voltage (at least after
signal conditioning), some transducers produce digital output. These signals do not pass
through the analog multiplexer and analog-to-digital converter but take a more direct path to
the computer (possibly through a digital multiplexer). The computer may be used to control
the process, either directly with digital signals or with analog signals from digital-to-analog
converters. The functions of these components will be discussed later in the chapter.
2
4.2. COMPUTER SYSTEMS
4.2.1. Computer Systems for Data Acquisition
The computer systems most commonly used for data acquisition in experiments are personal
computers using the Windows® operating system. Sampling rates of over 10 million samples
per second are possible, and more than 3000 separate sensors can be sampled (although not
in the same system at the same time). Several major companies supply software and hardware
to make a personal computer into a data acquisition system, and some of the hardware is
available in low-cost generic form. Generally, a board is designed to plug into an interior bus
of a personal computer and a shielded box for connecting the transducers used for the
experiment. This board not only permits reading the output of various transducers, but also
has outputs for control of the experiment if required. By carefully selecting suppliers,
integrating the systems and software can be seamless, making implementation
straightforward. Hardware and software are also available for the Macintosh® personal
computer systems.
In some cases, the performance of personal computers is not sufficient, and higher
performance computers called workstations and servers are more suitable. Data-acquisition
hardware and software are readily available for these computers. These higher performance
systems often use operating systems such as Unix instead of Windows®.
For monitoring and controlling many production systems, specialized embedded computers
are used. Probably the most common embedded computers are those used for fuel control in
modern automobiles. However, embedded computer systems are used in a wide variety of
devices from medical imaging equipment to assembly-line robots.
3
Figure 4.3 is a block diagram of these components.
The central processing unit (CPU) controls all aspects of computer system operation and
performs all of the arithmetic operations (multiplication, addition, etc.). The CPU operations
follow instructions contained in the user-provided program. The CPU also follows instructions
from the computer operating system programs and from built in programs.
Most personal computers have a single central processor, but may have similar processors
controlling certain peripheral devices, such as the display or keyboard. However, since there
is only one central processor, for the most part, computers execute instructions in a sequential
manner. That is, only one instruction can be executed at a time.
The program provides a set of instructions that cause a computer to perform a specific
function. The program is often known as software to distinguish it from the electronic and
mechanical components of the computer, known as hardware. Software may either be written
by the user completely, or it may be commercial software in which the user only specifies
certain inputs. In some cases (and commonly in the data-acquisition field), the user may
combine his or her own programming and commercial software.
The random-access memory is a subsystem of the computer that can store information
temporarily. In particular, it stores the program instructions and numerical data when the
computer is being operated. RAM is made up of purely electronic components with no moving
mechanical parts, and as a result, it can supply information to the central processor at a very
high rate (and store information at the same rate). The information in RAM can readily be
changed by the CPU. RAM is volatile, and all stored information is lost when the computer
power is interrupted. Consequently, pro grams and data are permanently stored in mass
storage devices. (See next paragraph.) There is normally another kind of memory in a
computer, read-only memory (ROM), used for permanent storage of information required by
the computer to operate. The user cannot normally modify information stored in ROM.
Mass storage devices are used to store large volumes of information, such as numerical data
and programs, in a permanent or semi-permanent form. The most common mass storage
device is the hard drive where information is stored in magnetic form on rotating metal discs.
Solid-state drives (SSD, or Flash Drives) in which information is stored on fixed semiconductors
4
are now becoming common. However, manufacturers have made the hard drive a moving
target by continuously increasing speed, reliability, and capacity.
Another technology is the optical disk storage device. The primary advantage of these devices
(which are based on the same technology as that used in audio compact disks) is that they
store very large volumes of data. Optical disks can be used to store large databases such as
library indices and encyclopedias. They can also serve as an everyday medium for file storage.
The display (or monitor or screen) system usually uses a liquid crystal display (LCD). The display
shows the user a limited amount of information and is also used to prompt the user for
required input or actions.
The most common user input device is the keyboard. The user simply types required
information. However, a "mouse" or a similar device is often used to point to regions on the
screen to communicate with the computer. Some computers have what are known as touch
screens, in which the user can touch regions of the screen to communicate.
Usually, computers have some kind of printer in order to produce printed output (hard copy).
The method of printing depends on the quantity and quality of printing required. Optical
devices such as laser printers are common for all types of computers. Moderately priced ink
jet printers usually have the capability to print in color, which is often desirable in
experimental work.
Computers also have features that enable the user, optionally, to connect to other devices.
Inside the computer, it is possible to connect to the bus, a series of conductors connecting the
internal components of the computer. Outside the computer, there are generally plug
connections known as ports, which are connected to the bus internally. The components that
convert a computer to a computerized data-acquisition system connect either directly to the
bus or to one of the ports.
Example 4.1.
5
Convert the 8-bit binary number 01011100 to decimal.
Solution: In moving from left to right, the bits represent 27, 26, 25, 24, 23, 22, 21 and 20. Hence
to get the decimal equivalent, we simply have to add the contributions of each bit.
Example 4.2.
Find the 8-bit binary number with the same value as that of the decimal number 92.
Solution: This problem can be solved by a series of divisions by 2:
Remainder
2/92 0
2/46 0
2/23 1
2/11 1
2/5 1
2/2 0
2/1 1
0
The answer is contained in the remainders. The top number is the least significant bit, and the
bottom number is the most significant bit. The answer is, thus, 1011100. However, we are
asked for an 8-bit number, so the most significant bit is 0 and the answer is N2 = 01011100
In Examples 4.1 and 4.2, binary numbers are used to represent positive decimal integers.
However, it is also necessary to represent negative numbers and floating point numbers (such
as 3.56 X 103). Special techniques are used to represent these numbers.
Negative numbers are most commonly represented inside computers by a technique known
as 2's complement. As noted above, 4 bits can be used to represent the decimal integers 0 to
15. These same 4 bits can alternatively be used to represent numbers from - 8 to +7. The
positive numbers from 0 to 7 are represented by the three least significant bits, ranging from
0000 to 0111. The negative numbers from - 8 to -1 are represented by the binary numbers
1000 to 1111, respectively. For positive numbers, the most significant bit is always 0, while it
is always 1 for negative numbers. To convert a negative decimal integer to 2's-complement
binary, the following procedure can be followed:
6
1. Convert the integer to binary as if it were positive.
2. Invert all of the bits-change 0's to 1's and 1's to 0's.
3. Add 1 LSB to the final result.
This process is demonstrated in Example 4.3. While 2's complement may appear to be an
awkward method to represent negative numbers, computers can perform arithmetic very
efficiently using this numeric representation.
Floating-point numbers are handled by keeping separate track of the two parts of the number,
the mantissa and the exponent. Separate arithmetic operations are per formed on the two
parts, similar to hand calculations.
Example 4.3
Convert the decimal integer -92 to an 8-bit 2's-complement binary number.
Solution: In Example 4.2 we converted +92 to binary and the result was
01011100
Next we invert all the bits, to obtain
10100011
and then add 1 to obtain the final result, 10100100.
In most computerized data-acquisition-system applications, the user will not actually need to
use binary numbers. This is because the interface between the user and the computer
normally makes binary-to-decimal or decimal-to-binary conversions automatically. When a
user requests that a number stored in the computer be printed out, the computer converts
the internal binary number to decimal prior to printing. Similarly, when a decimal number is
typed on the keyboard, it is converted to binary before it is stored in the computer. Although
the DAS user will not frequently convert bases between binary and decimal, it is necessary to
be familiar with the binary number system to understand the operation of some system
components.
When computers communicate with the outside world through various input/out put ports,
other binary codes are often used that differ from the internal code. One common code used
in computers is known as the American Code for Information Interchange (ASCII). In this
code, 8 bits are used to represent up to 256 characters. The first 128 of these (0 to 127) are
standardized. For example, the character lowercase k is represented by the binary number
01101011, which has the decimal value 107. Codes 0 to 32 are special control characters and
are not shown. While ASCII-coded data are used to transfer information, they are not useful
for arithmetic operations.
7
related systems) are required. If it is necessary to control the experiment (or process), the
computer must supply outputs in digital or analog form. If the required control signal is analog
(to control such components as valves and heaters), the computer-system digital output must
be processed through a digital-to analog converter.
4.3.1. Multiplexers
As mentioned above most computers perform instructions in a sequential manner. Thus, the
simplest method to take data is to read the outputs of the sensors sequentially. In most cases
the computer reads information from the various channels one at a time using a device called
a multiplexer (MUX). The MUX, as used in this application, is essentially an electronic switch.
The computer instructs the MUX to select a particular channel, and the data are read and
processed. The computer then causes the MUX to select another channel, and so forth. A
mechanical analog to the DAS multiplexer is shown in Figure 4.4. The switches in the
multiplexers used in data-acquisition systems are semiconductor devices.
8
for example, charge a capacitor to 5 V. In a digital device, 5 V will be represented by a digital
code (a digital binary number such as 0101), which is stored on bistable flip-flops. The actual
digital coding scheme used to represent an analog voltage is well defined in a particular
situation, but is not universal.
Most transducers generate an analog output signal. For example, a temperature transducer
might generate an output voltage that is proportional to the sensed temperature. If the
temperature were to be varied in a continuous manner, the transducer output will show a
continuous variation. There are possibly an infinite number of possible output values. The
analog-to-digital converter (A/D converter or ADC) is the device required in data-acquisition
systems to convert the analog transducer signals into the digital code used by the computer.
The digital representation of the value of the transducer output is a code that is related to the
analog transducer output but does not describe the output exactly. For example, we could
connect the output of the transducer to a relay, which in turn operates a light bulb. If the
voltage is less than or equal to 5 V, the bulb is off. If the transducer output voltage is greater
than 5 V, the bulb is on. The on-off status of the light bulb is a digital code that crudely
represents the transducer output. Similarly, the output of the transducer could be
represented by two light bulbs. There are four possible states for the pair of light bulbs:
Bulb 1 Bulb 2
V < 2.5 off off
2.5 < V < 5.0 off on
5.0 < V < 7.5 on off
7.5 < V on on
With two light bulbs, the transducer output is now represented more accurately in digital form
than with a single light bulb. These light bulb devices represent primitive forms of analog-to-
digital converters. The single-light-bulb device is a 1-bit A/D converter, and the two-light-bulb
device is a 2-bit A/D converter. A bit has two possible states, on or off. Inside a computer, flip-
flops instead of light bulbs are used to represent these states.
In general, the output of an analog-to-digital converter has 2N possible values where N is the
number of bits used to represent the digital output. The 1-bit device has two possible output
states, 0 and 1; and the 2-bit device has 22 = 4 possible output states (00, 01, 10, and 11 in
binary representation). Computerized data-acquisition systems usually use A/D converters
with at least 8 bits, where the number of possible states is 28 (which equals 256). The possible
states are then represented by binary numbers with values between 00000000 and 11111111.
An example of the output is 10000001. Since there is a direct conversion between binary (base
2) and decimal (base 10) numbers, this output of 10000001 could be stated as 129 in decimal.
The actual physical representation at the output of the A/D converter is, however, binary.
9
4.3.3. Practical Analog-to-Digital Converters
The most common type of A/D converter used in computerized data-acquisition systems, the
successive-approximations converter, employs an interval-halving technique. In this device a
series of known analog voltages are created and compared to the analog input voltage. In the
first trial, a voltage interval of one-half the input span is compared with the input voltage. This
comparison determines whether the input voltage is in the upper or lower half of the input
range. If the input voltage is in the upper half of the range, the most significant bit is set to 1;
otherwise it is set to zero. This process is repeated with an interval half the width of the
interval used in the first trial to determine the second most significant bit, and so forth until
the least-significant bit is determined. This process is shown graphically in Figure 4.8, and
Example 4.8 shows a numerical simulation. For an 8-bit converter, only eight comparisons are
needed, and in general, for an N-bit converter, only N comparisons have to be made. Hence
the device is very fast even for converters with large values of N (such as 16 or 18). A typical
12-bit successive-approximations converter can complete a conversion in 10 to 25. A block
diagram of a successive-approximations converter is shown in Figure 4.9. (The digital to-
10
analog converter component, which creates an analog signal to compare with the input signal,
is described in the next section.)
11
temperature, monitor the temperature until it has stabilized again, and then acquire more
data.
Most devices used to control a system, such as solenoids, heaters, and valves, are analog
devices. These devices operate on the basis of an analog input voltage. To operate these
devices under computer control, the computer digital signals must be converted to analog
signals. If the analog device is simply an on-off component, digitally controlled relays can be
used. If the analog device requires proportional control, then a digital-to-analog converter
(D/A converter or DAC) is required. As shown schematically in Figure 4.12, the various bits of
the digital output signal are used to operate a set of electronic switches. In Figure 4.12 there
are four bits and four switches. The resulting analog output voltage will be proportional to the
digital input number. D/A converters are specified like the A/D converter-the number of input
bits, the analog output range, and the conversion speed. As for A/D converters, a number of
digital codes are also used.
Generally, the output electrical power of a D/A converter is insufficient to directly operate
most control devices, such as proportional valves. Consequently, the output of the converter
will be used to operate an amplifier, which will in tum supply the power for the activated
control device.
14
4.4.3. Digital Connectivity
There are a large number of standard connections between digital devices and it is not
possible to review all of them here. A brief summary of the most common types of connections
is given below. The nature in which each of these standards transmits a digital signal varies,
but typically is based on sending pulses at a synchronized frequency or clock. In this fashion,
the voltage level might be read periodically (e.g. every 10 nsec for a 100-MHz clock signal)
with its value (high or low) constituting a single bit. The technical details of each standard
define a large number of items including how the clock signal is synchronized between the
transmitter and receiver, rules for handshaking between devices (making sure the devices are
communicating), voltage levels, connection types, number of lines, etc. Modern standards
allow for two-way communication, backward compatibility and power delivery. Most
components found in a data-acquisition system are typically offered in several formats,
providing the user with a significant amount of flexibility in system design.
Many DAQ components are offered with external connecting options via a cable using such
standards as universal serial bus (USB), IEEE1394 (i.e. firewire), Ethernet, RS-232, RS-422, and
IEEE488 (GPIB).
From a data-acquisition point of view, the user is typically concerned with the speed and
length over which the data can be transferred from the external device to a computer. Table
4.3 lists typical specifications for each standard. In many cases, the transfer rate and cable
length depend on other factors such as the type of cable and the presence of electromagnetic
noise in the system. Repeaters and hubs can also be used to
extend the length. Recent advances in fiber-optic based communications have increased these
distances significantly. Each family of standards has a unique connector design that allows one
to quickly identify the type of device being used and prevents accidental connection to other
types of connections. Many standards (e.g. USB and Firewire) are backward compatible such
that a device based on the old standard can be connected to a device or computer designed
using the more recent standard, albeit with the speed limited to that of the old specification.
In addition, most recent standards have a provision for delivering DC power to the connected
device, eliminating the need for an external power source for devices requiring relatively low
power.
15
More recently, wireless connections between devices have become prevalent. The most
common standards found in home networks are IEEE802.11b and IEEE802.11g, which allow
devices to connect over a limited distance. In addition, cellular networks are also allowing
many devices to connect to a computer remotely via the Internet. The length and speed of
wireless connections depend greatly on the strength of signal between the host and receiver
and generally are significantly slower than their hardwired counterpart. Wireless connections,
however, allow for mobility such that a measurement system is not confined to a single
location. For example, a technician may be able to travel to a remote site with a handheld
device and upload the data to a central computer.
16
Labview design interface
17
signals on a single screen or perform mathematical operations on the signals. While this
example would be straight forward to implement for even a lightly trained programmer, it
would still take time and resources to implement and may be an overkill for certain tasks. As
such, the system engineer must balance the function of the device with the cost.
18
is a specialized data logger and provides important information after accidents. Recent
automobiles often include a data logger that records a small amount of speed and other data
just before and after an accident (may be part of the airbag system). The following are some
common characteristics of data loggers:
• A microprocessor and memory (often nonvolatile)
• A limited number of channels (4-8 being common)
• Low sampling rates (sometimes as low as 1 sample/second)
• Unmanned operation
• Durable packaging
• Battery or battery backup operation
• Limited or no display and no keyboard
• Connection to a personal computer for programming/setup and data download
Data loggers may have a wide variety of features such as wireless communications, connection
to the Internet, or high sampling rates over a short time span. Many systems are commercially
available, so a suitable solution for a particular application should be readily available.
19
2. Instruct the A/D converter to make a conversion.
3. Retrieve the result and store it in memory.
In most applications, other instructions are also required, such as setting amplifier gain or
causing a simultaneous sample-and-hold system to take data. The software required depends
on the application.
20