Motion
Interfacing TTP223 Motion with Raspberry Pi
What is the TTP223?
TTP223 practical reference
A capacitive touch-sensing breakout that swaps a physical button for a solid-state touch pad, common in enclosure-friendly builds. Built around the TTP223 capacitive touch IC, it detects the small capacitance change caused by a finger touching (or even approaching through a thin non-metal panel) its copper pad, outputting a simple digital HIGH/LOW signal — a clean way to add a button-like input to a project without any moving parts or a hole cut in the enclosure.
Key specifications
- Sensor type: TTP223 capacitive touch sensor IC
- Operating voltage: 2.0V–5.5V DC
- Operating current: ~1.5-3 µA in standby, low active current
- Output modes: Toggle mode or momentary (direct) mode, selectable via a solder jumper on most breakout boards
- Output logic: Active HIGH by default on most modules (some variants can be configured active LOW)
- Touch-through thickness: Can sense through a few millimeters of non-conductive material (plastic, glass, acrylic), useful for sealed enclosures
- Response time: ~60ms typical
- Interface: Single digital output pin, read directly as a HIGH/LOW input
Pinout and connection notes
A small solder jumper pad on the back of most TTP223 breakout boards selects between momentary mode (output HIGH only while actively touched) and toggle mode (output flips between HIGH and LOW with each separate touch) — check which mode your board is configured for before wiring up your project logic, since it changes how you should read the pin in code.
- VCC: Power, 2.0–5.5V DC
- GND: Ground
- SIG (OUT): Digital output — goes HIGH when touched (in direct/momentary mode), or toggles state on each touch (in toggle mode)
Integration checklist
- Confirm the exact part number and breakout-board revision.
- Verify supply voltage, current demand, logic levels, and signal direction against the datasheet.
- Check controller pin assignments and bus address or interface mode against the example code.
- Power up with external loads disconnected, then test signals before full integration.
- If readings or communication fail, check power and ground first, then pin mapping, interface settings, and library initialization.
Troubleshooting and reproducibility
Record the board used, wiring, library/version, supply arrangement, and measured behavior. Use the selected board-specific wiring example as the source of truth. Never assume visually similar modules share identical voltage tolerance or pin order.
Setting Up TTP223 with Raspberry Pi
Library
gpiozero
Usually preinstalled on Raspberry Pi OS; otherwise: pip3 install gpiozero
Wiring
| Component pin | Raspberry Pi pin | Note |
|---|---|---|
| VCC | 3.3V (physical pin 1) | Power from 3.3V so the output swing matches the Pi's GPIO voltage exactly |
| GND | GND | |
| SIG (OUT) | GPIO17 (physical pin 11) |
Swipe sideways to see every column →
- Powering from 3.3V (not 5V) is the safer default on a Pi, since the module's output tracks VCC and the Pi's GPIOs aren't 5V-tolerant.
- gpiozero's Button class works fine here even though this isn't a mechanical button — pull_up=False matches the module's active-HIGH output.
- Same direct-vs-toggle-mode caveat as the other boards.
Related Components
Related Guides & Projects
Raspberry Pi Pico W and Pico 2 W: Install MicroPython with Thonny or UF2
Hold BOOTSEL, drag the correct UF2 file, open the REPL and blink the onboard LED. Includes the Pico vs Pico W vs Pico 2 W firmware differences and what to do when the drive does not appear.
Raspberry Pi Pico W Web Server in MicroPython: Control an LED and Read a Sensor
Connect the Pico W to WiFi, serve a responsive control page, switch an LED and display the onboard temperature or an external sensor, with timeouts and reconnect handling.
Raspberry Pi Pico Oscilloscope with MicroPython
Convert a Raspberry Pi Pico into a basic 500 kSPS oscilloscope using its 12-bit ADC and MicroPython. Displays waveforms on an SSD1306 OLED or streams samples over USB serial to a Python plotter on your PC.
Self-Hosted Nextcloud NAS on Raspberry Pi 4
Build a private, durable Nextcloud NAS on a Raspberry Pi 4 -- SSD boot instead of a failure-prone SD card, Docker Compose with Redis caching, Tailscale for remote access with zero ports forwarded, and an automated backup strategy that actually runs.