Capacitive sensing for advanced user interfaces
Challenges of integrating feedback
Noise due to crosstalk
A common backlighting technique for panels is to mount an LED under the sensor pad so that it shines through a hole in the middle of the sensor. When the LED is switched ON or OFF, the voltage transitions on the trace that drives the LED can couple into the capacitive sensor input, creating noisy sensor data. This coupling is referred to as crosstalk. To prevent crosstalk, capacitive touch sensing button traces (shown in Figures 13 and 14 as CapSense Traces) and LED drive traces should be isolated from one another. A minimum separation of 4 mm is recommended. A hatched ground plane also can be placed between those traces to isolate them. LED drive traces and capacitive touch sensing button traces should not be routed together.
Figure 13: NOT Recommended - LED and button (CapSense) traces in close proximity
Figure 14: Recommended - LED and button (CapSense) traces with wide separation
Another approach to reducing crosstalk is to slow down the rising and falling edges of the LED drive voltage using a filter capacitor, as shown in Figure 15. The value of the added capacitor depends on the drive current requirements of the LED; however, a value of 0.1 µF is typical.
These recommendations also apply to the PWM signals used for haptic and audio feedback.
If you use timers or software counters to generate software PWMs, the ISR should be optimized for execution speed, even if it requires additional memory.
Noise due to IR-drop
If your design uses GPIOs to drive LEDs in sinking mode, you may suffer from noise on the IR-drop. When multiple GPIOs sink current at the same time, the IR-drop increases and shifts the ground (reference level). This is a major problem as it can cause false triggering of the buttons. To avoid this problem, minimize the overall sinking current.
LCD inverter noise
If your design includes an LCD inverter you must be careful to keep it from upsetting the capacitive touch sensing system. An LCD inverter induces a lot of noise and reduces SNR drastically.
A simple technique to minimize LCD inverter noise is to partition the system with noise sources from the capacitive touch sensing inputs, as shown in Figure 16. Even a few inches can provide the extra margin required for good sensor performance.
Proximity sensing with capacitive sensing
As discussed earlier, capacitive touch sensing buttons detect a finger’s presence through overlays made of non-conductive materials such as acrylic and glass. In medical and industrial applications, the buttons are operated using gloves. In such cases, the gloves thickness adds to the thickness of the overlay. This reduces the sensitivity of buttons and may cause the touch of a finger to go undetected.
In applications like digital photo frames, LCD monitors/TVs, ID-conscious products, and hidden intercoms, the capacitive touch sensing buttons are hidden. When a human hand approaches the device, the front panel can light up with LEDs to provide an enhanced user interface.
In battery-powered applications low power consumption is crucial. It is a challenging task to optimize both response time to a button touch and power consumption.
When you bring your cell phone near your ear for talking, you do not want the touchscreen to be activated when your face touches it. The touchscreen should be deactivated when the phone approaches your ear and reactivated when it is taken away.
The solution to all of these issues is proximity detection using capacitive sensing technology. Capacitive sensing is by definition proximity detection. For standard buttons, the thickness of the overlay is the proximity setting. The sensor response is highest when a finger is touching the overlay. In true proximity sensing, no contact is required between the sensor overlay and the user's finger or hand. In this application, it is necessary to increase the sensitivity of the sensor over that required for buttons.
Increased sensitivity is realized by acquiring data from the sensor for a greater time. Longer acquisition times allow very small changes in capacitance that arise from more distant conductive objects to be magnified. Therefore, it is possible to detect conductive objects over greater distances while achieving the kind of update rate and response time required.
In battery powered applications, only the proximity sensor is scanned until the hand approaches. Once the proximity sensor is triggered, the rest of the buttons are scanned for button touches. Thus, this algorithm saves power. One more advantage is that it fastens the response time for button touches, as buttons start getting scanned at a fast rate as soon as the hand approach is detected.
Types of proximity sensor implementation
Different applications have different proximity detection range requirements as well as restrictions on PCB layout. These two factors have led to a variety of different proximity sensor patterns. The most commonly used are:
Gang proximity sensor
This is accomplished by combining multiple sensor pads into one larger sensor using firmware to connect and disconnect the sensors from the internal analog multiplexer bus of the Soc. This method can be used when required proximity detection range is 1 or 2 cm.
Proximity sensor using wire
This method gives a larger proximity detection range and is commonly used in applications where there are curved surfaces that cannot accommodate long PCBs.
Proximity sensor using PCB trace
This version of a proximity sensor consists of a long trace around the perimeter of the user interface, as shown in Figure 18. This method provides a larger proximity detection range than gang proximity sensing and is easier to mount than proximity sensors that use wires.
Challenges of proximity sensing
High sensor CP
To achieve a large proximity detection range, the proximity sensor loop size must be large. However, this long sensor trace has a high CP and will need to be scanned for a longer time for accurate touch detection. This results in increased power consumption and decreased response time. One way to reduce CP is to use a shield electrode, as shown in Figure 19.
In order to get good proximity detection range, the sensor data needs to be scanned for a longer time than for simple buttons. Longer acquisition times allow very small changes in capacitance that arise from more distant conductive objects to be magnified. This also magnifies the noise seen by the system, which reduces the signal-to-noise ratio (SNR).
Software filters can be implemented to reduce noise and improve SNR. IIR filters of the appropriate order are used for white noise while averaging filters are used for periodic noise.
Metal objects close to the proximity sensor significantly degrade the proximity detection range. Figure 20 illustrates the effect of a metal object. When a ground casing or metal object is close to the PCB, the electric field lines converge toward the conductive object.
Placing a shield electrode between the sensor and the metal object eliminates this effect, as shown in Figure 22.
Liquid Level Sensing
Water tanks, coffee vending machines, and fuel systems are examples of applications that require liquid level sensors. Mechanical floats, ultrasonic sensors, and conductivity measurements are some of the methods commonly used to perform liquid level sensing. However, these solutions have significant drawbacks, including poor reliability and the inability to be used with beverages and flammable liquids. Using capacitive sensing to perform liquid level sensing is a robust and reliable solution.
Capacitive sensors external to the reservoir measure the change in capacitance caused by a change in the liquid level as shown in Figure 23.
The object capacitance (CO) is the capacitance measured on the outside surface of the tank when liquid is present. The total sensor capacitance is defined by the equation CX = CP + CO.
Challenges of liquid level sensing
Liquid present at power up
As seen in the above equation, CX is CP when there is no liquid in the tank. The capacitive measuring system detects the presence of liquid when CX increases by CO. A problem occurs when liquid, CO, is present on the sensor at power up. CO will be considered to be part of CP, and the sensor will fail to detect the liquid.
There are two ways to solve this problem.
1. A virtual sensor is a dummy sensor with similar physical characteristics to the actual sensor. The virtual sensor does not contact with the liquid in any way, it must remain unaffected by liquid. The raw counts of the virtual sensor will be used as reference for the actual sensor as both these sensors posses same physical properties and must have same baseline ideally.
2. Alternately, you can measure CP during the design phase of your project and store it in nonvolatile memory to be used as a reference.
Temperature drift affects many of the parameters used for capacitance measurement, including CP, current source, and external passive components. This can change the Raw Counts measured for a specific sensor capacitance, as shown in Figure 25, and break the liquid level sensing system.
Figure 25: Temperature (oC) vs. Raw Counts measured without varying sensor Capacitance
There are two ways to account for temperature drift:
1. As mentioned earlier, a virtual sensor has the same physical characteristic as the actual sensor, so the effect of temperature on both the sensors will be same. When the differential capacitance between the two sensors is measured the temperature effect is eliminated.
2. Another solution is to use a software algorithm that creates and updates a reference based upon how quickly Raw Counts change. In general, temperature drift occurs slowly in comparison with the increase in capacitance caused by the presence of liquid. Therefore, an algorithm can be used where the reference is increased when Raw Counts increase slowly and decreased when Raw Counts decrease slowly. This only works if the temperature drift is slow compared to the change caused by the liquid. If this is not the case, a virtual sensor is the best solution.
Tank wall thickness
The tank wall acts as the overlay in the capacitive measuring system. As the thickness of the tank wall increases, the change in capacitance caused by the liquid decreases. Thus small change in capacitance might go undetected. This can be corrected by scanning the sensor for a longer time.
Every liquid possesses a unique viscosity. Table 1 gives the viscosity of some common liquids.
Low viscosity liquids such as water can be accurately measured with capacitive sensing. However, higher viscosity liquids can leave a residue on the side of the tank when it is emptied. This residue can impact the capacitance measurement system and delay when the system detects that the tank is empty.
Capacitive sensing technology is gaining momentum in many markets, from consumer to industrial, primarily due to its ability to sense robustly. Another key factor in the success of this technology is its ability to combine multiple user interface features as well as features beyond the user interface into a single Soc. This type of flexible integration is invaluable in markets where there is constant innovation and competition amongst technologies. As innovations continue to emerge, capacitive sensing technology can make applications feature rich, power savvy, and even more user-friendly.
Subbarao Lanka is a Senior Applications Engineer working in Cypress Semiconductors on Capacitive Touch Sensing applications since 2007. His responsibilities include defining technical requirements for new capacitive sensing controllers, developing new capacitive sensing controllers, conducting system analysis, debugging technical issues for customers, and technical writing. He can be reached at email@example.com.
Shruti H is an Applications Engineer working in Cypress Semiconductors on Capacitive Touch Sensing applications since 2009. She works on defining debugging technical issues for customers, technical requirements for new capacitive sensing controllers, developing new capacitive sensing controllers, conducting system analysis, and technical writing. She can be reached at firstname.lastname@example.org.