ECE 1250 Lab 3 Measuring - Canvas

advertisement
ECE 3300 Lab 2
ECE 1250 Lab 3
Measuring: Node Voltage
Building: Digital-to-Analog Converter Circuit
Designing: Digital Voltage Reference
Overview: In this lab you will:
• Build an R-2R ladder Digital-to-Analog converter for converting binary numbers to
analog voltages
• Measure voltages.
The Digital-to-Analog (D/A) circuit you build in this lab is like the one in your MP3
player that turns a series of stored binary numbers (patterns of 1's and 0's) into voltages
that represent a music waveform. The 1's and 0's are just voltages that are high (+15 V in
our case) and low (0 V). In this lab, you will use dip switches to connect inputs of a
circuit to a 1 (+15 V) or to a 0 (0 V = reference).
Our D/A circuit will have three binary inputs, which allows us to have eight binary
patterns of input: 000, 001, 010, 011, 100, 101, 110, 111. For each binary input, our
circuit will output a different voltage. Thus, we are building a digital power supply. This
circuit will output a voltage equal to the binary number input times 15V/8.
Equipment List:
• MyDAQ board with cables. (You can hook them to the lab computers if you don’t
want to bring your laptop.)
• Multisim software.
• From previous labs:
o Breadboard & wire kit
• Additional parts:
o 7 Resistors: values to be determined in lab
o Dip switch module (optional but convenient)
Instructions & Reference Material:
• MyDAQ as voltmeter
https://utah.instructure.com/courses/266578/assignments/1347122
• Multisim demos : See DVD in back of your book.
Prelab: Analyze D/A and Solve Using MATLAB (35 points)
1. The Digital-to-Analog (D/A) converter circuit that constitutes our digital power
supply is shown below in Fig. 1. Find Node-Voltage equations for the D/A circuit.
Use node voltages vA, vB, and vD/A in your equations. (Note that we add a node for
vD/A as though it were an essential node. This is convenient because it is the circuit
output. We can, of course, add nodes wherever we like.) Use symbolic names for v0,
v1, and v2 in your equations.
1
UNIVERSITY OF UTAH DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING
50 S. Central Campus Dr | Salt Lake City, UT 84112-9206 | Phone: (801) 581-6941 | Fax: (801) 581-5281 | www.ece.utah.edu
ECE 1250 LAB 3
Fig. 1 R-2R ladder D/A circuit with 3 inputs.
You should find that you can multiply both sides of your equations to cancel out R.
In other words, the output voltage does not depend on R. This means that, so long as
the ratios of the resistor values is precise, the particular value of R does not matter. It
turns out that we can control the ratios of resistances precisely on integrated circuits,
but not the value of R. Thus, we can make very accurate D/A converters even though
we cannot make accurate resistors!
WRITEUP: Show your derivation in your lab notebook.
2. Now rearrange your equations to put them in matrix form, and verify that you get the
following matrix equation:
⎡ 2
−1
0
⎢
⎢ −1 5 / 2 −1
−1 3 / 2
⎢⎣ 0
⎤ ⎡ vA
⎥⎢ v
⎥⎢ B
⎥⎦ ⎢ vD/A
⎣
⎤ ⎡
⎥ ⎢
⎥=⎢
⎥ ⎢
⎦ ⎣
v2 / 2 ⎤
⎥
v1 / 2 ⎥
v0 / 2 ⎥
⎦
(1)
Use MATLAB to solve (1) and determine the expected output voltage, vD/A, from the
circuit when the input voltages are the following:
v0 = 15 V (binary 1)
v1 = 0 V (binary 0)
v2 = 15 V (binary 1)
WRITEUP: Tape a copy of your MATLAB code and results into your lab
notebook.
3. Use Multisim, as described in the next section, to simulate the D/A circuit. If you do
not have Multisim running on your PC yet, then do the Multisim simulation on the lab
computers.
2
UNIVERSITY OF UTAH DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING
50 S. Central Campus Dr | Salt Lake City, UT 84112-9206 | Phone: (801) 581-6941 | Fax: (801) 581-5281 | www.ece.utah.edu
ECE 1250 LAB 3
Experiment 1: Simulate D/A Circuit Using Multisim (15 points)
Multisim: Use the Multisim circuit file for this lab provided on the class Canvas site to
simulate the R-2R ladder circuit and compare the output voltage with the results from
Prelab part 2: Lab3_DAconvertr.ms12. (You should find that vD/A is proportional to the
input number in binary.)
WRITEUP: Fill out the following table in your notebook using binary numbers of
your choice for lines 2-4:
number
binary
vD/A
5
101
Experiment 2: Design, Build, and Measure D/A Circuit (50 points)
1. Design: The R-2R ladder D/A circuit is shown above in Fig. 1. The value of R
cancels out in this circuit. That is, vD/A does not depend on the value of R. In
practice, however, we want a value of R that will result in currents around 100 mA.
Much smaller currents than 100 mA result in circuit noise that is undesirably large.
Much larger currents than 100 mA result in wasted power and excessive current drain
from the power supply.
The R-2R ladder, has an interesting property that it may be extended to the left with
more voltage inputs as far as desired and its input resistance, as seen from vD/A, will
be R. Verify that the resistance seen looking into the vD/A terminal when the inputs,
v0, v1, and v2, are at reference, (i.e., the inputs are all 0 V) is R. Hint: start at the left,
combining series and parallel resistances and work your way to the right. The ladder
will collapse in an elegant way.
Choose a value for R such that, when vD/A = 15 V and the inputs are all 0V, the
highest current in any of the resistors is about 100 µA (plus or minus a factor of two).
Note that vD/A actually will be slightly less than 15 V, (and it would actually be 0 V if
all the inputs were zero), but we will be safe if we use a larger but more convenient
value than the actual vD/A.
WRITEUP: Choose a standard 5% tolerance value of R that you will use in your
circuit, and list it in your notebook.
R choice:
List of standard 5% resistor values:
http://ieee.ucsd.edu/wiki/_media/tutorials/standard_resistor_and_capaciter_values.pdf
2. Build: Construct the R-2R ladder circuit as shown in Fig. 2. Use the binary input
pattern 101 from the Pre-lab. For a 1, connect to the 15 V power supply. For a 0,
connect to reference. If you wish, you may use dip switches as shown in Fig. 3 to
select whether inputs are 0 or 1. (If you use the dip switches, close only the 0 switch
3
UNIVERSITY OF UTAH DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING
50 S. Central Campus Dr | Salt Lake City, UT 84112-9206 | Phone: (801) 581-6941 | Fax: (801) 581-5281 | www.ece.utah.edu
ECE 1250 LAB 3
or the 1 switch but not both for a given input at a given time. If you close both
switches at once, no harm is done, but you get strange results.)
Fig. 2 R-2R ladder D/A circuit with 3 inputs
Fig. 3 R-2R ladder D/A with dip switches.
WRITEUP: Describe your work in your lab notebook. Be sure to include a
schematic diagram of the circuit.
3. Measure: Use the voltmeter on the myDAQ to measure the value of vD/A. Compare it
with the value you calculated in the Pre-lab. Try several different binary input
voltages for the R-2R ladder circuit and see if the results are an output voltage
proportional to the binary input number. Note that v0 is the most significant bit in the
binary input number.
WRITEUP: Fill out the following list in your notebook.
number 5
= binary input number 101
vD/A =
number
= binary input number
vD/A =
number
= binary input number
vD/A =
number
= binary input number
vD/A =
4
UNIVERSITY OF UTAH DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING
50 S. Central Campus Dr | Salt Lake City, UT 84112-9206 | Phone: (801) 581-6941 | Fax: (801) 581-5281 | www.ece.utah.edu
Download