Hardware implementation for touch control

Technoman

Senior Member
Hi,
In a next future, I intend to use touch control for the first time. I had a look at the AXE181 data sheet and at some application notes released by Microchip (AN1626, AN1325, ...).
Owner of a recent camper van with several control panels using touch control, I don't want any erratic behaviour as I could too often see : unwanted state change (may be due to condensation, RF disturbance, power line coupling or other unidentified reasons).
I am looking for advices concerning the hardware implementation for the best reliability.
 

hippy

Technical Support
Staff member
It's not clear if you are planning to use touch control in a vehicle, whether you have experienced the issues you mentioned or are rightly concerned about them.

For an automotive environment I would suggest physical button control. Products designed specifically for such use and attached to a PICAXE would likely be a better bet than using a PICAXE to do touch control.

It may be possible but I would expect it to be challenging, involving 'adaptive algorithms', and a lot of tweaking. I would definitely recommend undertaking some proof of concept testing on the bench before even considering making things work in a vehicle.
 

cpedw

Senior Member
There has been discussion here and elsewhere. My conclusion, shared by some others I think, is that e.g. TTP223 are reliable and cheap whereas Picaxe touch is quite challenging.
 

Technoman

Senior Member
I am(was?) planning to use touch control in a vehicle and at home. Unfortunately I do have experienced the mentioned issues.
At first, the advantage is to replace mechanical buttons while having the benefit of being waterproof.
@hippy : could you explain "adaptative algorithms"?
Microchip solutions : https://www.microchip.com/en-us/products/touch-and-gesture/capacitive-touch-solutions-for-buttons-sliders-wheels-and-proximity
Unfortunately, this technology is only available on more recent chips. No Picaxe MCU is listed.
 

rq3

Senior Member
Years ago I built a device that was supposed to drive a stepper motor up and down a string, with the position of the motor varying according to baromatric pressure. It eventually morphed into an aircraft altitude hold mechanism, complete with barometric sensor, stepper driver, OLED display, and touch switches. All driven by a Picaxe 20M2.

The trick to the touch switches was to have the Picaxe sense the switch parameters at initilization, store the result, and then constantly ask itself whether that result had changed more than a certain amount. If it had, the switch was considered to be touched, and the value immediately after the touch was stored as the new "baseline". This kept the switches constantly self calibrating from -40C to +150C, even with ice or condensed steam on the glass covered touch panel. IIRC, there was one line in the picaxe code that set the sensitivity, anywhere from a hand waving 6 inches away, to requiring a firm licked thumb on the switch. I'll see if I can find the code.

Video here:
 

hippy

Technical Support
Staff member
@hippy : could you explain "adaptative algorithms"?
It's basically automatically adapting to a changing environment as 'rq3' describes.

One example would an analogue pot which you want to be able to slowly adjust but also want to be able to detect large changes and light a LED - A variation on the 'buzzer wire' game; turn the pot back and forth without triggering the alarm.

You would need to track what the current pot position is to be able to determine what constitutes a large change. 45 to 90 degree might be an ADC change of 100 to 110, 180 to 225 degree might be and ADC change of 200 to 210.

You can't have a single "greater than 205" or similar, have to use "+/-10% change, or +/-N change from last or average or something like that.

The "adaptive" part is continually determining what the last or average is, what change constitutes a large change, adjusting parameters as you slowly turn the pot to be able to detect the big changes.

Another example might be wanting to detect when someone wearing a sensor is jumping up and down on a boat when the boat and the person are already moving up and down on the waves.

EMI and other environmental things can affect the touch readings in a similar way that waves prevent there being a constant baseline. As your hand approaches a touch switch its reading may go up even though it's not actually been touched yet.
 

Technoman

Senior Member
Thanks to all for these explanations and tips.

To sum up :
  1. software : use of an adaptative algorithms.
    The TTP223 data sheet is giving a 4s re-calibration period if no key touched and 16s after a key being touched.
    @rq3 : which period was optimum for you?
  2. hardware : architecture using a single Picaxe MCU or with a dedicated chip (TTP223, Microchip CAP11XX,...).

  3. hardware : protection against ESD and transients (diodes connected to VCC/GND, ...)?
    The chip's protection is may be sufficient.
  4. hardware : different layers.
    What are the most suitable materials?
 

rq3

Senior Member
@Technoman , I'm darned if I can find that old code, but as I recall, at boot time the picaxe assumed that the switches were NOT touched, and stored the touch value as the base line. A variable determined how much of a change was considered to be a valid touch. IF such a touch occured, then the value immediately AFTER the touch was stored as the new base line. All of this ran at 32MHz on a 20M2, using touch16. I also recall "tweaking" a lot of the deeper touch variables to get a consistent result. But once they were set up properly, they stayed consistent.

If the "sensitivity" variable was very small, the switches would detect a hand waving about 6 inches from the switches. If the variable was very large, it required a firm press with a wet finger to get a valid touch. I froze and steamed the entire device, and it seemed pretty reliable.

To directly answer your question, valid touches could be within milliseconds of each other. Had it been a keyboard, you could have easily typed on it.
 
Last edited:
Top