Don’t Sweat the Small Stuff

Can fixed-function capacitive sensing help embedded developers avoid getting mired in details while balancing energy efficiency and robustness?

Although capacitive sensing solutions have been on the market for decades, the barriers to successful design remain formidable. While balancing the often-conflicting priorities of touch robustness and current consumption, developers must also focus on sensor layout and stack-up and other system-level considerations to create an optimal solution. Below all of these system-level considerations comes the daunting task of creating firmware that filters interference, qualifies touches and produces reliable touch data. Fixed-function capacitive sensing can free developers from the low-level coding concerns of touch qualification and nuanced state maintenance. More development cycles become available to hone the product features and optimize other system-level concerns. Because fixed-function capacitive sensing devices are rarely pure ‘drop-in’ solutions due to the innate complexity of their function, developers must rely on tools and documentation provided by the fixed-function vendor to tune performance in a way that is intuitive, fast, and manageable inside a larger product development workflow.

Figure 1:  A strategy for stretching battery life recognizes that not every component of a remote control device has to be ready to respond to touch at any time.

Figure 1: A strategy for stretching battery life recognizes that not every component of a remote control device has to be ready to respond to touch at any time.

These Challenges Can Fly Under the Radar

Developers add capacitive sensing interfaces to products when a product needs a sleek and attractively low profile interface surface, improved long term reliability compared to mechanical buttons, and a customized interface that ensures their product has a distinctive look and feel. While the benefits of capacitive sensing interface design might be obvious, some of the challenges in capacitive sensing are less evident, especially in early-stage development. Capacitive sensing-enabled code examples may run well in demo environments.  However, developers attempting to drop code from those examples into product firmware may not realize the demo firmware lacks features that make the code product-ready. While development might go smoothly during a proof-of-concept stage, as a product heads into prototyping and deployment stages of development, issues can surface that slow progress and create panicked and expensive revisions, potentially incorporating sub-optimal fixes and hacks to get a product released on time.

All capacitive sensing solutions perform essentially the same task. These sensors combine integrated CMOS designs with external capacitive components to measure minute analog changes, and post-sample processing interprets those changes to characterize user touches. Any sensitive analog sub-system in a mixed signal design faces the challenge of performing optimally in systems where almost every factor—current draw constraints, timing limitations and other components—work in concert to degrade performance.

One rule of thumb that capacitive sensing developers come to learn is that a design never works better than it does when it’s on the developer’s desk. In many ways, a workstation can be an ideal environment for capacitive sensing because so many environmental variables are carefully controlled. Stress testing later in development might reveal susceptibility to interference. And undesirable behavior of the sensing interface, as the sensing component is integrated into a larger system, can occur. Interference immunity can be an insidious problem, hard to characterize and address if left to later-stage development.

Current and timing constraints are two other design factors whose effects sometimes go unnoticed in early stage development. In many cases, developers begin work on an isolated system such as a vendor evaluation board. There is a tendency to ‘turn every knob’ toward sensitivity and robustness in early firmware without noticing that in almost every case improving those metrics comes at the cost of increased current draw and sensing time. As with most analog measurement systems, capacitive sensing touch qualification benefits from sampling more data, more frequently. Unfortunately, sampling at higher frequencies tends to put capacitive sensors into states where current draw is relatively high. Additionally, turning robustness-related features to their maximum can cause touch qualification response time to decrease. The effects of this decreased responsiveness might not be fully apparent at first, because the system in these proof-of-concept stages might be responsible only for monitoring for touches. In later-stage development, if MCU cycles balance capacitive sensing with other responsibilities, this could exacerbate the decreased responsiveness.

Sensor design challenges can cause multiple prototype builds and schedule delays. The shape of a capacitive sensing electrode and its proximity not only to ground pour on a PCB, but also to other board components, can lead to interference and other issues. In many cases the developer first designs tests of a capacitive sensing solution on vendor evaluation boards—unencumbered by design constraints of a developer’s final product. Thus, when the solution moves to a board with a different layout, sensing performance may degrade.

Camp Coding and Its Alternative

The numerous capacitive sensing solutions on the market today divide into two camps: those that require some firmware development; and those that do not require any coding.

An MCU-based solution can be useful in designs that benefit from giving a single microcontroller multiple responsibilities in addition to capacitive sensing. Space-constrained board designs lead many developers to use an MCU with capacitive sensing features, saving board space by reducing the number of chips on a board. In other cases, a developer might need to go the MCU-based route because system-level requirements are such that the sensing solution desired falls outside the capabilities of fixed-function solutions on the market. If requirements are such that the sensor must use a less-common serial or parallel interface to communicate to the larger system, developers might be unable to find a fixed-function solution that can communicate over that interface while also fulfilling other design requirements.

Integrating capacitive sensing into a central MCU creates additional challenges that can be daunting for developers. In the worst case where a developer has chosen an MCU from a vendor without comprehensive capacitive sensing firmware and software support, all sensing firmware must be developed in-house. Coding, debugging, and finally optimizing capacitive sensing firmware against all of the factors that can degrade performance in the field is a task that can easily demand entire teams of developers.

Ideally, developers will find a way to avoid this treacherous path and instead choose a vendor that provides some firmware to be used as a starting point. However, even in the case where an MCU is running thoroughly tested firmware, integration challenges remain. In an MCU that is responsible for multiple tasks in a system, capacitive sensing sample and processing time must be shared among all other responsibilities. Resource sharing requires careful examination of expected worst-case runtime scenarios so that a balance can be struck among components. Otherwise, the capacitive sensing component could become a ’starved thread’ that isn’t responsive or reliable enough to be product-ready. Current consumption is another aspect of resource sharing that must be taken into consideration. MCUs chosen to perform many tasks are often relatively power-hungry. Without careful tuning of capacitive sensing sample time, such an MCU could be forced into a higher power state for a percentage of time that blows through a product’s current budget.

Putting a Lid on Firmware Development Costs

Fixed-function capacitive solutions eliminate the challenges presented by the integrated approach. Most obviously, all of the touch qualification and interference filtering techniques are baked into the fixed-function device, allowing developers to avoid costly firmware development. Instead of managing all the close-to-the-metal details of conversion and processing, the developer will be presented with an interface that is geared toward providing information as concisely and promptly as possible.

A fixed-function device requires that a host MCU be present in a system, monitoring the device for capacitive sensing events as well as managing other responsibilities. At first glance, this might seem to present a current draw issue compared to a solution using the integrated approach. However, because fixed-function devices have been optimized to perform a narrowly defined task, they have been highly optimized for that specific purpose while using minimal current draw. Simultaneously, these devices are usually designed to signal a host MCU in an event-driven manner, meaning that they don’t require constant polling from a host. This use model enables a host MCU to remain in its lowest power state for a higher percentage of time while monitoring the fixed-function signaling pin as a wake-up source. In cases such as these, a two-chip solution—with the larger chip in a deep sleep while the smaller, more current-conscientious chip efficiently scans capacitive sensing inputs—can lower system current draw.

Real World Example: A Remote Control

Deciding whether to go with an integrated or a fixed-function approach demands careful examination of how the product, a remote, for example, will handle real world tasks.  Remote control devices (Figure 1) are increasingly using capacitive sensing surfaces for user input. In its simplest form, a remote control might only have a few components: a user input system, IR transmitter circuit, and an MCU to control the system. An integrated approach might seem ideal in this type of device, because the product requirements are likely not so resource-intensive as to present resource-sharing challenges between the capacitive sensing component and the IR output component.

Figure 2: Simple signal flow diagram with capacitive touch input leading to a host controller driving IR output.

Figure 2: Simple signal flow diagram with capacitive touch input leading to a host controller driving IR output.

A closer examination of the use case, though, reveals how a fixed-function device may lead to a more highly optimized and energy-efficient system. Because all remote control behavior begins with user input —specifically a user pressing one of the buttons on the remote—the MCU controlling other components of the system, such as the IR output, could be placed in a deep sleep to minimize current draw and increase battery life. Also, because the MCU’s system requirements are likely not stringent in this type of application, using an optimized fixed-function solution means that the controlling MCU needs fewer port pins to operate. The controlling MCU won’t need to sense each input on its own. A lower pin count MCU is likely a lower-cost MCU, potentially enabling a developer to design in an MCU that is ‘just good enough’ rather than a chip that is more functionally dense and geared toward ’system on a chip’-style use.

Innovation Not Minutia

An end-to-end fixed-function capacitive sensing solution now on the market comes from Silicon Labs. Our CPT007 and CPT112S fixed-function devices provide reliable touch qualification, best-in-class current consumption and easy configuration through sophisticated software tools. Developers gain streamlined path toward adding button and slider capacitive inputs to a design.

Figure 3: The XPress Configurator lets users configure the characteristics of each sensor.

Figure 3: The XPress Configurator lets users configure the characteristics of each sensor.

In the case of the remote control design, many of the common issues and challenges faced by capacitive sensing developers are present. A developer must create a robust and responsive touch interface that consumes a small enough amount of current so that the system can be battery-powered. A remote control developer who has chosen to use one of the CPT devices can enter the proof-of-concept phase of development using the evaluation kits provided by Silicon Labs, which have sensors on board that can simulate buttons in the developer’s final product. The CPT device interface can be wired to a host MCU, while the CPT device’s configuration and data interface can interface with Simplicity Studio, Silicon Labs’ integrated development environment. Using this setup, users can easily configure characteristics of each sensor through XPress Configurator (Figure 3) as well as examine real-time capacitive output using Capacitive Sense Profiler.

Once a prototype board is designed, Simplicity Studio can still be used to optimize and improve a CPT device in-system through a two-wire interface that can be routed to pads or vias on the prototype board. This feature helps developers overcome challenges that occur when first moving a system away from ‘optimal’ proof-of-concept designs using vendor evaluation boards. Developers can prototype a product’s enclosure and different types of overlays without losing critical visibility into how each design choice affects capacitive sensing performance. Furthermore, supporting documentation guiding sensor design will ensure that a developer designs a board that performs optimally, even in a tightly integrated system.

The last thing that a developer wants to spend the majority of his or her design time on is the minutia of a product’s capacitive sensing component. The more time poured into tweaking firmware or spinning new board revs to avoid crippling interference coupling, the less time a developer can devote to making products that are innovative and distinctive. The goal of capacitive sensing vendors is to streamline the development process so that their customers don’t have to worry about low-level touch qualification issues. Fixed-function capacitive sensing devices take the idea of streamlining development to a logical end point, where all low-level concerns and touch sensing data are abstracted inside a single-purpose chip with configuration and event communication interfaces that have been crafted to be as simple to use as possible. Silicon Labs capacitive touch sensing devices show just how straightforward capacitive sensing development can be, by offering a combination of robust hardware and supporting software that can help a developer overcome the many pitfalls of capacitive sensing design, clearing a path for product design creativity and innovation.

Parker DorrisParker Dorris is a senior applications engineer supporting Silicon Labs’ microcontroller product line. He joined Silicon Labs in 2003 when the company acquired Cygnal Integrated Products. Mr. Dorris specializes in the areas of human interface and USB embedded system design. He holds a BSEE from the University of Texas at Austin.

Share and Enjoy:
  • Digg
  • Sphinn
  • Facebook
  • Mixx
  • Google
  • TwitThis