Professional Documents
Culture Documents
Lab Report 4
Lab Report 4
18
EGR 262
Lab #4
Digital to Analog Conversion
9.24.18
Nicholas Pauza
Dakota Bernacki
1
9.24.18
Table of Contents
Pre-lab
1. Fritzing breadboard layout.
2. Fritzing schematic layout.
3. 3-bit ladder network analysis.
4. Arduino program with DAC control function.
5. Written explanation of how the program and circuit work in concert.
Lab Work
1. Circuit construction.
2. Program test.
Post-lab report
1. Discussion of program performance.
2. Comparison of Analog outputs.
3. DAC resolution.
4. Restructuring as a 10-bit DAC.
5. Lessons Learned.
Pre-Lab
2
9.24.18
2. Fritzing schematic:
3
9.24.18
R 1 R 2 R 4 R 6
A B C
4 .4 K 2 .2 K 2 .2 K 4 .4 K
V1
D C = 5V R 3 R 5
AC = 0 4 .4 K 4 .4 K
TR A N = 0
Find Req:
4.4 kΩ /¿ 4.4 kΩ=2.2 kΩ
2.2 kΩ+ 2.2 kΩ=4.4 kΩ
4.4 kΩ /¿ 4.4 kΩ=2.2 kΩ
4.4 kΩ+ 2.2 kΩ+2.2 kΩ=8.8 kΩ
Req=8.8 k
Find V0 :
4
9.24.18
5V 1
I o= = A
8.8 kΩ 1760
1
V 5 V −V = A∗4.4 kΩ=2.500V
0
1760
V 0=5 V −2.500V =2.500 V
R 13 R 14 R 15
H I J
2 .2 K 2 .2 K 4 .4 K
R 16 R 17 R 18
4 .4 K 4 .4 K 4 .4 K
i1 V 6 i2 i3
D C = 5V
AC = 0
TR A N = 0
KCL i1:
4.4 kΩ∗i1+2.2 kΩi 1+ 4.4 kΩ ( i1−i 2 ) +0∗i3+5 V =0
11∗i1−4.4∗i2+0∗i 3=5 V
KCL i2:
4.4 kΩ ( i 2−i1 ) +2.2 kΩ∗i2+4.4 kΩ (i 2−i 3 )−5 V =0
−4.4 kΩ∗i1+11 kΩ∗i2−4.4 kΩ∗i3=5V
KCL i3:
0∗i1+4.4 kΩ (i 3−i 2 ) +2.2 kΩ∗i3=0
0∗i1−4.4 kΩ∗i2+8.8 kΩ∗i3=0
[ ]
−0.28 mA i 1
rref = 0.43 mA i 2
0.21mA i3
V0 : Find
V 0=−0.28 mA∗4.4 kΩ=−1.250V
5
9.24.18
R 13 R 14 R 15
G H I
2 .2 K 2 .2 K 4 .4 K
R 16 R 17 R 18
4 .4 K 4 .4 K 4 .4 K
i1 i2 V3 i3
D C = 5V
AC = 0
TR AN = 0
KCL i1:
6.6 kΩ∗i 1+4.4 kΩ ( i 1−i2 ) +0∗i 3=0
11∗i1−4.4∗i2+0∗i 3=0
KCL i2:
4.4 kΩ ( i 2−i1 ) +2.2 kΩ∗i2+4.4 kΩ (i 2−i 3 ) +5 V =0
−4.4 kΩ∗i1+11 kΩ∗i2−4.4 kΩ∗i3=−5 V
KCL i3:
−5 V + 4.4 kΩ ( i3−i2 ) + 4.4 kΩ∗i 3=0
0∗i1−4.4 kΩ∗i2+8.8 kΩ∗i3=5V
[ ]
−0.14 mA i1
rref = −0.36 mA i 2
0.39 mA i 3
Find V 0 :
V 0=−0.14 mA∗4.4 kΩ=−0.625 V
b. Step Graph
3
2.5
2
1.5
1
0.5
0
000 001 010 011 100 101 110 111
Digital Input
Voltage
Binary [V]
000 0
001 0.625
010 1.25
011 1.875
100 2.5
101 3.125
110 3.75
111 4.375
7
9.24.18
8
9.24.18
9
9.24.18
10
9.24.18
Lab Work
1. Build Circuit 1
a. Most of the circuit should already be in place from Lab #3. Add the additional parts.
b. The circuit should match your Fritzing breadboard layout.
c. Use neat wiring practices.
11
9.24.18
b. Connected a voltmeter to output V0 on the R-2R ladder network. Recorded voltages for all 8
possible inputs:
Bit Voltage [V]
000 0.012
001 0.629
010 1.260
011 1.880
100 2.500
101 3.130
110 3.750
111 4.370
12
9.24.18
13
9.24.18
Post Lab
1. Program performance:
The program has 2 loops running, the increment loop and the decrement loop. If a valid
button press is detected from either the increment or the decrement button, then the
corresponding “if” statement will be initiated. In the “if” statement, the “x” value will either
be incremented or decremented. The “display_digit” function and the “R2R” function will be
called out so that the 7-segment display will display the current count and the binary number
will be displayed on the screen. The valid button press is a function that will avoid the button
bouncing and continuously incrementing or decrementing the number. This way when the user
presses the button once, the number increments or decrements once.
2. Comparison of the measured analog outputs with the predicted analog outputs for each digital
(binary) input. Identification of major contributors to this error:
14
9.24.18
=N25-M25 =O25/M25*100
While all of our measured values were quite close to their expected values we can still speculate
on why there was variation. There is never an absolute 0V being output by the Arduino; this most
likely is why we had a small voltage present for binary 000. The other voltages likely varied from
our predictions due to the resistors we used not possessing exactly their professed resistances.
However, since our error is so small, it seems that the resistors we used were quite close to their
expected resistances.
4. If we replaced the 3-bit R-2R ladder network with a 10-bit R-2R ladder network:
a. How many digital output pins would be needed for the R-2R circuit:
10 output pins are required.
5. Lessons learned:
In this lab we learned how to convert digital signals to analog utilizing
voltage stepping. We gained a base understanding of how a DAC can be
built and how it leverages the circuit principles we know to achieve the
conversion from analog to digital.
15
9.24.18
16