## Trying to Understand Qtouch method of touch sensing

26 posts / 0 new
Author
Message

Qtouch describes their method of touch as "charge transfer signal acquisition technology". I have been trying to understand it.

Only working with one single key. I presume Qtouch has the best algorithm from what I have read online, if there is a more robust way that you recommend, please do share.
(I found this, it looks quite sensitive but I dont think it will be as robust as the Qtouch method:
http://elm-chan.org/works/capsens/report_e.html)

I think there is a fundamental flaw in my understanding.

This is how I think it works:
(refer to the attached pic below)

Step1: Set PB1 and PC1 as outputs, and output a low on both of them to discharge Cs.
Step2: Set PC1 to an input.
Step3: Pulse PB1 high , then put it back to HiZ (or should if remain an output and output a low?)
Step4: Check if PC1 if high.
Step5: Repeat Steps3&4 until PC1 measures a High.
Step6: If the number of iterations taken is below the threshold then it is said to be touched.

Questions 1:
In Step2: Should PC1 be an input or set set to output low?

Questions 2:
In Step3 is PB1 is pulsed between high/low or High/HiZ?

Questions 3:
I dont understand how the process works. To me what would make sense is if you remove PC1 all together, and ground the side of Cs that used to connect to PC1. Now the voltage built up across Cs is with respect to GND. And when you pulse PB1, Cs will charge up with each pulse, and can be measured on PB1 (PB1 Switching between an output and an input).

But clearly my reasoning is wrong because that is not how it is done. I am starting to think my cap knowledge that has served me quite well so far is fundamentally flawed.

I look at Cs as a cap with one leg connected to CB1, and the other leg connected to nothing (CS1 is a HiZ input I presume), so how can it ever build up a voltage across it?

Thank you for any help, your insight and time is much appreciated!

## Attachment(s):

Just a noob in this crazy world trying to get some electrons to obey me.

Last Edited: Tue. Jan 16, 2018 - 11:16 AM
```My guess(and is is simply a guess) would be thus:
1) PC1 and PB1 both low to discharge Cs.
2) PC1 tri-state.
3) PB1 high output to charge the cap formed by electrode/dielectric/finger.
4) PB1 tri-state
5) PC1 low output - cap [e/d/f] transfers charge to Cs
6) Check voltage on PB1 to see if it's reached threshold yet. If so, go to Step 9.
7) PC1 tri-state.
8) Increment a counter and go to step 3.

9) If the counter is less than something, finger exists.```

 Code tags added to avoid smiley problem with figure eight followed by closing parenthesis.[/Edit]

Four legs good, two legs bad, three legs stable.

Wow thanks John, I see your step 5 is what I was missing and could not deduce. Thank you very much, that is very smart of you!

Just a noob in this crazy world trying to get some electrons to obey me.

Well don't take it as gospel.
I'm strictly ones and zeros
I was rather hoping that some erudite analog type would shoot my ideas down in flames and provide the real explanation.

Four legs good, two legs bad, three legs stable.

John_A_Brown wrote:

 Code tags added to avoid smiley problem with figure eight followed by closing parenthesis.[/Edit]

No need for code tags, simply select the "Disable Smilies in this post" checkbox when you edit. [also available when you quiote, or select "new reply"], just not available in the quick-reply.

Writing code is like having sex.... make one little mistake, and you're supporting it for life.

John_A_Brown wrote:
Well don't take it as gospel.
I'm strictly ones and zeros
I was rather hoping that some erudite analog type would shoot my ideas down in flames and provide the real explanation.

lol well until another willing and better preacher comes around, I am taking it as gospel truth and going to test it.

Just a noob in this crazy world trying to get some electrons to obey me.

Svofski has explained it here:
http://sensi.org/~svo/capsensor/...

Hi:

I've done some Qmatrix and Qtouch design as well. The chips have a DSP under the hood. That's why they are so reliable.

I've tested them with thin substrates, thick substrates, wet substrates with condensed water drops, and all kind of interference coming from GPRS / radio modules, switching regulators and the like.

And I have to say that they are really well designed and very though. They even can work with pretty bad PCB layout (although I recommend to stick to the design rules)

What the chips really don't like is dirt, and dirty/poorly cleaned or soldered PCB's.
I once mounted a QT60486 prototype that worked when it liked. Some times it powered up OK, some other times it stopped with an "FMEA error" . And finally we found that the problem was a flux stain going to some pins from below the chip package.

Anyways, for "touch" technology I've seen (before qtouch) some switch/interrupters done with common off the shelf CD4000 chips (ELEKTOR or NUOVA ELETTRONICA published some of these, back in the 80's) and other design based on specialty chips. I remember a light dimmer based on the S576 chip. But that design used physical contact with a control pad, it wasn't "capacitive touch" properly said.

nachus

avra wrote:
Svofski has explained it here:
http://sensi.org/~svo/capsensor/...

Hi, thank you for the link, I have read it, but unfortunately it is for a capacitive touch matrix. And it seems to be very different.

Unless for a single key if I use pads that "mesh" (like two puzzle halves) into each other and then use a similar concept?

Just a noob in this crazy world trying to get some electrons to obey me.

fever2tel wrote:
avra wrote:
Svofski has explained it here:
http://sensi.org/~svo/capsensor/...

Hi, thank you for the link, I have read it, but unfortunately it is for a capacitive touch matrix. And it seems to be very different.

Unless for a single key if I use pads that "mesh" (like two puzzle halves) into each other and then use a similar concept?

You can peek in the documents that explain the "Qtouch" (not Qmatrix) internals, which are designed with no matrix and uses one electrode per key. The chips available are for 1, 2 and 4 keys AFAIK.
Go to Atmel website, they have many documents explaining the technology and layout techniques in detail.

Thanks nachus, I checked out the AT42QT1011 and learned quite a bit.

However I tried coding the above algorithm, and voltage on SNS always follows SNSK, there is no build up of charge.

So I thought maybe if I simulate it I can try get a better understanding and see how it works in theory before coding it.

In the simulation below, V2 is just a pulse generator that pulses between -1V and 1V with an on time of 3us, and a cycle time of 12us. S1 and S2 just act as comparators that if the + voltage pin is greater than the - voltage pin, then the switch is closed.

The net results is S1 is closed for 3us, then it is opened and s2 is closed for 9us, then the cycle repeats. I expected to see a voltage build up across Cs.

So we can see a decrease in the SNS voltage with each pulse which is exactly what I was looking for. It would appear the algorithm we have deduced is correct.

The values in the simulation (timing and Cs, Cx, R values were all taken from the AT42QT1011 datasheet).

LT spice codes follows below:
(reason for edit: got the simulation working, had to step the DC voltage supply or else Cx would just start charged up for some arb reason).

## Attachment(s):

Just a noob in this crazy world trying to get some electrons to obey me.

Last Edited: Mon. Dec 6, 2010 - 01:08 PM

LT spice code:

```Version 4
SHEET 1 1208 680
WIRE 80 -144 -96 -144
WIRE 144 -144 80 -144
WIRE 32 -64 -48 -64
WIRE 144 -64 32 -64
WIRE 144 -32 144 -64
WIRE -96 32 -96 -144
WIRE -48 32 -48 -64
WIRE -112 80 -224 80
WIRE 144 80 -32 80
WIRE 208 80 144 80
WIRE 272 80 208 80
WIRE 400 80 352 80
WIRE 208 96 208 80
WIRE 400 96 400 80
WIRE 32 128 32 -64
WIRE 80 128 80 -144
WIRE 16 176 -32 176
WIRE 144 176 96 176
WIRE 208 176 208 160
WIRE 208 176 144 176
WIRE -32 192 -32 176
FLAG -32 192 0
FLAG -224 160 0
FLAG 144 -32 0
FLAG -96 -144 sw_control
FLAG 400 160 0
FLAG 144 80 SNSK
FLAG 144 176 SNS
SYMBOL sw -16 80 R90
SYMATTR InstName S1
SYMATTR Value comp
SYMBOL sw 112 176 R90
SYMATTR InstName S2
SYMATTR Value comp
SYMBOL voltage -224 64 R0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName V1
SYMATTR Value 5
SYMBOL voltage 144 -160 R0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName V2
SYMATTR Value PULSE(-1 1 0 .1u .1u 3u 12u)
SYMBOL cap 384 96 R0
SYMATTR InstName Cx
SYMATTR Value 5p
SYMBOL cap 192 96 R0
SYMATTR InstName Cs
SYMATTR Value 4.7n
SYMBOL res 256 96 R270
WINDOW 0 32 56 VTop 0
WINDOW 3 0 56 VBottom 0
SYMATTR InstName R1
SYMATTR Value 1K
TEXT 200 224 Left 0 !.tran 4ms
TEXT 200 248 Left 0 !.model comp sw (ron=0.1 Roff=1e10)
```

Just a noob in this crazy world trying to get some electrons to obey me.

Hi fever:

One problem is that you have to model the "substrate" (the actual piece of isolator which will interact with the key and your finger)

The other problem, is that the substrate is by definition unknown, and probably, highly nonlinear so the process of charge and measurement is designed to be adaptive. (for Qtouch you usually change R's and C's to fit your key geometry and substrate, for Qmatrix you also have a huge register file that let you change paramenters for individual keys)

I don't know frankly how to model such a process, but if you want to know whats goin' on with the Qtouch guts, register in the atmel "touch forum" and post there. That forum is run by Atmel Qtouch product engineers that uses to respond quickly to your questions (I attest) And they may prompt you to some literature specific on the matter.

Cheers
Nachus

thanks nachus I have emailed atmel and joined the touch forum, just waitig for my account activation to be accepted by the moderators.

One thing I really dont understand is in my simulation SNSK does not look anything like those in the datasheet:
See the attached pic below:

Why does ATMELs pics of the SNSK pin show a high top that tapers down?
That pin is being driven directly off an IO port, it most go to VDD when the output is high!?!?

## Attachment(s):

Just a noob in this crazy world trying to get some electrons to obey me.

Hi guys, just a small follow up, I got my simulation working nicely, then I coded it and got the code working, then I added routines to update the average reading, and then adjust for positive and negative drift.
Its all done in assembly and is included via a macro.
Its working very well thanks to the help you guys gave me.

I was going to post it here, but I know the Qtouch charge transfer method is patented.

But then today I came across this:
ST has now released the same thing as Qtouch for their micros. Have a look here:
http://www.st.com/internet/mcu/product/251122.jsp?wt.mc_id=enews_jan11_stm8touchlib
http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/DATA_BRIEF/CD00284216.pdf

Just a noob in this crazy world trying to get some electrons to obey me.

Quote:
I got my simulation working nicely, then I coded it and got the code working, then I added routines to update the average reading, and then adjust for positive and negative drift.
Its all done in assembly and is included via a macro.

That's quite an achievement! I'd be interested to see that source code. I have a couple of products where I'm planning to replace the mechanical buttons on future revisions, but I don't have the code space available to link in the Qtouch libraries. I could probably do it in assembler.

My Atmel rep stopped by last week and dropped off a couple of new Qtouch evaluation boards - a single key using a Tiny10 and a 5 key board using a Tiny20. They work beautifully well. Unfortunately there's no documentation with them, and the Atmel web site doesn't return any search results yet.

peret wrote:
Quote:
I got my simulation working nicely, then I coded it and got the code working, then I added routines to update the average reading, and then adjust for positive and negative drift.
Its all done in assembly and is included via a macro.

That's quite an achievement! I'd be interested to see that source code. I have a couple of products where I'm planning to replace the mechanical buttons on future revisions, but I don't have the code space available to link in the Qtouch libraries. I could probably do it in assembler.

My Atmel rep stopped by last week and dropped off a couple of new Qtouch evaluation boards - a single key using a Tiny10 and a 5 key board using a Tiny20. They work beautifully well. Unfortunately there's no documentation with them, and the Atmel web site doesn't return any search results yet.

I have a board from Atmel labeled "TP100 - ATtouch2C Evaluation Board". No documentation that I can find either.

Does anybody know how to register for the Atmel touch forum? It says that registration is closed.

Hello I am new to this forum,

so go easy on me.

for our setup we have capacitive sensors of the type AT42QT1011 in use for testing small animals through touch of licking.

on the moment of licking we attain a flicker on the signal in Labview. If we use our own fingers we get a solid high and low.

The board we use for the capacitive sensor is a AT42QT1011 on a small SMD PCB board with all the components needly pact together.

For the touching we use copperwire glued around the red straw.

we do not understand this problem of flicker on the signal (fast switching to high and low) see white signal image 2015-03-24 16.10.31.

is it due to the fact that the animals touch through his nosehairs produce these small disturbances? is the device to sensitive? or need the animales be grounded?

I would greatly appreciate your help on this

sincerely yours

Bastiaan

## Attachment(s):

YOur finger is providing a 'constant' presence, and pressure, where as your lab rat's tongue is providing an intermittent, and 'noisy' signal as it's tongue scrapes across the sensor.  YOu can filter the 'noise' out to some degree in Qtouch Composer.

JIm

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

"The critical shortage here is not stuff, but time." - Johan Ekdahl

"Step N is required before you can do step N+1!" - ka7ehk

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

How interesting that this old thread should be reopened at the exact time I started trying to design a Tiny10 Qtouch button and need to ask a question. My lack of success so far at finding any documentation has reminded me why I abandoned my earlier efforts with Qtouch four years ago.

So. I have the 2013 version of the Qtouch libraries 5.0 installed. There is a tool for Tiny10 (single key configurator) that spits out a hex file configured various ways (though why the frack they couldn't just post the source code is a mystery to me). However, the version of the tool in that library is 2.0.1, but the documentation I've been able to find is for 4.0.0.0, 2014, which looks very different and has more options.

There's a 2014 version of Qtouch libraries 5.0 - it is different from the one I have, it's larger, so I presume Atmel were just too busy to up the revision number. Unfortunately I can't get it to install. I get this highly uninformative error message -

Looks a lot like a dot-net problem to me. I know, there's probably some 100MB extension I can download for Studio 6, but my time is precious. I don't feel inclined to waste half a day installing a bunch of ARM and Xmega crap only to find the piece I want isn't there. I just want to get this damn thing out of the way with the least amount of trouble. Can anybody direct me to a place where I can download the 4.0.0.0 version of Single_key.exe, found in the ATtiny10 folder of the library? Pretty please?

Reminescent of early stud sensors.

There is a Qtouch Composer add-on for Studio, and there is a stand alone version as well.  The add on will only work with AS6.2 build 1502 or newer.

The stand alone....well you get the idea.

The composer is useable.  I took a tech on tour seminar where we worked with a Sam D21 kit and Composer and it went rather smoothly.

Jim

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

"The critical shortage here is not stuff, but time." - Johan Ekdahl

"Step N is required before you can do step N+1!" - ka7ehk

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

I know there's a Qtouch Composer, I wasted a whole day on it. It doesn't have what I need. And the stand-alone - well, the 2013 version installed ok but the 2014 gives me that error.

<edit> Perseverance finally paid off. The problem was that due to the extremely verbose directory names in the library, when I tried to install it in C:\Program Files\Atmel\ some of the path lengths were too long. Installing it to C:\ worked and I found the file I wanted.

Last Edited: Sat. Apr 4, 2015 - 07:23 AM

Hello again,

thanks for the reply and the Qtouch sensor App for the Atmel Studio. the thing is the sensor as described with photos in my previous comment is stuck or the signal will stay high wenn nothing is touching it. Pressure is used agains the coil on the tip to unlatch the signal to Zero.

what can be the cause that it is constantly high, for no reason?

sincerely yours

B

I don't know. I presume you're using the 42QT1011 in stand-alone mode. I've only used the 42QT2120, in I2C mode, and have never noticed any problem with it sticking. Perhaps your device is in toggle mode, touch on touch off? I know that mode is available on the AT tiny10 version, don't know if it's available on the 42QT1011.