0% found this document useful (0 votes)
33 views8 pages

Lab 09 Dac

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 8

LABORATORY EXPERIMENT #9

A FOUR-BIT DIGITAL-TO-ANALOG CONVERTER

Discussion: In this laboratory experiment section, we will investigate a four-bit Digital-toAnalog Converter (DAC) circuit and, in the process, further consider op-amps.
Digital-to-Analog Converter (DAC): A DAC is a device that takes a digital word (ones and
zeros) and converts it into an analog voltage, say within the range from 0 to 10V. Special
integrated circuit (IC) chips are designed to do this, but we will look at the basic building blocks
to understand how the ICs work. An example of an 8-bit digital word is 10001101 and this word
may represent some analog value that we wish to transmit out of the computer. The decimal
equivalent of that digital word is found by treating each one or zero as the weighting factor for
two taken to various powers. For example 10001101 is evaluated by as follows:
1( 27 ) + 0 ( 26 ) + 0 ( 25 ) + 0 ( 24 ) + 1( 23 ) + 1( 22 ) + 0 ( 21 ) + 1( 20 ) = 141
Now we may wish to have that word control some electric actuator, so we need to convert it to
the analog world (to an actual voltage). The circuit we will be considering is given in Figure 1.
Note that it consists of an R2R ladder network (that we know something about), an op-amp, and
a series of jumper wires that we can locate in either in the ground bus or in the virtual ground
bus. A jumper in the ground bus is considered a '0' while a jumper in the virtual ground bus is
considered a '1'. Thus, the status of the four switches will represent a four-bit digital word,
D3 D2 D1 D0
pt. A

pt. B

1%
2R
1%

pt. C

1%
2R
1%

pt. D

1%
2R
1%

2R
1%

2R
1%

-10V
D3

D2

D1

D0
R 1%

Ground
"0"
"1"

+15V

Virtual Ground

6
3
-15V

Figure 1. DAC Consisting of R-2R Ladder and Current-to-Voltage Amplifier

The decimal equivalent of this word is given by


D3 ( 23 ) + D 2 ( 2 2 ) + D1( 21 ) + D0 ( 20 )
The leftmost entry of the digital word (D3) is termed the Most Significant Bit (MSB) it
controls the weighting of two raised to the highest power. The rightmost entry of the digital
word (D0) is termed the Least Significant Bit (LSB) it controls the weighting of two raised to
the smallest power, namely 20 .
Note that the virtual ground bus directly connects to the inverting terminal of the op-amp. As we
saw in Lab #8, an active op-amp will have a very small voltage between its inverting () and
non-inverting (+) terminals. As a result with the non-inverting terminal grounded, the inverting
terminal of op-amp #1 appears to be at ground (~0V). What this means is that regardless of
which position we place a given jumper, the R2R network "sees" the same result (a path to
ground). The only difference is going to be the size of the current routed along the virtual bus to
the op-amp. Now since no current can enter the inverting terminal of the op-amp (it appears as an
open circuit), we find that the output voltage for this op-amp is simply
Vout = RI virt
where Ivirt is the total current flowing on the virtual ground bus (hence the name current-tovoltage amplifier). To get a sense for what this value will be, calculate the theoretical current
flowing down through each jumper position (again remember, at either jumper position, the
connection is at 0V):
Current Thru D3: _____________
Current Thru D2: _____________
Current Thru D1: _____________
Current Thru D0: _____________
In order to achieve this ideal division of current, the R-2R ladder employs high-precision
resistors and we require a very accurate 10V source. As per our work in Lab #8, we learned
that a voltage divider has a certain Thevenin Resistance which will disrupt the above
calculations. Therefore, we are going to use a voltage divider network coupled with a Voltage
Follower circuit to obtain the precision 10V supply.
Section A. Hardware Implementation and Testing of the DAC
1. Build the voltage divider /buffer circuit illustrated in Figure 2. Use the Resistance
Substituter Box for the 1% 20k-ohm resistor. Energize the op-amp and the voltage divider
using the proto-board power supplies.

2. Measure the output voltage using the Keithley DMM (adjust the measurement range for the
greatest accuracy). If necessary, tweak the variable resistance so that the output is as close to
10.0000V as possible.

-15V
10k
1%

+15V

2
20k
1%

6
3

10V
-15V

Figure 2. Voltage Divider with Buffer Circuit


3. Build the R-2R ladder network illustrated in Figure 1. Use R=10k and 2R=20k. (Note, at
the bottom of each 2R resistor there will be a jumper which can go either to our circuit
ground bus or to a VIRTUAL GROUND bus. It is probably easiest to do this by assigning
contiguous vertical busses of the proto-board as the ground bus and the virtual bus. Note
further, that the proto-board power supply ground (black terminal) must be connected to this
ground bus.
4. Connect the virtual ground bus to the current-to-voltage converting amplifier as shown in the
figure. The power supplies for this second op amp may be the same as those used for the
first (the buffer).
5. Connect the first circuit (the voltage divider/buffer network) to the input of the R-2R ladder
network. All jumpers in the ladder network should be in the ground bus (all "0"). Since no
current flows along the VIRTUAL GROUND bus in this state, the output should be zero.
Measure the output and record the value in the following chart (Table 1). Also measure the
voltages at points A, B, C, and D of the ladder to confirm that the ladder is operating
properly (see Lab #3).
Voltage at Point A: _____________
Voltage at Point B: _____________
Voltage at Point C: _____________
Voltage at Point D: _____________
6. By iteratively changing the jumper positions, complete Table 1. After evaluating the
theoretical output voltage, compute the percent error. After completing a couple of entries,

have the instructor verify your set-up and data. Have the corresponding theoretical output
voltage values calculated for comparison purposes.
INSTRUCTOR VERIFICATION: __________________
Table 1. Four-Bit DAC Data
D3

D2

D1

D0

Decimal
Equivalent

10

11

12

13

14

15

Vout
Theoretical

Vout
Measured

Percent
Error

7. What is the resolution for your DAC? That is, how much does the DAC output change for
a change in one Least Significant Bit (LSB)? __________________
8. For one of the DAC positions, confirm that the inverting terminal of the current-to-voltage
amplifier is at virtual ground (make sure to set your DMM for the finest resolution as this
number should not be precisely zero): _____________
9. Given your output data, come up with an expression for Vout in terms of the decimal
equivalent of the binary word and the resolution value identified in part 7.

10. De-energize the proto-board. DO NOT DISASSEMBLE your circuit. We will use it in the
final exercise of this lab!

Section B. RC Network Time Constants


Discussion: A capacitor is a device that consists of two metallic surface plates separated by a
dielectric. Ideally, the dielectric is a perfect insulator, so that it prevents charge flow inside the
capacitor. When a voltage source is connected to a capacitor, the source draws free electrons
away from the plate at the higher potential and deposits an equal number of additional electrons
on the plate at the lower potential. Charge displacement creates an electric field between the
plates, and this electric field holds energy supplied by the source. The governing equation that
models the terminal characteristics of the capacitor is given by
ic = C

dv c
dt

where the current ic is a displacement current because it represents the change of displaced
charge on the capacitor plates rather than internal charge flow through the dielectric. As the
above equation indicates, in the steady state with a constant voltage across the capacitor, no
current will flow indicating that the capacitor ultimately appears as an open circuit to DC. The
energy (in joules) stored in the electric field of the capacitor is given by
1
Wc = Cvc2
2
Capacitors are used to filter, couple, tune, block DC, pass AC, bypass, shift phase, isolate, store
energy, and suppress noise. They are typically categorized according to the type of dielectric
material. Thus, we have ceramic capacitors, film capacitors, and electrolytic capacitors.
Ceramic disk capacitors have plates coated with metal and are typically used in bypassing and
coupling applications. They are normally available as a small capacitor in the range of 5pF to
50nF. Larger capacitances are achieved by rolling sheets of metal foil and flexible dielectric into
a tubular shape. The film capacitors are normally available in the range of 1nF to 5 F and are
usually used in high-frequency circuits. Electrolytic capacitors provide even more capacitance
per volume because the dielectric is an extremely thin oxide layer formed on aluminum or
tantalum foil. However, the oxide can be destroyed by excessive voltage or the wrong polarity
of voltage (thus care must be taken when inserting them into the circuit). Electrolytic capacitors
are available in the range of 1 F to 1F, and they are commonly used in power supply filtering
applications.
We wish to explore the transient or charging characteristics of capacitors. For instance,
consider the circuit illustrated in Figure 3. With zero charge initially on the capacitor, when the
switch is closed, displacement current flows and the capacitor charges up. Clearly following this

t=0

Vs

vc

Figure 3. A Simple RC Charging Network


transient period, the capacitor must ultimately look like an open-circuit to DC and no current
will flow. Therefore, the final voltage on the capacitor must be the supply voltage. Given the
constitutive relationship for the capacitor involves a derivative term, it is not surprising that a
differential equation governs the charging process, where the solution to this differential
equation is given by
t

vc = Vs 1 e

where is termed the circuit time constant, and in this simple case, is given by the product RC.
The following exercises will allow us to explore this relationship and use it to perform a timing
application.
1. With the proto-board de-energized, build the circuit illustrated in Figure 3. Use a 1000uF
aluminum electrolytic capacitor for C (note that the +-side should be on the top) and the
series combination of a 10k-ohm 1% resistor and the resistance substituter box for R. The
proto-board +5V supply will serve as the input voltage. With the Keithley DMM, measure
the open-circuit voltage of the +5V supply. The proto-board power switch will be used to
implement the step turn-on of the supply voltage.
Open-Circuit +5V Supply Voltage: __________
2. Use the Keithley DMM to monitor the capacitor voltage. In order to achieve a time constant
of 20 seconds, calculate the required setting of the resistance substituter box.
Rsub = ____________
3. Program the above value in the resistance substituter box and have the instructor verify
your circuit. Given the equation above, calculate the capacitor voltage we would expect at
one time constant and then at two time constants:
VC _1 = ___________
VC _ 2 = ___________

INSTRUCTOR VERIFICATION: ________________


4. With the stop-watch provided, energize the proto-board supply and measure the time it takes
for the capacitor voltage to rise to the values identified in Step 3.
Time to VC _1 = ___________
Time to VC _ 2 = ___________
Note the final value that the capacitor voltage asymptotically approaches.
VC _ final = ___________
Switch off the proto-board supply and note how the capacitor voltage decays. The capacitor
is discharging through the internal output resistance of the de-energized supply.
5. If necessary, adjust the resistance substituter box and repeat Step 4 so that one time
constant is 20sec and two time constants is 40sec. Record the refined value of resistance
here. Note, if there is some imprecision in the value of the capacitor or if there is some
appreciable internal resistance associated with the proto-board supply, then a slight
adjustment in the R value might be required.
Rsub _ new = ______________
6. Finally, we want to illustrate how we can use this RC charging circuit, together with our
DAC and the LM311 comparator, to create a programmable timer network. Consider the
circuit illustrated in Figure 4. Note that we will use the output of the DAC to establish a
threshold on the non-inverting terminal of the LM311. The capacitor charging voltage is
applied to the inverting terminal of the LM311. Therefore, initially with the capacitor
voltage zero, the output of the LM311 is open-collector and no current flows through the
LED. Once the capacitor voltage exceeds that of the DAC output, the LM311 output is at
ground and current flows through the LED. Thus, we can program different threshold
voltage levels with the DAC and create an adjustable turn-on time for the LED.
7. Build the circuit shown in Figure 4. Note that we will now use a jumper to connect the +5V
supply to the RC components. This allows us to energize the rest of the components prior to
the charging process. Set the DAC output voltage to provide a turn-on delay time of
approximately 40sec. Record the DAC input word here:
DAC Input Word for 40sec delay: ____________
8. Connect the +5V supply to the RC circuit (via a jumper) and measure the achieved delay.
Delay Time: ___________

9. De-energize the proto-board. Note that the capacitor voltage discharges to 0V. Remove the
jumper connecting the +5V supply to the RC components. Reset the DAC to provide a turnon delay of approximately 20sec. Record the DAC input word here:
DAC Input Word for 20sec delay: ____________
10. Energize the proto-board. Connect the +5V supply to the RC network and measure the
achieved delay.
Delay Time: ___________
11. De-energize the proto-board. Note that the capacitor voltage decays to 0V. Remove the
jumper connecting the +5V supply to the RC components. Reset the DAC to provide a turnon delay of approximately 10sec. Record the DAC input word here:
DAC Input Word for 10sec delay: ____________
12. Energize the proto-board. Connect the +5V supply to the RC network and measure the
achieved delay.
Delay Time: ___________
13. De-energize the proto-board and disassemble your circuit. Make sure to return the precision
resistors, LED, op-amps, and comparator to the appropriate bin drawers. Return the protoboards, DMM, proto-wire boxes, and resistance substituter box to the appropriate lab
cabinet.

+15V
DAC
Output

741

+5V
+15V
8

-15V

130 5%

jumper

Green

LM311

vc

5V

6
4
-15V

Output

Figure 4. Adjustable LED Turn-On-Time Circuit

You might also like