approximation of “011” or 3V
is compared with 3.25V and
again this is below the incom-
ing voltage. Therefore, the
1 remains and is placed in the
holding register in the LSB’s
place. So, when an analog
voltage of 3.25V is converted
in this three bit SAR, the
binary conversion is “011” or 3.
Enough Theory;
Let’s Measure!
FIGURE 3
FIGURE 4
Now let’s look at converting
analog voltages with the USB-
6008 unit. You probably noticed
that two values were given for
the number of bits used in the
A-to-D converters in the USB-
6008( 9) units. When these
converters are used in the
differential mode — that is,
two sides of an analog voltage
are fed into the converter —
they use the higher number of
bits for the conversions, with a
FIGURE 5
total of four analog inputs
possible. When they are used
in the single-ended mode or
RSE (respect to ground single
ended) mode, the conversion
bits are one less with a total
of eight analog inputs possible.
In this article, we are going
to use a 10K potentiometer, an
LM34 temperature transducer,
and an LDR (light dependent
resistor) which can all be used
in the single-ended or RSE mode,
FIGURE 7
and we are going to use a
voltage range of 0V up to +5V. Therefore, for the USB-6008 unit
the resolution will be: Resolution = (5V-0V) / (211 - 1) or 5V /
2047 = 2.44 mV. Since the LM34 changes its output by 10 mV/°F,
it will fit within the USB-6008’s A-to-D capabilities quite well.
Let’s first connect a 10K potentiometer to AI0 as
shown in Figure 2. Now let’s make a VI that will display the
analog voltage conversion result. Open a blank VI and place
a numeric indicator and a stop button on the front panel by
selecting from the controls palette: Express>Numeric
Indicators>Num Ind and Express>Buttons>Stop. In the block
diagram, open a DAQ Assistant by selecting from the functions palette: Express>Input>DAQ Assistant. From the DAQ
Assistant pop-ups, select: Acquire Signals>Analog>Voltage;
see Figure 3. Next select AI0 and finish; see Figure 4. From
the final pop-up window, set the Max to 5 and the Min to 0
and the terminal configuration to RSE as shown in Figure
5, then select OK. Place the DAQ Assistant, the numeric
FIGURE 6
FIGURE 8
indicator, and the stop button inside of a while loop on the
block diagram by selecting from the functions palette:
Programming>Structures>While Loop and wire as in Figure 6.
When you run the VI, you will see the analog voltage
change as you turn the potentiometer wiper. You can also
connect a multimeter to the potentiometer and compare its
readings against the VI display. Analog inputs can be displayed
in more graphical ways than just through a numeric indicator.
Let’s add a meter to the front panel by selecting: Express>Numeric
Indicators> Meter. Open the meter’s properties window and
under the scale tab set the maximum to five; see Figure 7.
In the block diagram, place the meter’s icon inside of the
while loop and wire it to the output of the DAQ Assistant
as shown in Figure 8. Now you have a graphical display of the
analog voltage along with the numeric indicator as in Figure 9.
Next, let’s connect the LM34 temperature transducer to
the AI0 terminal as shown in Figure 10. Be sure to remove
SERVO 06.2009
55