Capacitor ESE112 Passive element designed to store energy Electric Circuit Theory: Capacitor Stores energy in the form of an electrical charge Like a battery but can’t produce new electrons Consists of two metal plates separated by a non-conduction substance or dielectric Some common uses: Radio tuning circuits (filtering frequencies) Clocks (counter/timer) X-rays and MRI (high-frequency applications) ESE112 How it stores energy? RC Circuit 2 A resistor placed in series with capacitor will control the rate at which it charges or discharges Charge flows up to the plates but not across the insulator Once it's charged, the capacitor has the same voltage as the battery Capacitor resists change in voltage ESE112 3 ESE112 4 1 Circuit Response (Discharge) Circuit Response (Discharge) contd.. Assuming that the capacitor is initially charged The voltage across the capacitor is said to decay over time and is given by: v(t) = V0e-t/RC where V0 is voltage at t = 0 Rapidity at which the voltage decreases is expressed in terms of time constant denoted as τ (tau) τ = RC v(t) = V0e-t/RC V0 t τ V(t)/V0 0.36788 2τ 0.13534 3τ 0.04979 4τ 0 01832 0.01832 5τ 0.00674 Smaller the τ, the more rapidly the voltage decrease i.e. the circuit response is faster. rcTime in CPU class int rcTime(int timeout, int portPin, boolean pinState) The method records the time it takes for the voltage at the capacitor’s plate to cross 2.5V logic threshold The returned value (amount of time for the pin to reach a desired state) and timeout parameter are in 8.68 us units rcTime starts the counter that increments every 8 8.68us. 68us It stops the counters as soon as the pin reaches pinState What does the rcTime method return ? v(t) = V0e-t/RC Îv(t) = V0/et/RC Î t/RC = V0/ v(t) Îe (t) Take natural log (base e) on both sides Î ln(et/RC) = ln(V0/ v(t) ) Î t/RC = ln(V0/ v(t) ) Therefore: t = R*C*ln(V0/ v(t) ) 2 Example Consider a 10KOhm resistor and 1.0uF cap t = (10 x 103) x (1 (1.0 0 x 10-66) x ln(5/2 ln(5/2.5) 5) = 6.93 ms In rcTime units of 8.68 us, 6.93 ms ~800 units Handy rule: 0.693 x R (kOhm) * C (in uF) 3