Quick prototyping Robotdyn TTP229 LSF touch sensor board

I wanted to post quick small sketch I’ve put together today for working with the 16 channel capacitive touch sensor board TTP229 LSF from RobotDyn. I bought it from AliExpress and it will be part of an upcoming project.

Connected TTP229 LSF to arduino


I’ve been looking around for an example code ready made but I could only find examples for a similar board from aliexpress that is using a slightly different chip. So I will post my example in case somebody can benefit from it.

Here we can see the wiring connections for an arduino mega.

Arduino and TTP229 LSF


This particular board ( the TTP229 LSF) differs from other ones I’ve seen on the use of the i2C instead of a pulling mechanism. This makes the hole process much easier. Here we can see a screen capture from the oscilloscope with the actual I2C data transmission.

I2C comunication between TTP229 LSF and arduino

The first packet is the addressing where we tell the I2C bus we want to read from the sensor. The following 2 packets is the response, where each bit received is the status of each of the 16 capacitive sensors.

And, of course, a crude serial monitor output  with the data of the sensors.

Sketch serial output TTP229 LSF


And finally the code:

Soon I will upload it in github.


Notice that in this particular chip there is a pin that signals when a sensors changes making it really economic to checking the sensors with the use of interrupts.

More on that soon.

Leave a comment if you like it.

12 Responses to “ Quick prototyping Robotdyn TTP229 LSF touch sensor board ”

  1. great explanation,
    I have one this module and now I will continue in my touch project.
    thank you

  2. TTP229, not TTP299

  3. Thank You! Best regards

  4. nice job, many thanks, i get some time to test same
    i order too the Capacitive Touch Disk, when i plug it with 20cm dupont wire, all pin go to 1 never go back 0
    is somebody test it ?

  5. Thank you! I’ve tried some other example codes for this module but with yours I’m able to detect any of the button combinations with ease. And this is great! Awesome job!

  6. The only code actualy works. Have You been thinking of library. Would be easy to use. Also I’m looking for single button solution..

  7. Thanks man. This is the only code I could find that actually works. I do have a question though. Do you or someone here know how to us the output data for a keypad?

    Again THANKS.

  8. Nice, I want to play .wav from sdcard ..where each button different sound. how is the code

  9. Did you put it on github now?

Leave a Reply to Attila Cancel reply