Component guide · Beginner · 3 min read
TTP223 Capacitive Touch Sensors and ESP32 Touch Pins
By Geekobot Learning Team · Updated 24 Oct 2026
On this page
A capacitive touch sensor detects a finger by the small change in capacitance it adds to a pad, so there is no moving part. The TTP223 module gives a digital HIGH when touched, runs from 2 to 5.5 V, and two solder pads set toggle mode and output polarity. It works through a few mm of plastic or glass. Classic ESP32 boards have built-in touch pins, and the MPR121 handles 12 pads.
Key specs at a glance
- Chip
- TTP223 single-key touch IC
- Supply
- 2.0 to 5.5 V
- Output
- Digital, HIGH on touch by default
- Modes
- Momentary or toggle, and active HIGH or LOW, set by pads A and B
- Through material
- Up to a few mm of plastic, glass or wood
- Multi-key
- TTP224 (4), MPR121 (12, I2C), ESP32 touch GPIOs
Wiring and modes
Connect VCC to 3.3 V or 5 V, GND to GND and SIG (I/O) to a digital pin. Touching the pad sets the output HIGH and lights the LED. No pull-up or debouncing is needed.
The two solder jumpers on the back select behaviour. On most modules one pad sets toggle mode (each touch flips the output, like a latching switch), and the other inverts the output to active LOW. Check the module's silkscreen or listing, since labelling differs. The chip calibrates itself at power-up, so do not touch the pad while switching on.
Touch through a case
Mount the module with its pad pressed flat against the inside of a plastic, acrylic or glass panel up to about 3 mm thick; thicker panels need a larger pad or adjusting the sensitivity capacitor on the module. Metal panels block it. Keep the wires to the pad short, and keep it away from mains wiring and motors. Damp surfaces and water drops can cause false touches.
ESP32 built-in touch and MPR121
Classic ESP32 boards (and ESP32-S2 and S3) have touch-capable GPIOs: touchRead(T0) returns a value that drops (on classic ESP32) when touched, so compare it against a threshold measured at start-up. A strip of copper tape or a coin on a wire makes a pad. ESP32-C3 boards have no touch pins.
For a keypad of 12 touch pads, use an MPR121 board over I2C, with up to four boards on one bus.
Common mistakes to avoid
- Touching the pad while powering up, so it calibrates wrongly.
- Putting the sensor behind metal.
- Long unshielded wires to a remote pad.
- Expecting touch pins on an ESP32-C3.
- Not checking which jumper does toggle versus polarity.
Frequently asked questions
Does the TTP223 need a pull-up resistor?
No. It has a push-pull output that drives HIGH and LOW itself.
How do I make the TTP223 work as a toggle switch?
Bridge the toggle-mode solder pad on the back; each touch then flips the output.
Can a touch sensor work through glass?
Yes, through about 2 to 3 mm of glass or plastic with the pad pressed flat against it.
Which ESP32 boards have touch pins?
Classic ESP32, ESP32-S2 and ESP32-S3. The ESP32-C3 and C6 do not.
Why does my touch sensor trigger by itself?
Moisture, nearby mains wiring or a long pad wire. Shorten wires, keep it dry and re-power without touching.
Parts for this guide
Terms in this guide
Projects that use it
Put this into practice: 12 step-by-step builds in our project library use parts from this guide.
Keep learning
Sources
Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.


