Discharge of a Capacitor

        Voltage across a capacitor discharging through a resistor as a function of time is shown in the figure below. The experimental points are obtained by digitizing the voltage at regular intervals. To do the experiment connect one end of the capacitor to ground and the other end to one of the ADC inputs. Connect one of the digital output lines to the same point through a resistance R. To get the discharge curve take the digital output HIGH for a second and then take it LOW. Start digitizing the output to get the discharge curve. The is the program to do it.

rc discharge