Charging and Discharging of Capacitors

The RC circuit under study is connected between the Digital output socket D3 and Ground. The voltage across the capacitor is monitored by the ADC channel 0. The voltage on D3 can be set to 0V or 5V under software control. Taking D3 to 5V will make the capacitor charge to 5V through the resistor R and then taking D3 to 0V will cause it to discharge. All we need to do is digitize the voltage across C just after changing the output of D3.  A screen shot of the experiment is given below. One can also do this with the simple python program cap.py .


Linear Charging
  If we charge the capacitor through a linear element like a resistor the curve is exponential. How about a linear charging ! Connect the capacitor between D3 and CH0. Connect resistor from CCS to CH0. The software should keep D3 HIGH for a second and then take it LOW. When D3 goes to 0V, the capacitor charges through the constant current source and the charging will be linear as shown below.


Charging and Discharging multiple capacitors at a time