Changing the Detect Hysteresis of a QTouch® Sensor

Last modified by Microchip on 2023/11/10 11:18


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.

Reference Materials

ATmega328PB Xplained Mini Evaluation Kit

Atmel® Studio Integrated Development Environment

Back to Top


Stop Reading

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

Stop Reading

Back to Top

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.

QTouch Project Builder

Back to Top

Change Button Settings

Select 'Button0' and click on the Settings icon.

Sensor Selection tab Select 'Button0'

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

'Button0' settings

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

Back to Top

Generate Project

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

'Project Generation' section and click Generate Project

Back to Top

Build and Program

Build the solution.

Build Icon

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

Start Icon

Back to Top

QTouch Analyzer

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

QTouch Analyzer Icon

In the QTouch Analyzer window, click ReConnect.

QTouch Analyzer window, click ReConnect.

Click on Start Reading.

QTouch Analyzer select "Start Reading"

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

'Tabular View'

Back to Top

Detect State

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

Back to Top

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.

'Tabular View' state is ON

Back to Top

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).

'Tabular View' state is OFF

Back to Top


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.

Back to Top