touch sensor pins not all created equal

Status
Not open for further replies.

JBeale

Well-known member
Just FYI, if you are using touch sensing on the T3, there are 12 different possible pins to use, but not all pins are equivalent. If you want the lowest noise, your best bet is pin 15 (A1). The noisiest touch values are on pin 22 and 23, I presume from adjacent-net noise coupling from chip internal layout and/or board layout. Below values were obtained by running the attached program to read and average together a set of touch sensor readings, for each of the 12 possible touch pins. This is on a T3 board with edge pins soldered, but held in midair by the USB cable: not plugged into a breadboard and with nothing else connected. The Average, Peak-to-Peak (max - min) and Standard Deviation are sent out from the program, and in this case each number shown below is the average of 181 sets of readings, over about 20 minutes.

Note, pins 25-33 are on the bottom side of the board (access by SMT pads only). Pin 25 has the lowest absolute reading, indicating the shortest net with least coupling to the ground plane.

Incidentally, the calibration of the touch sensor is as advertised, 1 count = 0.02 pF at least within 10%. A 10 pF test capacitor I have showed a delta of 496 counts when connected.

Code:
Pin #	Avg	Pk-Pk	St.Dev.
----------------------------------
0	415.92	1.52	0.23
1	424.79	2.96	0.40
15	401.00	0.01	0.00
16	372.27	1.76	0.42
17	449.68	14.42	2.01
18	604.84	6.53	0.85
19	618.47	3.38	0.56
22	516.41	48.76	7.08
23	626.27	52.35	8.54
25	282.78	1.00	0.37
32	305.06	6.65	1.06
33	315.89	20.36	2.48

From this chart it actually looks like pin 15 isn't even working, since the reading almost never budges even a single count. However I verified by connecting a short wire to the pin, that it does respond as expected. Not sure why it has so much lower noise than the rest, maybe specific to operation of my code (?)
 

Attachments

  • T3_CapSense_Test.zip
    1.4 KB · Views: 262
Last edited:
Very helpful thread. Seems it is wise to have a rolling average or power on self test to calibrate each run - Do you see similar results between teensies?
 
So far I've only done this test on one unit- but feel free to run the test program on yours, and report your results!
 
Code:
Pin	Average	PkPk	Std
0	410.7	1.039	0.426960784
1	416.1	2.000	0.314607843
15	396.5	2.980	0.512745098
16	373.0	2.000	0.314588235
17	451.9	12.235	1.768098039
18	616.6	7.431	1.082039216
19	625.9	3.431	0.474
22	512.6	45.196	6.760215686
23	618.1	54.412	7.305901961
25	297.6	1.020	0.460960784
32	319.0	10.392	1.632
33	329.0	23.804	3.129764706

Counted about 50 readings from each pin...playing with excel I can't for the life of me figure out how to have more than one vertical axis scale (so the numbers jump out a bit more, otherwise the stdev and pkpk are less than a pixel high)
 
Thanks Frollard, very interesting to compare results! The worst performing pins on your device match up with mine (22, 23, 33) although your best pins are different.
 
It was sat on my glass desk, but was near my mouse cable, and I was using the computer at the time, so that might have affected it a bit.

My numbers are without pin headers attached.
 
Just for curiosity, here is a different Teensy 3.0, again held up in the air by the USB cable. Board has pins soldered, but nothing connected. This time it is pin 0 which has no apparent noise (although the signal does go up when touched with a finger). Again it is pins 22,23,33 which have the most noise.

Code:
Pin #	Avg	Pk-Pk	St.Dev.
0	440.00	0.00	0.00
1	443.12	2.35	0.45
15	432.68	1.15	0.45
16	408.54	1.54	0.49
17	491.33	9.63	1.78
18	649.49	5.35	0.81
19	660.22	4.06	0.59
22	550.56	45.70	6.96
23	668.00	47.78	8.32
25	310.43	2.00	0.55
32	333.64	8.13	1.33
33	342.02	15.44	2.26

...actually, any pin which has "Peak-to-Peak" noise near 1.0 might go to apparent "zero noise" if the DC level happens to be right in the middle of the ADC value. Or, if the average value happens to be at or near the threshold, it will toggle by one bit. Looks like all three samples agree than pins 0,1,15,16, and 25 are the best, and the others are significantly more noisy.
 
Last edited:
Status
Not open for further replies.
Back
Top