TTP223 touch sensor
The TTP223 capacitive touch module: a small red board with a round pad printed on it. Aliases: touch button, capacitive touch sensor, touch pad.
There is no switch on it. The pad is one plate of a capacitor and a finger is the other, and the TTP223 chip watches for the few picofarads a touch adds. It needs no pull-up and it does not bounce, which is why a class that has fought button bounce likes it.
Pins
| Pin | What it does |
|---|---|
SIG |
A push-pull output, HIGH while touched as shipped. |
VCC |
Supply, 2.0 V to 5.5 V. |
GND |
Ground. |
Properties
toggle and activelow are the two solder jumpers on the back, B and A, which
are the chip's TOG and AHLB pins:
toggle |
activelow |
SIG |
|---|---|---|
| off | off | HIGH while touched (as shipped) |
| off | on | LOW while touched |
| on | off | flips on each touch, starting LOW |
| on | on | flips on each touch, starting HIGH |
While it runs
Hold the pointer on the pad: that is a finger. The lamp in the corner is the
module's own, lit while SIG is high.
What the model gets right
From the Tontek TTP223 datasheet:
Response time. Up to 60 ms in fast mode, which is the only mode the six-pin chip
on these modules has. A touch takes 60 ms to reach SIG, and so does a release. A
tap shorter than that is never seen.
Power-on calibration. For about half a second after power comes up the chip is measuring the pad and ignores it. A finger already on the pad when that time ends becomes part of the pad: it has to come off and go back on before it counts.
The output. A real push-pull output: 8 mA sink and 4 mA source at 3 V, so it drives a pin or an LED with no pull-up.
No time limit. The module's chip has its maximum-on-time timeout disabled, so
SIG stays high for as long as the finger stays.
What it does not model
Sensitivity (the pad feels a finger or it does not), the slow recalibration while untouched, and water on the pad.
Common mistakes
Holding a finger on it while the board powers up, then wondering why the first touch does nothing.
See it in action
Touch climate display uses one to flip a temperature between Celsius and Fahrenheit. Open it at /templates.