RC Circuits

12
1 RC Circuits and Applications Lab Ticket and Write-up Comments Read this lab write-up and write an outline of the procedure you will follow during your two-week investigation. Also, derive equation [22]. Your lab write-up should summarize all of the investigations you undertook in the lab. Include all important plots and findings; motivate your arguments and discuss the method you used to come to your results. Be sure to discuss possible sources of error. Feel free to explore questions not specifically asked in the lab. In the guided section of this lab, you should measure the time constant for an RC circuit, build high- and low-pass filters and measure their gain curves. Introduction RC circuits are among the most useful, simple and robust passive electric circuits, and play integral roles in everyday equipment such as traffic lights, pacemakers and audio equipment. While their applications are numerous and varied, they are mostly used for their signal filtering capabilities and surprisingly precise timing abilities. In this lab you will explore these fundamental uses of RC circuits, filtering and timing. You will also interface RC circuits with a simple but powerful IC 1 called the 555 timer circuit and control its functioning through the RC circuit. The coupling of the 555 timer to an RC circuit gives the user many interesting applications, some of which you will be able to explore on an open-ended basis. Theory and Application RC Charging, Discharging and Timing When the switch S is closed in the battery powered circuit of Figure 1a, current begins to flow. Electrons pile up on the side of the capacitor connected to the negative side of the battery and are drawn off of the side of the capacitor connected to the positive side of the battery. The value of the resistor (it can be attached to the negative or positive side of the battery), as will be shown, regulates the rate at which current flows. As more charge is effectively taken off one side of the capacitor and placed on the other the potential difference between the sides of the capacitor grows, hindering the flow of electrons. This in turn slows down the rate of increasing potential difference between the sides of the capacitor. 1 “Integrated Circuit”. An IC a set of electronic components and their interconnections that are etched or imprinted on a semiconductor chip.

description

RC circuits

Transcript of RC Circuits

Page 1: RC Circuits

1

RC Circuits and ApplicationsLab Ticket and Write-up Comments

Read this lab write-up and write an outline of the procedure you will followduring your two-week investigation. Also, derive equation [22].

Your lab write-up should summarize all of the investigations you undertook in thelab. Include all important plots and findings; motivate your arguments and discuss themethod you used to come to your results. Be sure to discuss possible sources of error.Feel free to explore questions not specifically asked in the lab.

In the guided section of this lab, you should measure the time constant for an RCcircuit, build high- and low-pass filters and measure their gain curves.

Introduction

RC circuits are among the most useful, simple and robust passive electric circuits,and play integral roles in everyday equipment such as traffic lights, pacemakers andaudio equipment. While their applications are numerous and varied, they are mostly usedfor their signal filtering capabilities and surprisingly precise timing abilities.

In this lab you will explore these fundamental uses of RC circuits, filtering andtiming. You will also interface RC circuits with a simple but powerful IC1 called the 555timer circuit and control its functioning through the RC circuit. The coupling of the 555timer to an RC circuit gives the user many interesting applications, some of which youwill be able to explore on an open-ended basis.

Theory and Application

RC Charging, Discharging and Timing

When the switch S is closed in the battery powered circuit of Figure 1a, currentbegins to flow. Electrons pile up on the side of the capacitor connected to the negativeside of the battery and are drawn off of the side of the capacitor connected to the positiveside of the battery. The value of the resistor (it can be attached to the negative or positiveside of the battery), as will be shown, regulates the rate at which current flows. As morecharge is effectively taken off one side of the capacitor and placed on the other thepotential difference between the sides of the capacitor grows, hindering the flow ofelectrons. This in turn slows down the rate of increasing potential difference between thesides of the capacitor.

1 “Integrated Circuit”. An IC a set of electronic components and their interconnections that are etchedor imprinted on a semiconductor chip.

Page 2: RC Circuits

2

Figure 1: a) The battery powered RC circuit with switch. b) The capacitor charging curve when the switchS is closed. c) The capacitor charging curve when the capacitor is fully charged (with the battery taken outof the circuit) and switch S closed.

Mathematically, using Kirchhoff's loop rule, the circuit is governed by the equation

ε = IR + QC

[1]

where ε is the emf of the battery, I is the current, Q is the charge on the capacitor and Cthe capacitance of the capacitor. Both Q and I are functions of time and are related by I =dQ/dt. Knowing this relation between I and Q, we may rewrite equation [1]:

ε = R dQdt

+1CQ , [2]

which has the solution (you should check it)

Q = Cε(1− e−t /RC ). [3]

Since voltage V is related to charge on a capacitor by the equation V = Q/C, the voltageacross the capacitor is given by

V = ε(1− e−t /RC ) . (charging) [4]

This mode of operation of an RC circuit is called “charging”, simply because thecharge on and potential across the capacitor increases asymptotically from zero to amaximum value of the battery's emf, ε (Figure 1b). Another mode of operation, sansbattery power, of an RC circuit is called “discharging,” in which the capacitor with someinitial potential of ε (not necessarily related to a battery emf) asymptotically decreases toa value of zero (Figure 1c). Mathematically, this is given by

0 = RdQdt

+1CQ , [5]

Page 3: RC Circuits

3

which has solution

Q = Cεe−t /RC [6]

implying that the voltage across the capacitor is

V = εe−t /RC . (discharging) [7]

The quantity RC, which must have dimensions of time, appears conspicuously inboth the charging and discharging solutions. It is called the “time constant” of the circuitand is represented by the symbol τ:

τ ≡ RC . [8]

In a circuit that is charging (equation [4]) the potential across the capacitor at time t = τ,starting with no charge at time t = 0, is

V[τ] = ε(1− e−τ /τ ) = ε(1− e−1) ≈ .63ε . [9]

In other words, during the first time constant τ the voltage has increased from zero toapproximately 63% of its ultimate value (the value after an infinite amount of time), ε. Ina time of 2τ the voltage will reach a value of

V[2τ ] = ε(1− e−2τ /τ ) = ε(1− e−2) ≈ .86ε . [10]

For a discharging circuit initially fully charged, the potential after time t = τ is

V = εe−τ /τ = εe−1 ≈ .37ε , [11]

meaning the voltage has dropped to about 1 - .63 = .37 or 37% of its ultimate value. Firstwe saw that a charging capacitor takes time

τ to reach 63% of it’s final value (

ε). Nowwe see that a discharging capacitor also takes time

τ to reach 63% of it’s final value(0V). So a circuit's time constant is a measure of how quickly it charges or discharges.

RC Low Pass Filter

One common use of RC circuits is for analog AC filtering (Figure 2a). Imaginethat a sinusoidal signal generator instead of a battery is powering the RC circuit. Whatwould the voltage across the capacitor as a function of time look like? The equationgoverning the circuit, derived from Kirchhoff's loop rule, is

V0sin[2π f t] = IR +QC

, [12]

Page 4: RC Circuits

4

Figure 2: a) The RC low-pass circuit. The voltage is measured across the capacitor. b) The gain curve forthe low-pass filter as a function of frequency where ω is angular frequency equal to 2! f.

where

V0sin[2π f t] is the signal from the signal generator with signal amplitude V0 andfrequency f.

If the time derivative is taken and the equation is written in terms of I the equationbecomes

2π fV0cos[2π f t] =dIdtR +

IC

. [13]

The solution to this equation is

I[t] = Acos[2π f t −α] , [14]

where A and α are constant with regards to in time. To be exact,

A = V01

R2 + 1/(2π fC)2 and

tan[α] = 2πfRC = 2πfτ . [15]

This means that the voltage across the capacitor is

V[t] =Q[t]/C =I[t]∫ dtC

=Asin[2π f t −α]

2π fC. [16]

We are interested in the gain of the system, the ratio of the output to the inputvoltage (Figure 2b). The gain is a measure of how attenuated or amplified the outputsignal is, relative to the input signal. Roughly speaking, it is a measure of how much ofthe input signal has gotten through the circuit. The gain is computed as the outputamplitude divided by the input amplitude:

g =A /2πfCV0

=1

1+ (RC2πf )2. [17]

Page 5: RC Circuits

5

Notice that the gain is dependent on the frequency of the input signal; for low frequencysignals (2πf <<RC), the gain is close to 1 and for high frequency signals (2πf >>RC) thegain is close to zero. This means that low frequency signals are passed with almost noattenuation, while high frequency signals are almost completely blocked, hence the name“low-pass filter.” Filters are often characterized by their “-3 dB point,” the frequency atwhich the gain of the circuit is

1/ 2 . For an RC circuit (both low- and high-pass) thisfrequency happens to be )2/(1 CRπ :

f−3dB =1

2πRC. [18]

RC High Pass Filter

If we switch the resistor and capacitor in the low-pass circuit (so that we’re nowmeasuring the voltage across the resistor), what will the output voltage look like (Figure3a)? Luckily, by finding the current through an RC circuit, given by equation [14], allthat has to be done to find the voltage drop is to use Ohms law and multiply the currentby the value of the resistor:

V[t] = RAcos[2π f t −α], [19]

where A is given by equation [15] and α is given by

tanα =1

2πfRC=

12πfτ

. [20]

This means that the gain of the circuit is

g =1

1/(RC2π f )2 +1. [21]

For low frequency signals (2πf << RC ) the quantity 1/(RC2!f) is large, and the gain isclose to zero (Figure 3b) while at high frequencies (2πf >> RC ) the quantity 1/(RC2!f) issmall, and the gain is close to one so most of the input signal gets through. This circuitallows signals with high frequencies to make it through while attenuating low frequencysignals, hence the name “high-pass filter.”

Page 6: RC Circuits

6

Figure 3: a) The RC high-pass circuit. The voltage is measured across the resistor. b) The gain curve for thehigh-pass filter as a function of frequency where ω is angular frequency equal to 2! f.

Figure 4: a) The 555 timer chip with pin numbers and names. b) The pin configuration of the 555. Note thatpins 3 and 5 are not connected while pin 1 is connected to ground.

The 555 timer and RC Circuits

The 555 timer is a cheap, important and relatively simple IC that produces veryaccurate sequences of digital signals2, called “pulse trains" (for example, a series ofsquare waves is a periodic pulse train). Among their many uses, 555 timers can be used tocontrol everything from simple robotic motors called servos to complex electricalcircuits.

2 Digital signals, unlike analog signals, can have only one of two voltage values, in this case zero and five volts. Ingeneral, the lower voltage signal is called “low" or “off” and the high voltage signal is called “high” or “on.” While notall digital signals operate on the same voltages, they all operate on this same basic principle.

Page 7: RC Circuits

7

Figure 5: The output signal (above) of a 555 timer when the input signal (below) comes from an RC circuitin which the capacitor continually charges through the resistors and discharges through RB to pin 7,jumping back and forth from 2/3 Vcc to 1/3 Vcc. When the capacitor is charging, the output of the 555 is adigital high signal, when it is discharging, the output is a digital low signal.

The 555 is relatively simple... for an IC. To describe why the 555 works the wayit does is beyond the scope of this lab and only how the 555 functions, the basic ideas andrules behind it, will be explained. As shown in Figure 4a, the 555 has 8 “pins” which linkthe internal circuitry to the outside. Figure 4b shows the manner in which the 555 shouldbe setup. This configuration of the 555 is called the “astable” mode of the 555. In thismode the chip will generate a periodic pulse train. The 555 is controlled through andfunctions in the following manner, depicted in Figure 5.

1. Initially, when the power is first turned on (Vcc is applied to the circuit) the output pinis low (zero volts).

2. The capacitor charges through the combined resistance of RA and RB (i.e. charges likean RC circuit with resistance equal to RA + RB).

3. When the capacitor charges to a value of 1/3 Vcc, pin 2 is triggered, causing the outputof the 555 goes high (five volts).

4. The capacitor continues to charge until the voltage across it reaches 2/3 Vcc, at whichpoint pin 6 will cause the output go low (zero volts) and the discharge pin 7 to open (itnow provides a connection to ground), allowing the capacitor to discharge through RB.

Page 8: RC Circuits

8

Figure 6: This chip contains six NOT gates, shown by triangle/circles symbols. The lead going into thetriangle is the input to the gate and the lead coming from the circle is the output. Vcc for the chip should be5 volts.

5. The capacitor continues to discharge until the voltage across the capacitor reaches1/3 Vcc, at which point pin 2 causes the output to go high again the discharge pin 7 toclose. Now the capacitor begins to charge again through the combined resistance of RA

and RB.

6. This charging and discharging continues indefinitely (as long as power is supplied) andthe output continues to flip-op between zero and five volts.

The 555 turns an analog timing signal into a digital, pulsed timing signal. Thetime the output is high, TH (also called the “pulse width”), is controlled by the values ofRA, RB and C. The pulse width is given by the time it takes the capacitor to charge from1/3 to 2/3 Vcc. The time the output is low TL is controlled by the value of RB and C, and isequivalent to the time it take the capacitor to discharge from 2/3 to 1/3 Vcc through RB. TH

and TL are given by

TH = C ln[2](RA + RB)TL = Cln[2]RB ,

[22]

which you derived in the lab ticket.Notice that TH must always be greater than TL, since RB ≠ 0 . In other words the

duty cycle, the percent time the circuit is high, can never be less than 50 percent. This isunfortunate, there are many times when it is desirable to have short pulse widths and lowduty cycles, such as when controlling a servo! To get around this simply add a basicdigital circuit called a NOT gate (Figure 6) which “inverts” the input; if the input is low,the output will be high and visa versa.

Page 9: RC Circuits

9

Experiment and Analysis

Measuring the Time Constant

You can easily measure τ of an RC circuit by fitting its charge/discharge curve toan exponential and literally reading off the value of τ. Set-up the circuit and proceed asdirected below.

• First, pick values for the capacitor and resistor which give a value of τ on the order ofone second with the value of resistor somewhere between 10 kΩ and 100 kΩ. Use the“Impedance meter” to measure the values for capacitance and resistance. Be sure tonote the uncertainty in these values.

• Connect the resistor and capacitor in series on an op amp board and use pieces of wireand banana cables to connect either end of the circuit to the PASCO Power Amplifierand its ground. Change the settings on the Power Amplifier so that it outputs a 5 voltDC signal. Remember to turn on the Power Amplifier before launchingDataStudio.

• Place the voltage sensor across the capacitor and change the sensor's sampling ratesuch that you take 100 samples in each period τ.

• Start collecting data and then start Power Amplifier. To do this, turn “Auto” off on theSignal Generator control window, start taking data, then press the ON button on theSignal Generator window. Stop collecting data after a few seconds, but leave theSignal Generator turned on. This graph should look like a charging curve, as picturedin Figure 1b.

• After 15-20 seconds (so the capacitor has plenty of time to charge) collect another runand turn the Signal Generator off. This graph should look like a discharging curve aspictured in figure 1c.

• Finally, measure τ directly by finding the time it took for the circuit to charge to 63%of its final voltage.

Low and High Pass Filters

To study the low and high pass filters choose values for R and C which givevalues for the -3 dB point between 100 and 500 Hz. Use the signal generator of thePASCO interface to generate the input sine waves. Measure the gain curves for both thelow and high pass filters using DataStudio’s Scope feature (ask your TA if you areunfamiliar with this feature). Try to get at least 10 data points around both sides of the -3dB point. Are the curves as you would expect them to be? If you like you can fit yourdata with a “user defined” fit, as mentioned in the previous section. The functional formsfor the gain of the low and high pass filters are given by equations [17] and [21]respectively. To fit the data in DataStudio, you will have to enter it into a data table byselecting Experiment>>New Empty Data Table.

The 555 Timer

Page 10: RC Circuits

10

To set-up and study the 555, follow the directions below.

• Hook up the 555 to the op amp board as shown in Figure 4b, with Vcc being the fivevolt power supply on the board.

• Use values for the resistors of between 5kΩ and 10kΩ, and for the capacitor a valuebetween .1 and 1 µF. Use values which give the circuit a duty cycle between 50 and 80percent.

• Use two voltage sensors: place one across the capacitor and hook the other one up tothe output of the 555 timer, pin 3 (Figure 4a). Change the sampling rate of both sensors tosomewhere between 4000 and 5000 Hz.

• Open the scope and turn on the power supply. If you are interested, hook up a variableresistor to the circuit and change the width of the pulse train.

How close are TH and TL, for both the RC circuit charging/discharging and thedigital output, to being what equation [22] predicts them to be, and is the duty cycle whatit is expected to be? Are these values within uncertainty? Does the potential on thecapacitor jump from 1/3 Vcc to 2/3 Vcc continually?

Now, choose values for the resistors which make the duty rate around 90 percent.Set-up and use one of the NOT gates from the 7404 IC chip (the long rectangular chiphas 6 NOT gates as shown in Figure 6, we’ll only use one) on the op amp board andattach the output of the 555 to the input pin of the NOT gate. Hook the voltage sensorformerly attached to the output of the 555 to the output of the NOT gate and monitor theoutput. Is the NOT gate acting like an inverter, changing the duty rate to around 10percent?

Some Possible Extensions

The number of uses for the 555 and RC related circuits are wide and varied.Below are some ideas for an open-ended study of such circuits.

• The input and output of an RC filter have different voltage phases, as given byequation [20]. Explore this difference.

• If an inductor is included in an RC circuit, making it an RLC circuit, the circuit willallow only mid-range frequencies to pass. Explore the RLC circuit. See pages 776-779 inyour text to learn about RLC circuits and their filtering properties.

• Explore RC circuits as circuits that integrate/differentiate their input signals. See theappendix for details.

• Use the 555 in “astable” mode (meaning it generates a periodic pulse train) to control amotor called a servo. See the appendix for details.

Page 11: RC Circuits

11

• Using an RC circuit and/or a 555 to create a simple function generator which generatessquare and sine waves (Hints: Choose circuit elements such that the –3dB point is wellbelow the fundamental frequency of the square wave, so that any higher frequencies willbe severely attenuated. See pages 401 and 402 in your text to learn about frequencycomponents. Generating a triangle wave is tricky, do it if you can, using an RC circuit asan integrator and integrate a square wave).

• A 555 can also be operated in “monostable” mode, meaning the 555 outputs only onepulse, with the pulse width controlled by an RC circuit. This would be desirable to do ifyou wanted to trigger a piece of equipment once (like a camera). See the website

http://www.play-hookey.com/digital/timer_555.html

or the 555 technical sheet on mononstable operation (despite the name, it's not to dense)called “mononstable.pdf” located on the lab computers hard drive at “LabExtras >> RC circuit” or talk to an instructor.

• Using multiple 555s you can generate a pulse train consisting of a number of pulseshaving different pulse widths and starting times. Warning: this application of the555 can be involved, but also quite useful and interesting! See the website

http://www.play-hookey.com/digital/timer_555_sequencer.htmlfor instructions or an instructor for help.

• Explore the myriad of other projects/applications associated with the 555. The web canbe a good resource for finding this kind of information.

Appendix A

RC Integrator/Differentiator

A high pass filter will function as a differentiator, when operated at a frequency wellbelow the -3 dB point. In this regime

Vout ≅ (iωRC)Vin [A.1]

and hence, if the input is mostly sinusoidal,

Vout ≅ (RC)dVindt

(for ω <<1/RC). [A.2]

Apart from the constant factor RC, the output is the time derivative of the input.

Page 12: RC Circuits

12

A low pass filter at frequencies well above the -3 dB point functions as an integrator, forin this regime

Vout ≅ (1

iωRC)Vin . [A.3]

and hence, if the input is mostly sinusoidal,

Vout = (1RC) Vin dt∫ (for ω >> 1/RC). [A.4]

Apart from the constant factor (1/RC), the output is the integral of the input.

Servo Control

This particular servo, called an HS-303 and used in many robotic applications, iscontrolled by a signal of a periodic pulse train with a pulse width from one to twomilliseconds with a time between pulses of 20 to 30 milliseconds. The time betweenpulses controls the position (not the angular velocity) of the servo. For example, it mightbe the case that with a time between pulses of 20 milliseconds the servo is at an angularposition of zero degrees, while with a time between pulses of 30 milliseconds the servo isat an angular position of 180 degrees.

Of the three wires coming out of the servo the black wire should be grounded, thered wire should be hooked up to a voltage source (either the five, 12 or 15 volt supply onthe op amp board should suffice) and the yellow wire is where the controlling signal isattached. Use a 555 with a NOT gate (to have the signal low most of the time) as thecontrolling signal. Let RA = 10 kΩ and have RB be a 10 kΩ variable resistor, which willallow you to easily control the servo. Use a 1 µF capacitor.