CAPSENSE™ & MagSense Forum Discussions
CapSense capacitive-sensing also provides capacitive proximity detection. Proximity sensors detect the presence of a conductive object (such as a hand) in a three-dimensional space around the sensor. However, the actual output of the proximity sensor is an ON/OFF event, similar to a button. Proximity sensing can detect an object at a distance of several centimeters to tens of centimeters depending on the sensor design. This is also a good replacement for IR sensors and other proximity sensors out in the world today.
Proximity sensing requires electric fields that are projected to much larger distances than buttons and sliders. This requires a large sensor area. However, a large sensor area also results in large parasitic capacitances, Cp, and detection becomes more difficult. This requires a sensor with high electric field strength at large distances while also having a small area. Recommendations are to use a trace with a thickness of 2-3mm surrounding the other sensors.
Proximity Sensor
To find out more, please check the PSoC 4 and PSoC 6 MCU CapSense Design Guide.
Show LessCapactive-sensing is used in a variety of applications such as home appliances, automotive, and industrial applications. These applications require robust capacitive-sensing even in the presence of mist, moisture, water, ice, and humidity changes. In a capacitive-sensing design, false touches or proximity detection can happen due to the presence of a film of liquid or liquid droplets on the sensor surface, due to the conductive nature of some liquids. Cypress' CapSense capacitive-sensing provides liquid tolerant features for capacitive sensors. When a liquid is on the sensor, CapSense can identify the capacitive characteristics of a liquid vs. finger and reject false events in wet conditions, delivering a robust, intelligent, and easy-to-use method to get a capacitive-sensing design to production.
Liquid-Tolerant CapSense-Based Touch UI in a Washing Machine
To compensate for changes in the capacitive signal due to mist, moisture, and humidity changes, CapSense continuously adjusts the baseline signal of the sensor to prevent false events. To compensate for the changes in the signal due to wet conditions, a Shield Electrode and Guard Sensor should be implemented to provide robust touch sensing.
Shield Electrode (SH) and Guard Sensor (GUARD) Connected to CapSense Controller
To find out more, please check the PSoC 4 and PSoC 6 MCU CapSense Design Guide.
Show LessTuning and Signal-to-Noise Ratio (SNR)
Tuning and SNR
- Set MagSense Tuning parameters: Set the tuning parameters outlined in the Getting Started with MagSense section in the Inductive Sensing Design application note. The most critical parameters are the Lx clock frequency and the number of sub-conversions, the number of conversions per data sample. Ensure that the Lx clock frequency is set to the resonant frequency of the LC tank (f0).
Inductive-Sensing Tuning Flow
2. Measure SNR: See Ensure SNR Is Greater Than or Equal to 5:1 in the Inductive Sensing Design application note. If the SNR measured is greater than or equal to 5:1, proceed to Step 5; otherwise, enable filters and measure the SNR again.
Computing SNR
To compute the SNR, acquire a fixed number of samples, for example 2,000 raw count samples, as Figure 17 shows, and measure the peak-to-peak noise count. Place your target at the required proximity-sensing distance and measure the shift in raw counts. The signal will be equal to the raw count (after placing the target) minus the average raw count (before placing the target.)
3. (SNR< 5:1) Enable FW filters or increase the number of sub-conversions: See Table 3 in the Inductive Sensing Design application note.
Simple filters such as median, average, and infinite impulse response (IIR) filters may not be able to attenuate the higher noise amplitude in sensors, so you may need to use the advanced low-pass filter (ALP filter). The ALP filter is designed specifically for attenuating noise in the inductive sensor and providing a fast response time. See Advanced Low-Pass (ALP) Filter section in the Inductive Sensing Design application note.
4. Max sub-conversions/All filters used: If all filters are enabled and the number of sub-conversions is set to a maximum, defined by Equation [9], debug is required to determine the reasons for the design not meeting SNR >= 5:1. See Design Debug in the Inductive Sensing Design application note.
5. (SNR ≥ 5:1) System meets timing: If SNR ≥ 5:1, it is important to check the system meets timing requirements. You might need to reduce the number of sub-conversions or remove filters if the SNR and scan time are high.
6. Set the system thresholds: After the scan time and SNR meet requirements, it is important to set the firmware thresholds for optimum detection of the target.
For more details on tuning, please check the Inductive Sensing Design Guide.
Show LessDesign Considerations
Sensor design plays a crucial role in achieving optimal inductive-sensing designs.
Sensor Resonance Frequency
The sensor requires a capacitor (C) in parallel to form a parallel resonant circuit. The inductance and capacitance of that circuit determine the resonant frequency (f0) according to the simplified expression f0= 1/(2π √LC)
The range of currently supported inductance is indicated by the graph below, where the minimum resonant frequency of operation is 45 kHz and the maximum is 3 MHz.
Range of Supported Inductance and Capacitance Values
Capacitance Range
The supported capacitance range is 0.1 nF to 470 nF. The 0.1 nF lower limit is defined to reduce the effect of coil parasitic capacitance on the resonant frequency (f0). The upper limit is based on the availability of NPO (also referred to as COG) grade capacitors, which are easy to obtain up to 470 nF.
Inductance Range
The supported inductance range is 1 μH to 10,000 µH. The 1 μH lower limit is defined by practical inductance values that can operate with the Lx frequency up to 3 MHz. Inductances > 10 μH are preferred.
Sensor Shape
The shape of the inductive sensor is important because it determines the shape of the generated magnetic field and therefore the change in inductance in the presence of a target metal object. The following are common shapes of PCB and flex coils:
- Circular coil: Circular coils are generally used when sensing a target object that is moving orthogonal to the sensor plane.
Circular Coil with Illustration Showing Optimal Plane of Movement
- Hexagonal coil: Hexagonal coils are designed to approximate circular coils in cases where a circular oil is difficult to manufacture.
- Square coil: Square coil provides optimal performance with respect to sensitivity in both horizontal and vertical directions.
Hexagonal Coil and Square Coil Examples
- Rectangular coil: Rectangular coils can be used to detect movement along a preferred axis.
Rectangular Coil with Illustration Showing Optimal Plane Movement
Sensor Parameters
For a given shape, the sensor coil is specified by the following parameters, some of which are illustrated in the figures above:
- n, the number of turns.
- w,
- s, the turn spacing.
- Din, the inner diameter.
- Dout, the outer diameter – usually either Din or Dout needs to be specified; the other can be derived from other parameters
To find out more about inductive-sensing designs, check out the Inductive-Sensing Design Guide.
Show LessHow Does MagSense Work?
Cypress’ PSoC 4700 MCUs provide support for MagSense inductive-sensing. This figure shows the inductive-sensing system using a PSoC 4700 MCU. A capacitor, C, is placed in parallel with the coil to create a parallel LC “tank”. The tank has a resonant frequency provided by the following equation: f_0= 1/(2π √LC)
The frequency of the Lx GPIO (sensor excitation pin) is set to the resonant frequency of the tank (f0). The pin drives the tank circuit through a resistor, RLX. The impedance of the tank circuit is the maximum at the resonant frequency, so a significant sinusoidal component with amplitude VAMP (peak) appears across the tank circuit. This signal is AC-coupled into the Amplitude to Digital Converter through the capacitance Cc and is then converted into equivalent raw counts. A change in inductance of the LC tank causes a change in VAMP resulting in a change in the raw count of corresponding channels.
PSoC 4700 MCU MagSense Inductive-Sensing System
This system has the advantage that it excites the tank circuit to a know frequency. Multiple tank s can be set to resonate at different frequencies. Also, the frequency of operation of the tank circuit is controlled and can be designed for robust EMC performance. The practical coil impedance is represented as an Inductance (L) with a series resistor (Rs).
LC Tank Resonance Circuit
To find out more, checkout the Inductive Sensing Design Guide.
Show LessTuning and Signal-to-Noise Ratio (SNR)
SNR
In practice, the raw counts (digitized capacitance values) vary due to inherent noise in the system. CapSense noise is the pk-to-pk variation in raw counts in the absence of touch. A fine-tuned CapSense system reliably discriminates between the ON and OFF states of the sensor. To achieve good performance, the CapSenes signal must be significantly larger than the CapSense noise. SNR, which is defined as the ratio of CapSense signal to CapSense noise is the most important performance parameter of a CapSense sensor.
In this example, the average level of raw count in the absence of a touch is 5925 counts. When a finger is placed on the sensor, the average raw count increases to 6060 counts, which means the signal is 6060 – 5925 = 135 counts. The minimum value of the raw count in the OFF state is 5912 and the maximum value is 5938 counts. Therefore, the CapSense noise is 5938 – 5912 = 26 counts. This results in an SNR of 135 / 26 = 5.2.
The minimum SNR recommended for a CapSense sensor is 5. This 5:1 ratio comes from best practice threshold settings, which enable enough margin between signal and noise in order to provide reliable ON/OFF operation.
Tuning
SmartSense
SmartSense is a FW algorithm that automatically sets all CapSense tuning parameters to optimum values. Advantages of SmartSense vs. Manual Tuning are:
- Reduced Design Cycle Time: The design flow for capacitive touch applications involves tuning all of the sensors. This step can be time consuming if there are many sensors in your design. In addition, you must repeat the tuning when there is a change in the design, PCB layout, or mechanical design. Auto-tuning solves these problems by setting all of the parameters automatically.
- Performance is independent of PCB variations: the Cp of individual sensors can vary due to process variations in PCB manufacturing, or vendor-to-vendor variation in a multi-sourced supply chain. If there is significant variation in CP across product batches, the CapSense parameters must be re-tuned for each batch. SmartSense sets parameters for each device automatically, hence taking care of variations in CP.
- Ease-of-use: SmartSense is faster and easier to use because only a basic knowledge of CapSense is needed.
Manual Tuning
Cypress SmartSense technology allows a device to calibrate itself for optimal performance and complete the entire tuning process automatically. This technology will meet the needs of most designs, but in cases where SmartSense does not work or there are specific SNR or power requirements, the CapSense parameters can be adjusted to meet system requirements. This is called manual tuning.
Some advantages of manual tuning, as opposed to SmartSense auto-tuning are:
- Strict control over parameter settings: SmartSense sets all of the parameters automatically. However, there may be situations where you need to have strict control over the parameters. For example, use manual tuning if you need to strictly control the time PSoC 4 takes to scan a group of sensors or strictly control the sense clock frequency of each sensor (this can be done to reduce EMI in systems).
- Supports higher parasitic capacitances: SmartSense supports parasitic capacitances as high as 45 pF for a
0.2-pF finger capacitance, and as high as 35 pF for a 0.1-pF finger capacitance. If the parasitic capacitance is higher than the value supported by SmartSense, you should use manual tuning.
To find out more in detail, please check the PSoC 4 and PSoC 6 MCU CapSense Design Guide.
Show LessDesign Considerations
Sensor Construction
A capacitive sensor can be constructed using different materials depending on the application requirements. In a typical sensor construction, a conductive pad, or surface that senses a touch is connected to pin of PSoC MCUs using a conductive trace or ink. This arrangement is placed below a non-conductive overlay material and the user interacts on the top of the overlay
Typical CapSense Sensor Construction
The copper pads etched on the surface of the PCB act as CapSense sensors. A nonconductive overlay serves as the touch surface. The overlay also protects the sensor from the environment and prevents direct finger contact. A GND hatch surrounding the sensor pad isolates the sensor from the other sensors and PCB traces. The simplest CapSense PCB design is a two-layer board with sensor pads and hatched GND plane on the top layer, and the electrical components on the bottom layer.
CapSense Hardware
Overlay Selection
The overlay is an important parameter of a CapSense system, as it determines the magnitude of finger capacitance. The finger is directly proportional to the relative permittivity of the overlay material. This table shows the relative permittivity of some common overlay materials. Materials with relative permittivity between 2.0 and 8.0 are well suited for CapSense overlays.
NOTE: conductive materials interfere with the electric field pattern. Therefore, use of conductive overlay materials is not recommended.
Relative Permittivity of Overlay Materials
Material | er |
---|---|
Air | 1.0 |
Formica | 4.6 – 4.9 |
Glass (Standard) | 7.6 – 8.0 |
Glass (Ceramic) | 6.0 |
PET Film (Mylar®) | 3.2 |
Polycarbonate (Lexan®) | 2.9 – 3.0 |
Acrylic (Plexiglas®) | 2.8 |
ABS | 2.4 – 4.1 |
Wood Table and Desktop | 1.2 – 2.5 |
Gypsum (Drywall) | 2.5 – 6.0 |
Overlay Thickness
Finger capacitance is inversely proportional to the overlay thickness. Therefore, a thin overlay gives more signal vs. a thick overlay. This table lists the recommended maximum thickness of acrylic overlays for different CapSense sensor types.
Because finger capacitance also depends on the dielectric constant of the overlay, the dielectric constant also plays a role in the guideline for the maximum thickness of the overlay. Common glass has a dielectric constant of approximately εr = 8, while acrylic has approximately εr = 2.5. The ratio of εr/2.5 is an estimate of the overlay thickness relative to plastic for the same level of sensitivity. Using this rule of thumb, a common glass overlay can be about three times as thick as a plastic overlay while maintaining the same level of sensitivity.
For CSX sensing, it is recommended to have minimum overlay thickness of 0.5 mm.
Maximum Thickness of Acrylic Overlay
Widget | Maximum Thickness (mm) |
---|---|
Button | 5 |
Slider | 5 |
Touchpad | 0.5 |
Overlay Adhesives
The overlay must have a good mechanical contact with the PCB. You should use a nonconductive adhesive film for bonding the overlay and the PCB. This film increases the sensitivity of the system by eliminating the air gap between the overlay and the sensor pads. 3M™ makes a high-performance acrylic adhesive called 200MP that is widely used in CapSense applications. It is available in the form of adhesive transfer tapes; example product numbers are 467MP and 468MP.
To find out more, please check the PSoC 4 and PSoC 6 MCU CapSense Design Guide.
Show LessHow Does CapSense Work?
All PSoC MCUs support CapSense capacitive-sensing. The figure below shows the self-capacitance of each electrode modeled as CSX and the mutual-capacitance between the electrodes modeled as CMXY. The CapSense circuitry internal to PSoC MCUs converts these capacitance values into equivalent digital counts (raw counts). These digital counts are then processed by the CPU to detect touches.
PSoC MCU, Sensors, and External Capacitors
CapSense also requires external capacitor CMOD for self-capacitive sensing and CINTA and CINTB capacitors for mutual-capacitive sensing. These external capacitors are connected between a dedicated GPIO and GND.
The capacitance of the sensor pad in the absence of touch is called the parasitic capacitance (Cp). Cp results from the electric field between the sensor (including the senor pad, traces, and vias) and other conductors in the system such as GND planes, traces, and any metal in the product’s chassis or enclosure. The GPIO and internal capacitances of PSoC also contribute to the Cp. However, these internal capacitances are typically very small compared to the sensor capacitance.
To find out more, checkout the PSoC 4 and PSoC 6 MCU CapSense Design Guide.
Show Less- « Previous
- Next »