Adjusting the Detect Threshold of a QTouch® Sensor

 Objective

Using QTouch® Analyzer you will monitor the touch delta of a sensor and adjust its detect threshold.

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.

 Materials

Hardware Tools

Tool About Purchase
ATmega328PB-XplainedMini-50px.png
ATmega328PB Xplained Mini
Evaluation Kit

Software Tools

Tool About Installers
Installation
Instructions
Windows Linux Mac OSX
swtool-28px.png
Atmel® Studio
Integrated Development Environment

 Procedure

1

Connect to QTouch Analyzer

Perform steps 1 through 7 from the Analyze Touch Data Using QTouch® Analyzer project.

2

Tabular View

Select Tabular View and touch the 'V' in the AVR symbol (shown below) on your ATmega328PB Xplained Mini. Observe the maximum Delta shown in the Tabular View.

AVRSymbolandTabularView.png

3

Stop Reading

In the QTouch Analyzer window, click on Stop Reading.

StopReading.png

4

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.

SolutionExplorerWindow.png

5

Change Button Settings

Select 'Button0' and click on the Settings icon.

Button0.png

In the 'Button0' settings, set detect threshold to 75.

Button0Settings.png

6

Generate Project

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

GenerateProject2.png

7

Build and Program

Build the solution.

Build.png

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

Start.png

8

QTouch Analyzer

Open QTouch Analyzer.

LaunchAnalyzer.png

In the QTouch Analyzer window, click ReConnect.

ReConnect.png

Click on Start Reading.

StartReading.png

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

TabularView2.png

9

Touch the Sensor

Touch the sensor lightly (so that Delta is less than 75). You will notice that State is OFF.

StateOFF.png

Touch State will only change to ON whenever the Delta of Button0 is more than 75.

StateON.png

Detect threshold can be directly modified inside the touch_selfcap_sensor_config() function of the respective sensor in the touch.c file.

ChangingDetectThreshold.png

 Results

You have learned how to configure and set the detect threshold value of a sensor.

© 2024 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.