How to Make a Secret Button for Your Bag That Actually Works!
by CMoz in Circuits > Wearables
138 Views, 3 Favorites, 0 Comments
How to Make a Secret Button for Your Bag That Actually Works!





This is a great way to make your own pressure-sensitive button that you can incorporate into your wearable designs. When making wearables that fit and move with the body, it can be difficult to find the right sensors, buttons, and similar, so it's great if we can make the exact one we need.
You can use this pressure-sensitive button as presented here, to alter the number of LEDs being lit, but you can also use it in any of your microcontroller designs. Connect it as a switch to control your NeoPixels!
Supplies




To make the pressure-sensitive circuit you will need the following items:
- 2 x conductive textile / fabric pieces
- 1 x piece of velostat
- 1 x microcontroller, so we can program the behaviour of this button
- wires to connect the fabric / crocodile clips
- 4K resistor
- LED strip or something you want to react to the button you make
- Arduino IDE or Visual Studio with Platform IO to program your circuit
[I added an OLED for messages to confirm when there is a tap, touch, hold etc. This is optional.]
That's everything you need, you can choose any microcontroller that you enjoy working with.
I'm using a custom board that has an ESP32 C3 chip. The code I provide is written for the Arduino IDE or PlatfomIO.
I am using PlatformIO, if you too are using PIO, I've provided the .ini file for the C3, but the sketch will work fine if you are using a different IDE. Don't forget to alter your .ini to reflect the board you are using.
What's Going On: Why Are We Making This?
This is a great way to add interactivity to your designs, in a way that is integrated into fashion tech.
Adding a pressure-sensitive button to a handbag introduces an innovative and interactive element that enhances both functionality and user experience.
This smart feature allows users to discreetly trigger actions—such as activating LED lights for visibility, sending a safety alert, or unlocking a hidden compartment—simply by pressing a specific area of the bag.
It seamlessly integrates technology into everyday accessories, making the handbag not just a fashion statement but also a practical tool for convenience and safety.
For makers and students, incorporating a pressure-sensitive button provides a hands-on opportunity to explore e-textiles, wearable technology, and DIY electronics, fostering creativity and problem-solving skills while addressing real-world needs.
How It Works:
- Voltage Divider: This circuit creates a voltage divider. The Velostat acts as a variable resistor (R1), and the 4KΩ resistor acts as a fixed pull-down resistor (R2).
- No Pressure: When you are not pressing the sensor, the Velostat has extremely high resistance. The pull-down resistor pulls the voltage at pin A1 very close to 0V, so analogRead() will return a low value.
- With Pressure: When you press down on the top fabric, you squeeze the Velostat, which dramatically lowers its resistance. This allows current to flow from the 3.3V pin through the Velostat. The voltage at pin A1 rises significantly.
- Result: The harder you press, the lower the Velostat's resistance becomes, and the higher the value you will see from analogRead(A1).
First Conductive Fabric Piece

We are essentially making a sandwich of elements!
Look at the diagram, which shows our 'sandwich' of elements. For the first part, we will:
- Take one piece of conductive fabric and attach a connection from your microcontroller's POWER pin. Using a crocodile clip to prototype is the quickest and easiest way to get started. If we prototype it first while we check the code, then you can integrate it into your own completed circuits.
That's this step done.
Put this piece aside for a moment.
Second Conductive Fabric Piece






Take the second piece of conductive fabric, and this one we need to attach a few more connections.
- connect this piece to GROUND - but before you connect ground, take a 4K resistor - this should then connect to your microcontroller's ground pin
- from the microcontroller's ground pin, through the 4k resistor, then attach the end of this ground connection to your conductive fabric piece
- also connect an analog pin to this same conductive fabric piece
Choose an analog pin,
For this circuit, we need to record a reading of different values. If we used a digital pin we would only get 1 or 0, so no variance.
This circuit relies on getting the various values. We use these values to then control components connected to the microcontroller.
Time to Layer!





With both pieces of conductive fabric connected to the microcontroller, we can now layer up our sandwich!
- Place one of the conductive fabric pieces at the bottom
- Place the Velostat on top of the conductive fabric
- Place the second piece of conductive fabric on top
IMPORTANT: Make sure the Velostat COMPLETELY covers BOTH the conductive fabric pieces. The pieces of conductive fabric cannot touch or it will create a short - or an undesirable, unpredictable circuit.
If you are unsure, please refer to the diagram in step two.
Upload Code to Your Microcontroller

Now that our awesome pressure sensitive button is complete - I'm uploading my code to the board.
I added an OLED at this step so I can get a read on the touches and taps, but this is optional. You can use the serial out to view messages instead of this.
I won't go through the code in detail here, but the code is on my GitHub, and it can be used for the Arduino IDE, or PlatformIO too.
The effect that this button is programmed for (and you can edit it for your purpose), is that if you tap it lights up an light strip (WS2812b). The longer you hold the button, and keep it pressed, the more lights will light up. Once they are all lit, then there is the rainbow effect.
Releasing the button will turn off the lights.
Design Your Button to Suit Your Style

You can choose fabric; I like felt for wearable technology, to cover your button so you can put it into your circuit.
As shown in the photos - I'm embedding mine straight into my handbag so I'll sew felt around the button to protect it before I embed it.
That's it! I hope you have fun making this. It's a great way to add a little more interactivity to your fashion tech pieces.
Learning About Wearable Technology? Join Me in My Journey!
💜Make fun wearable tech projects with me! Do you want to learn more tips and tricks for creating wearable technology? https://www.youtube.com/@ChristineFarion
➡️Dive into more fun projects with Arduino and ESP32 by exploring my playlist.
➡️Additionally, for wearable technology items, such as conductive fabrics, visit my little maker shop Tinker Tailor. or my book on Amazon about making wearable technology.
➡️Or for other projects and information, see my site: https://christinefarion.com