SP511E + TTP223 | Touchpad Tutorial

I’m working on a project and finally understood how to use a capacitive touch sensor to control the SP511E, so let’s get started.

REQUIREMENTS

  • SP511E
  • TTP223 Module
  • Solder Iron
  • Thin Iron Tip
  • Wire
  • Dupont Connectors

TTP223 IC

According to the Datasheet, The TTP223 is a touchpad detector IC which offers 1 touch key. The touching detection IC is designed for replacing traditional direct button key with diverse pad size. Low power consumption and wide operating voltage are the contact key features for DC or AC application.

TTP223B TouchPad Module

For this project we will be using the TTP223B TouchPad Module, it’s small and it can be powered with 2.0V ~ 5.5V, that makes it perfect for the SP511E since it already has a 3.3V out.
As you can see in the image above, the sensor has 3 pins, VCC, I/O and GND.

Here’s the schematic

On my tests, it can detect a “touch” at around 3mm by default.

Warning: Everything is tiny and delicate, please be careful while soldering so you don’t rip the pads off, use a thin iron tip.

INCREASING/DECREASING TOUCH SENSITIVITY/AREA

The detection sensitivity can be decreased by adding a capacitor on C (up to 50uF) and increased by removing the capacitor on C1 (or swapping it for a lower value capacitor), removing the C1 capacitor gives you about 7mm of detection. If you want, you can increase the detection area by scratching the pad a little, and then soldering a cable to it, then connect it to a metal plate or just roll the cable.

stupid me

I saw somewhere that you could increase the area by soldering a cable on C, but it was not reliable, it had false detection, and I ended up ripping one pad off, so I don’t recommend it

For my project I removed the C1 capacitor, I recommend you testing it before you try to change the detection range.

NORMALLY CLOSE CONVERSION

Now, the buttons on the SP511E are momentary normally close pushbuttons, and the TTP223 acts as a momentary normally open pushbutton (should I call it touchbutton?) by default, so we need to convert it to a normally close button for it to work properly.

To do this, we just have to short the jumper A, this will convert it into a normally close button. After doing it, it should look like this:


(A-Jumper shorted and C1 capacitor removed) (Don’t look at the missing pad on C, lol.)

As you can see, I already soldered pins to it, when doing it, try to cut the pins on the other side as much as you can, so it doesn’t look like mine, I don’t have the tool, so this is how mine looks.

I’ll probably sand them away.

By the way, you’ll see me using dupont connectors on the pictures, this is only for testing purposes, you may want to use proper JST connectors for the final product (check the last images).

Anyway, let’s continue.

SP511E SETUP

Now we need to connect the TTP223 to the SP511E, as I already mentioned, it needs at least 2V to work, so we’ll power it directly from the SP511E. I’ll use the 3.3v pin on the back, as well as the ground. The I/O pin, aka signal, has to be connected to the actual button on the SP511E. I just soldered the wire directly to the bottom left pin of the button like in the picture below. All cables have a female dupont connector on the other end.

Make sure you clean everything after with isopropyl alcohol, and then check for continuity with a multimeter, nothing have to peep.

Clean looks better, my soldering skills don’t lol.

TESTING

After checking everything looks fine, you should be good to connect the button and turn it on. As soon as you power the SP511E, the red led on the touch pad should turn on, if you touch it, then the led should turn off (while touching it) and the LED Strip should turn on.

I configured mine (on WLED) so it turns on/off by long pressing, adjust the LED strip brightness up by touching once and down by touching twice.

on/off function

And that’s all. Now let’s desolder everything and re-do it using proper connectors.

MAKE IT LOOK GOOD

REQUIREMENTS

  • JST-SM connectors
  • JST-XH connectors
  • JST Crimper
  • Wire
  • Soldering Iron
  • Sharp knife
  • Sandpaper

To make it look better, I used a JST-SM 3P Male connector, I made a hole on the case with the solder iron (if you do it, don’t breathe, it smells like sh**t), then refined with a sharp knife and finally sanded it, it ended up looking like this:

I used 22awg silicon wire since that’s what I had, it barely fits inside, actually it’s pretty hard to push the original button (which I don’t mind since the thing will be inside a wooden box anyway). I recommend you use 26awg silicon wire instead.

For the button I soldered a JST-XH 3P Wafer to the button instead of the normal pins, and then just made a Female 3P JST-SM to Female 3P JST-XH harness.

Now that looks good :ok_hand:t4:

UPDATE: After some testing, I discovered that the JST-XH connector is too big and it interferes with the button, making it activate randomly. So you may just wanna go with the pins instead.

THINGS TO KEEP IN MIND.

  • You may want to use wire of around 26awg to 30awg. Using silicone wire may be a good idea so the cable can move freely.

  • Use a thin iron tip to solder, everything is tiny and very delicate, please be extremely careful while soldering as you may take the pads off.

  • Use connectors, they make things easier and cleaner.

  • You don’t need to change anything on the WLED LED settings, the button should be kept configured as a normal Pushbutton for it to work properly.

RESOURCES

TTP223 Module Schematic: https://www.epitran.it/ebayDrive/datasheet/23.pdf
TTP223 IC Datasheet: https://datasheet.lcsc.com/szlcsc/TTP223-BA6_C80757.pdf

Hope this guide was useful, I’m still learning English so sorry if I made any grammatical mistakes. If something is not clear, please feel free to ask any questions.

1 Like

Looks like a great job, congratulations!

One little trick I’ve used to get the tiny solder bridges over two close (but not close enough!) pads.
I take a single strand from stranded copper wire, probably the equivalent to 30 or 32 AWG, and wrap a few turns around my thin piece of solder. You want the wrap more like widely spaced “barber pole stripes” than a tight coil.

You solder one of the pads using that wrap-set and drape the other end to the 2nd pad. You end up applying solder to both, but you leave a small piece of wire between that will cause the solder to bridge. At worst the wire will be all that’s between the pads, but it will be electrically connected. At best you get a clean “blob” joining the two pads.

Again, thanks for the in depth tutorial.

1 Like

Thank you man, that’s a great piece of advice :ok_hand:t4:

Great work and write up. Although, if you use an ESP32 based controller you get up to 10 capacitive buttons for free simply by connecting the pin to a pad. Although in WLED, you get one threshold setting for all capacitive buttons. So using more than one or two is not very practical.

Yup, the approach on this is using what I had at the moment, but if the purpose is doing this, there’s no point on buying the SP511E. Getting an ESP32 is way better. Although for the price and size, for less demanding projects, the SP511E is not bad at all.