mTouch® Button/Proximity Sensor Configuration

The Button or Proximity Sensor is an abstraction layer over the physical sensor which decouples the signal acquisition module and the decoding module. The benefit of this abstraction is that regardless of what acquisition method is being used for the sensor, the Button or Proximity Sensor decoding works the same way.

Common Button/Proximity Sensor Configuration

Similar to the sensor configuration, the Button/Proximity Sensor also has a common section. The common Button settings area consists of six sub-areas:

  • Create New Button
  • Interface Method
  • Press Timeout
  • Negative Capacitance Recovery
  • Baseline Filtering
  • Reading.
button_common_config.png

The common Proximity Sensor has two extra sections: deviation integrator and median filter.

proximity_common_config.png

Create New Button/Proximity Sensor

The 'Create New Button/Proximity Sensor' tab in the Common Settings area allows for the creation of an additional button or proximity sensor for the mTouch® sensing solution project. When a new button/proximity sensor is created, the default name is Button#/Proximity#, where # is the lowest number not currently used.

Interface Method

The mTouch sensing solutions library allows your application code to obtain button/proximity sensor status in two ways: through a callback function or through polling. There are examples of how to use these two methods In the Step by Step Example section.

Press/Activation Timeout

Press/Activation Timeout is a mechanism used to release a stuck proximity sensor. If a button/proximity sensor is pressed or activated for a number of consecutive counts, the button’s or proximity sensor's state will be reset. Each button/proximity sensor has its own time-out counter to track the press time. The underlying press time-out counter will increment each time the MTOUCH_Service_Mainloop() call is performed. The counts parameter acts as a threshold to each button’s/proximity sensor's press time-out counter. Upon the time-out’s counter exceeding the counts value, the button/proximity sensor state will be reset.

Baseline Filtering

The baseline of a touch button/proximity sensor is the output of a conditionally low-pass filter and the input of this low pass filter is the button’s or proximity sensor's raw reading. This allows the baseline to track and react to environmental changes such as temperature and humidity. Upon a button entering a pressed state, the baseline will stop updating until released.

The filter gain parameter determines the baseline filtering strength. The larger the value, the stronger the filter gets, and the more slowly the baseline follows the button reading value.

The update parameter determines how often the system will update the button’s or proximity sensor's baseline. The larger the value, the less often the system updates the baseline.

Negative Capacitance Recovery

Enabling this feature allows the quick recovery of a button’s or proximity's baseline if negative capacitance is detected. The negative capacitance means the baseline value is greater than the reading for a button. The consecutive decodes parameter specifies the number of consecutive decoding cycles (MTOUCH_Service_Mainloop() call) with negative capacitance that the program has to detect before resetting the button’s/proximity state.

Reading Filter

To minimize the impact of impulse noise, the sensor output goes through a low-pass filter; the output of the filter is the reading of the button/proximity sensor. A higher filter level setting provides an improved signal to noise ratio under noisy conditions while increasing the total time for measurement, possibly resulting in increased power consumption and response time.

Deviation Integration Filter

To help the sensitivity of the proximity sensor, a deviation integrator is used. A larger gain value results in more sensitivity.

Median Filter

To gain a greater Signal to Noise Ratio (SNR) for the proximity sensor, a median filter can be used after the reading filter. The value of the median filter window decides how much historical data will be stored. Similar to the reading filter, a higher value provides more noise immunity but longer response time.

Individual Button/Proximity Sensor Configuration

The individual Button/Proximity Sensor Configuration allows users to set name, threshold, deviation scaling and AKS group for each individual button/sensor. The Delete Item button is used to remove the button/proximity sensor from the project.

individual_button_configuration.png

Name

This input field allows you to modify the name of the selected button/proximity sensor. This name can be used in the code to reference this button/proximity sensor.

Sensor

This selection box allows you to select a hardware sensor to be associated with this button. A hardware sensor can be associated with multiple buttons/proximity sensors. For example, if you want to achieve proximity detection and touch detection on the same physical sensor, this sensor can be associated with a button and a proximity sensor.

Threshold

The signal deviation is defined as the difference between a button’s reading and the baseline value. The threshold input field allows users to determine the press threshold value for signal deviation before the button will be in the pressed state. The release threshold is 50% of the press threshold so that there is a hysteresis to release the button.

deviation.png

Deviation Scaling

The signal deviation will be scaled down from a signed 16-bit integer to a signed 8-bit. If the deviation after scaling down is greater than 127, then the value will be clipped to 127 (0x7F). The deviation scaling parameter controls how many bits will shift to the right. The smaller the value is, the more sensitive the button will get. The goal is to shift the scaled-down deviation to be a value between 64 and 127 when the button is pressed, in order to get the full dynamic range.

scaling.png

AKS Group

AKS® stands for Adjacent Key Suppression. In designs where the sensors are placed close together or configured for high sensitivity, multiple buttons might report a detection simultaneously. To allow applications to determine the intended single touch, the mTouch library makes it possible to configure multiple buttons/proximity sensors in an AKS group. When a group of buttons/proximity sensors are in the same AKS group, only the first strongest button/proximity sensor will report detection. The button or proximity sensor continues to report detection until its deviation or delta falls below its detection threshold. As long as this sensor is in the pressed state, no other button/proximity sensors in the same AKS group will report detection even if another button/proximity sensor's deviation becomes stronger in the same AKS group.

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