# Don't Touch! Designing Capacitive Proximity Sensing Into IoT, Industrial, & Automotive Applications

Contributed By Digi-Key's North American Editors

To fulfill its promise, the Internet of Things (IoT) will require a huge number of low-cost sensors to capture information about the real world and convert it into digital form. There are many sensing technologies, but not all are suited for industrial or environmentally challenging applications where corrosive or explosive liquids and gases may be present.

Capacitive proximity sensing, however, is particularly well suited to these applications.  It is non-contact; the active components can be environmentally sealed; and there are no moving parts, eliminating the risk of explosions caused by sparking contacts.

The foundation of a capacitive sensor is straightforward: A simple capacitor is formed from two parallel plates; its capacitance value C, in Farads, is given by the equation:

where:

εr = the dielectric constant of the material between the plates

ε0 = the permittivity of free space (8.85 x 10-12 F/m)

A = the area of the plates (W x L)

d = the plate separation in meters

ε0 is a constant, but changing any of the other variables affects the value of C.  This is the basis of capacitive proximity sensing.

The simplest capacitive sensor is formed by constructing an isolated sensor plate out of a conductive area on a circuit board, and then applying a charge. When a grounded conductive object (including a finger), or any object with dielectric constant different from air, approaches the sensor plate, a capacitor is formed. The capacitance increases as the object approaches the sensor. Although the variation is small and non-linear, it is large enough to measure and thereby form the foundation of a proximity sensor.

Figure 1: Three sensor configurations for capacitive proximity sensing: simple single plate (a), indirect measurement (b), and variable dielectric constant (c). (Image courtesy of Texas Instruments)

Figure 1 shows three common designs for capacitive proximity sensors, depending on the goal of the design. Figure 1(a) shows the scheme already mentioned. There is a single sensor plate and a finger acts as the ground plate. As the finger approaches the sensor plate, the measured capacitance increases until it exceeds a threshold, triggering an on/off event such as a simulated switch closure. Multiple independent sensors can be used to interpret gestures for up/down and left/right detection. As a finger or object moves over the target area, it changes the capacitance of all four sensors. A multi-channel detector reads all four values; then software can calculate speed and direction based on the difference in readings.

For liquid-level sensing, the indirect measurement method illustrated in Figure 1(b) is popular. The sensor and ground plates are adjacent to each other and the electric field lines pass through the liquid, which changes the capacitance as it rises and falls.

Direct sensing can also be used to measure liquids; in this case, both sensor plates are immersed in the liquid. Both techniques have their disadvantages: the direct method cannot measure conductive liquids, and the indirect method exposes the sensors to the external environment.

Liquid sensing is based on a ratiometric measurement and typically uses three capacitance sensor/ground pairs. The level sensor output is proportional to the liquid height; the reference liquid sensor is always below the liquid level to compensate for the base capacitance and temperature; and an optional reference environment sensor can be situated above the maximum liquid level to track non-liquid (environmental) factors. Figure 2 shows a typical sensor location.

Figure 2: Liquid measurement can involve up to three sensors. The measured capacitance is a function of the liquid height as well as the dielectric constants of both air and liquid. (Image courtesy of Texas Instruments)

In a third variation, Figure 1(c) shows the setup for a material-handling application: the capacitance depends on the dielectric constant, which is a function of the number of sheets between the plates.

A capacitive proximity sensor interface IC needs a specialized analog front end (AFE) to sample the capacitive sensor signal and convert it to a digital value. In addition to periodically sampling the sensor output, the device should provide an excitation signal to charge the sensor plates.

Devices usually contain multiple channels either because the application demands it – three channels for liquid sensing and four channels for direction sensing, for example – or simply because it allows system blocks to be used across channels for a more compact and efficient design.

The sampling rate can be relatively slow, so a front-end multiplexer (mux) allows one analog to digital converter (ADC) to service multiple channels. High resolution is needed to capture small differences in capacitance, which can be less than 1pF.

The FDC1004 from Texas Instruments is a 4-channel capacitance-to-digital converter that is a good example of an integrated proximity sensing IC. It has a sampling rate of under 500 samples per second, and its 16-bit sigma-delta ADC provides a good balance between speed, resolution, and low power consumption.

Figure 3: The FDC1004 has four channels and all of the circuitry needed to implement a liquid-level sensing design; it also incorporates active shielding. (Image courtesy of Texas Instruments)

Compensating for parasitic capacitance

Unlike a mechanical switch, a capacitive sensor is an analog device, so any noise affects the accuracy of measurement. One troublesome source of interference in capacitive sensing is parasitic capacitance to ground that appears between the sensing device pins and the sensor itself. This interfering capacitance can be represented by any part of the circuit – or any physical object – that causes an unintended change to the electric field.

A simple way to mitigate this problem is an active shield, also called an active guard. The shield driver is an output that is driven at the same voltage potential as the sensor input, resulting in no potential difference between the shield and sensor. Any external interference will then couple to the shield electrode with minimal interaction with the sensor electrode.

Microchip's MTCH10x is a 2-, 5-, or 8-channel proximity and touch controller that incorporates this feature. Depending on the application, the inputs can be set up either as independent sensor channels or as channel/active guard pairs.

The MTCH10x features run-time-configurable sensitivity and power and incorporates a sophisticated scan-optimization algorithm to actively attenuate noise from the signal. An active-low output communicates the state of the sensors to a host microcontroller, or drives an indication LED.

Figure 4: Microchip's MTCH102 configured as a single-channel device with an active guard to give maximum sensitivity. (Image courtesy of Microchip Technology)

In Figure 4, a two-channel MTCH102 reads a single sensor: the second channel is configured to act as an active guard. R1 (4.7 kΩ) is recommended to increase noise immunity on the input. The voltage at the MTSA pin determines the sensitivity of the touch or proximity sensor. VDD will give the lowest sensitivity; VSS will give the highest.

Improving operation in harsh environments

While capacitive proximity sensing enables a hermetically sealed interface with no mechanical parts, still, accumulated contamination, condensation or water droplets can pose a challenge.  Contamination is encountered in many industrial plants and work areas, extreme climate conditions may apply in automotive applications, and wet hands and water spills are almost standard operating procedure in many white-goods applications.

Figure 5: The NXP PCF8883 capacitive sensor IC auto-calibration feature minimizes false triggering caused by variations in temperature and humidity. (Image courtesy of NXP)

A common approach in touch sensing is to measure the absolute capacitance of the load at the sensor input pin and compare it to a threshold value to decide if a touch has occurred. This method works well if the sensor plate can be kept clean and the environment is controlled for temperature and humidity. Still, temperature and humidity changes in the air can affect the surface leakage of the sensor, change the capacitance, and trigger a false switch, even when the rate of change is quite slow.

Filtering can avoid false triggering by helping to eliminate capacitance changes due to contamination or leakage, which have a different profile than those caused by a valid input. The NXP PCF8883 and PCF8885 capacitive sensors, for example, use an auto-calibration technology to detect changes in capacitance. The devices digitally filter out both very slow and very quick capacitance changes at the input stage. As a result, the performance is less affected by conditions such as dirt, humidity, freezing temperatures, or damage to the electrode that can impair performance.

Improving EMI resistance

Another challenge limiting sensitivity in capacitive sensing applications is noise susceptibility of the sensors and maintaining performance in an environment with high levels of electromagnetic interference (EMI).

Modifying the sensor circuit to include a frequency-sensitive resonant inductive tank circuit is a useful method of increasing immunity to EMI. A change in the capacitance of the sensor then causes a shift in the resonant frequency of the LC tank circuit.

Although the change is simple, adding a resonant component to a capacitive sensor brings some major advantages. With its inherent narrowband characteristics, the LC resonator provides excellent immunity to EMI. Also, if the frequencies of the noise sources are known, shifting the operating frequency of the sensor can filter them out without the use of external circuitry. This will help increase the sensitivity of the system and reduce its complexity.

TI’s FDC2212 EMI-resistant sensing IC makes use of this principle. It is one member of a family of multi-channel noise- and EMI-resistant, high-resolution, high-speed capacitance-to-digital converters that measure the oscillation frequency of an LC resonator-based sensor. The device outputs a digital value proportional to frequency and sends it to a downstream MCU to be converted to an equivalent capacitance.

The devices in the family offer high rejection of noise and interference and support a wide excitation frequency range. This is especially useful for reliable sensing of conductive liquids such as detergent, soap, and ink.

Figure 6: The FDC211x and FDC2212x devices use an inductive tank as part of the sensing circuit to reduce sensitivity to EMI. (Image courtesy of Texas Instruments)

The FDC221x (x = 1, 2, 4) is optimized for high resolution, up to 28 bits. Another group of parts, the FDC211x, offers sample rates up to 13.3 ksps for applications that use fast-moving targets.

Self-contained capacitive sensors

System-level designers who want the advantages of capacitive sensing, but who need a “plug-and-play” solution, can choose from a variety of pre-packaged sensors for specific applications. These sensors simplify the design by combining the sensor and the interface into a single package. Omron's E2K-L, for example, is a family of capacitive proximity sensors for liquid-level sensing, packaged to fit around pipes of specified diameters. It includes an NPN transistor configured as a normally-open (NO) switch; the switch closes when the liquid inside the pipe reaches the level of the sensor. Figure 7 shows two devices mounted on different pipes.

Figure 7: Omron's E2K sensors are packaged to clamp around a pipe and indicate when a liquid has reached their location. (Image courtesy of Omron Automation)

Conclusion

Capacitive sensing is a flexible technology that is becoming increasingly popular, especially for designs that must operate in hazardous environments. A sensor can be as simple as a conductive area on a printed circuit board, and integrated interface chips are readily available at low cost. Designers must pay attention to EMI and noise issues, though, in order to ensure best performance.

Disclaimer: The opinions, beliefs, and viewpoints expressed by the various authors and/or forum participants on this website do not necessarily reflect the opinions, beliefs, and viewpoints of Digi-Key Electronics or official policies of Digi-Key Electronics.