AN367 U NDERSTANDING CAPACITIVE SENSING SIGNAL TO NOISE R ATIOS AND SETTING RELIABLE THRESHOLDS. 1. Introduction Definition of Terms

Similar documents
Figure 1. 8-Bit USB Debug Adapter

Figure 1. Proper Method of Holding the ToolStick. Figure 2. Improper Method of Holding the ToolStick

AN111: Using 8-Bit MCUs in 5 Volt Systems

AN862. OPTIMIZING Si534X JITTER PERFORMANCE IN NEXT GENERATION INTERNET INFRASTRUCTURE SYSTEMS. 1. Introduction

AN962: Implementing Master-Slave Timing Redundancy in Wireless and Packet- Based Network Applications

AN580 INFRARED GESTURE SENSING. 1. Introduction. 2. Hardware Considerations

AN803. LOCK AND SETTLING TIME CONSIDERATIONS FOR Si5324/27/ 69/74 ANY-FREQUENCY JITTER ATTENUATING CLOCK ICS. 1. Introduction

TS1005 Demo Board COMPONENT LIST. Ordering Information. SC70 Packaging Demo Board SOT23 Packaging Demo Board TS1005DB TS1005DB-SOT

AN486: High-Side Bootstrap Design Using ISODrivers in Power Delivery Systems

UG103.8: Application Development Fundamentals: Tools

AN952: PCIe Jitter Estimation Using an Oscilloscope

UG129: ZigBee USB Virtual Gateway Reference Design (RD ) User's Guide

UG103-13: Application Development Fundamentals: RAIL

Current Digital to Analog Converter

Making Prototyping Boards for the EFM32 kits

AN922: Using the Command Line Interface (CLI) for Frequency On-the-Fly with the Si5346/47

RoHs compliant, Pb-free Industrial temperature range: 40 to +85 C Footprint-compatible with ICS , 2.5, or 3.3 V operation 16-TSSOP

AN583: Safety Considerations and Layout Recommendations for Digital Isolators

ETRX3USB ETRX3USB-LRS ETRX3USB+8M ETRX3USB-LRS+8M PRODUCT MANUAL

Backup Power Domain. AN Application Note. Introduction

Selecting the Right MCU Can Squeeze Nanoamps out of Your Next Internet of Things Application

Bootloader with AES Encryption

AN614 A SIMPLE ALTERNATIVE TO ANALOG ISOLATION AMPLIFIERS. 1. Introduction. Input. Output. Input. Output Amp. Amp. Modulator or Driver

ZigBee-2.4-DK 2.4 GHZ ZIGBEE DEVELOPMENT KIT USER S GUIDE. 1. Kit Contents. Figure GHz ZigBee Development Kit

CPU. PCIe. Link. PCIe. Refclk. PCIe Refclk. PCIe. PCIe Endpoint. PCIe. Refclk. Figure 1. PCIe Architecture Components

Table 1. RF Pico Boards of the EZRadioPRO Development Kits. Qty Description Part Number

Design Challenges for Adding Relative Humidity Sensors

AT11805: Capacitive Touch Long Slider Design with PTC. Introduction. Features. Touch Solutions APPLICATION NOTE

Capacitive Sensing Solutions from Silicon Labs. In this section, we are going to cover the Silicon Labs Capacitive Sensing solutions.

AN0822: Simplicity Studio User's Guide

UG103.14: Application Development Fundamentals: Bluetooth Smart Technology

Telegesis is a trademark of Silicon Laboratories Inc. Telegesis ZigBee Communications Gateway. Product Manual

UG103.8 APPLICATION DEVELOPMENT FUNDAMENTALS: TOOLS

AN588 ENERGY HARVESTING REFERENCE DESIGN USER S GUIDE. 1. Kit Contents. 2. Introduction. Figure 1. Energy Harvesting Sensor Node

Digital Isolator Evolution Drives Optocoupler Replacement

QSG108: Blue Gecko Bluetooth Smart Software Quick-Start Guide

AN75. Si322X DUAL PROSLIC DEMO PBX AND GR 909 LOOP TESTING SOFTWARE GUIDE. 1. Introduction

USB Audio Simplified

QSG105 GETTING STARTED WITH SILICON LABS WIRELESS NETWORKING SOFTWARE

AN655 R ANGE TEST APPLICATION FOR EZRADIO AND EZRADIOPRO. 1. Introduction. 2. Supported Radio Types

CS4525 Power Calculator

Figure 1. Classes of Jitter

Connect the EFM32 with a Smart Phone through the Audio Jack

AN437. Si4432 RF PERFORMANCE AND FCC COMPLIANCE TEST RESULTS. 1. Introduction. 2. Relevant Measurements to comply with FCC

APPLICATION. si32library. Callback CMSIS HARDWARE. Figure 1. Firmware Layer Block Diagram

Touchless switch Object detection Handsets Intrusion/tamper detection. Reflectance-Based Proximity Detection PRX. Signal processing SREN

APPLICATION NOTE. AT12405: Low Power Sensor Design with PTC. Atmel MCU Integrated Touch. Introduction

APPLICATION NOTE. RF System Architecture Considerations ATAN0014. Description

APPLICATION NOTE. AT16268: JD Smart Cloud Based Smart Plug Getting. Started Guide ATSAMW25. Introduction. Features

Si52144 PCI-EXPRESS GEN 1, GEN 2, & GEN 3 QUAD OUTPUT CLOCK GENERATOR. Features. Applications. Description. Functional Block Diagram

Analog to Digital Converter

Clock Jitter Definitions and Measurement Methods

1 Software Overview ncp-uart ash-v3-test-app ash-v3-test-app Command Line Options Testing... 2

Si52142 PCI-EXPRESS GEN 1, GEN 2, & GEN 3 TWO OUTPUT CLOCK GENERATOR WITH 25 MHZ REFERENCE CLOCK. Features. Applications.

AN104 I NTEGRATING KEIL 8051 TOOLS INTO THE SILICON LABS IDE. 1. Introduction. 2. Key Points. 3. Create a Project in the Silicon Labs IDE

How To Develop A Toolstick

PC Base Adapter Daughter Card UART GPIO. Figure 1. ToolStick Development Platform Block Diagram

CP2110-EK CP2110 EVALUATION KIT USER S GUIDE. 1. Kit Contents. 2. Relevant Documentation. 3. Software Setup

Software Real Time Clock Implementation on MC9S08LG32

USER GUIDE EDBG. Description

AVR151: Setup and Use of the SPI. Introduction. Features. Atmel AVR 8-bit Microcontroller APPLICATION NOTE

INTEGRATED CIRCUITS. NE558 Quad timer. Product data Supersedes data of 2001 Aug Feb 14

In the idle state, the TIP lead will be high impedance to ground and the RING lead will have the battery voltage. See Figure 1.

AN335 USB DRIVER INSTALLATION UTILITY. 1. Description. 2. Installation Install Package

Accuracy maintained over the entire operating temperature and voltage range Low Power Consumption

USB FM Radio-RD USB FM RADIO USER S GUIDE. 1. USB FM Radio Setup. One-time set-up enables configuration of presets and region specific FM band

PAC52XX Clock Control Firmware Design

APPLICATION NOTE. AT07175: SAM-BA Bootloader for SAM D21. Atmel SAM D21. Introduction. Features

AN220 USB DRIVER CUSTOMIZATION

AN2680 Application note

IRTC Compensation and 1 Hz Clock Generation

SINGLE-SUPPLY OPERATION OF OPERATIONAL AMPLIFIERS

Simplifying System Design Using the CS4350 PLL DAC

AN220 USB DRIVER CUSTOMIZATION

PESDxU1UT series. 1. Product profile. Ultra low capacitance ESD protection diode in SOT23 package. 1.1 General description. 1.

Product Datasheet P MHz RF Powerharvester Receiver

LEVERAGING FPGA AND CPLD DIGITAL LOGIC TO IMPLEMENT ANALOG TO DIGITAL CONVERTERS

AVR127: Understanding ADC Parameters. Introduction. Features. Atmel 8-bit and 32-bit Microcontrollers APPLICATION NOTE

SEMICONDUCTOR TECHNICAL DATA

GETTING STARTED WITH LABVIEW POINT-BY-POINT VIS

CAN bus ESD protection diode

AT88CK490 Evaluation Kit

CP2102/ V. 48 MHz Oscillator. USB Function Controller. 640B TX Buffer. 576B RX Buffer 1024B PROM. Figure 1. Example System Diagram

Output Filter Design for EMI Rejection of the AAT5101 Class D Audio Amplifier

MICROPHONE SPECIFICATIONS EXPLAINED

Evaluation Board for the AAT1275 Boost Converter with USB Power Switch

Microcontroller-based experiments for a control systems course in electrical engineering technology

Prepared by: Paul Lee ON Semiconductor

Interactive Logging with FlukeView Forms

The Heartbeat behind Portable Medical Devices: Ultra-Low-Power Mixed-Signal Microcontrollers

76-77 GHz RF Transmitter Front-end for W-band Radar Applications

Quad 2-input NAND Schmitt trigger

CryptoAuth Xplained Pro

Flexible Active Shutter Control Interface using the MC1323x

AN2604 Application note

AN LPC1700 timer triggered memory to GPIO data transfer. Document information. LPC1700, GPIO, DMA, Timer0, Sleep Mode

Intel Core i5 processor 520E CPU Embedded Application Power Guideline Addendum January 2011

8-bit RISC Microcontroller. Application Note. AVR182: Zero Cross Detector

APN1001: Circuit Models for Plastic Packaged Microwave Diodes

CS V/250 ma, 5.0 V/100 ma Micropower Low Dropout Regulator with ENABLE

Transcription:

U NDERSTANDING CAPACITIVE SENSING SIGNAL TO NOISE R ATIOS AND SETTING RELIABLE THRESHOLDS 1. Introduction The purpose of this application note is to assist embedded designers as they create and compare the performance of capacitive sensing systems. These systems require a thorough understanding of signal, noise, and threshold levels to insure proper operational conditions of the end product. 1.1. Definition of Terms Inactive: a capacitive sensor switch state that occurs when the intended conductive object is not nearby. Inactive mode is often referred to as off, idle, or baseline; however, baseline is not explicitly a state. Active: a capacitive sensor switch state that occurs when the intended conductive object is within the desired activation range. Signal-to-Noise Ratio (SNR): a quality measure of desired signal level divided by undesired noise. : a system configuration set point that allows a change in parametric state when crossed by a signal of interest. Inactive-to-Active : a user-defined trigger level for changing the state of a switch from Inactive-to-Active. Active-to-Inactive : a user-defined trigger level for changing the state of a switch from Active to Inactive. Safe Zone: a region between the Active and Inactive noise bands where switch thresholds may be set without fear of false threshold activation or sluggish switch response. Hysteresis: a system stabilization method provided through a combination of two thresholds that, after the initial crossing, requires both thresholds to be crossed to trigger a change in parametric state. 1.2. Related Documents The Capacitive Sense Profiler and Capacitive Sense library are documented in: AN0828: Capacitive Sensing Library Overview An overview of the capacitive sensing library, including basic tips and tricks on using the profiler tool. AN0829: Capacitive Sensing Library Configuration Guide Describes how to configure the capacitive sensing library for different application requirements These documents can be found at www.silabs.com/8bit-appnotes or using the application notes tile in Simplicity Studio. Rev. 0.4 6/14 Copyright 2014 by Silicon Laboratories AN367

2. Calculating Simple SNR Signal-to-Noise Ratio is a quality metric that provides the developer with a rough measure of the likelihood of false switching and a means of comparing the relative performance of various implementations. 15950 15900 15850 15800 15750 15700 15650 15600 0 10 20 30 40 50 Time (seconds) Figure 1. Typical Capacitive Sensor Output The graph in Figure 1 illustrates a typical capacitive sensor output. The vertical axis is the measured digital representation (counts) of the capacitance of the sensor versus time. The distinct rise in the waveform indicates the presence of a conductive object near the capacitive sensor. The relative change in digital counts from Inactive to Active is the signal. The noise riding on the Inactive and Active levels in the sensing system comes from many sources. The traditional approach to calculating SNR is to measure the average Active level, subtract the average Inactive level, and divide that result by the peak level of noise witnessed on the Inactive level. This can be measured in digital counts or capacitance. SNR = Avg A Avg I ------------------------------------ Noise I An example using digital counts: SNR 15878 15643 = ------------------------------------------- = 23.5 10 While this measure is sufficient for comparing the relative sensing quality of one implementation to another, the result of this calculation should not be used to set and maintain thresholds. The simple SNR calculation ignores the Active mode noise impact and the trigger thresholds. 2 Rev. 0.4

3. The Impact of Noise In a capacitive sensing system, the embedded designer needs to be prepared to protect the product from false switching. Measuring the signal and setting thresholds seems straightforward; however, it is not as simple as it appears. The first line of defense against false triggering is to understand the level of noise relative to the level of signal and the chosen thresholds. 3.1. Measuring Noise Measuring the noise is a simple process of accumulating samples in both Inactive and Active states, determining the two averages, and calculating the respective standard deviations for every sensing element. The suggested sample size is at least 1000 for calculating the standard deviation in capacitive sensing systems. It is not unusual for the Active mode noise to exceed the Inactive mode noise as the human body often introduces ac line noise into the capacitive sensor. The Inactive mode data is generally a normal (Gaussian) distribution. In typical systems, the Active mode noise is also sufficiently normal for sensor margin calculation purposes. A histogram provides the most meaningful illustration of the Active and Inactive variation. An example is provided in Figure 2. 250 x = 15643 200 Number of Occurrences 150 100 50 1 = 1.8 1 = 6.1 x = 15878 0 15600 15700 15800 15900 250 200 x = 15643 Number of Occurrences 150 100 50 1 = 1.8 1 = 6.1 x = 15878 0 * * horizontal axis not to scale Figure 2. Histogram of Typical Capacitive Sensor Output Rev. 0.4 3

In cases where the data is not normal, the contributing noise factors should be investigated and, if possible, corrected. Non-normal Active noise is often due to signal variation caused by minute changes in the location or pressure of the conductive object. Alternatively, if the noise is too non-normal, the embedded designer may choose to measure the peak noise level over a very large number of samples. The thresholds should be sufficiently separated from the measured peak noise to protect from false switching. 4. Recommendations Setting sensing level thresholds is an important task. Choosing a single threshold for both Active and Inactive switching may cause unwanted instability if the signal hovers near the threshold. For this reason, it is suggested that hysteresis be implemented with dual thresholds. Since not all capacitive sensing devices are capable of dual thresholds, some single threshold devices can provide similar results by dynamically adjusting the threshold. 15950 15900 15850 15800 15750 15700 15650 to- -to- 15600 0 10 20 30 40 50 Time (seconds) Figure 3. Typical Capacitive Sensor Output with s Referring to the two thresholds as upper and lower should be avoided as some applications may require an Activeto-Inactive threshold that is higher than the Inactive-to-Active for product safety reasons. For example, a laser product that is enabled only when in contact with human skin requires the Active-to-Inactive threshold to be higher on the vertical axis than the Inactive-to-Active threshold. Without hysteresis, the region between the two thresholds would be an undefined state where the laser could be either on or off. A histogram serves as a more meaningful illustration of setting thresholds away from the Active and Inactive noise distributions. However, a histogram does not portray the inherent hysteresis of the switch as clearly as other representations. 4 Rev. 0.4

250 Number of Occurrences 200 150 100 50 -to- -to- 0 15600 15700 15800 15900 Figure 4. Histogram of Typical Capacitive Sensor Output with s Setting thresholds is an important step in the development process. Determining the Inactive-to-Active threshold is a compromise between avoiding Inactive state noise from triggering a false Active and responding too sluggishly to true Active signals. Rev. 0.4 5

4.1. Determining Inactive-to-Active The Inactive-to-Active Safe Zone is a range from 3.3 standard deviations of noise above the Inactive average to 1 standard deviation of noise below the Active average. With the Safe Zone identified, set the Inactive-to-Active threshold to 75% away from the Inactive edge of the safe zone. In equation form: SafeZone ItoA = Avg A A Avg I + 3.3 I Initial ItoA = 0.75 SafeZone ItoA + Avg I As an example, the Inactive average from the data in Figure 1 is 15643, the Active average is 15878, the Inactive standard deviation is 1.8, and the Active standard deviation is 6.1. Using the equations above, the Inactive-to- Active Safe Zone is: SafeZone ItoA = 15878 6.1 15643 + 3.3 1.8 = 222 Initial ItoA = 0.75 222 + 15643 = 15809 15950 250 15900 15850 15800 15750 15700 15650 1 { -to- Safe Zone } 3.3 -to- Number of Occurrences 200 150 100 50 3.3 } -to- Safe Zone -to- 1 { 15600 0 10 20 30 40 50 Time (seconds) 0 15600 15700 15800 15900 Figure 5. Typical Capacitive Sensor Output with Inactive-to-Active Safe Zone 6 Rev. 0.4

4.2. Determining Active-to-Inactive Conversely, the Active-to-Inactive Safe Zone is a range from 3.3 standard deviations of noise below the Active average to 1 standard deviation of noise above the Inactive average. With the Safe Zone identified, set the Activeto-Inactive threshold to 75% away from the Active edge of the safe zone. In equation form: SafeZone AtoI = Avg A 3.3 A Avg I + I Initial AtoI = Avg A 0.75 SafeZone AtoI As an example, the Inactive average from the data in Figure 1 is 15643, the Active average is 15878, the Inactive standard deviation is 1.8 and the Active standard deviation is 6.1. Using the equations above, the Active-to-Inactive Safe Zone is: SafeZone AtoI = 15878 3.3 6.1 15643 + 1.8 = 212 Initial AtoI = 15878 0.75 212 = 15719 15950 250 15900 15850 15800 15750 15700 15650 -to- Safe Zone -to- 1 { } 3.3 Number of Occurrences 200 150 100 50 1 { -to- Safe Zone -to- 3.3 } 15600 0 10 20 30 40 50 Time (seconds) 0 15600 15700 15800 15900 Figure 6. Typical Capacitive Sensor Output with Active-to-Inactive Safe Zone Ideally, the signal and noise levels in the system provide far more than 3.3 standard deviations of margin to the threshold levels. At the edge of the Safe Zone, 3.3 standard deviations of margin only provides 1 in 1000 samples violating the Safe Zone. Once the thresholds are set, the margin of safety from false switching can be determined by calculating the number of digital counts between the threshold level from the current switch level (Active or Inactive) and dividing by the standard deviation of that switch level. Rev. 0.4 7

A product with 5 standard deviations of margin above the Inactive level would be expected to maintain a proper Inactive state in 99.99994267% of the samples. Other common confidence intervals are provided in the following table. Standard Deviation ( ) Multiplier Equivalent Percentage 2x 99.45% 3x 99.73% 3.3x 99.90% 4x 99.993666% 5x 99.99994267% 6x 99.9999998027% 7x 99.9999999997440% A product with 6 standard deviations of margin would be expected to maintain a proper Inactive in 99.9999998027% of the sensed samples. The Active-to-Inactive threshold can be adjusted to improve the margin. Using the data from Figure 1 and the calculated Inactive-to-Active threshold from section 4.1. Determining Inactive-to-Active, the margin between the Inactive average and the Inactive-to-Active threshold is: ItoA Avg I Margin ItoA = -------------------------------------------------------- I For a noise data point to trigger the Inactive-to-Active threshold, it would have to be more than 92 standard deviations away from the Inactive average. 4.3. Additional Protections from False Switching While a 6x standard deviation (99.9999998027%) sensing confidence initially appears more than sufficient for most applications, it would not be sufficient enough for the launch switch on a nuclear missile, for example. Statistically, it is extremely unlikely that two or more noise-induced samples beyond the threshold would appear sequentially. Therefore, it is important for the sample-interpreting device (predominantly an MCU) to accept a switch change as valid only if multiple sequential samples are received above or below a given threshold. This additional safety factor, or other real-time data analysis, should render the noise as inconsequential. 4.4. Capacitive Sensing API 15809 15643 Margin ItoA = -------------------------------------- = 92 1.8 The Capacitive Sensing API provides code that implements the dual threshold detection method described in this application note. The Capacitive Sensing API package includes a Human Interface Studio application that displays capacitance values measured by a device and allows the configuration of Inactive-to-Active and Active-to-Inactive threshold levels in real-time. 8 Rev. 0.4

5. Other Areas of Consideration 5.1. Improving Margin Through Baselining There are a variety of system factors that can impact the sensing margins. Variations can occur in any of the following aspects of a touch sense system: Temperature Humidity Supply voltage PCB, Flex, Substrate, or glass Overlay variation Air gap Adhesive Sensing IC Many of these factors change over time and adjustments to the Inactive baseline become necessary. Designs with critical switching requirements should be tested for specific variation impact. 5.2. Improving Margin Through System Layout The greatest impact on margin is often the mechanical design of the capacitive sensor and its connections. For optimal SNR, embedded designers must implement optimal sensor layouts. Here are some key areas of concern: Minimizing stray capacitance Maximizing sensor size within the constraints of neighboring sensors and overlays Minimizing overlay thicknesses Avoiding conductive overlays that span beyond the sensor area Avoiding air gaps For additional information on capacitive sensing and layout considerations, see Silicon Labs Application Note AN447: Printed Circuit Design Notes for Capacitive Sensing with the CS0 Module. Rev. 0.4 9

Simplicity Studio One-click access to MCU and wireless tools, documentation, software, source code libraries & more. Available for Windows, Mac and Linux! IoT Portfolio www.silabs.com/iot SW/HW Quality Support and Community www.silabs.com/simplicity www.silabs.com/quality community.silabs.com Disclaimer Silicon Labs intends to provide customers with the latest, accurate, and in-depth documentation of all peripherals and modules available for system and software implementers using or intending to use the Silicon Labs products. Characterization data, available modules and peripherals, memory sizes and memory addresses refer to each specific device, and "Typical" parameters provided can and do vary in different applications. Application examples described herein are for illustrative purposes only. Silicon Labs reserves the right to make changes without further notice and limitation to product information, specifications, and descriptions herein, and does not give warranties as to the accuracy or completeness of the included information. Silicon Labs shall have no liability for the consequences of use of the information supplied herein. This document does not imply or express copyright licenses granted hereunder to design or fabricate any integrated circuits. The products are not designed or authorized to be used within any Life Support System without the specific written consent of Silicon Labs. A "Life Support System" is any product or system intended to support or sustain life and/or health, which, if it fails, can be reasonably expected to result in significant personal injury or death. Silicon Labs products are not designed or authorized for military applications. Silicon Labs products shall under no circumstances be used in weapons of mass destruction including (but not limited to) nuclear, biological or chemical weapons, or missiles capable of delivering such weapons. Trademark Information Silicon Laboratories Inc., Silicon Laboratories, Silicon Labs, SiLabs and the Silicon Labs logo, Bluegiga, Bluegiga Logo, Clockbuilder, CMEMS, DSPLL, EFM, EFM32, EFR, Ember, Energy Micro, Energy Micro logo and combinations thereof, "the world s most energy friendly microcontrollers", Ember, EZLink, EZRadio, EZRadioPRO, Gecko, ISOmodem, Precision32, ProSLIC, Simplicity Studio, SiPHY, Telegesis, the Telegesis Logo, USBXpress and others are trademarks or registered trademarks of Silicon Labs. ARM, CORTEX, Cortex-M3 and THUMB are trademarks or registered trademarks of ARM Holdings. Keil is a registered trademark of ARM Limited. All other products or brand names mentioned herein are trademarks of their respective holders. Silicon Laboratories Inc. 400 West Cesar Chavez Austin, TX 78701 USA http://www.silabs.com