Capacitance-based sensors are used in a broad range of applications in consumer electronics (especially touch screens).
Capacitance can be calculated if the geometry of the conductors and the dielectric properties of the insulator between the conductors are known. A qualitative explanation for this can be given as follows.
Once a positive charge is put unto a conductor, this charge creates an electrical field, repelling any other positive charge to be moved onto the conductor; i.e., increasing the necessary voltage. But if nearby there is another conductor with a negative charge on it, the electrical field of the positive conductor repelling the second positive charge is weakened (the second positive charge also feels the attracting force of the negative charge). So due to the second conductor with a negative charge, it becomes easier to put a positive charge on the already positive charged first conductor, and vice versa; i.e., the necessary voltage is lowered.
As a quantitative example consider the capacitance of a capacitor constructed of two parallel plates both of area A separated by a distance d. If d is sufficiently small with respect to the smallest chord of A, there holds, to a high level of accuracy:
where:
C is the capacitance, in farads;
A is the area of overlap of the two plates, in square meters;
ε is the permittivity (ε0 ≈ 8.854×10−12 F⋅m−1); and
d is the separation between the plates, in meters;
Permittivity is a measure of the electric polarizability of a given dielectric material. Materials with a high permittivity are able to store more energy because they polarize more in response to an applied electric field. For designing capacitors, higher permittivity corresponds to greater capacitance. Permittivity is typically expressed as the unit-less relative permittivity ε (epsilon), or ratio of a material's permittivity to vacuum permittivity. The relative permittivity of polypropylene is 2.3; other common materials include printer paper (1.4), polyethylene (2.2), silicone (3.5), rubber (7), and water (80).
Transmit-Receive Sensing
Tx-Rx capacitive sensing, especially useful for making sensors to measure capacitance of a dielectric between two electrodes.
Capacitive Touch Sensing
Alternatively, you can try using the Capacitive Sensor library. This method is particularly useful for detecting touch. More information on this technique here.