You are on page 1of 18

EEE 334 Lab 1

LTSpice and Lab Orientation – Instruments and Measurements


Due 4 February 2016
Student Name: Ziyan Wang Student ID: 1207895113
Instructor Name: David R. Allee

Introduction: The lab aims to familiarize the student with using the ADK by building DC circuits,
AC circuits, and filters. DC, transient, and AC analyses will be performed using LTSpice, and
these simulations will be compared to experimental results obtained using the ADK,
breadboard, and multimeter.

Equipment and Components:


Equipment:

Analog Discovery Kit, Analog Parts Kit, MS8217 Digital Multimeter, EIC-106 Breadboard
2 x 1kΩ resistor, 3 x 2.2kΩ resistor, 2 x 10kΩ resistor, 20kΩ resistor, 0.01μF capacitor

Course of Action:
1.1) Simple DC Circuit
Figure 1.1 shows the LTSpice schematic for part 1.1 of the lab, in which three 2.2kΩ resistors
are connected to two DC voltage sources of 3V and 4V.

Figure 1.1: LTSpice schematic for a simple DC circuit


Superposition will be used to calculate Vout by hand, which will then allow the current
through R2 to be found using Ohm’s law
In LTSpice, a DC operating point analysis (.op) will be used to obtain both the voltage
Vout, and the current through R2
In the hardware portion, the circuit will be built on a breadboard, using the ADK as both
a voltage source and voltmeter; the handheld multimeter will be hooked up in series
with R2 to measure the current through the resistor
The hardware results will be compared with the calculated and theoretical results to
check for error

1.2) Simple AC Circuit


Figure 1.2 shows the LTSpice schematic for part 1.2 of the lab, in which an AC source is
connected to a parallel configuration of four resistors.

Figure 1.2: LTSpice schematic for a simple AC circuit

The currents through R2 and R4 and the voltages across each resistor will be
calculated using current division and Ohm’s law, respectively
In LTSpice, transient analysis for 50ms will be used to plot 5 cycles of the currents in
each branch, and 5 cycles of the voltages across each resistor
In the hardware portion, the ADK will be used as a signal generator to power the
circuit, and as an oscilloscope to measure the voltage across each resistor
The handheld multimeter will also be used to measure both the currents in each
branch and the voltages across each resistor
The hardware measurements will be repeated for triangular and square waves, and
the multimeter voltage readings will be compared to the oscilloscope readings
1.3) Low Pass Filter Analysis
Figure 1.3 shows the LTSpice schematic for part 1.3 of the lab, in which a capacitor and
resistor are connected to an AC voltage source to make a low pass filter across the
capacitor.

Figure 1.3: LTSpice schematic for a low pass filter

The gain of the circuit in figure 1.3 will be calculated by hand using the provided
transfer function, and ω3dB will be calculated using ω3dB = 1/τ = 1/(RC)
In LTSpice, a transient analysis will be performed to determine the gain and phase
shift of the circuit, and an AC analysis will be performed to determine the frequency
response of the circuit’s gain and phase
In the hardware portion, the gain and phase of the circuit will then be measured and
calculated based on oscilloscope readings from the ADK, and the frequency response
of the circuit’s gain and phase will be determined using the ADK’s network analyzer

1.4) High Pass Filter Analysis


Figure 1.4 shows the LTSpice schematic for part 1.4 of the lab, in which a capacitor and
resistor are connected to an AC voltage source to make a high pass filter across the resistor.

Figure 1.4: LTSpice schematic for a high pass filter


The gain of the circuit in figure 1.3 will be calculated by hand using the provided
transfer function, and ω3dB will be calculated using ω3dB = 1/τ = 1/(RC)
In LTSpice, a transient analysis will be performed to determine the gain and phase
shift of the circuit, and an AC analysis will be performed to determine the frequency
response of the circuit’s gain and phase
In the hardware portion, the gain and phase of the circuit will then be measured and
calculated based on oscilloscope readings from the ADK, and the frequency response
of the circuit’s gain and phase will be determined using the ADK’s network analyzer

Results:
1.1) Simple DC Circuit
i. Theoretical Calculations
Contribution by VS1: =0 VS2 is shorted, so no current flows through R3
.
Contribution by VS2: =− 2 = (−4 ) )
= −2V
∗( .

Vout = Vout + =0 −2
Vout = −2V
− 2 −2 + 4
I = =
2 2.2 Ω
I = 9.09 ∗ 10
ii. LTSpice Simulation
As can be seen from figure 1.5, the output voltage of the circuit = −2 ,
and the current through resistor R2 ( 2) = −9.09 ∗ 10 . The current is
negative

Figure 1.5: DC operating point analysis of figure 1.1


iii. Hardware Simulation
Two DC signals were used to power the circuit, with channel 1 corresponding to
VS1, and channel 2 corresponding to VS2, as shown in figure 1.6. Using the ADK,
Vout was measured to be −2.016 , and the voltage across resistor R2 was
measured to be -1.992V. Applying Ohm’s law, the current through R2 can be
calculated as:
1.992
= =− = 9.05 ∗ 10
2 2.2 Ω

Figure 1.6: Vout as measured by the ADK

iv. Comparison
| − ℎ |
% = ∗ 100%

Table 1: Results for simple DC circuit


Theoretical Simulated Measured % Error
Vout −2 −2 −2.016 0.79%
|IR2| 9.09 ∗ 10 9.09 ∗ 10 9.05 ∗ 10 0.44%

1.2) Simple AC Circuit


i) Theoretical Calculations

Input signal parameters: = =1 , =2 = 200 , = sin(200 )


( )
Current through R2: = = = 5 ∗ 10 sin(200 )
( )
Current through R4: = = = 5 ∗ 10 sin(200 )

Voltage across R1, R2: = = 1= 2 = 0.5 sin(200 )


Voltage across R3, R4: = = 3= 4 = 0.5 sin(100 )
Vrms is the root mean square voltage of a signal, and is a description of the
average voltage of a voltage signal V(t). The rms value is given by the equation:

1
= [ ( )]

Vrms for R2: = sin (200 ) = = = 0.01


.
= [1 − (400 )]
.
.
= [1 − (400 )]
.

= There is intentionally an error in this


= 0.707
calculation for the rms value - see if
you can spot it.
ii) LTSpice Simulation
The current through R2 oscillates between ±5 ∗ 10 , while the current
through R4 oscillates between ±5 ∗ 10 , as shown in figure 1.7. Both signals
have a 10ms period.

Figure 1.7: LTSpice plot of currents through each branch of the circuit in figure 1.2
The voltages across each resistor have an peak to peak voltage of 1 , creating
overlapping plots, as shown in figure 1.8. All the voltage signals are in phase, and
have a period of 10ms.
Figure 1.8: LTSpice plot of voltages across each resistor depicted in figure 1.2
iii) Hardware Simulation
Using oscilloscope channel 1 to measure the voltage across R2, and channel 2 to
measure the voltage across R4, the signal produced is two coincident sine waves
with peak to peak voltages of 1V and periods of 10ms, as shown in figure 1.9.

Figure 1.9: ADK oscilloscope reading of voltages across R2 and R4 for sinusoidal input
Repeating the measurement with a triangular wave input, two coincident
triangle waves with peak to peak voltages of 1V and periods of 10ms were
produced, as shown in figure 1.10. The rms voltage value was measured to be
about 0.577 times half the peak to peak value of 1.02V.
Figure 1.10: ADK oscilloscope reading of voltages across R2 and R4 for triangular input
Repeating the measurement with a square wave input, two coincident square
waves with peak to peak voltages of 1V and periods of 10ms were produced, as
shown in figure 1.10. The rms voltage was also measured to be half the peak to
peak value of 1.02V.

Figure 1.11: ADK oscilloscope reading of voltages across R2 and R4 for square input
iv) Comparison
Although the multimeter only gives rms values, peak to peak values and
amplitudes can be derived from the following equation:

= 2√2 = 2| |

As shown in table 1.2a, the rms values measured by the ADK matched those
measured using the multimeter. Because the measured and calculated voltages
across each resistor were identical, a single voltage value was provided in table
1.2a for all four resistors in the circuit. The theoretical and simulated results
matched each other, and both the measurement results yielded the same result,
so the % error is only calculated between the theoretical and measured results.

Table 1.2a: Results for sine wave input


Theoretical Simulated Measured Measured % Error
(ADK) (multimeter)
1V 1V 1.01V 1.01V 0.99%
0.354V 0.354V 0.358V 0.358V 1.1%
(peak) 5 ∗ 10 5 ∗ 10 N/A 4.95 ∗ 10 1.0%
(peak) 5 ∗ 10 5 ∗ 10 N/A 5.15 ∗ 10 2.9%
T 10ms 10ms 10ms 10ms 0%

The rms ratios for the square and triangular waveforms are shown in table 1.2b,
and can be calculated as follows:

/
Triangular: = [ ( )] = = ( )=

/
Square: = [ ( )] = = ( )=

Table 1.2b: Ratio of Vrms/Vpeak


Theoretical Measured % Error
Triangular Wave 1/√3 =0.577 0.577 0%
Square Wave 1 0.992 0.81%

1.3) Low Pass Filter Analysis


i) Theoretical Calculations
Angular frequency: =2 = 20000

Gain: = = = = 0.847
( )

Bandwidth: = = 1 ∗ 10 /

ii) LTSpice Simulation


As shown in the plot of Vin and Vout in figure 1.12, both signals have a 100μs
period, but Vin leads Vout by about 9.21μs. Vin has a peak of about 998mV,
whereas Vout has a peak of about 845mV. Based on these values, the gain and
phase shift of the circuit are:
Gain: = = = 0.847
Phase shift: = ∗ 2 = −0.578 = −33.1

Figure 1.12: Transient analysis of a low pass filter


As shown in the frequency response plot of a low pass filter in figure 1.13, the
maximum gain of the circuit = 0 , and the 3dB frequency of the circuit
occurs at about = 2 = 9.86 ∗ 10 / .

Figure 1.13: Frequency response of a low pass filter


iii) Hardware Simulation
The oscilloscope readout from the ADK is shown in figure 1.14, where channel 1
shows the source voltage and channel 2 displays the output voltage. The peak to
peak voltages are 2.05V and 1.72V, respectively, while the rms voltages were
measured to be 0.723V and 0.607V. Both signals have a period of 0.1ms, but Vin
leads Vout by 9.02μs

Phase shift: = ∗ 2 = −0.567 = −32.5


.
Gain: = = = 0.84
.
Figure 1.14: ADK oscilloscope voltage reading of a low pass filter
The network analyzer of the ADK yields a similar result to the LTSpice simulation,
as shown in figure 1.15. In both plots, the gain decreases by 3dB at a frequency
just above 10kHz.

Figure 1.15: ADK network analysis of low pass filter


iv) Comparison
The 3dB frequencies from theoretical calculations and LTSpice simulations are
presented in table 1.3 below.

Table 1.3: Comparison of 3dB frequencies for a low pass filter


Theoretical Simulated % Error
1 ∗ 10 / 9.86 ∗ 10 / 1.4%
Table 1.4 compares the gain and phase shift obtained for a low pass filter.
Because the theoretical and simulated values are equivalent for gain, the error is
calculated between the theoretical and measured values. A theoretical value for
phase shift was not calculated, so the error shown is between the simulated and
measured values.

Table 1.4: Comparison of gain and phase shift for a low pass filter
Theoretical Simulated Measured % Error
Gain 0.847 0.847 0.840 0.83%
Phase shift N/A -33.1° -32.5° 1.8%

1.4) High Pass Filter Analysis


i) Theoretical calculations
Angular frequency: =2 = 2000

Gain: = = = = 0.782

Bandwidth: = = 5000 /

ii) LTSpice Simulation


As shown in the plot of Vin and Vout in figure 1.16, both signals have a 1ms
period, but Vout leads Vin by about 0.109ms. Vin has a peak of about 994mV,
whereas Vout has a peak of about 762mV. Based on these values, the gain and
phase shift of the circuit are:
Gain: = = = 0.767
Phase shift: = ∗ 2 = 0.685 = 39.2

Figure 1.16: Transient analysis of high pass filter


As shown in the frequency response plot of a low pass filter in figure 1.17, the
maximum gain of the circuit = 0 , and the 3dB frequency of the circuit
occurs at about = 2 = 5000 / .

Figure 1.17: Frequency response of a high pass filter


iii) Hardware Simulation
The oscilloscope readout from the ADK is shown in figure 1.18, where channel 1
shows the source voltage and channel 2 displays the output voltage. The peak to
peak voltages are 2.04V and 1.60V, respectively, while the rms voltages were
measured to be 0.722V and 0.563V. Both signals have a period of 1ms, but Vout
leads Vin by 0.108ms

Phase shift: = ∗ 2 = 0.679 = 38.9


.
Gain: = = = 0.780
.

Figure 1.18: ADK oscilloscope reading of a high pass filter


The network analyzer of the ADK yields a similar result to the LTSpice simulation,
as shown in figure 1.19. In both plots, the gain decreases by 3dB at a frequency
just below 1kHz.

Figure 1.19: ADK network analysis of a high pass filter


iv) Comparison
As shown in table 1.5, the simulated 3dB frequency of a high pass filter matches
the theoretical value.

Table 1.5: Comparison of 3dB frequencies for a high pass filter


Theoretical Simulated % Error
5000 / 5000 / 0%

Table 1.6 compares the gain and phase shift obtained for a low pass filter. A
theoretical value for phase shift was not calculated, so only the error between
the simulated and measured values is shown.

Table 1.6: Comparison of gain and phase shift for a high pass filter
Theoretical Simulated Measured % Error % Error % Error
Theoretical, Theoretical, Simulated,
Simulated Measured Measured
Gain 0.782 0.767 0.780 1.9% 0.26% 1.7%
Phase N/A 39.2° 38.9° N/A N/A 0.77%
shift

Conclusion:
The DC circuit analysis proves that the superposition principle is effective for analyzing
circuits, and that LTSpice is very accurate in analyzing DC circuits. There was a slight deviation
between the theoretical and measured values of voltages and currents, but those small errors
of less than 1% can be explained by the tolerances of the resistors—the resistors used were not
exactly 2.2kΩ.
The AC circuit analysis proved that voltage and current division are also effective
techniques for analyzing AC circuits. The calculations for the rms voltages of different signals
also demonstrated that different periodic signals provide different average power. LTSpice
produces very accurate results for simple AC circuits as well. All measured errors are less than
3%, which is low enough to be attributed to the tolerances of the resistors used.
Analysis of the low pass filter showed that low pass filters behave nearly ideally, with all
errors being less than 2%. As such, low pass filters can be designed very precisely, if the correct
values of resistors and capacitors are used. Part of the error in phase shift and frequency is due
to the fact that the cursor could not be placed in exactly the right position in LTSpice and the
ADK.
Similarly, high pass filters behave fairly ideally, with all errors being less than 2% as well.
However, the high pass filter was the only circuit for which the values produced by LTSpice did
not match theoretical values. The same inaccuracy of the cursors likely contributed significantly
to the problem.
The goal of the experiment was achieved, as the numerous parts provided ample
practice for me to understand both the ADK and the lab report guidelines. There was a period
of time in which my handheld multimeter could not detect continuity, but that problem
appears to have fixed itself. Although the four circuits gave a helpful introduction to LTSpice
and WaveForms, the lab report itself is extremely tedious and annoying due to all the
requirements in the lab manual, as shown by the length of this report. The sample lab report
introduced each figure with a paragraph explaining the parameters (a guideline which I
followed), but I think it would be much easier if students could simply list the relevant
information without including it in a paragraph.
Post Lab Questions:
1. Multimeters are restricted to displaying rms values for AC currents and voltages. On the
other hand, oscilloscopes generally can only measure voltages and not currents.
However, they can display much more information beyond rms values of voltages, such
as period, peak to peak values, and phase shift.
2. When a voltage source is shorted, it is connected with a very low resistance, which
causes the voltage source to draw a large amount of current in order to maintain a
constant potential difference. This act discharges a significant amount of energy, which
can damage both people and circuits.
3.
a. With all resistors being equal value, the voltage across each resistor becomes 1V
peak to peak, and the current through each resistor becomes 0.1mA peak to
peak. Both current and voltage signals have periods of 10ms.
b. At 1kHz, the circuit has an output peak value of 9.972V, and an input peak value
of 9.995V. Vin leads Vout by Δ = 9.8 . Based on those values, the gain and
phase shift can be calculated as:

Gain: = = 0.9977

Phase shift: = ∗ 2 = 0.0616 = 3.53

The frequency response plot of the circuit shows a 3dB frequency of about
15.7kHz
c. At 1kHz, the circuit has an output peak value of 124.6mV, and an input peak
value of 999.6mV. Vout leads Vin by Δ = 225 . Based on those values, the
gain and phase shift can be calculated as:

Gain: = = 0.1246

Phase shift: = ∗ 2 = 1.41 = 81.0

The frequency response plot of the circuit shows a 3dB frequency of about
8.02kHz.

4.
i. = 10 ∗ 100 = 1 Ω ± 5% = 1 Ω ± 50Ω
ii. = 44 ∗ 10000 = 440 Ω ± 5% = 440 Ω ± 22 Ω
iii. A = brown; B = black; C = black; D = gold

You might also like