We discussed a new circuit component today called a capacitor. Capacitors are capable of blocking DC current since there is no path for the current to move through due to the fact that capacitors are comprised of two plates separated by a distance. Charge builds up on these plates over time creating a voltage drop over the capacitor. While the charge is varying with time there is also an AC current caused by the "sloshing" of charge on the plates. However, when the capacitor is fully charged there is no current, but all of the Vin drops across the capacitor. This can be modeled as Vout(t) = q(t) / C.
These unique properties of the capacitor mean that when you differentiated the output voltage with respect to time you get dVout(t)/dt = I(t)/C. When this is limited to cases where Vout is much smaller than Vin (capacitor is not allowed to charge much) we can rewrite the function as dVout(t)/dt = (1/RC)Vin(t). This new function shows that Vout increases proportionately to the input voltage.
The bottom line of this discovery is that if you don't allow a capacitor to charge much you have an automatic calculation of time based on the current input and the voltage output. This is commonly used to make extremely accurate measurements of time in labs by utilizing capacitors in "time-to-amplitude convertors" (TACs) that take in signals and output a voltage that is easily used to find the time between start and stop signals because of the integral/derivative relationship between current and voltage with capacitors.
Section 2 - Response of a RC Circuit to a "Step Input"
For this section, we no longer limit the capacitor to not charging much and instead allow it to charge fully. We started this exercise by considering an analogy for an RC circuit where we are trying to "charge" a tub full of water, by filling it with water. In this analogy, the height of the water was the charge and the area, A, was the capacity (RC). The larger the area/capacity the longer it takes for height/charge to increase.
Going back to our previous function of dVout(t)/dt = I(t)/C and imposing the initial condition of Vout(0) = 0 and the limiting behavior of Vout(t) approaching A as time approaches infinity. Using these equations in combination gives us a general solution of Vout(t) = A(1-e^(-t/(RC)))
From this formula we can suss out the time constant, RC which is the amount of time it takes the output voltage to reach approximately two-thirds of its final value. This time constant can also be considered the "time lag" between turning the circuit on and the capacitor being charged.
Lab 2-1 in the Student Manual
In this lab exercise we constructed an RC circuit of 10k ohm resistor and an 0.01 micro Farad capacitor. We drove this circuit with a 500Hz square wave and used an oscilloscope to look at the output. Using the oscilloscope's cursors we measured the time for the output to drop from 100% to 37% and found this to be 120 microseconds or 0.12ms, which is our experimental RC value. We also calculated RC by doing (10^4 ohms)*(10^-8 Farads) = 10^-4 seconds = 0.1ms. These two values are very close (0.12~0.1) and thus we know we correctly measured the RC value.
We further confirmed this value by using the time cursors on the oscilloscope to measure the time to climb from 0% to 63% of final voltage. This value was 100 microseconds or 0.10ms which is exactly the calculated value.
An interesting thing happened when we varied the frequency of the square wave driving the circuit. The rise and fall-times were greatly affected by this, as we expect them to be. This is because the higher the frequency the less time the capacitor has to charge before it discharges again. This means the higher the frequency the more closely the Vout will resemble a straight line since this is approaching the simplest case we discussed in the previous section where the capacitor is not allowed to charge much. Using this knowledge we can increase the frequency until our output looks as like a sawtooth or triangle wave because of how straight its lines are.
Section 3 - Arduino Capacitance Meter
Now we used our Arduino circuit to built a similar device to the TAC we discussed earlier. We began by creating a voltage divider where the "bottom" of the divider is a capacitor instead of a resistor. We than ran a program included in the lab which uses the Arduino's internal timer to return the elapsed time, in microseconds, since the program started running.
This program sets up a drivePin, a pin to measure the Vout, and creates variables for our high and low thresholds and start and end times. During the setup we set the drivePin to a HIGH voltage in order to power our circuit. Then we started the serial communication in order to receive feedback from the circuit. Inside the loop we turn the drivePin "off" by setting the voltage to LOW. This gives the capacitor a chance to uncharge. To make sure it has time to uncharge we create a while loop that does nothing while the voltage measured is above our low threshold. Once we detect that the capacitor has sufficiently uncharged we turn the drivePin back on to recharge the capacitor and start our timer by setting start time to the current micros() time. Now we must wait until the capacitor has charged for a time constant (63% of final) and we do this by constantly measuring the micros() time and setting endTime to this value. When we break the loop the endTime keeps the last measured value, i.e. the time when capacitor charged to 63%. Now by taking the difference of our measured time values we end up with the time constant. Finally, to make this information accessible to the user we print it to the serial window.
We used our circuit and program to make RC time constant measurements for different RC circuits. For these measurements we kept the resistor the same and varied the capacitor.
Capacitor(microFarads) expected RC (ms) experimental RC(ms)
0.1 1 1.012
0.47 4.7 5.388
4.7 47 45.260
These numbers make sense when you consider that the resistors have 20% error margin. All of our values are within 20% of the expected values (i.e. 0.47 microFarads + 20% = 5.64 ms)
We also "calibrated" our meter by converting the numbers on the screen to display microfarads. We did this by adding the following lines:
float res = 10000; //value of resistor in ohms. (added before setup and loop)
(added in loop right before delay)
Serial.print("capacitor in microFarads (+- 20%) = ");
Serial.println( (endTime - startTime) / (res));
We further calibrated our meter by measuring the experiment RC(ms) on the oscilloscope using the cursors.
Capacitor(microFarads) Oscilloscope RC (ms) Arduino RC(ms)
0.1 1 .12 1.012
0.47 5.2 5.388
4.7 45.0 45.260
These values were much closer to our measured values from the Arduino than the theoretically expected ones were, showing that our Arduino chip is pretty well calibrated.
To further explore, we compared the readings for a single 0.1 microFarad capacitor with two 0.1 microFarad capacitors wired in parallel. We measured a capacitance of 0.2 microFarad with our Arduino meter and this is the result we expected sense two capacitors wired in parallel have a total capacitance that is the sum of the two individual capacitors (0.1 + 0.1 = 0.2). We then did the same for two 0.1 microFarad capacitors in series. This gave us a measured value of 0.06 microFarads which is very close to the expected 0.05 microFarads. We got the expected value by using the formula for capacitors in series, which is very similar to the formula for resistors in parallel. (1/C1 + 1/C2 = 1/Ctot)
Lab 2-3 in the Student Manual
In this lab we constructed an integrator using a 10k ohm resistor as the top of a voltage divider and a 0.01 microFarad capacitor as the bottom. We then drove this circuit with a 100kHz square wave with 5Vpp amplitude. (need video)
Then we drove it again with a triangle wave and the output waveform is a
Doing some quick worst-case impedance calculations we know that
- The impedance presented to the signal generator by the circuit at f=0 is similar as to impedance at DC and is therefore infinite impedance. This is because with direct current there is no "sloshing' of current and therefore no current is pushed along by the capacitor, so it acts as if it were an infinite resistor.
- The impedance of this circuit at infinite frequency is going to be approximately 10k ohm. This is because with frequency so large the capacitor has essentially no time to charge and therefore acts like a normal wire. This leaves our circuit with just its 10k ohm impedance from the resistor.
No comments:
Post a Comment