Source: https://mokxi.com/parts/ttp229
Updated: 2026-11-22

Part

# Touch keypad, TTP229 16-key

Sixteen touch pads on two wires: clock SCL and each pulse puts the next key on SDO, low while touched. Link TP2 for 16 keys.

See every part

- 12 pins
- 3 settings
- In 1 project

Drawn live by the editor's own code, at the size you see it.

At a glance

## The Touch keypad, TTP229 16-key in brief

What it is, and every setting the properties panel gives it.

The TTP229-B is a red 16-key capacitive touch keypad. Each printed pad is one plate of a capacitor and a finger is the other; the Tontek TTP229-BSF chip on the back watches all sixteen pads and reports them over its own two-wire serial interface, SCL and SDO, which is not I2C and not SPI. In 8-key mode it also drives eight direct outputs, OUT1 to OUT8, high while touched. The model gets the serial frame right: each clock pulse on SCL puts the next key on SDO, key 1 first, 16 bits or 8, with SCL from 1 kHz to 512 kHz. It also models data valid, the 93 µs SDO pulse once a scan while a key is touched, and the scan timing, 32 ms with 16 keys and 16 ms with 8. It leaves out sensitivity adjustment, the 4 s recalibration while no key is touched, sleep mode's slower wake-up sampling, the maximum key-on time, open-drain direct outputs, and the sheet's mixed single and multi-key group modes.

Family

Inputs

Pins

12

keys

8 (or 16)

activehigh

false

multikey

false

Pins

## 12 pins

Named as the editor names them, so a wire lands where you expect it.

Pin

Role

What it does

VCC

Input or output

Supply, 2.4 V to 5.5 V.

GND

Input or output

Ground.

SCL

Input

Serial clock in, driven by the board.

SDO

Output

Serial data out: one key per clock pulse, low while touched.

OUT1

Output

OUT2

Output

OUT3

Output

OUT4

Output

OUT5

Output

OUT6

Output

OUT7

Output

OUT8

Output

How to use it

## How to use the TTP229 touch keypad with an Arduino Uno

The example project is Touch keys. A red TTP229-B 16-key touch keypad is wired to an Arduino Uno with two signal wires: SCL to pin 2 and SDO to pin 3. VCC goes to the Uno's 5 V pin and GND to GND, both through the breadboard power rail. The TP2 pads are linked so the chip runs in 16-key mode. Touch a pad and its number prints on the serial monitor.

The sketch includes TTP229.h and makes a TTP229 object on pins 2 and 3. ReadKey16() waits for a touch and returns the key, 1 to 16. A held key is reported once a scan, every 32 ms, so a sketch that prints whatever it returns would print the same key about 30 times a second. This sketch prints a key only when it changes, or when the same key comes back after a gap of more than 100 ms, which is a new touch.

With default settings, the serial monitor printed: "TTP229 touch keys: touch a key". That is the startup line from setup(), printed once. No key was touched yet, so no key number follows.

After a touch on key 1, the serial monitor printed: "Key 1". That is the number of the pad touched, 1 to 16. Things to try: hold a key down and watch it print once, not 30 times a second; touch several pads at once and see which one wins; set keys to 8 and the sketch must call ReadKey8() instead, since pads 9 to 16 stop being keys.

Part pin

Goes to

VCC

Arduino Uno R3 pin 5V (through the breadboard power rail)

GND

Arduino Uno R3 pin GND (through the breadboard power rail)

SCL

Arduino Uno R3 pin 2

SDO

Arduino Uno R3 pin 3

Click to open it in the editor

This is the simulator itself, running here. Click anything to open it in the editor.

Open this project in the editor Read the full tutorial

sketch.ino · Arduino Uno R3

Common errors

## Common Touch keypad, TTP229 16-key errors and fixes

What goes wrong

The fix

Calling ReadKey16() with TP2 open, in 8-key mode.

The chip sends only 8 bits, so keys 9 to 16 never come back. Set keys to 16, or use ReadKey8().

Expecting one print per touch.

A held key is reported every scan, about 30 times a second. Print the key only when it changes.

Using the Arduino Library Manager's library named TTP229.

That library is for a different board, the I2C TTP229-LSF. Use TTP229.h, the library the red board's tutorials use.

Reading keys right after power on.

For about half a second after power the keys are off while the chip calibrates. A finger already on a pad counts only once it lifts and comes back.

Questions

## Questions and answers

### is the ttp229 keypad i2c

No. It uses its own two-wire serial interface on SCL and SDO, which is not I2C and not SPI.

### how do i get 16 keys on the ttp229

Link the TP2 pads, which is the keys setting set to 16. In 8-key mode pads 9 to 16 are direct outputs and the serial frame is 8 bits.

### what do readkey16 and getkey16 return

ReadKey16() waits for a touch and returns the key, 1 to 16. GetKey16() waits up to about 50 ms and returns the last key if none came. Key numbers are 0 for none, and with several keys the highest wins.

### what voltage does the ttp229 need

VCC takes 2.4 V to 5.5 V. The example wires it to the Uno's 5 V pin.

How it is modeled

## What is true about the Touch keypad, TTP229 16-key, here

In its help article’s own words: what the simulation gets right, and where it stops.

### Modeled

The serial frame, from the datasheet. Each clock pulse on SCL puts the next key
on SDO, key 1 first, 16 bits or 8. With TP1 open a pulse starts on the falling
edge, so the library's "SCL low, read SDO, SCL high" reads one key per pulse. If
SCL sits still for 2 ms (Tout) the interface resets and the next pulse is key 1
again. The sheet allows 1 kHz to 512 kHz on SCL.

Data valid. While a key is touched, SDO pulses low for 93 µs once a scan (DV),
and the first clock may come 10 µs after it ends. A library that waits for a touch
waits for this pulse. The sheet does not say whether DV comes with no key touched;
here it does not, which is how the library's blocking read behaves on a real board.

Timing. A touch or a release shows at the next scan: 32 ms with 16 keys, 16 ms
with 8, the sheet's response time. For about half a second after power the keys are
off while the chip calibrates. A finger still on a pad when that ends was measured
as part of the pad, and counts only once it lifts and comes back.

### Not modeled

Sensitivity (a pad either feels a finger or it does not), the 4 s recalibration
while no key is touched, the sleep mode's slower wake-up sampling (TP5, TP6), the
maximum key-on time (TP7, about 80 s, off as shipped), open-drain direct outputs
(TP0), and the sheet's two mixed single and multi-key group modes.

From TTP229 16-key touch keypad, in full.

Projects

## See the Touch keypad, TTP229 16-key in a project

One built-in project uses it. It opens in the editor, already wired.

Boards

## The boards it is shown on

This board has a built-in project with the Touch keypad, TTP229 16-key in it.

- Arduino Uno R3

Keep going

## Keep going

- Touch sensor, TTP223
- Capacitive touch, MPR121
- Keypad, 4x4

More parts

## The rest of the bench

Every one of these is drawn and simulated the same way.

Full-size breadboard

A real 0.1 inch grid with the rails and the center channel, 63 columns wide.

Jumper wires

Drag from any pin or hole to any other. Corners snap, and you can drag them.

Power

A supply rail at the voltage you choose.

Ground

The other end of every circuit.

LED

Lights when current flows. Five colors, and the brightness is what your eye would see.

Filament lamp

A tungsten bulb in a holder: an inrush when it is switched on cold, tens of milliseconds to warm up, and dim on half its voltage.

Resistor

Any value you like, with the color bands drawn to match.

ESP32-C3-DevKitM-1

A RISC-V board that runs your firmware at 160 MHz on the real memory map.

Pushbutton

A 12 mm tactile switch. Hold it while the simulation runs.

Raspberry Pi Pico

The RP2040 board on our own Cortex-M0+ core. Pick a program and press Run.

Raspberry Pi Pico W

Raspberry Pi Pico W (RP2040). The same board and the same pinout as a Pico, with the CYW43439 on it. The WiFi is simulated (no radio; real internet through the Cloud panel’s switch), and the on-board LED, which hangs off that chip rather than off GP25, is driven through the same path. Everything else is the Pico.

Raspberry Pi 4 Model B

Raspberry Pi 4 Model B: the 40-pin header, driven by main.py with RPi.GPIO or gpiozero.

See every part

## Wire up the Touch keypad, TTP229 16-key

Open the editor and push it into the breadboard. It is free, and it runs on your own machine.

Start building free Open the editor
