TTP229 Capacitive Touch Keypad

This is a keyboard board based on the 8229BSF IC for capacitive touch sensing. There are a few other siblings in the TTP family, with similar features but a different number of supported touch pads. The TTP229 can handle up to 16 touch pads. It has a built in regulator so it offers stable sensing to cover various conditions. I only tested it indoor and for a limited amount of time but it is obvious there are many factors that can impact the functionality like humidity, temperature, body mass, proximity to other objects, RF fields, etc.

Several ICs for different number of touch pads are available

My idea was to get these and see it they can be used when covered by a plastic sheet, so that I could design a waterproof device that still has an interface exposed to its operator. Apparently yes, as the datasheet confirms it, and so did my tests, see the following video:

Human interfaces control panel links through non-conductive dielectric material.

The board seems to use I2C but it doesn’t. Instead it has a proprietary 2-wires protocol, very easy to use. You just ping the clock line do a reading then move to the next key. I wanted to have multitouch, to be able to read several touch pads at the same time, so I used a buffer for that:

int pinTouchData = D3; 
int pinTouchClock = D4; 

// key configuration
uint8_t keys[16] = {0};

// simple 8229 IC protocol, pinging the clock line 16 times to get all key states
void getKeyStatus() {
  uint8_t num = 0;
  for (uint8_t i = 0; i < 16; i++) {
    digitalWrite(pinTouchClock, LOW); // pull clock low
    if (digitalRead(pinTouchData) == 0) // read bit for key state
      keys[i] = 1; // key touched
    else
      keys[i] = 0; // not touched
    digitalWrite(pinTouchClock, HIGH); // pull clock high to signal done
  }   
}


Demo video showing multitouch capability and dielectric materials

As you can see by the end of the video, a sheet of paper will have no influence on the functionality. Similar results with plastic, making this keypad perfect for a watertight enclosure where we still need an interface to the device.
Download the TTP229 code here. I also used an OLED 128x64 LCD for this demo, but you can leave that aside if not needed. If you still want to use the LCD, get the SSD1306 OLED Library here. The jumpers must be set as follows:

Jumpers to enable 16 keys and multitouch

Leave a Reply