Changing the Detect Hysteresis of a QTouch® Sensor


In this lab, you will change the detect hysteresis of a button and analyze its impact. To explore this feature, you will tune the detect hysteresis value of the touch button and monitor the behavior.

This tutorial builds on the Intro to PTC and Analyze Touch Data Using QTouch® Analyzer projects. Make sure you've completed those before continuing with this hands-on exercise.


Hardware Tools

Tool About Purchase
ATmega328PB Xplained Mini
Evaluation Kit

Software Tools

Tool About Installers
Windows Linux Mac OSX
Atmel® Studio
Integrated Development Environment



Stop Reading

If you've just completed the Detect Threshold Project you should click on Stop Reading.



Open the QTouch Project Builder

In the Solution Explorer window, double-click on the .qtdgn file. Note that you may have named your project differently.



Change Button Settings

Select 'Button0' and click on the Settings icon.


In the 'Button0' settings, set the detect hysteresis to HYST_50.


Note that the Detect Threshold is 75. We changed it from the original value during the Detect Threshold Project.


Generate Project

Go to the 'Project Generation' section and click Generate Project.



Build and Program

Build the solution.


Program the application by clicking on the 'Start Without Debugging' icon.



QTouch Analyzer

Open the QTouch Analyzer window by clicking on the icon as shown below.


In the QTouch Analyzer window, click ReConnect.


Click on Start Reading.


Use the 'Tabular View' to observe touch delta and state.



Detect State

Move a finger towards the sensor. When delta crosses the detect threshold (75), the sensor will go into the detect state.


Below Detect Threshold

Move the finger away from the sensor. The sensor will stay in the detect state even after the delta has fallen below the detect threshold.



Detect Hysteresis

The sensor goes out of detect only after the delta value has fallen below the detect threshold by a value of more than 50% of the detect threshold (~38).



In this project, you observed that the touch button turns ON when the touch delta crosses the detect threshold, but it does not turn off until the touch delta falls below the detect threshold by the percentage value set in the Detect Hysteresis parameter.

© 2018 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.