0% found this document useful (0 votes)
404 views10 pages

ECEN 214 Lab 6

The document describes designing and simulating a first-order RC circuit that causes an LED to flash at a frequency of choice. It provides: 1) The goals of exploring the transient behavior of the circuit and building one that flashes an LED. 2) Equations that describe the exponential transient response of the RC circuit as the output voltage transitions between starting and final values over time. 3) Details on an op-amp based oscillator circuit using the RC circuit that causes the outputs to oscillate between saturation values at a predictable frequency as it switches between cases. 4) A prelab assignment to design the circuit to oscillate at 1 Hz and calculate expected frequency, voltages, and simulate the design.

Uploaded by

Shoaib Ahmed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
0% found this document useful (0 votes)
404 views10 pages

ECEN 214 Lab 6

The document describes designing and simulating a first-order RC circuit that causes an LED to flash at a frequency of choice. It provides: 1) The goals of exploring the transient behavior of the circuit and building one that flashes an LED. 2) Equations that describe the exponential transient response of the RC circuit as the output voltage transitions between starting and final values over time. 3) Details on an op-amp based oscillator circuit using the RC circuit that causes the outputs to oscillate between saturation values at a predictable frequency as it switches between cases. 4) A prelab assignment to design the circuit to oscillate at 1 Hz and calculate expected frequency, voltages, and simulate the design.

Uploaded by

Shoaib Ahmed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
You are on page 1/ 10

Lab 6: Transient Response of a 1st Order RC Circuit

Theory and Introduction

Goals for Lab 6 - The goal of this lab is to explore the transient behavior of a 1st order circuit.
To do so, you will build a circuit that will cause an LED to flash at a frequency of your choosing.

Theory

+ +

𝑉𝑖𝑛 𝑉𝑜𝑢𝑡
𝐶
_ _

Figure 6.1 – A 1st Order RC Circuit.

In the RC circuit shown in Figure 6.1, a resistor and a capacitor form a first order circuit. Using
the techniques described in class and in the textbook, the differential equation that describes this
circuit is found to be

𝑑𝑉𝑜𝑢𝑡 𝑉𝑜𝑢𝑡 𝑉𝑖𝑛


+ = .
𝑑𝑡 𝑅𝐶 𝑅𝐶

Assuming that 𝑉𝑖𝑛 is a constant, and that initially the output voltage is 𝑉𝑜𝑢𝑡 (0) = 𝑉𝑜 , the solution
to this differential equation is

𝑉𝑜𝑢𝑡 (𝑡) = 𝑉𝑖𝑛 + (𝑉𝑜 − 𝑉𝑖𝑛 )𝑒 −𝑡/𝑅𝐶 .

The voltage transitions from a starting value of 𝑉𝑜 to a final value of 𝑉𝑖𝑛 in an exponential fashion.
The graph of such a behavior is shown in Figure 6.2. The product, 𝜏 = 𝑅𝐶, which is given in units
of seconds, is called the time constant of the circuit and determines the rate at which the output
voltage transitions from its starting to ending values. Note that by time, 𝑡 = 5𝜏 (five time
constants), the output voltage has very nearly reached its final value.
5

vout(t) 3

0
0 1 2 3 4 5
t (seconds)

Figure 6.2 – Transient response of a 1st Order RC Circuit; 𝑉𝑜 = 1, 𝑉𝑖𝑛 = 5, 𝜏 = 1.

𝑅1

+5V
𝑅2
𝑉1
+
741
_ +
𝑉2
𝑉𝑜𝑢𝑡
𝐶 _
-5V

𝑅
Figure 6.3 – An Op-amp based oscillating circuit

In this lab, we are going to use the circuit shown in Figure 6.3. The analysis of this circuit proceeds
as follows. First, using the fact that the current flowing into the non-inverting terminal must be
zero, it follows that the voltages 𝑉1 and 𝑉𝑜𝑢𝑡 must be related by a voltage divider,

𝑅2
𝑉1 = 𝑉𝑜𝑢𝑡 .
𝑅1 + 𝑅2
𝑅2
To simplify future notation, let 𝛾 be the voltage divider, 𝛾 = 𝑅 , so that 𝑉1 = 𝛾𝑉𝑜𝑢𝑡 . Next,
1 +𝑅2

using the fact that the current flowing into the inverting terminal must also be zero, the voltages
𝑉2 and 𝑉𝑜𝑢𝑡 are found to be related by

𝑑𝑉2 𝑉2 𝑉𝑜𝑢𝑡
+ = .
𝑑𝑡 𝑅𝐶 𝑅𝐶

Note that 𝑉1 and 𝑉2 are related to 𝑉𝑜𝑢𝑡 by two very different equations. As a result, we would
expect that 𝑉1 ≠ 𝑉2 . If the two inputs to an op-amp are not equal, the op-amp will saturate. So, at
this point it should be pretty clear that this op-amp circuit is operating in saturation mode. When
𝑉2 < 𝑉1, the output of the op-amp will be 𝑉𝑜𝑢𝑡 = +𝑉𝑠𝑎𝑡 , and when 𝑉2 > 𝑉1 , we get 𝑉𝑜𝑢𝑡 = −𝑉𝑠𝑎𝑡 .

Case 1: Consider first the case when 𝑉2 < 𝑉1 . The voltage 𝑉1 will be constant and equal to 𝑉1 =
𝛾𝑉𝑠𝑎𝑡 . The voltage 𝑉2 will be given by the solution to the differential equation,

𝑑𝑉2 𝑉2 𝑉𝑠𝑎𝑡
+ = .
𝑑𝑡 𝑅𝐶 𝑅𝐶

Depending on the initial condition, this solution will be of the form

𝑉2 (𝑡) = 𝑉𝑠𝑎𝑡 + (𝑉2 (0) − 𝑉𝑠𝑎𝑡 )𝑒 −𝑡/𝑅𝐶 .

This behavior will look like that in Figure 6.2 where it approaches a final value of 𝑉2 (𝑡) → 𝑉𝑠𝑎𝑡 .
However, since 𝑉1 is smaller than 𝑉𝑠𝑎𝑡 , at some point 𝑉2 (𝑡) will grow to the point where it becomes
larger than 𝑉1. At that point we switch to the other case.

Case 2: When 𝑉2 > 𝑉1 we now get 𝑉1 = −𝛾𝑉𝑠𝑎𝑡 and 𝑉2 will be of the form

𝑉2 (𝑡) = −𝑉𝑠𝑎𝑡 + (𝑉2 (0) + 𝑉𝑠𝑎𝑡 )𝑒 −𝑡/𝑅𝐶 .

Now 𝑉2 (𝑡) will decrease over time and approach a final value of 𝑉2 (𝑡) → −𝑉𝑠𝑎𝑡 . Again, since 𝑉1
is now larger than −𝑉𝑠𝑎𝑡 , at some point 𝑉2 (𝑡) will decrease to the point where it becomes smaller
than 𝑉1. At that point we switch back to the first case.

So this circuit is going to switch back and forth (oscillate) between the two cases described above.
The voltages involved are all periodic and will behave as shown in Figure 6.4. If we take time
𝑡 = 0 to be the beginning of a period as shown in Figure 6.4, the starting voltage for 𝑉2 will be
𝑉2 (0) = −𝛾𝑉𝑠𝑎𝑡 . The first switching time will occur when 𝑉2 (𝑡) = 𝛾𝑉𝑠𝑎𝑡 . We can determine that
time by solving for 𝑡 in the equation

𝑉2 (𝑡) = 𝑉𝑠𝑎𝑡 + (−𝛾𝑉𝑠𝑎𝑡 − 𝑉𝑠𝑎𝑡 )𝑒 −𝑡/𝑅𝐶 = 𝛾𝑉𝑠𝑎𝑡 .

After a little algebra, this is found to be

1−𝛾
𝑡 = −𝜏ln⁡( ).
1+𝛾

This time represents ½ of a period of each of the periodic waveforms. The resulting frequency
(1/period) is then

1
𝑓𝑜 = − 1−𝛾 .
2𝜏ln⁡(1+𝛾)

For example, for the values given in Figure 6.4, we would expect the frequency to be 𝑓𝑜 =
0.621Hz and therefore the period is 1.601sec.

15 V
out
V1
10 V
2

5
V (volts)

-5

-10

-15
0 0.5 1 1.5 2 2.5 3 3.5
t (seconds)

2
Figure 6.4 – Waveforms in the oscillating op-amp circuit; ⁡𝛾 = 3 , 𝜏 = 0.5𝑠𝑒𝑐.
Prelab

A. Design the circuit of Figure 6.3 to oscillate at a frequency as near to 𝑓𝑜 = 1 Hz as you can
get it. Choose component values for 𝑅, 𝐶, 𝑅1 , 𝑅2 that are available to you in your lab kit.
Also, try to choose the values of 𝑅1 and 𝑅2 so they sum to a value as close as possible to
10𝑘Ω.⁡⁡Note, the resistors (or the capacitor) do not necessarily have to be a single
component. You can use parallel/series combinations to get the component values closer
to where you would like them. Specify your chosen component values and then
calculate your expected values for the following quantities related to the voltage
𝑽𝟐 (𝒕):
a. Actual frequency of oscillation. This should be near 1Hz but probably not exactly
1Hz.
b. Peak-to-peak voltage. For this, you will need to know the saturation voltage of
the op-amp. Use your measured value from Lab 4.
c. Root-Mean-Square (RMS) Voltage. For a periodic signal 𝑥(𝑡) with period 𝑇𝑜 , the
RMS value is given by
1
𝑋𝑟𝑚𝑠 = √𝑇 ∫𝑇 𝑥 2 (𝑡)𝑑𝑡,
𝑜 𝑜

where the integral is taken over any interval of length 𝑇𝑜 .

Make sure to show all of your work.

Note: It is very unlikely that your design will end up exactly the same as somebody else’s. Please
do your own work.

B. Simulate your design using SPICE. Print out and hand in the transient waveforms at
𝑽𝟏 , 𝑽𝟐 , and 𝑽𝒐𝒖𝒕 . Consult your TA if you need help setting up the transient response in
SPICE. A few pointers are listed below.

Transient Simulation in LTSPICE

Once you have created your schematic diagram of the circuit in SPICE, it is fairly straightforward
to run a transient simulation. When you click on the “running man” an “Edit Simulation
Command” box will pop up. Choose the “Transient” tab. In this case, the only parameter you
should need to enter is the “Stop time.” Since you will be creating periodic waveforms with a
period of 1 second and you will want to observe a few periods, you probably want to choose a stop
time of something like 3-5 seconds. Then click OK. A window with an empty plot will open next
to your schematic. This is where your waveforms will appear. You will need to tell SPICE where
you want to measure a voltage. To do so, hover the mouse over your schematic and you will see
a probe icon. Click on the point where you want to measure voltage and the waveform will appear
in the plot window. You will probably see a waveform that is zero for all time. This is because
SPICE is assuming there are no initial conditions (all voltages are zero initially). With no voltage
everywhere at time zero, nothing will ever happen in this circuit. You will need to specify a non-
zero initial condition. To do this, choose “SPICE directive” from the “Edit” menu. An “Edit Text
on Schematic:” box will pop up. In the text window, enter something like “.ic V(n001)=1” This
is telling SPICE to use an initial condition of 1V at node 001. You may want to use a different
node number (or different initial voltage) depending on how your nodes are labelled. When you
click OK you will want to left click in the schematic window to place the text SPICE directive in
your schematic. You should see the text you entered on your schematic now. Run the simulation
again with the new initial condition. Hopefully you are starting to see something like the
waveforms in Figure 6.4.

Note: When you put your schematic together in SPICE, please make sure that you have hooked
up the correct components to the positive and negative op-amp input terminals. For some reasons,
students frequently hook things up backward and can’t figure out why the waveforms don’t look
like they are supposed to.
Procedure

Equipment and parts needed

A selection of ¼-W resistors


A selection of capacitors
1 – Red LED
1 – Green LED
1 – 10k potentiometer
1– potentiometer turner (a small slotted screwdriver should be suitable for this purpose)
1 – 741 OPAMP

Task 1 – Flashing LED Circuit.

Build the circuit shown in Figure 6.5. Here we have added some LEDs to the output of the circuit
you studied in the prelab. Use the component values you designed in the prelab. If you have
chosen your component values correctly, the two LEDs should flash on and off alternately about
once per second.

𝑅1

+5V
𝑅2
𝑉1 1𝑘Ω
+
741
_
𝑉2
𝐶
-5V

Figure 6.5 – A Flashing LED Circuit

Use your oscilloscope on your AD2 to display both 𝑉1 (𝑡) and 𝑉2 (𝑡). Adjust your vertical scale so
that the waveforms occupy about 70% (as close as you can) of the full scale and adjust the
horizontal (time) scale so that approximately two periods of the waveforms are shown. If you need
help learning how to use the oscilloscope, do not hesitate to ask your TA.
A. Once you have the waveforms displayed the way you like, save a screenshot of the waveforms
for use in your lab report.
B. Use the scope to measure each of the following quantities for both 𝑉1 (𝑡) and 𝑉2 (𝑡):
a. Actual frequency of oscillation.
b. Peak-to-peak voltage.
c. Root-Mean-Square (RMS) Voltage.
C. In your lab report, compare the measured values with the design values from your prelab. Be
sure to point out any differences and give an explanation for the major cause(s) of any
differences you see. To give an intelligent explanation here, you might want to measure the
actual component values and the actual saturation voltage of your op-amp.

Task 2 – Potentiometers

In order to make it easy to adjust the parameters of the waveforms created by the circuit in Figure
6.5, you will now replace the two resistors, 𝑅1 and 𝑅2 , that formed the voltage divider with a
potentiometer (also known as a variable resistor or “pot” for short). Figure 6.6(a) shows a picture
of typical potentiometer. You can envision the potentiometer as a resistance laid out in a linear
fashion with a slider that can be moved anywhere within the length of the resistive material (see
Figure 6.6(b)). The slider essentially splits the resistance into two parts as shown in Figure 6.6(c).
The two resistances 𝑅1 and 𝑅2 must sum to a constant value which is usually printed on the
package. For example, a 10𝑘Ω pot must have 𝑅1 + 𝑅2 = 10𝑘Ω. By connecting all three terminals
up to a circuit, the potentiometer basically functions as a variable voltage divider. You can also
use the potentiometer as a variable resistor by leaving terminal 3 (or terminal 1) disconnected.

𝑅1 𝑅2
1 3 1 3

2 2

(a) (b) (c)

Figure 6.6 – (a) A typical potentiometer, (b) its schematic, and (c) an equivalent circuit.
A. Replace the resistors 𝑅1 and 𝑅2 from the circuit in Task 1 with a 10𝑘Ω potentiometer. Your
circuit should now look like that shown in Figure 6.7. Adjust the potentiometer until the circuit
oscillates at a frequency of 2Hz. Remove the pot from the circuit and measure the values of
𝑅1 and 𝑅2 . What is the corresponding value of the voltage division ratio, 𝛾? Note: If you are
using the DMM in the lab, it is straightforward to measure the resistances. If you may just
want to directly measure the voltage division ratio. Put the pot back in the circuit. Record the
waveforms you see on the scope to include in your lab report.

10𝑘Ω

+15V

𝑉1 1𝑘Ω
+
741
_
𝑉2
𝐶
-15V

Figure 6.7 – Modified Flashing LED Circuit for Task 2.

B. Replace the resistor 𝑅 with one at half its value. You can easily do this by placing another
identical resistor in parallel. Measure and record the new frequency of oscillation. Record the
waveforms you see on the scope to include in your lab report.
C. Again, adjust the potentiometer until the circuit oscillates at 2Hz. As in part A, remove the pot
from the circuit and measure the voltage division ratio. Record this value to include in your
lab report. Record the waveforms you see on the scope to include in your lab report.

Before you leave the lab…


Your TA will show you how to use the bench oscilloscope to make some of the same
measurements you did with the scope on your AD2. You should bring your data sheet to be signed
by the TA and you should also be prepared to show your TA how you made your various
measurements.
Lab Report

1. Title page, as always


2. Report write up:
A. Procedure – Write in your own words what you did in lab
B. Measured Data – Include tables of values you measured throughout the lab.
C. Measured Waveforms - Be sure that you label your screen shots and intersperse
comments and screenshots through your document.
D. Sample Calculations –Demonstrate how you performed any calculations needed.
E. Discussion –Be sure to answer any questions posted in the procedure section. Also,
discuss differences between theoretical values calculated in the prelab and actual values
measured in the lab. Definitely comment on what you think are the major sources of
any significant differences.

You might also like