Conductive fabric touch buttons connected to an ESP32

Still Using Plastic Buttons? Make Fabric Touch Buttons for Your ESP32 (Video Recap)

Plastic buttons click, wear out, and always look like electronics. In my latest video I swap them for small squares of conductive fabric and let the ESP32 do the sensing. It is a short one, about seven minutes, and by the end you will have a button that works with a simple touch.

What is in the video

  • A touch timer glove. Two fabric pads on the back of the hand: one adds a minute, the other adds ten. Touch and hold to start the timer.
  • A no-code test circuit. Two pieces of conductive fabric, a little coin cell and a filament LED, joined with crocodile clips. Press the fabric together and the filament lights up. It is the quickest way to see that the fabric really is part of the circuit.
  • Finding the touch pins. On an ESP32 pinout, touch-capable pins are labelled with a T (T0, T8, T9 and so on). Pick three of those for your pads.
  • Three pads, three reactions. One touch wakes up a pixel cat on the screen, another shows a motivational quote.
  • A Simon memory game, where the lights show you a colour and you repeat the pattern by touching fabric strips.

Why fabric instead of a plastic button?

There are no moving parts to wear out, you can cut the fabric into any shape, and you can sew it straight into a sleeve, a glove or a bag. The ESP32 has capacitive touch built in, so you do not need any extra chip or breakout board. A wire or a line of conductive thread from the fabric to a touch pin is all it takes.

What you need

Want the written version and the code?

I wrote a step-by-step tutorial that goes with this video: Build a Soft Touch Button From Conductive Fabric and an ESP32. It has the PlatformIO setup, the main.cpp code, how to tune the touch threshold so the button feels right, and a three-pad version that runs different NeoPixel effects. The code from the video is on my GitHub, linked in the video description.

Not sure which pins on your board are touch pins? The ESP32 Pinout and Touch Pin Guide covers every board we sell.

Try a few fabrics first

Every conductive fabric feels and responds a little differently. The 5 Samples: Conductive Fabric pack is an easy way to compare them. And if you want to build the Simon game from the video, the Wearable Simon Game Video Kit has everything used in that build.

If you make one, show me. You can also bring your questions to the Wednesday Workbench live stream, every Wednesday at 12:00 pm Atlantic on the CMozMaker channel.

Christine

Back to blog

Leave a comment