techniques for robust touch sensing designww1.microchip.com/downloads/en/appnotes/00001334b.pdf ·...

Download Techniques for Robust Touch Sensing Designww1.microchip.com/downloads/en/AppNotes/00001334B.pdf · The purpose of this application note is to describe the ... Techniques for Robust

If you can't read please download the document

Upload: hoangnguyet

Post on 06-Feb-2018

218 views

Category:

Documents


0 download

TRANSCRIPT

  • AN1334Techniques for Robust Touch Sensing Design

    INTRODUCTIONThe purpose of this application note is to describe thebest design practices when developing capacitivetouch applications for noisy environments. Thisapplication note will begin by defining the problemscaused by noise, and explain how that noise typicallyaffects systems. Hardware guidelines will then beprovided to help maximize the natural signal-to-noiseratio (SNR) of the application. Software techniques arethen covered to describe some of the commonmethods used to filter a sensors signal to increase theSNR further, and then to make a decoding decisionbased on the behavior of the capacitive sensor.

    The hardware design topics that will be covered are:

    1. Button and slider pad design and spacing2. Overlay material and thickness3. Adhesive layer recommendations4. Sensor trace layout and series resistance5. Layout techniques for ESD protection6. Power supply grounding scenarios7. Choosing VDD and bypass capacitors

    mTouch and RightTouch sensing solution systemshave passed industry test standards in conducted andradiated susceptibility, and radiated emissions. Thisapplication note describes the important aspects ofcapacitive touch design which, when coupled with goodprinted circuit board (PCB) techniques, will allow thesesystems to continue performing in these extremetesting conditions.

    For information on the basics of capacitive touchsensing and other more advanced topics, visit theMicrochip touch and input sensing solutions web site athttp://www.microchip.com/mTouch.

    Basic Capacitive Touch ReviewCapacitive sensors are areas on a PCB that have beenfilled with copper and then connected back to the PICdevice using a trace. The PIC device will then measurethe sensor in some manner that allows it to notice smallshifts in capacitance typically caused by a users fingerapproaching the sensor. The capacitance iscontinuously read in software and when a changeoccurs, the system will register a press on that sensor.

    In Figure 1, CBASE is the capacitance value when noobject is over the pad. This is referred to as thesensors base capacitance. CF is the capacitancechange caused by a finger touch, and CT is the totalcapacitance of the sensor.

    FIGURE 1: CAPACITIVE SENSOR SYSTEM

    The capacitances in this system can be calculated bythe parallel plate capacitance shown in Equation 2. It isimportant to understand that in real applications thecapacitive sensor system is much more complex thanEquation 1. Generally speaking, the system could beconsidered as a network of capacitors, resistors, andinductors which are a result of the PCB, the overlay, thehuman body, and the environment. Therefore, it is verydifficult to calculate the exact characteristics of acapacitive sensor system.

    The recommendations in this application note arebased on lab test results and are not absoluteconditions. Users can always make their ownadjustments based on the capacitance equation andtheir own applications needs.

    Author: Burke DavisonMicrochip Technology Inc.

    Overlay

    SensorPad

    PCBSubstrate

    GND

    C0

    C0CF

    CT = C0 + CF

    2010-2013 Microchip Technology Inc. DS00001334B-page 1

    http://www.microchip.com/mTouchhttp://www.microchip.com/mTouch

  • AN1334

    EQUATION 1: PARALLEL PLATE

    CAPACITANCE

    There are two fundamental methods for detecting ashift in capacitance using a microcontroller. The first isto use a voltage measurement where the systemmanipulates the pin of the sensor, to place a voltagebased on the amount of capacitance on the pin, andlooks for a shift in the voltage reading on the sensor.This includes methods such as Microchips ChargeTime Measurement Unit (CTMU) and CapacitiveVoltage Divider (CVD). The alternative is to measurethe sensor using a frequency approach, such as theRightTouch scanning method, which uses apseudo-randomized frequency to sense changes incapacitance. The waveforms for all three scanningmethods can be found below in Figure 2.

    FIGURE 2: CAPACITIVE SENSING ACQUISITION WAVEFORMS

    Acquisition WaveformsThis application note will focus on the hardware designof the system and the sections of firmware not involvedin signal acquisition. For designs implementing theCVD or CTMU techniques, the source code available inthe Microchip Library of Applications implements thisfor the designer. If using a RightTouch turnkey product,these techniques are built-in as part of the solution.

    Noise Immunity vs. Low PowerWhen developing a capacitive touch system, it isimportant to know what your main goal should be fromthe very start of product development. For the majorityof applications, how the system is powered will answerthis question. For line-powered systems, conductednoise immunity is the main concern. Forbattery-powered systems, low power is the mainconcern.

    It is also possible that some systems may overlapbetween these two regions. A cell phone that has theoption of being powered through a USB cable is oneexample. The majority of the time, it would beconcerned with low power; however, it needs to becareful of conducted noise when being poweredthrough the main line. For this reason, onlyvoltage-based acquisition methods should be used inthese systems.

    While noise immunity and low power are not mutuallyexclusive, focusing on one will require that designtrade-offs be made to the other. For example, imple-menting a slew rate limiter filter to reduce susceptibilityto conducted noise will require increasing the samplerate of the system, which will increase the overallpower consumption. Lowering VDD is an excellent ideain low-power applications, but doing so will alsodecrease your noise immunity (see Section PowerSupply Considerations). This application note focuseson decreasing noise susceptibility and treats low poweras a secondary goal. If low power is the main goal ofthe application, visit http://www.microchip.com/XLP formore technical details.

    EFFECTS OF NOISE ON CAPACITIVE TOUCH SENSORS

    Push Buttons vs. Capacitive SensorsBefore considering how to develop a robust capacitivetouch application, it is important to understand thefundamental reason why noise is a concern. Whenusing a mechanical button, the microcontrollers portcircuitry decides whether the switchs pin is beingpulled high or low and provides a single-bit digital resultto the user. This result is then debounced to adjust forringing, and the state of the button is based on the stateof the debounce variable.

    Capacitive touch sensor applications, however, areanalog. The first clear difference is the need tomanually perform the reading process. When using amechanical switch, the microcontroller is able to readthe pin using its internal hardware logic. For capacitivetouch applications, separate hardware modules willneed to be used to manipulate the sensor line. Whetherit is using a voltage-based measurement or afrequency-based measurement, the analog result willbe provided in the form of an integer value. This valueis then typically filtered using different digital signalprocessing techniques to amplify the signal andattenuate the noise. The filter value is then sentthrough some form of debounce algorithm and a morecomplex decoding process. An extra layer ofcomplexity is also added when the system is designedto perform in a closed loop manner, adjusting itsbehavior based on the sensors current state.

    C r0Ad---=

    Where:r = relative permittivity of the dielectric material0 = permittivity of space (8.854 x 10

    -12 F/m)A = plate area in square meters (m2)d = distance between the plates in meters (m)

    Charge Time Measurement Unit(CTMU)

    Capacitive Voltage Divider(CVD)

    RightTouch Sensing(CAPxxxx Devices)

    DS00001334B-page 2 2010-2013 Microchip Technology Inc.

    http://www.microchip.com/XLP

  • AN1334

    The capacitive touch software process can besimplified into three distinct phases:

    1. Acquisition

    Using a voltage-based or frequency-basedmeasurement technique to obtain a sample fromthe capacitive touch sensor.

    2. Filtering

    Manipulating the incoming sensor samples toincrease the effective SNR of the system byattenuating the noise.

    3. Decoding

    Determining whether a sensor is pressed orreleased based on the current value of the sen-sor samples and the sensors previous behavior.

    Figure 3 illustrates the difference between pushbuttons and capacitive touch sensors, and labels thethree main software stages of a capacitive touchsystem.

    FIGURE 3: PUSH BUTTON VS. CAPACITIVE SENSOR SOFTWARE PROCESS

    Conducted and Radiated NoiseConducted and radiated are the two mainclassifications of injected noise that can createinstability in capacitive touch systems. Conductednoise is caused in systems that are powered externallyfrom the device. This can include systems powered offthe main-line power, desktop-powered USB devices, orany other situation that may mean the user is notsharing a ground with the application.

    Radiated noise is a common challenge across allcapacitive touch systems. In particular, if the capacitivetouch sensor is a high-impedance input when beingscanned, it essentially performs as a high-frequencyantenna. Thus, electronic devices radiatingelectro-magnetic fields near the capacitive touchsystem will cause the readings to be affected. This caninclude cell phones, high-power communication lines,and fluorescent lights to name a few.

    There are two main reasons why these two types ofnoise show up:

    1. When a user presses on a capacitive touch sen-sor, he/she is becoming part of the system, so, ifthe user and the system are on different groundreferences, the system will interpret the user asan injected AC signal on the sensor.

    2. Analog readings are susceptible to outsideforces pushing them slightly in one direction orthe other. The digital result of a mechanicalswitch is either high or low.

    This application note will describe the different systemdesign techniques that are recommended to overcomethese two noise types. In addition to these guidelines,designers should be aware of the future workingenvironment of the application and ensure there are noexcessively noisy electronics nearby that may interferewith the system.

    Capacitive Sensor Noise BehaviorInjecting noise on a capacitive touch sensor will causethe system to become more unstable. Voltage-basedmTouch sensing solution reading methods such asCTMU and CVD will be affected differently thanfrequency-based reading methods, the RightTouchscanning method. In voltage-based systems, thevoltage of the sensor at a specific point in time is whatdetermines the integer value of the reading. Infrequency-based systems, the effect on the readingswill vary based on the frequency of the injected noiseand the frequency of the sensors oscillation.

    NOISE BEHAVIOR: FREQUENCY-BASED ACQUISITIONFrequency-based acquisitions methods must performfrequency-hopping techniques to eliminate harmonicnoise concerns. This is handled automatically by theRightTouch turnkey products, and is always enabled.Additionally, multiple proprietary techniques are usedto sense and adjust for noise in the device.

    Read Port Acquisition

    Application

    Push Buttons

    Filtering

    Decoding

    Capacitive Sensors

    (Digital) (Analog)

    (Digital)

    2010-2013 Microchip Technology Inc. DS00001334B-page 3

  • AN1334

    NOISE BEHAVIOR: VOLTAGE-BASED ACQUISITIONIn voltage-based systems, injected noise can cause apositive or negative offset away from the naturalsample value. If the sampling rate falls on a harmonicof the injected noise, resonance can occur. When thishappens, the samples are falling on the peaks orvalleys of the injected noise. An example of this behavior can be seen in Figure 4.When sampling at one of these harmonics, thereadings may all fall on the peaks of the noise orsomewhere in the middle based on the starting time ofthe acquisition. Because of this, multiple readings atthe same frequency will show a large amount of noise.This can be seen in Figure 5 where some of the noisefrequencies are harmonics of the sampling rate andothers are not.

    FIGURE 4: VOLTAGE-BASED HARMONIC FREQUENCY ACQUISITION

    The Microchip Library of Applications, available athttp://www.microchip.com/mla, implements acquisitionand filtering techniques to eliminate this behavior fromthe sensors outputs.

    FIGURE 5: VOLTAGE-BASED ACQUISITION NOISE FREQUENCY RESPONSE

    DS00001334B-page 4 2010-2013 Microchip Technology Inc.

  • AN1334

    Signal-to-Noise RatioIn order to understand how hardware and softwarechanges affect the system, it is necessary to have away of measuring the signals current performance.Sensitivity, or the amount that the system shifts, is nota sufficient measurement to define if a system is stable.For example, in a system where the average sensoroutput value is 20000 and a shift of 2000 is reached,you could simply subtract 18000 from each reading andclaim a 100%, 2000 count shift was achieved. In reality,however, the shift or signal must be compared withthe amount of noise. If noise was causing the sensor todrift by 1000 counts at any point in time, the system isin trouble.One of the easiest ways to determine how stable asystem is, or how much the system is affected by noise,is to look at its Signal-to-Noise Ratio (SNR). Just as itsounds, this is a way of measuring how strong thesignal is when compared to unwanted disturbances ofnoise.For the purpose of this application note, the SNRformula being used is defined in Equation 2.

    EQUATION 2: SIGNAL-TO-NOISE RATIO

    The numerator of the equation is the amount that thesystem will shift when pressed or the signal. Thedenominator is a measure of how much the noise isable to affect the readings. Using these as a ratio, asingle number can be used to describe the quality ofthe sensors signal by answering the question: Howmuch shift do you require compared to the amount ofnoise you are trying to avoid? If conducted noise is present on the system, the SNRwill change when the sensor is pressed versusreleased. It may also change based on the frequencyof the injected noise.

    An example SNR calculation is shown below(Figure 6).

    FIGURE 6: SNR CALCULATION

    There are other formulas to calculate the SNR of asystem. The important thing is to choose a method thatprovides consistent numbers across multiplemeasurements so informed decisions can be madeabout which of the hardware and software changesmade are good and which are bad.For reference, Figure 7 is provided to show an exampleof what a signal-to-noise ratio of 3.5 would look likeusing Equation 2. Note that, since the standarddeviation of the noise and not the peak-to-peak value isbeing used, an SNR of 3.5 leaves little room to place athreshold. To be able to place a fixed threshold on thesystem, so that the pressed section plus its noise iscompletely separated from the unpressed section plusits noise, a system with an SNR of at least 7 is needed.In real applications, system SNRs should ideally be atleast 15 to provide a higher level of reliability.

    FIGURE 7: SIGNAL-TO-NOISE RATIO = 3.5

    SNR U P

    ------------------------=

    Where:U = mean value when not pressedP= mean value when pressed= standard deviation of the signal

    SNR U P

    ------------------------ 13763 136615.52--------------------------------------

    18.5= = =

    13763

    13661

    St. Dev.5.52

    2010-2013 Microchip Technology Inc. DS00001334B-page 5

  • AN1334

    HARDWARE DESIGNThe hardware design of a capacitive sensor applicationis crucial to the systems overall success. Thedecisions made in this step of the process willdetermine how difficult it is to get a working, robustapplication. If the hardware design guidelines arefollowed, the sensors sensitivity will be increased andit will be significantly easier to pass industry noisestandards. Likewise, not following the guidelines willmake success much more difficult and, in some cases,impossible. Keep this in mind while deciding which ofthese guidelines to follow in your designs.

    Parallel Plate Capacitance EquationThe most important thing about hardware design is toremember that the basic capacitance equation, shownin Equation 1, defines the relationship betweenhardware design decisions and the resulting sensitivityof the system.For example, if the distance between the finger and thesensor is decreased by half, the sensitivity will double.If the area of the sensor is doubled (assuming it is stillsmaller than the area of a fingers press) then thesensitivity will also double.Another important characteristic of capacitive touchsensors is the existence of parasitic capacitance whichdetermines the sensors base capacitance, CBASE.Equation 3 explains how CBASE can affect a systemssensitivity. You are only able to take a measurement ofthe total capacitance on the sensor, CT, so the strongerthe effect of CBASE, the less you may be able to see CF,the change in capacitance due to a finger. An illustration of this system was previously provided inFigure 1.

    EQUATION 3: TOTAL SENSOR CAPACITANCE

    Equation 1 and Equation 3 will be the basis of thehardware design guidelines for capacitive touch. Theequations are simply physics. The guidelines arerecommendations that will attempt to maximize yoursystems SNR and should be followed wheneverpossible. In some cases, an application may requirethat some of the guidelines not be followed. Forexample, a system might have size constraints or mayrequire a thick covering material to protect it fromdamage. If this is the case, extra care should be takento ensure a quality signal-to-noise ratio by closelyfollowing the other recommendations.

    Design GoalsIn general, to optimize performance of a capacitivesensor system using the mTouch or RightTouchsolutions, designers should strive to: Achieve a large change in capacitance, CF,

    relative to noise Minimize the base capacitance of the sensor,

    CBASE Avoid conductive overlay material unless it is a

    metal-over-capacitive system Minimize overlay thickness

    PCB Design ConsiderationsBoard Material No special requirementsLayer Thickness No special requirementsRecommended two-layer PCB stack-up: Layer 1 (top): Capacitive sensor pads and some

    sensor traces if they cannot be routed on the other layer.

    Layer 2: All components, any LED signal traces, power traces, and communication traces.

    Recommended four-layer PCB stack-up: Layer 1 (top): Capacitive sensor pads. Layer 2: Capacitive sensor traces. Layer 3: GND plane, except under capacitive

    sensor pads. Every effort should be made to keep this ground plane contiguous. This is especially true for the area under the capacitive sensing controller.

    Layer 4 (bottom): All components, any LED signal traces, power traces, and communication traces.

    For a PCB with more than four layers, always route thecapacitive sensing traces on a layer close to thecapacitive sensing pad layer, and place the GND orguard layer between the capacitive sensing traces andother signal layers.

    Button Pad Design ConsiderationsShape No special requirements.Size 15x15 mm (0.6x0.6) is recommended.Pad-to-Pad Distance 10mm (0.4) or 2-3x theoverlays thickness is recommended.

    BUTTON PAD SHAPEmTouch and RightTouch capacitive touch sensors workwell with any button shape, including the mostcommonly used ones: square, rectangular, round, andoval. When designing a rectangular or oval sensor pad,a length-to-width ratio of less than 4:1 isrecommended.

    CT CBASE CF+=Where:CT= total capacitance / measured valueCBASE= sensors base capacitanceCF= fingers capacitance

    DS00001334B-page 6 2010-2013 Microchip Technology Inc.

    http://www.microchip.comhttp://www.microchip.com

  • AN1334

    BUTTON PAD SIZEA in Equation 1 is defined as the overlapping area. Forcapacitive touch applications, this means that you arelimited by the smallest capacitive plate. If the sensor issmaller than a fingers press, the sensors area is thelimiting factor. If the sensor is larger than a fingerspress, the finger is now the limiting factor. You cannot change the users finger size, but you canadjust the sensor size to maximize the sensitivity. Thelarger the sensor is, the higher the sensors basecapacitance will be. This will lower the sensitivity andallow more conducted noise to be injected into thesystem when a user presses. The smaller the sensor,the greater the chance that it is the limiting factor onsensitivity instead of the users finger size. For thisreason, the ideal sensor size is about the area of afinger press.Best Option: The sensor size should be the same as anaverage users finger press (15x15 mm or 0.6x0.6inch).

    Option 2: Design sensors to be smaller than optimal.

    Overlapping area, A in Equation 1, is limited which reduces the maximum sensitivity.

    Adequate sensor separation will become more important to minimize the amount of sensor cross-talk.

    Use a thin cover overlay to gain some extra sensi-tivity.

    Option 3: Design sensors to be larger than optimal.

    Sensor base capacitance, CBASE in Equation 3, can increase because of the increased proximity to ground which reduces sensitivity.

    Conducted noise disturbance is increased. Press shifts will vary by larger degrees because

    small fingers will cause less of a shift than large fingers due to less overlapping area, A in Equation 1.

    Proximity sensing capability is increased.

    PAD-TO-PAD SEPARATION DISTANCECrosstalk can become a challenge in capacitive touchapplications if overlays are too thick or sensors are tooclosely placed together. Crosstalk is the unwanted shiftof a different sensor from the one you are intending topress. If crosstalk is a problem in an application, thesoftware must compare the two sensors and determinewhich sensor is more pressed. This adds an extrastep to the decoding process, increases the likelihoodof error, and (depending on how it is implemented) canlimit your system to one touch at a time. Following ourguidelines will allow you to avoid implementing asystem that must compare each sensor with everyother sensor.

    Figure 8 shows how a fingers press can affect thesensors located around the target sensor. Byseparating the sensors by 2-3 times the coversthickness, the strength of the finger-to-sensor couplingis limited to a low and manageable amount. Analternative way of thinking about this relationship is tofocus on the distance variable, d, in Equation 1. Byseparating the sensors, as shown in Figure 8, thecrosstalk press is equivalent to pressing through anoverlay that is much thicker. This results in a decreasedcrosstalk response from the system which increasesthe effective signal.

    FIGURE 8: CROSSTALK CAUSED BY FINGER

    Sensor-to-sensor coupling is the other form of crosstalkthat can negatively impact a design. Figure 9 showshow field lines will radiate from a capacitive sensor. Theability of those field lines to affect a neighboring sensoris based on the distance it travels and the material it istraveling through.

    FIGURE 9: IDEAL SENSOR ELECTRIC FIELD

    d = 1 d = 2.7

    2010-2013 Microchip Technology Inc. DS00001334B-page 7

  • AN1334

    If the field lines are able to propagate only through thecover as shown in Figure 10, the effect will be strong.The amount of crosstalk will be significantly reduced ifthe field lines must travel through the overlay, exit intofree space, and then return through the overlay in orderto affect a neighboring sensor, the amount of crosstalkwill be significantly reduced. This is shown in the figureas the difference between the strong and weakcoupling field lines. By following the first hardwaredesign guideline, the field lines will be forced to travelthrough free space to reach a neighboring sensor andso the crosstalk caused by sensor-to-sensor couplingwill be insignificant.

    FIGURE 10: SENSOR-TO-SENSOR COUPLING

    Alternatively, air gaps could be placed in the cover orPCB that will require the field lines to travel through freespace. Figure 11 illustrates this possibility. Notice howthe crosstalk path now has a very small capacitor inseries with the normal parasitic capacitances. Thissmall capacitor will dominate the others and will resultin an overall crosstalk shift that is very low. The largerthe air gap, the smaller the capacitor, and the better thismethod will perform.Finally, another option is to limit the sensitivity of thesensor by using nearby ground traces to block the fieldlines. Before using this technique, review SectionLayout Design Considerations to understand therecommended use of ground near sensors. Reducingthe sensitivity of a system should not be a designdecision that is made lightly and should only be usedwhen the other possibilities have been exhausted.

    FIGURE 11: AIRGAP CROSSTALK SOLUTION

    By following this hardware design guideline, yourdesigns will have reduced finger-to-sensor couplingand sensor-to-sensor coupling. This will result in asystem that sees very little crosstalk which will allow theresponse time to speed up due to decreasedprocessing overhead and the reliability of the systemwill increase as the sensors signals become moreimmune to these negative effects.Best Option: Separate sensors as much as possible.

    Ideal minimum separation is 2-3 times the coversthickness.

    The distance, d in Equation 1, between the sensors is kept high compared to the distance between the finger and the sensor, which results in reduced sensor crosstalk.

    Parasitic capacitance, CBASE in Equation 3, is kept low compared to the fingers capacitance, CF, which results in increased sensitivity.

    Option 2: Create slotted air gaps in the cover.

    The relative permittivity, r in Equation 1, between the sensors is lowered to 1, which results in decreased coupling between the sensors which decreases sensor crosstalk.

    Option 3: Use guard traces between the sensors.

    The guard creates a low-impedance shield between the two sensors. Since the guard is at the same potential as the sensor being scanned, the field lines of the sensors are forced to move away from the guard and the neighboring sensor. This reduces the effect of crosstalk.

    StrongCoupling

    Small capacitancedominates series

    DS00001334B-page 8 2010-2013 Microchip Technology Inc.

  • AN1334

    ACTIVE GUARD DRIVESThe base capacitance of a sensor determines howmuch sensitivity it will have. This capacitance can belowered by making the environment around the sensorhave the same voltage potential as the sensor while itsperforming its waveform.How exactly the guard is driven depends on themTouch method or RightTouch device being used, butthe voltage does not have to perfectly match thewaveforms. Efficiencies of 60-70% can be achieved bysimply driving an I/O in phase with the sensor. One guard trace can be used for all sensors. Sen-

    sors are scanned sequentially, so the guard can be actively driven for the sensor being currently scanned without affecting the others.

    Any power planes or low-impedance traces should be guarded from the sensor.

    Around the sensors pad, the guards trace should be about 1 mm thick and separated from the sensor by 2-3 mm.

    Following the sensors trace back to the PIC devices pin, the guards trace can be the same thickness as the sensors trace: 0.1-0.3 mm. The separation of the guard trace from the sensor trace can be as small as 0.5 mm.

    Figure 12 shows how an active guard can shape asensors field lines to increase its sensitivity.

    FIGURE 12: ACTIVE GUARD FIELD LINES

    MUTUAL DRIVESMutual drives are any I/O pin that is driven in phasewith the mTouch waveform with the intention ofmeasuring changes in the relative permittivity betweenthe mutual drive (Tx) and the sensor (Rx).When implementing a mutual sensor, there will be abase amount of coupling and then a change in thecoupling when a new material is placed in the couplingpath. In order to ensure maximum sensitivity, themutual waveform should be driven in phase with thesensing waveform to ensure that the voltage shift dueto additional capacitance is in the same direction as theshift due to the permittivity/mutual-coupling change.There are two main situations where a mutual drivesignal is advantageous to a design: If a piece of metal has the possibility of physically

    touching the sensor, driving the metal with a mutual signal will eliminate glitches on the sensors reading when the short occurs.

    Guard

    2010-2013 Microchip Technology Inc. DS00001334B-page 9

  • AN1334

    (For example, the metal layer on ametal-over-capacitive system. This is not required,but beneficial if the metal layer can short to thesensor.)

    If the target being detected is isolated from the sensors ground reference, placing a mutual drive near the sensor will allow the application to detect changes in the permittivity between the sensor and the mutual drive.

    Depending on the type of capacitive sensing beingused, the mutual drive may be driven differently. Thedifferential CVD waveform requires that mutual drivesbe driven in phase with the waveform, but CTMUssingle-ended waveform allows any board ground tobehave like a mutual drive.

    SLIDER SENSOR DESIGNSliders can be implemented using the mTouchFramework and Libraries, available in the MicrochipLibrary of Applications, and on some RightTouchcapacitive sensing devices, such as the CAP1114.A typical slider shape is shown in Figure 13. Similar tothe individual capacitive sensing pad design, thedistance between pads should be greater than 1.3 mm(~50 mils).Theoretically, any pad shape used for a button pad canbe used for a slider pad. However, the chevron shapeshown in Figure 13 will provide more linear (smoother)responses when a finger crosses from one pad to thenext. It will also provide a clear direction indicator forschematic design, PCB layout, and assemblingprocesses.

    FIGURE 13: RECOMMENDED SLIDER DESIGNS

    The seven-pad slider shown in Figure 13 will providegood sensitivity, as well as enough accuracy for mostapplications, but a slider with less than seven padscould also be used for some applications. If the padssize cannot meet the minimum requirement andreduced accuracy is acceptable, the number of pads inthe slider can be reduced down to two.The width of each pad and the distance between padswill usually be limited by the total length of the slider.The height of the slider will usually be limited by thephysical dimensions of the machine.

    Overlay Material ConsiderationsThickness As thin as possible. Less than 3mm, idealMaterial Glass and plastics, typical. Dielectricconstant between 2.0 and 8.0 recommended.Adhesive Thin, high permittivity, no air bubblesIn most applications, the capacitive sensor pads will becovered with an overlay to protect them as illustrated inFigure 1. The material and thickness of the overlay, aswell as the adhesive used, will affect the performanceof the system.

    OVERLAY THICKNESSThe thickness of the covering material is very importantin affecting the sensitivity of capacitive touch systems.Product designers will try to make the covering materialas thick as they can to increase the durability of the endproduct, but thick covers will decrease the systemssensitivity. Equation 1 helps to explain why thick coversare such a concern for capacitive touch applications.As the distance between the PCB and the finger isincreased, the expected capacitance shift isdecreased.The relationship between overlay thickness andsensitivity can be seen in Figure 14. One thing to noteabout the graph is the importance that the permittivityof the material plays in defining the curves. A highpermittivity material will allow for a larger sensitivityshift than an equally thick, but lower permittivitymaterial. High permittivity has the negative effect ofincreasing the amount of crosstalk, however. If thecovering material is highly conductive, the capacitivesystem may fail.Figure 8 shows the effect that a finger can have on aneighboring sensor. As the overlays permittivityincreases, so does this coupling.If your application requires a thick covering material,consider creating a slot in the covering material wherethe sensor will be so the sensor can be placed closer tothe users finger. Conductive foam products are alsoavailable that can be used to fill the gap if the wholePCB cannot fit in the slot.

    Best Option: Keep the overlay as thin as possible.Ideally, cover thickness should not exceed 3 mm tomaximize sensitivity.

    See Figure 15(a).Option 2: Overlay is thicker than optimal, but thesensors areas are increased to provide additionalsensitivity.

    See Figure 15(b).Option 3: Overlay is thicker than optimal, but slots in thecovering material are created to allow the sensor closerto the surface.

    See Figure 15(c).

    0% 1 99% 100%

    0% 1 99% 100%

    DS00001334B-page 10 2010-2013 Microchip Technology Inc.

  • AN1334

    Option 4: Overlay is thicker than optimal, but slots in thecovering material are created to allow EMI gaskets orsprings to bridge the gap between the PCB and thefinger.

    See Figure 15(d).When overlays are thicker than optimal:

    The distance, d in Equation 1, between the sensor and the users finger increases, which causes the capacitance between the finger and the sensor, CF in Equation 3, to decrease which results in decreased sensitivity.

    Sensor-to-sensor crosstalk increases, as shown in Figure 10, due to additional sensor field lines being able to travel through the high-permittivity cover compared to the low-permittivity air.

    FIGURE 14: OVERLAY EFFECT ON SENSITIVITY

    FIGURE 15: THICK OVERLAY OPTIONS

    ADHESIVE SELECTIONAdhesive is used to secure the covering material to thePCB and is another important element to a robustcapacitive touch system. Equation 1 will help to explainthe necessity of a good connection. The relativepermittivity of air is about one. Plastics are usuallybetween two and three. Glass is about four. If you have

    air separating the cover and PCB, your effectivepermittivity, R, will be significantly decreased. Forexample, a 1 mm air gap will decrease your sensitivityto a half or a quarter of what it was. Remember thatwhen three capacitors are in series, the smallest willdominate. For systems using the metal-over-capacitivetechnique, it is especially important that a goodadhesive is found for the application. Distances of tensof microns (10 micron 0.4 mil) can make a significantdifference in these designs. Talking to a representativefrom 3M or another adhesives manufacturer isrecommended to ensure your choice is the best foryour custom application.There are several other important factors to keep inmind when choosing or working with a commercialadhesive:1. Keep the adhesive thin in order to keep your

    sensitivity high. For most regular capacitivetouch systems, 2 mil (50 micron) is a good thick-ness.

    2. Always read the bonding instructions for theadhesive. Some data sheets specify a requiredamount of pressure, temperature, and time toachieve a secure, lasting grip.

    1 2 3 4 5 6

    Sens

    itiv

    ity

    Overlay Thickness (mm)C0 = 5pF CADC = 10pF

    Plastic Glass Wood

    (A)

    (B)

    (C)

    (D)

    Recommended

    Thick Overlay, Larger Sensor

    Option: Create Slot for PCB

    Option: Bridge Gap with Conductive Material

    2010-2013 Microchip Technology Inc. DS00001334B-page 11

  • AN1334

    3. Check the temperature limitations of your adhe-

    sive. In some environmental conditions, the gluecan fail which will lead to unpredictable behaviorfrom your capacitive touch application.

    4. Be careful of air bubbles when applying theadhesive. If there are bubbles in the glue, yoursensitivity will suffer the same as if you had anair gap between the cover and the PCB.

    5. Make sure the adhesive type matches well withthe covering material. Different adhesives aremade for low surface energy and high surfaceenergy plastics. Most adhesives will adhere toglass and PCB with few problems.

    Some example adhesives that may perform well are:High Surface Energy Plastics:Example: ABS or Polycarbonate

    3Ms Adhesive Transfer Tape 467MPLow Surface Energy Plastics:Example: Polypropylene

    3Ms Adhesive Transfer Tape 9626 3Ms Adhesive Transfer Tape F-9752PC

    3Ms Adhesive Transfer Tape 91223Ms Optically Clear Adhesive (OCA):

    8211, 8212, 8213, 8214, 8215All of these will adhere to PCB and glass.

    CONDUCTIVE OVERLAYSUnless you are designing a metal-over-capacitivesolution, highly conductive overlays are neverrecommended. However, in some capacitive sensorapplications, the overlay may be conductive due to aconductive coating over the non-conductive plastics ordue to filling with carbon to darken the overlays color. With conductive material over the capacitive sensor,the resistance of the material will add an equivalentresistor between neighboring sensors. When a fingertouches a sensor, the capacitance change on one padwill affect the other untouched sensor to a varyingdegree. As the resistance decreases, the change incapacitance on untouched sensor pins becomes larger.If the resistance is too small, the signals can becometoo similar to determine the difference between a presson one sensor or the other. This is illustrated inFigure 16.

    FIGURE 16: CONDUCTIVE OVERLAY

    Using a conductive overlay is not recommendedbecause: The amount of carbon in the plastic may change

    and then make the resistance change over time. The resistance from location to location could

    vary. The resistance from different product groups

    (different date codes) could vary.Any of the above changes will affect the capacitivesensor input values and cause the device settings(such as the thresholds) to be incorrect.If a design must use conductive materials, always testthe overlay samples and determine the allowable rangeof conductivity.

    Layout Design ConsiderationsThe following rules will ensure a successful capacitivesensor PCB design. However, these arerecommendations, not requirements. LED Output Traces should be isolated from

    capacitive sensor pads on different layers with a GND or guard plane between them.

    Neighboring capacitive sensor traces appear as GND from the sensors perspective. Routing two sensors traces in parallel is equivalent to routing both parallel to GND.

    Sensor traces cannot be parallel with LED output traces on the same layer or on adjacent layers. If a sensor trace must cross an output signal on adjacent layers, they must cross at a 90 degree angle.

    Sensor trace width: 0.1-0.2 mm Sensor trace length: Minimized, or guarded Sensor series resistance:

    - CVD :: 4.7 - 10 k- CTMU :: 1 - 2.5 k- RightTouch :: None required

    Minimum sensor trace separation: 0.1 mm Minimize via usage in sensor traces. This

    increases base capacitance. Unused RightTouch sensor and LED pins should

    be terminated either with a pull-down resistor or tied directly to GND.

    ConductiveOverlay

    R

    (Not Recommended)

    Note: The same isolation should be observedfor the capacitive sensing pads/traces andany other switching signals on the PCB,including signals generated by sourcesother than the mTouch or RightTouchdevice.

    Note: Ensure unused LED/GPIO pins shorted toGND are not driven by controllingfirmware.

    DS00001334B-page 12 2010-2013 Microchip Technology Inc.

  • AN1334

    Bypass capacitor(s) should be placed close to the

    capacitive sensing controllers VDD pin(s).

    CAPACITIVE SENSOR COUPLINGThe field lines of an ideal capacitive sensor wouldradiate away from the pad without coupling into anynearby components or low-impedance trace. When auser approaches the sensor, field lines able to reachout further will detect changes more quickly. In practice,coupling will always occur and will distort the ideal fieldline pattern in some manner. This behavior is shown inFigure 17.The goal of any design should be to minimize thedegree of coupling that is seen between the pad and itssurrounding environment so that the sensors field linesare able to behave as ideally as possible.

    FIGURE 17: CAPACITIVE SENSOR FIELD LINES

    CAPACITIVE SENSOR TRACESBest Option: Keep sensor traces thin and short.

    There are two main reasons to follow this advice. First,keeping trace lengths short will minimize CP which willincrease the sensitivity of the system. Long traces arealso more susceptible to behaving like antennas whichwill increase the noise floor of the application. Communication lines should be kept away from sensortraces if at all possible. If not, run them perpendicular tothe sensor traces to minimize their disturbance. Youcan also guard them with ground traces to couple thecommunication lines to ground instead of the moresensitive capacitive sensor traces. Avoid runningcapacitive sensor traces parallel with anynoise-causing lines and keep them separated fromground and other capacitive sensor lines to reduceparasitic capacitance.To keep sensitivities high and noise low, make sensortrace lengths short.

    CAPACITIVE SENSOR SERIES RESISTANCEAdding a series resistor to CVD and CTMU sensor pinswill stabilize the sensor readings in high frequencynoise environments. The resistor works with theinternal pin capacitance to create a low pass filter. Asthe resistance increases, the cutoff frequency of thefilter decreases. However, if the resistance becomestoo large, the settling time of the waveform will increasewhich may allow low-frequency noise to be injected onthe signal. If using the CTMU acquisition method, do not exceedthe modules maximum input impedance of 2.5 k, orthe scan rate will decrease. The lowest recommendedseries resistance is 1 k.If using the CVD acquisition method, the typical resistorvalue is 4.7 k, but can vary from 1-10 k based onyour applications requirements. The settling delay ofthe sensors waveform may need to be adjusted toallow the capacitors to fully settle before beginning theADC conversion.If using a RightTouch turnkey product, no seriesresistance is required.

    ELECTROSTATIC DISCHARGE PROTECTIONMicrochips capacitive touch sensors are capable ofwithstanding high levels of electrostatic discharge(ESD) without physical damage. In addition,operational immunity from electromagneticinterference (EMI) is minimized through hardware andsoftware filtering. However, excessive environmentalconditions can produce false triggers, activate internalESD protective clamps, or affect VDD and groundresulting in a device Reset. As such, it is important forelectromagnetic compatibility (EMC) to be consideredas early as possible in the system design process.ESD typically has two distinct points of entry into asystem:1. Transient charge entering through a

    board-to-board connection, requiring circuitdesign solutions.

    2. Transient charge coupling to the PCB, requiringlayout and system solutions.

    For transient charge entering through a board-to-boardconnection, there are several approaches that mayhelp resolve this issue: Increase the impedance to high frequencies using

    ESD protection device(s) such as a series resis-tor, ferrite bead, or common-mode choke on the VDD and ground lines.

    Add these ESD protection devices to the commu-nication lines.

    Add Transient Voltage Suppression diodes (TVS), also known as avalanche breakdown diodes, between VDD and ground to shunt the ESD current.

    2010-2013 Microchip Technology Inc. DS00001334B-page 13

  • AN1334

    For transient charge coupling to the PCB, there areseveral approaches that may help resolve this issue: The ESD charge point(s) of entry must be deter-

    mined. These can be visible air gaps in the cover-ing material, areas where two pieces of covering material come together, around the edges of the covering material, etc.

    Specific metal on the PCB may be designed as an ESD-Ground (EGND) for conducting the ESD charge. The EGND should be exposed as a metal ring around the outer edge of the PCB to conduct ESD current to the chassis. This EGND should be terminated directly to the system chassis using conductive foam when possible. The EGND ring should be routed on all layers of the PCB.

    Route the signal ground between the EGND and all other traces on the PCB, using a spacing of 0.5-1 mm (20-40 mils).

    FIGURE 18: GND ROUTING EXAMPLE

    There are several additional points to remember: Direct coupling of ESD to sensor device pins

    should be minimized by directing energy to safe areas of the system, such as to chassis ground via a ground strap or similar means.

    Metal covering materials and surfaces are usually more difficult to protect against ESD than those made only of plastic. Additionally, plastics may only require air discharge ESD compliance (i.e., IEC 61000-4-2) whereas metal overlays and buttons can require direct contact discharge compliance. It is generally simpler to provide a safe ESD environment inside a plastic enclosure than one with exposed metal parts.

    Other PCBs, in particular ones mounted on the same overlay and directly connected to the capacitive sensing PCB, should be considered potential sources of ESD.Example: A mechanical power button board.

    Typically, these boards utilize the same VDD as thecapacitive sensor PCB. It is recommended to sepa-rate the voltage supply between the two PCBs by asmall value resistor (~50 ohms).

    Radiation of ESD energy from nearby metal chassis plating should be considered a possible coupling mechanism. A useful mitigation tech-nique for this type of coupling is to either shield the plate or shield the bottom PCB layer with conductive tape over a thin insulating material.

    If ESD energy cannot be redirected by mechani-cal means, TVS diodes can be connected to VDD, MCLR,and long LED traces (especially those going off-board). The voltage rating of these TVS devices should match VDD with board placement ideally being in between the ESD source and the capacitive sensor controller.

    A full layer board grounding and internal conduc-tive coatings on plastic enclosures are among the best mitigation techniques to minimize the effects of EMI.

    Small bypass capacitors (5 pF-15 pF) can be placed on the sensor traces, located as close as possible to the controller pins to help shunt excess energy to ground rather than having it enter the device.

    Power Supply ConsiderationsBetter, cleaner power supplies lead to better, cleanercapacitive sensor readings. The following topics shouldbe considered when evaluating a power supply for yourdesign.

    GROUNDING SCENARIOSThere are three coupling paths that are affected whena user approaches a capacitive sensor. There is achange in coupling between the capacitive sensor andthe boards ground due to the close proximity of thefinger. This is a localized effect and will not be affectedtoo greatly by the power supply or board layout.The second coupling path connects the sensor andearth ground through the users body. It addscapacitance to the sensor and is one of the primarypaths for conducted noise injection. If this is an opencircuit because the user is not sharing a ground withthe board, the capacitance added by this path isnegligible.

    Board Circuitryand

    VSS Plane

    EGND

    (1) Example connector:- Shield connected to EGND- VSS pin connected to boards VSS plane

    (2) 0.1F coupling capacitor

    (1)

    (2)

    The EGND is the strip of metal isolated from the boardground by a spacing of approximately 0.5 mm (20 mils), andis AC coupled to the system ground by a 0.1 F capacitor.

    Note: Bypass capacitors on sensors are not rec-ommended unless other techniques havefailed to produce sufficient ESD protec-tion. This technique may limit the sensitiv-ity of the sensors and should not be usedon proximity sensors.

    DS00001334B-page 14 2010-2013 Microchip Technology Inc.

  • AN1334

    Finally, the third coupling path is the amount ofadditional capacitance to earth ground that is added tothe boards ground due to the users body. If theboard-to-earth capacitance increases, the effect of thesensor-to-earth coupling will be seen more strongly onthe sensor.This model, illustrated in Figure 19, leads to some verysignificant conclusions in order to best design a qualitycapacitive system. 1. The best sensitivity can be achieved by having

    a common ground between the user and thesensor.

    2. If this is not possible, the capacitance of thebody-to-earth coupling path should be maxi-mized.

    Shared-ground systems typically have twice as muchsensitivity as systems that do not share a ground withthe user.

    FIGURE 19: CAPACITIVE SENSING GROUNDING MODELS

    CHOOSING VDD TO MAXIMIZE NOISE IMMUNITYBest Option: Keep VDD as high as possible to maximizenoise immunity.

    Although not ideal for low-power applications, high VDDsystems will perform better in conducted noiseenvironments than low VDD systems. This is due to thefact that all capacitive touch systems will eventually beoverpowered by the injected noise as the voltage levelof the noise is increased. Making VDD a higher valuewill require a higher voltage level of injected noisebefore this happens.In voltage-based acquisition systems, the behavior youare attempting to delay is the reverse pressphenomenon. Figure 20 shows a regular sensor beinginjected with noise of increasing voltage levels. Thenoise begins adding voltage to the reading whicheventually overpowers the normal capacitive sensingbehavior and causes a positive shift when pressed.

    BY-PASS CAPACITORSAt least one by-pass capacitor to ground (~0.1F)should be connected to and placed near each VDD pinon the controller. Additional filtering is possible byplacing another smaller value, smaller packagecapacitor in parallel.

    CBASE

    CGND

    CFCBODY

    CBASECFCBODY

    VSS

    VSS

    SensorInput

    SensorInput

    User and Device Share Common Ground

    User and Device Do Not Share Ground

    User

    User

    CapacitiveSensorCBASE

    DeviceGround

    EarthGround

    CGND

    CFCBODY

    CGND

    CGND

    2010-2013 Microchip Technology Inc. DS00001334B-page 15

  • AN1334

    FIGURE 20: REVERSE SHIFT BEHAVIOR WHEN INJECTING CONDUCTED NOISE ON A

    VOLTAGE-BASED ACQUISITION METHOD

    DS00001334B-page 16 2010-2013 Microchip Technology Inc.

  • AN1334

    SOFTWARE TECHNIQUESThe software methods described in this section of theapplication note are a subset of the techniques alreadyimplemented in the mTouch Framework, mTouchLibrary, and RightTouch capacitive sensing controllers.This section is provided for educational purposes. It isnot necessary to implement these if using any ofMicrochips capacitive sensing solutions.

    Consider Your System RequirementsYour systems limitations are based on two mainfactors. First, your hardware design decisions will resultin a base SNR for the application. If the base SNR ishigh, the software will not need to filter the signal asmuch and the detection process will be fast and easy. If the base SNR is low, the software will need to heavilyfilter the signal and the detection process will need togo through more steps to make sure no false triggersare registered. The second factor to determining yourlimitations is the applications performancerequirements. If the product must have a specificresponse time, or if there is a limited amount of memoryavailable, then some software techniques may not beapplicable.For example, in gaming systems speed is the mostimportant requirement. Care should be taken whenchoosing a software filtering technique that theresponse time does not suffer significantly. The codesize should be kept small to allow for fast execution,and the sampling rate of our system may need to beincreased.When considering any of the techniques described inthis section, remember that all of them have a cost intime, power, and memory usage. The benefits shouldalways be weighed against the costs.

    Sampling RatesOne of the first decisions when creating capacitivetouch firmware is whether to trigger a new scan fromthe main loop or from the Interrupt Service Routine. Forapplications concerned with noise, the secondapproach is recommended. Fixed-time sampling rates are important to the correctoperation of filters and detection decisions should bebased off a concept of how long, in real-world time, anew behavior has been measured. If the sample rate ofthe system is based on a non-fixed interval, like afunction call from the main loop, other applications inthe system could change the sampling rate. Forexample, a system that is actively controlling a powersupplys output voltage will have priority over mTouchsensing due to its special timing requirements. If thepower supply control application does not allowmTouch sensing to regularly scan, the system couldmiss a press or release.

    The second decision that must be made is: What willthe fixed sampling rate be? This is largely dependenton the acquisition method that has been chosen as wellas the specific requirements of the system. Voltage-based acquisition methods scan often andvery quickly, while frequency-based acquisitionmethods scan over a longer period of time at a slowerrate. Gaming systems that require a very fast responsetime may scan over 100 times a second, while abattery-powered proximity sensor may only scan threetimes a second until it notices a user nearby. For many systems concerned about noise, thesampling rate and the decoding rate may be different.For example, a system could scan a sensor once every50 s, continuously updating the filter, but only run thedecoding sequence every 10 ms. This can reduce theamount of processing overhead while still allowing thesystem to adjust constantly to the changingenvironment.Software filters and the decoding algorithm will need tobe designed with the sampling rate of the sensors inmind. If not, the filters will become too fast and sufferfrom too little noise reduction or they will become tooslow and may cause the signal to be dampened orslowed. Decoding algorithms that do not consider thesampling rate of the system may have problemsachieving a required response time or may changestates (on/off) too quickly.

    Jittering the Sample Rate

    VOLTAGE-BASED ACQUISITION METHODS ONLYOne of the problems that can occur in systems that usethe Interrupt Service Routine to trigger a new scan isthat the scans are then vulnerable to noise beinginjected at a harmonic of the sampling rate. Jittering willhelp to dampen high-frequency noise being injected onto the system either through radiated or conductednoise. Figure 13 shows an example of what this canlook like.The simplest solution is to change the sampling rate bya very small amount each time a sample is taken usingthe jittering technique. For example, if you arescanning a sensor once every 400 s, you may decideto delay the reading by an extra 0-10 s (an amountthat changes each time a sample is taken) to makesure you are not hitting any harmonics. Although thiswill technically change our sample rate, it will notchange the average sampling rate and the change isinsignificant compared to the total sampling interval.In the jittering implementation below (Example 1), theLeast Significant bits from our last ADC sample areused to create the random, short delay. The value ismasked with 0x0F to limit the maximum amount ofdelay that is possible.

    2010-2013 Microchip Technology Inc. DS00001334B-page 17

  • AN1334

    EXAMPLE 1: JITTERING THE SAMPLE

    RATE

    FREQUENCY HOPPINGFrequency-Based Acquisition Methods Only

    This is the frequency-based acquisition equivalent tojittering the sample rate on a voltage-based acquisition.It is important to change the sampling frequency of thewaveform to avoid issues with harmonic noise. To keepthe signal offset value consistent, the hoppingprocedure should be the same for every samplingperiod.RightTouch capacitive sensing controllers will performthis automatically based on the level of noise in thesystem.

    OVERSAMPLINGOversampling is the process of using more than oneacquisition sample per sensor reading. For example,in most systems, the Interrupt Service Routinedetermines when a new reading should take place.When this occurs, the system acquires a value andsaves it as the new reading. To increase the stability ofyour readings, you could have the system acquire twosamples off the same sensor by scanning it twice andthen adding the two samples together to create onesensor reading.

    There are several reasons why this technique is helpfulto a system:1. Sampling errors caused by impulse noise will

    not affect the system as much since eachsample is only part of a full reading value. Thesystem effectively averages out some of theerrors during the acquisition process.

    2. Samples do not have decimal values. Byallowing the system to scan multiple times perreading, it is able to gain additional resolution onthe signal.

    The benefit of this method to the effective SNR of thesystem is shown in Figure 21. The clear diminishingreturn of oversampling should be considered againstthe systems time and power consumptionrequirements.

    FIGURE 21: OVERSAMPLING TRADE-OFF: TIME VS. SNR

    For more information about the effects of oversamplingon an ADC conversion, refer to AN1152, AchievingHigher ADC Resolution Using Oversampling,available on the Microchip web site athttp://www.microchip.com.

    Software FilteringFilters are algorithms that take an input signal andoutput a modified version of the signal. The function itperforms is based on the type of filter it is. Thebandwidth of a filter also plays a large role in how itperforms. From a firmware perspective, the function ofthe filter is defined in the code structure and operationsthat are performed. The bandwidth is usually set byconstants in the implementation that determine whatnumber a value should be divided by, how many timesto bit-shift left or right, and what coefficient should beused to multiply the result by.With filters, there is a trade-off between noise reductionand response time delay. This trade-off can bevisualized in the bandwidth of the filter as shown inFigure 22.

    Note: Sample is used to refer to a single scanof a sensor using a hardware module(e.g., ADC). Reading is used to refer to agroup of samples that have been addedtogether, which are then sent as-is to thefiltering and decoding routines.

    void interrupt ISR()

    {

    if (T0IE & T0IF)

    {

    // Short Delay

    jitter = ADRESL & 0x0F;

    while(jitter--);

    mTouch_Service();

    }

    }

    1 :: 10-bit

    4 :: 11-bit

    16 :: 12-bit

    64 :: 13-bit

    256 :: 14-bit

    60

    65

    70

    75

    80

    85

    90

    0 50 100 150 200 250

    10-b

    it AD

    C S

    igna

    l to

    Nois

    e R

    atio

    Samples Taken / Sensor Reading

    Graph labels show the number of samples required to reachthe equivalent SNR of a higher resolution ADC.

    DS00001334B-page 18 2010-2013 Microchip Technology Inc.

  • AN1334

    FIGURE 22: NOISE REDUCTION VS. RESPONSE TIME TRADE-OFF

    If the filters bandwidth is narrow, less noise will be ableto pass through, but it may take a long time for the filterto follow the signal. On the other hand, if the filtersbandwidth is wide, more noise will be able to passthrough, but it will follow the signal more closely.Combining multiple filters can allow the designer to getthe benefits of each while limiting the negative impact.There are three types of filters that are commonly usedin mTouch sensing solution applications. More filterscould easily be added to this list and may be moreappropriate for a specific application, but these havebeen chosen because most designs will be able to useone or more of them.The three filter types are:1. Slew Rate Limiter

    Used as the first input filter on new incomingsamples to reject impulse noise and smooth thesignal.Implemented in the acquisition routine.

    2. L-Point Running AverageUsed to create a slow-updating (high timeconstant) baseline (average) for each sensoras a reference point during decoding. Allows thesystem to track environmental changes such astemperature and humidity.Implemented in the filtering routine.

    3. Low Pass ButterworthUsed to reject white noise on the sensor read-ings while still maintaining a fast response time(low time constant).

    Implemented on the reading variable in thefiltering routine before sending it to the decodingalgorithm.

    FIR FILTERS VS. IIR FILTERSFinite-Impulse Response (FIR) filters take a fixednumber of previous inputs and use them to create thenext output.Finite-Impulse Response Filter Benefits: Simple implementations Better filter stability Fewer concerns about integer precisionInfinite-Impulse Response (IIR) filters take the inputand use it in combination with the previous output of thefilter to determine the next filter output.Infinite-Impulse Response Filter Benefits: Low memory requirements Low processing requirementsUltimately, both filter types can be useful to anapplication. For capacitive touch systems, IIR filterscan be used for slowly-updating environmentalbaselines. The filter should be designed so that it canhandle impulse noise without becoming unstable. FIRfilters can be used for quickly-updating sensorvariables like the current reading.

    FILTER: SLEW RATE LIMITER The Slew Rate Limiter (SRL) filters main design goal isto reject impulse noise from sensors readings.Sometimes referred to as a decimation filter,implementing the SRL filter requires a specificscanning technique that will possibly change thesample rate of your design.

    2010-2013 Microchip Technology Inc. DS00001334B-page 19

  • AN1334

    The concept of the SRL filter is simple. The PIC deviceis maintaining a current reading variable for eachsensor. In most systems, when a new sensor reading iscreated, the current reading variable is replaced bythe new value. In an SRL filtered system, when a newreading value is generated, the current reading valueis then either decremented or incremented by one,based on whether the latest reading is higher or lowerthan the current reading variable. For example, if asensors current reading is 200 and the next acquisitionresults in a value of 300, the system will update thecurrent reading to 201. In order for the system toreach a current reading of 300, the next 99 scans mustbe higher than the current reading.This behavior is very beneficial because it limits theinfluence of each sample. If impulse noise is affectingthe system, a single impulse-noise-affected reading willonly cause 1 bit of noise on the reading variable. On theother hand, because you are updating the currentreading variable so slowly, you need to update the rateof the samples. When a user presses on a sensor, thecurrent reading variable needs to be able to move withthe fingers capacitance at a fast rate. There is also noneed to access the decoding function of the systemafter each individual reading, since it can only shift by 1each time.There will be several parts to the SRL filterimplementation to take care of these specialrequirements. First, the system will scan based on atimers interrupt at a fast rate. After each of thesescans, it will run the SRL filter to increment/decrementthe current reading variable. After the Nth sample, aflag is set that allows the decode function to run. Anexample code implementation of this filter can be seenbelow in Example 2.

    EXAMPLE 2: SLEW RATE LIMITER FILTER

    The benefits of this filter can be seen in Figure 23. Theimpulse noise on the system has been rejected and thesignal is now more easily decoded.

    FIGURE 23: SLEW RATE LIMITER FILTER BEHAVIOR

    #define SCANS_PER_DECODE 100

    uint16_t reading;

    uint16_t counter;

    void main(void)

    {

    // Main Loop while(1)

    {

    if (counter >= SCANS_PER_DECODE)

    {

    mTouch_decode();

    counter = 0;

    }

    }

    }

    void interrupt ISR(void)

    {

    uint16_t newReading;

    if (TMR0IE && TMR0IF)

    {

    // Take a reading, store the value

    newReading = mTouch_getReading();

    // Initialize

    if (reading == 0)

    reading = newReading;

    // Slew Rate Limiter

    if (newReading > reading) reading++;

    else reading--;

    counter++;

    }

    }

    DS00001334B-page 20 2010-2013 Microchip Technology Inc.

  • AN1334

    Care should be taken to make sure the SRL filter is notmoving too slowly. If the sampling rate is too low, thecurrent reading value will not update fast enough andcan cause problems with response times. An exampleof what this too-slow behavior will look like is shown inFigure 24.

    FIGURE 24: EXCESSIVELY SLOW SLEW RATE LIMITER FILTER EXAMPLE

    To solve this issue, either:1. Reduce the amount of time between timer inter-

    rupts.2. Change the increment/decrement amount to a

    value larger than 1. However, the larger thisvalue is, the less the filter will be able to rejectimpulse noise.

    FILTER: L-POINT RUNNING AVERAGESThis filtering technique is used in a vast number ofapplications and has been documented thoroughly. Itsbehavior is defined in Equation 4. The current value,x[n], is averaged with the last L-1 values. Whendeciding on a value for L, keep in mind the divisionoperation. If a power of 2 is chosen for the value of L,the division operation can be simplified to a series ofbit-shifts, reducing the complexity of the filter.

    EQUATION 4: L-POINT AVERAGE (FIR)

    Also notice that, as implemented in Equation 4, this isan FIR filter which means that a single reading can onlyaffect the output for a specific number of samples, L.After this period, the sample no longer has an influenceon the systems behavior. For noise-injected situations,this is a very beneficial characteristic for our filters tohave. However, the memory cost of this filter will makeany filters with a large window difficult to implement.To solve this limitation of the filter, its behavior can bechanged from FIR to IIR, as shown in Equation 5. Thiscreates a fixed, low-memory cost for the filter butdegrades some of its features. The IIR version of theL-Point Running Average will become more distortedfrom the original as L gets larger.

    EQUATION 5: L-POINT AVERAGE (IIR)

    EXAMPLE 3: FIR L-POINT AVERAGE FILTER

    y n 1L--- x n k =L=1

    k=0Where:y[n]= output at time nx[n]= input at time nL= memory of the filterk= counter variable

    y n y n 1 x n y n 1 L------------------------------------+=Where:y[n] = output at time nx[n] = input at time nL= memory of the filter

    #define HISTORY 8 // 'L'

    uint16_t reading[HISTORY];

    uint8_t index;

    uint16_t FIR_Average(uint16_t new)

    {

    uint16_t average = 0;

    // Replace oldest reading reading[index] = new;

    // Sum all reading values for (uint8_t i = 0; i < HISTORY; i++)

    {

    average += reading[i];

    }

    // Divide by the history window size

    // NOTE: This operation is efficient

    // as long as HISTORY is a power of 2.

    average = (uint16_t)(average/HISTORY);

    // Update index for next function call index++;

    if (index >= HISTORY) index = 0;

    return average;

    }

    2010-2013 Microchip Technology Inc. DS00001334B-page 21

  • AN1334

    EXAMPLE 4: IIR L-POINT AVERAGE

    FILTER

    Figure 25 shows the difference between the FIRL-point running average and the IIR L-point runningaverage estimation. Notice that the estimationintroduces a response time delay in the system. Forthis reason, it is not recommended to use this filterdirectly on the reading signal. However, the time delayof this filter is not a problem for the baseline calculation.Since the baseline should be moving very slowly, thetime delay will not affect its behavior negatively.

    FIGURE 25: FIR VS. IIR AVERAGES

    FILTER: LOW PASS BUTTERWORTHThis filter implementation is an alternative to the L-pointrunning average. While both are low pass filters, thedigital low pass filter in this section is based on thedigital implementation of a Butterworth filter, and canbe seen defined in Equation 6. Notice that the onlycomplex operation in this filter is the multiplicationbetween K and the previous output of the filter. If K ischosen wisely, this filter can be easily implementedwith the use of bit-shifts.

    EQUATION 6: DIGITAL BUTTERWORTH LOW PASS FILTER

    Smart values for A include: 0.8125, 0.8750, 0.9375,and 0.9688 to name a few. These factors can bemultiplied easily using only bit-shift operations on they[n-1] value. An example of this can be seen below:As the value of A gets closer to 1, the cutoff frequencyof the Butterworth low pass filter approaches zero. Thisincreases the effectiveness of the filter, but will slightlyincrease the filters settling time. Also, as A gets closerto 1, the integer value of y[n] will increase quickly. Thisputs an upper limit on the value of A if you want tocontinue representing each sensors signal with thetypical 16-bit integer value.The benefit of this type of filter when compared with theL-point running average can be seen in Figure 26. Theincrease in the effective SNR of the sensor is muchhigher when implementing the Butterworth than therunning average; however, the running averageestimate is very inexpensive to implement andperforms the job well as a filter for the sensorsbaseline.

    #define HISTORY 8 // 'L'

    uint16_t average;

    uint16_t IIR_Average(uint16_t new)

    {

    // Update Average

    average -= (uint16_t)(average/HISTORY);

    average += new;

    // NOTE:

    // This filter implementation has a gain

    // of 'HISTORY'. For that reason, we

    // can divide the average by HISTORY

    // or multiply the reading by HISTORY

    // before we compare the two.

    return (uint16_t)(average/HISTORY);

    }

    y n x n x n 1 Ay n 1 + +=Where:y[n] = the output at time nx[ = the input at time nA = the filters coefficient (0 A < 1)

    DS00001334B-page 22 2010-2013 Microchip Technology Inc.

  • AN1334

    EXAMPLE 5: DIGITAL BUTTERWORTH

    LOW PASS FILTER#define FILTER_GAIN 3

    typedef struct

    {

    uint16_t y;

    uint16_t x;

    } filter_t;

    filter_t filter;

    uint16_t LP_Butterworth(uint16_t reading)

    {

    // Pointer to the correct filter

    // variables for our sensor...

    filter_t* h = &filter;

    // Temporary variables

    uint16_t x1, y1, ay1;

    uint16_t temp0, temp1;

    // Populate temporary variables

    x1 = (h -> x);

    y1 = (h -> y);

    // Calculate: ( a * y[1] )

    // Where, a = 0.8125.

    temp0 = y1 >> 2;

    temp1 = y1 >> 4;

    ay1 = y1 - temp0 + temp1;

    // 1st Order Filter Equation:

    // y1 = x[0] + x[1] + (a * y[1])

    y1 = reading + x1 + ay1;

    // Store values for next time

    (h -> y) = y1;

    (h -> x) = reading;

    // Return the filter's new result

    return y1 >> FILTER_GAIN;

    }

    2010-2013 Microchip Technology Inc. DS00001334B-page 23

  • AN1334

    FIGURE 26: LOW PASS FILTER COMPARISONS

    SETTING SENSOR THRESHOLDSAfter the sensor signal has been read and filtered, thedecoding process should begin. During this step, thesensors signal will be compared against apre-determined threshold to decide if there is a press. When establishing a threshold, there are two mainoptions: setting a fixed threshold or calculating thethreshold at run-time. Setting a fixed threshold is theeasiest and least time/memory intensive, but it may notwork in every situation. For mass production systems,it is possible there will be slight differences in thesensors default values across boards. If theapplication is using a fixed threshold, there is apossibility that the threshold may not work for all ofthem. Calculating the threshold at run-time is the otheroption. When this is implemented, the system will takeseveral readings on power-up and will determine wherethe threshold should be set based on the systemssamples. For the majority of applications, a calculatedthreshold will not significantly affect the systemsbehavior and is preferred for its flexibility. In some cases, two thresholds may be used in thesame way as hysteresis one used to enter thepressed state and one used to enter the released state.A diagram showing this behavior is seen in Figure 27.Choosing where to place the thresholds for a systemcan be one of the most important and difficult tasks ofgetting a robust solution working. Assuming thesensors signal moves down when pressed, if thethreshold is too high, false triggers can become a risk.If the threshold is too low, the system may be unable todetect a press in all situations.

    It is important to remember that your system will beused by a wide variety of people. People with big handswill cause more of a shift than those with small hands.Make sure you are setting the thresholds and testingthem with a cross-section of individuals so thateveryone will be able to activate the sensor.

    FIGURE 27: THRESHOLD HYSTERESIS

    ENVELOPE DETECTORThe Envelope Detector is a decoding technique thatuses an extra variable to track the average deviationfrom the sensors baseline (or average). This can beparticularly effective in systems that experience a largeamount of injected noise. Figure 27 illustrates anexample of a system that would benefit from thisdecoding technique.

    Release Threshold

    Press Threshold

    Sensor Reading

    Sensor enterspressed state

    Sensor entersreleased state

    User press begins User press ends

    DS00001334B-page 24 2010-2013 Microchip Technology Inc.

  • AN1334

    When a high level of injected noise is present oncapacitive touch sensors, press detection can bedifficult if the decoding algorithm is only looking for ashift in sample values. Some frequencies of noise maycause the press behavior shown in Figure 28. Whenthis occurs, an envelope can be created to track thenoise level of the system and this can be used with athreshold to make press decisions. An exampleimplementation of this decoding technique has beenprovided in Example 6.Keep in mind while implementing this technique thatthe delta value is the absolute value of the differencebetween the current sensor reading and the average.This means that shifts in both the positive and negativedirection will cause the envelope to increase. If thisbehavior is not desirable for your system, the absolutevalue section of the code example can be removed. Formore information about the envelope detectordecoding algorithm, see application note AN1317,mTouch Conducted Noise Immunity Techniques forthe CTMU.

    EXAMPLE 6: ENVELOPE DETECTOR

    FIGURE 28: ENVELOPE DETECTOR UNDER HIGH INJECTED NOISE

    COMMON CHALLENGESThere are several behaviors of capacitive touchsystems that commonly appear. In this section, themain issues seen in these applications will bediscussed and the different possible solutionsdescribed that can be used.The challenges and solutions covered in this sectionare: Crosstalk Impulse Noise Unresponsive Buttons Flickering Buttons Reversed Operation

    Common Challenges: CrosstalkCrosstalk is the undesired shift of a sensor when anadjacent sensor is pressed. It is mainly a side effect ofplacing sensors too close together, but can be alsosignificantly affected based on the thickness andrelative permittivity of the covering material.Best Option: Increase the amount of separationbetween sensors.

    If possible, reducing the amount of crosstalk usinghardware design techniques is preferred to thesoftware adjustments that can be made. Crosstalk willalso become more of a problem in systems with thickcovers, so reducing the overlay thickness may also bea required step. For more information on the causes of crosstalk andthe available hardware changes to reduce this effect,see the Section Pad-to-Pad Separation Distanceof this application note.

    // Speeds from Fastest-Slowest:

    // 2, 4, 8, 16, 32

    #define SPEED 4

    uint16_t envelope;

    uint16_t baseline;

    uint16_t UpdateEnvelope(uint16_t reading)

    {

    int16_t delta = baseline - reading;

    // Absolute Value

    if (delta < 0)

    delta = -delta;

    // Update envelope

    envelope -= (uint16_t)(envelope/SPEED);

    envelope += (uint16_t)(delta);

    return envelope;

    }

    2010-2013 Microchip Technology Inc. DS00001334B-page 25

  • AN1334

    Option 2: Adjust the Thresholds

    If the above hardware solutions are not adequate orcannot be used by your specific application, adjustingthe software may be your only alternative. Changingthe threshold by increasing the amount of shift requiredto detect a press might be the best option if the systemhas more sensitivity than needed. Eliminate the ability of crosstalk to activate a sensor byrequiring that the sensors reading shifts more than themaximum shift caused by crosstalk in the system. Keepin mind when doing this, however, that noise on thesystem may increase the maximum crosstalk shiftwhich could cause false triggers in the future.Option 3: Implement the Most Pressed Algorithm

    Alternatively, the systems decoding algorithm can bechanged to compare each sensors shift with the othersensors in order to determine which one is the mostpressed. Implementing this algorithm will limit your systemscapabilities. First, the system will only be able tosupport one press at a time since only the highest shiftsensor is always picked. To minimize the effect of thislimitation, only compare nearby sensors to each other.The second limitation this algorithm places on a designis on response time. The extra execution time requiredby the processor and the requirement that all sensorsmust be scanned before the decoding process canbegin will both slow the system down. Depending onthe application, this may or may not be an acceptabledesign trade-off.

    Common Challenges: Impulse NoiseImpulse noise appears as individual or small groups ofreadings that behave in a significantly different mannerthan the readings before and after them due to a noisesource and not a fingers press. These spikes canquickly destabilize a system if not handled correctly.Additionally, if noise spikes are a common problem forthe system, they can also lower the effective SNR.Software filters are usually the easiest method forremoving this problem. The key is to adjust the filter toreduce the affect of the spikes, but not affect theresponse time of the system. For example, if thedecision is made to take the average and just slow itdown to minimize the impact a single reading can have,it will reduce the noise spikes in the system. However,it will also slow down the response time since relianceis now on a much slower average.Best Solution: Implement the Slew Rate Limiter filter.

    Infinite Impulse Response (IIR) filters are not going tobe as effective as Finite Impulse Response (FIR) filterswill be in this case. Since IIR filters allow one reading toaffect the signal for a (theoretically) infinite period oftime into the future, the effect of a noise spike couldcause the filter to become unstable. The best option inthis case is to use the Slew Rate Limiter (also referred

    to as Decimation) filter described in the softwaresection of this application note. It will eliminate allimpulse noise from the system with a minimal impacton the overall behavior so long as the sample rate isincreased to adjust for the decrease in response time.

    Common Challenges: Unresponsive ButtonsUnresponsive buttons are sensors that will not changestate when a finger is placed on them. The two mainsoftware features that will affect your sensors topossibly make them unresponsive are thresholds anddebounce values. Sensor sensitivity can change asnoise is injected on a system. This change can reducethe sensitivity to the point that the threshold is no longercrossed. Increased noise on the system will increasethe probability of a single sensor reading falling outsideof the acceptable range to change state. If themaximum debounce value is high and the noise is high,it is possible the sensor will never respond.There are several things that can be done to fix thisproblem in a system.Best Solution: Adjust the Thresholds

    First, the threshold can be made easier to cross bymodifying the software. When noise reduces thesensitivity of the system, the easier threshold willdecrease the possibility of an unresponsive button.This may not be a solution if making the thresholdeasier to cross will introduce false triggers into thesystem. The best way to make sure there is plenty ofsensitivity to work with in this situation is to follow thehardware design guidelines described in thisapplication note.Option 2: Check Both Directions for Shifts

    Another possibility is that the system is being injectedwith a specific amount of noise that has caused it toreverse its press behavior. When this happens,pressing on the sensor will cause a shift in the oppositedirection as expected. The solution to this problem is toplace the threshold on both sides of the readings. Thismay not be an option, however. In some systems, thedirection of a shift indicates a specific event. Forexample, in some water-resistant systems a shift in onedirection is a press while a shift in another directionindicates the presence of water. Implementing ashift-check in both directions would eliminate the waterresistance of the application.

    DS00001334B-page 26 2010-2013 Microchip Technology Inc.

  • AN1334

    Option 3: Use Hardware to Increase Sensitivity

    Finally, if adjusting the thresholds does not solve theproblem, hardware changes may need to be made toincrease your systems base sensitivity. First, makesure the application is following all of the designguidelines. The next step is to begin increasing sensorarea, decreasing crosstalk through sensor separation,decreasing the cover thickness, or changing itsmaterial. All of these suggestions can be traced back totheir origins in Equation 2, which defines therelationship between capacitance and hardwaredesign.

    Common Challenges: Flickering ButtonsThe term flickering button refers to a sensor that willrapidly toggle its state while a finger is present. This isdistinctly separate from a false trigger, which is asensor changing state while there is no finger.Flickering buttons are caused in the same way asunresponsive sensors. As noise is injected on a sensor,the sensitivity of the sensor can change. If thesensitivity is reduced to the point that it approaches thethreshold, noise can sometimes cause the readings tojump above and below it. This will result in the sensorrapidly changing states.Best Solution: Implement Threshold Hysteresis

    The best and most effective solution to this problem isto adjust your algorithm so that it implements a largehysteresis on the thresholds. Separate press andrelease thresholds will be able to tolerate a much largeramount of system noise. If sensitivity levels are high,the thresholds will be able to be placed further apart,increasing the noise resistance of the system. Similarly,as the thresholds are placed closer together, thesystem begins to return to its single-threshold behaviorand can once again experience flickering buttons. Forthese reasons, a combination of hysteresis anddebouncing should be the default solution to thisproblem in applications.Option 2: Increase the Debounce Requirement

    The easiest way to reduce this problem is to increasethe maximum debounce value, but this method canhave mixed results. Increasing the debounce count willdecrease the response time of the system and will onlydecrease the probability of flickering. The smallerprobability of flickering will translate to a slower flicker,but most likely not the complete elimination of it.Option 3: Adjust the Thresholds

    A third option is to make the threshold easier to crossor to increase the sensitivity of the system throughhardware changes. However, if there is a large amountof noise on the system, this still may not be enough byitself to solve the problem.

    Common Challenges: Reversed OperationReversed operation can occur in systems with a highamount of injected noise. The noise can cause thesystem to shift in the opposite direction as the no-noisebehavior. If the system was shifting down on eachpress, it is now shifting up. This can be a problem insystems that only look for a shift in one direction. Figure24 shows how a system looking for a down shift canenter a reversed operation state if an up shift occurs.There are two main ways of solving this problem. Thebaselines speed can be decreased and thresholds canbe placed on both sides of the baseline.Best Solution: Check Both Directions for Shifts

    The more robust solution to this problem is to create athreshold on either side of the average so that a shift ineither direction will result in a detected press. Not allsystems may work well with this solution, however. Forexample, in some systems designed to work in wetconditions, a shift in one direction means a finger ispresent while a shift in the other direction correspondsto a the effect of water. In a situation such as this, it maybe wiser to ignore any shifts in the wrong direction.Ultimately, the decision should be based on the specificapplications requirements.Option 2: Adjust the Filters Time Constants

    Slowing down the baselines speed would require thata longer opposite-direction-from-normal shift occurbefore the system enters the reversed operation state.This would cause unresponsive buttons when specifictypes of noise are injected onto the application, butmay be the best option for a given system. Just slowingdown the average will not eliminate the problem,however. If a user were to press on a sensor for a verylong period of time, the slow average will eventuallyfollow the finger and, when it is finally removed,reversed operation could still occur. This is aperformance trade-off that must be considered whenusing any baseline in a system. Determining thedifference between the environment naturally shiftingthe readings and a finger artificially shifting thereadings can sometimes be difficult.Option 3: Increase the VDD of the system

    While this will not eliminate the problem, raising VDDwill fight against the reversing behavior by increasingthe amount of noise that must be injected on thesystem before it flips. This option is placed lastbecause increasing VDD results in a higher currentconsumption for the system.

    2010-2013 Microchip Technology Inc. DS00001334B-page 27

  • AN1334

    CONCLUSIONGood hardware design choices are the foundation to arobust capacitive touch design. By following theprovided design guidelines, your custom applicationwill have a high base SNR which will decrease yourrequired software overhead, speed up your systemsoverall response time, and allow your system toperform well even in noisy conditions.Although there are many opportunities to adjust adesign to meet a specific applications needs, the bestdesign choices for a robust system are summarized inTable 1.Acquisition techniques such as jittering the sample rateand implementing a slew rate limiter will reduce theamount of noise that is introduced through thereadings. Digital filters such as the L-Point Averageand the low pass Butterworth allow the system to trackenvironmental changes and further increase the SNRof the signal. Finally, specific algorithmimplementations such as threshold hysteresis,debouncing, and the most pressed algorithm willallow the system to react to even the most rare of noisedisturbances.

    From start to finish, capacitive touch systems should bedeveloped with the key focus of increasing the SNR ofthe sensors signal. Following the given hardwaresuggestions and implementing the provided softwarealgorithms will make the system both cost effective androbust.For information on the basics of mTouch sensing andother more advanced topics, visit the Microchip website at http://www.microchip.com/mTouch.

    TABLE 1: IDEAL HARDWARE DESIGN RECOMMENDATIONS

    Button PadsShape No specific requir