Have you ever found the need to measure the capacitance of a capacitor? No multimeter handy (for shame)? Well, as it turns out you can actually measure capacitance using your Arduino Uno, with no external components, and only ~20 lines of code.
[Jonathan Nethercott] does an excellent job explaining a capacitance test circuit which uses a reference capacitor to calculate the unknown capacitance. He further explains that, with the Arduino Uno, you can remove the reference capacitor from the circuit, and simply use the stray capacitance present in the board and microcontroller, which can be calculated. This results in the test circuit being as simple as plugging in your capacitor to pins A0 and A2.The code is quite simple: it sends a 5V pulse to the capacitor and measures the voltage on the other side, looping every half second, and outputting the data onto a chart.
It does, however, require calibration. [Jonathan] measured a known capacitor for a baseline, and used that data to calculate the stray capacitance in the Arduino. Once calibrated, he found that you can easily achieve a resolution of about 1% for capacitors between 3.5pF and 225pF, and around 5% for capacitors between 0.5pF and 1300pF — you can see the results of his analysis here. He plans on determining the accuracy and linearity too, but he will need some very accurate reference capacitors.