The CapSense solution simplifies capacitive touch sensing design.
2026-04-06 01:05:05··#1
Compared to traditional mechanical buttons, sliders, and potentiometers, capacitive touch sensing technology offers numerous advantages and is rapidly becoming the preferred input technology for a wide range of applications, from mobile phone menu navigation to automotive dashboard display buttons. This article introduces a low-cost capacitive touch sensing design developed by Cypress Semiconductor. Capacitive touch sensing technology adds robustness to human-machine interfaces in numerous applications, including industrial and white goods, by sensing the presence of fingers through glass or plastic surfaces of varying thicknesses. The touchpad used in laptops is one of the most well-known examples of capacitive touch sensing. In recent years, many best-selling MP3 players have also adopted capacitive touch sensing technology to provide easy navigation and popularize capacitive touch input methods. However, traditional implementations of this technology employ inflexible, costly modular design solutions and involve licensing issues. To address these problems, Cypress Semiconductor has introduced a new design methodology called CapSense, eliminating the "black box" barrier of modules and achieving the lowest-cost solution to date. Figure 1: Simple Capacitive Switch. Some touch sensing technologies appear similar to capacitive touch sensing (e.g., resistive film and field-effect sensors), but their performance ultimately falls short. Resistive film sensors measure the voltage change between two resistive plates covering a display screen. Resistive films are not only expensive but also prone to wear and have a short lifespan. Field-effect sensors, on the other hand, detect changes in an electric field that occur in the presence of a conductive element. Currently, field-effect implementations are very expensive because they require a system controller, and each switch requires an additional IC. Since each IC sensor must be isolated from nearby sensors, field-effect designs lack flexibility and have limitations, making it practically impossible to implement sliders and touchpads with any effective resolution. Field-effect implementations often require costly switch calibration during manufacturing. Compared to the two aforementioned touch sensing technologies, capacitive touch sensing is much more flexible and much cheaper. Its basic principle is that the presence of a conductive element changes the charging voltage on the capacitive switch. (The simplest capacitive switch consists of only two adjacent conductive plates, as shown in Figure 1). This measured capacitance change can be used to provide a wide range of highly flexible input configurations, from buttons, sliders, and touchpads to proximity detectors for security applications. The CapSense solution is based on Cypress's PSoC mixed-signal array technology. Through close collaboration with specific customers whose applications require a flexible, single-IC architecture that can be easily integrated into existing systems at a lower cost and with greater flexibility than modular solutions, Cypress's PSoC design team ultimately achieved the unique CapSense solution. With modular solutions, customers have to pay for module redesigns by module vendors. Therefore, embedded product engineers urgently need a new approach to gain the initiative by providing methods for quickly implementing unique solutions. This uniquely configurable PSoC architecture and new intuitive software tools together enable the CapSense solution. Both the CY8C21x34 and CY8C24794 PSoC devices include a DAC-adjustable current source, automatic connection of comparators and reset switches, and a unique analog multiplexed bus. This analog multiplexed bus allows all channels under test to be operated by a shared comparator and current source. This means that each IO (28 IOs total) of the CY8C21x34 device and all 48 IOs of the CY8C24794 device can be used for CapSense switches. In contrast, competing solutions often require multiplexers and multiple ICs to provide a comparable number of switches. PSoC offers superior integration and significant BOM cost savings. The PSoC architecture not only boasts excellent capacitive touch sensing adaptability but also employs the best technology for handling capacitance changes, for two reasons: it is an open technology (not subject to expensive patent royalties) and it is implemented using easy-to-use design tools. Relaxation Oscillator Technology Relaxation oscillator technology is a specific method used by PSoC devices to perform capacitive touch sensing. Figure 2 shows the PSoC device configuration for implementing a relaxation oscillator. Figure 2: Relaxation Oscillator Block Diagram. The relaxation oscillator consists of a capacitive switch, a charging current source, a comparator, a reset switch, a PWM, and a timer. The voltage across the capacitor charges linearly until a threshold is reached, triggering the comparator to output a high level. This starts the switch and then resets the voltage across the capacitor to ground (thus restarting the charging cycle). Its oscillation waveform is shown in Figure 3. Figure 3: Relaxation Oscillator Waveform. The output frequency of this oscillation depends on the capacitance value (Cp) and the charging current. If an additional conductive element (such as a finger) is not on the switch, Cp consists only of parasitic capacitance. If a finger is present, the value of Cp increases because it includes additional capacitance formed by the conductive element in addition to parasitic capacitance. The larger the capacitance, the longer the charging time, and the lower the oscillation frequency. The oscillation frequency corresponds to the size of the capacitor driven by the oscillator output. A digital counter provides a count value (n) that can be used to determine whether the capacitive switch has been activated. The digital counter can be configured to provide two different measurement methods: frequency measurement and period measurement. (See Figure 3 for the period measurement method.) As the names suggest, these measurement methods differ in the physical quantity being measured. In period measurement, the PWM frequency is fixed, and the period length is determined by the relaxation oscillator. Conversely, frequency measurement techniques have a fixed period and measure the change in the PWM frequency (which is determined by the frequency of the relaxation oscillator). In both cases, the PWM output will enable a timer whose count (n) can be associated with a specific threshold to achieve a simple on/off switch. Alternatively, since a switch can have an interpolation resolution of up to 1/256, the timer count (n) can be used to determine the position of a slider or touchpad. The user-friendly PSoC Designer software makes both methods easy to implement. Simplified Function Block Implementation Design: The PSoC device is a complex mixed-signal array with an onboard 8-bit controller and high flexibility. The majority of the chip consists of analog and digital blocks controlled by registers that can be configured to implement onboard peripherals such as PWM, timers, counters, ADCs, programmable gain amplifiers, and many other components, all belonging to the same device. Because PSoC devices are flash-based, these function blocks can be reconfigured 50,000 times and can be freely reconfigured. Embedded product engineers can quickly configure these functions one by one and interact with the PSoC device at the register level; they can also save significant design time by using the PSoC Designer user module (available for free download from www.cypress.com) for function block-level device configuration control. PSoC Designer includes a library of over 50 user modules. Cypress provides engineers with a simple design wizard and parameter tables during the user module selection process. Each user module automatically configures the appropriate PSoC registers and provides a set of application programming interfaces (APIs). These APIs enable engineers to simplify code, implementing a PWM with just two lines of code. This simplified function block-based design standard also applies to capacitive touch sensing. The CSR user module (Capacitive Switch Relaxation Oscillator) provides drop-down parameter settings, a GUI configuration wizard, and a detailed product manual to answer questions related to board layout and duplexing, resulting in more efficient slider or touchpad implementations. Figure 4 shows a photograph based on the CSR GUI configuration wizard. Figure 4: CSR Configuration Wizard. In addition to the user module, Cypress provides several related application notes (AN2233a: Capacitive Switch Scanning and AN2292: PSoC CapSense Layout Guide) to provide engineers with further design support. Two demonstration boards, along with the user guide, supporting firmware, and application notes, constitute the basic CapSense design (CY3220-FPD and CY3220-Slider). To assist designers new to CapSense, Cypress also offers a training kit that provides detailed instructions on CapSense implementation. It includes a training board (see Figure 5). The combination of the training kit, easy-to-use design tools, flexible and powerful architecture, and patent-free measurement technology makes PSoC CapSense ideal for all capacitive touch sensing designs. Figure 5: Training Board (CY3212 - CapSense)