Overview
The essence of capacitive touch sensing is a change in capacitance when an object approaches a capacitor. The presence of a finger increases capacitance by: 1) introducing a material with a relatively high dielectric constant (the human body), and 2) providing a conductive surface that forms additional capacitance in parallel with the existing capacitor.
Two Common Implementation Methods
Measuring the small change in capacitance reliably requires a circuit that can measure capacitance with sufficient precision. Two general methods are commonly used: one based on the RC time constant, and the other based on frequency shift.
RC Time-Constant Method
An intuitive approach uses the charging and discharging behavior of an RC network. For example, consider an RC circuit composed of a 1 MΩ resistor and a capacitive touch sensor with a typical no-touch capacitance of 10 pF. A general-purpose I/O pin on a microcontroller can be used to charge the sensor to a logic-high voltage (configured as an output). To measure discharge, the pin must be switched to a high-impedance input so that the capacitor discharges primarily through the large resistor; simply driving the pin low would present a low impedance that discharges the capacitor too quickly to detect subtle timing differences caused by small capacitance changes.

The sequence is: set the pin as a logic-high output to charge the sensor, then switch the pin to input mode to begin the discharge phase. The capacitor voltage during discharge follows an exponential curve. If a finger adds, for example, 3 pF to the sensor, the RC time constant increases and the discharge curve slows.
A microcontroller timer can be used to measure discharge time. For example, if a timer is clocked at 25 MHz, start the timer when the pin is switched to input mode and use an input-capture feature triggered when the pin voltage crosses the logic-low threshold (for example 0.6 V). The measured discharge time difference might be ΔT = 5.2 μs, which corresponds to about 130 clock ticks at a 25 MHz timer clock (timer period = 1/(25 MHz) = 40 ns). Even if the capacitance change is 10 times smaller, a 13-tick difference remains measurable.
The practical approach is to repeatedly charge and discharge the sensor while monitoring the discharge time. If the discharge time exceeds a threshold, the microcontroller infers that a finger is present. Real-world issues and error sources are discussed below.
Frequency-Shift Method
In the frequency-shift approach, the touch sensor forms the “C” in an RC oscillator so that changes in capacitance shift the oscillator frequency. The oscillator output drives a counter that counts edges during a measurement window. When a finger increases the sensor capacitance, the oscillator frequency decreases and the counted edges drop accordingly.
A common circuit type for this purpose is the relaxation oscillator, which requires resistors and a comparator in addition to the touch sensor capacitor. This is more complex than the simple charge/discharge technique, though many microcontrollers integrate comparator and oscillator peripherals that can simplify implementation. If dedicated capacitive-sense hardware is available in a microcontroller or IC, that is often the easiest option.
As one example, Silicon Labs EFM32 microcontrollers include capacitive-sensing peripherals based on the relaxation oscillator method:

A multiplexer can allow multiple touch sensors to share the oscillator so the chip can rapidly scan several channels and effectively monitor multiple touch buttons by cycling through channels quickly relative to finger movement:

Noise, Averaging, and Adaptation
Capacitive touch systems are affected by both high-frequency and low-frequency noise.
High-frequency noise causes small sample-to-sample variations in measured discharge time or edge counts. For example, measured discharge times might be 675, 685, 665, 670 timer ticks, etc. Whether this noise is significant depends on the expected signal change from a finger. If a finger increases capacitance by 30% and ΔT is 130 ticks, then ±10 ticks of high-frequency noise still allows an easy separation between signal and noise. But if the expected capacitance change is much smaller, the margin may be insufficient.
To reduce the impact of high-frequency noise, increase the signal amplitude if possible, for example by reducing the physical spacing between the PCB sensor and the finger. When mechanical constraints limit signal amplitude, averaging can lower the noise floor. Instead of comparing each new discharge time to the previous single value, compare it to the average of the last 4, 8, or 32 measurements. The frequency-shift method inherently benefits from averaging because small frequency variations have less effect on the total edge count over a longer measurement window.
Low-frequency noise refers to long-term changes in the sensor’s baseline capacitance due to environmental drift. This type of noise cannot be averaged away. The only effective approach is adaptive calibration: the threshold used to detect a finger should not be fixed but should adjust periodically based on recent measurements that show no abrupt short-term changes, e.g., the slow-moving baseline should follow environmental changes while still allowing rapid deviations (finger touches) to be detected.
Practical Summary
Capacitive touch sensing does not require exotic hardware or overly complex firmware. It is a versatile and robust technique that can offer advantages in performance and reliability compared with many mechanical alternatives when implemented with appropriate noise handling and adaptive thresholding.
FAQs
1. How can I increase a capacitive sensor's sensitivity?
In most cases, increasing the sensing area improves sensitivity. When the sensing area is constrained by the application, increase the sensor capacitance (for example by design changes) to improve sensitivity. Using a larger touch object also increases sensitivity.
2. What materials can make a surface capacitive?
Sponge material can be an interesting, low-cost option for activating capacitive touch because it is effective and can conform to the surface. However, sponge is flexible and may not be suitable for constructing a precise stylus.
3. How does capacitive touch sensing work?
Capacitive sensors exploit capacitor characteristics and the electric field formed around them. They detect any change in that field. Capacitive sensors can register touch or proximity, displacement, and can also be used for humidity or liquid-level detection.
4. What factors determine a capacitive touch sensor's output?
Capacitance increases with larger electrode area and decreases with greater separation between electrodes. The insulating material between electrodes determines the dielectric constant.
5. What is a capacitive touch screen?
A capacitive touch screen is a display control that uses the conductive touch of a human finger or a dedicated device for input. Many modern smartphones, tablets, and other mobile devices rely on capacitive touch.
6. How do capacitive and resistive touch screens differ?
Unlike resistive touch screens, capacitive touch screens rely on the natural conductivity of the human body. These screens are built from transparent conductive materials, typically an ITO coating on glass.
7. Where are capacitive sensors used?
Capacitive sensors are used for precise measurements such as detecting minute deformation in brake discs. They can operate close to hot objects where many other sensors are unsuitable, detecting nanometer-scale changes to measure wear.
8. What are the advantages of capacitive touch sensors?
Surface capacitive touch technology provides better image clarity compared with five-wire resistive touch and tends to be more durable with superior water-, oil-, and dust-resistance and higher scratch resistance.
9. How is XY position calculated on a capacitive touch screen?
Touch position is determined by measuring the spatial distribution of signal changes across X and Y electrodes and processing those changed signal levels with mathematical algorithms to compute the contact coordinates.
10. What materials are used in capacitive touch screens?
Capacitive touch screens use transparent conductive materials, often ITO on glass, and other materials that facilitate charge distribution and sensing when the touch circuit is exposed to pressure or environmental changes.