Jump to main content

Weaving a Wearable Touch Sensor

Summary

Active Time
2-3 hours
Total Project Time
2-3 hours
Key Concepts
Wearables, circuits
Credits
Jennifer Lee, Science Buddies
Make a Woven Capacitive Touch Sensor

Introduction

Sensors are everywhere—on your phone, in your car, and even at the grocery store. Learn how to craft your own wearable sensor that you can put on your clothing. Using a simple and easy crafting method, you will be able to weave your own capacitive touch sensor patch that will detect when someone touches the fabric. You can use the sensor to turn on an LED, buzzer, or motor when it detects touch!

This activity is not recommended for use as a science fair project. Good science fair projects have a stronger focus on controlling variables, taking accurate measurements, and analyzing data. To find a science fair project that is just right for you, browse our library of over 1,200 Science Fair Project Ideas or use the Topic Selection Wizard to get a personalized project recommendation.

Materials

Crafting Materials:


 Materials needed for patch integration

Prep Work

  1. Set up your loom for a patch using the directions for your loom. Each loom should have a set of instructions. If not, feel free to look through our playlist for the loom most like yours. If your loom design is like the one shown in this project, you can follow the instructions under "Setting up your loom."
  2. To familiarize you with basic weaving terminology, the warp is the yarn that runs vertically and is held in tension by the loom. The weft is the yarn that passes horizontally over and under the warp as you weave.
  3. Make sure you have the Arduino IDE installed on your computer.
  4. If this is your first time using an Arduino, see the Science Buddies How to Use an Arduino page. That page is for the Arduino UNO, but the process is similar for a TinyLily board.

Instructions

Setting up your loom

  1. Warp your loom. The warp yarn should be your non-conductive thin yarn of choice. Using a thinner yarn for the warp will make it easier to weave. If your loom looks like the one shown here, you can follow the instructions in this section. If you do not need these instructions, skip to the next section.
    yarn and empty loom
  2. To set up the warp, first measure out and cut approximately 10 feet of thin yarn. Form a knot with the desired warp yarn to fit over the first groove. Leave a 3-4 inch tail. Wrap the yarn around the groove so that it faces the front. It needs to be secure but not super tight. You can tape the loop down to the frame so that it does not come loose.
    yarn in perfection loop/knot
    perfection loop on a corner of the loom.
  3. Now stretch the warp yarn across the loom to the opposite slot.
    Loom's warp being threaded.
  4. Bring the warp yarn around the back of the next prong and up through the adjacent groove. Then stretch it across the loom to the opposite slot. (All of your warp yarns will stretch across the top of the loom.)
    Loom's warp being threaded.
    Loom's warp being threaded again
  5. Repeat this process across the loom. Cut any excess warp yarn. Note: the pictures in this procedure show an 8" x 5.2" patch, that might take you all day to weave. For a smaller 2" x 2" or 3" x 3" patch that will only take a few hours to weave, do not thread the entire loom. Rather, only thread the loom the approximate width of the patch (see image below).
    Smaller patch, narrower loom
  6. Once the warp yarn is through the final slot, you can bring it around to the back and tie a knot to connect it with the beginning warp tail to secure the warp in place.

    The following image shows the beginning warp tail.

    Loom's warp being threaded. Emphasis on initial loop's tail.   Then loom completely threaded.
    tieing loose ends and tied final

Weaving

  1. To start, cut about 6 feet of non-conductive thick yarn. This is your weft yarn. For the weaving, you will be using a plain weave technique. The plain weave is the basic "over, under" sequence.
  2. Thread your weft yarn through the hole in the tapestry needle and weave.
    Threaded tapestry needle.
    Tapestry needle weaving through warp threads
     weaving with thick yarn
  3. Pull the yarn all the way through but leave a 3-4 inch tail.
    One row of woven yarn.
  4. Use the comb that came with your loom or your fingers to push the yarn down after weaving a row. At the end of each row, add a little bit of slack to the yarn so the edge does not pull in.
    Combing the row of woven yarn.
  5. Weave about an inch or two. If 6 feet of yarn is not enough, cut more yarn and tie it to the end of your weft yarn. Cut the excess yarn leaving about a 2 inch tail.
  6. Once the non-conductive yarn section is done, begin your conductive thread section. Because conductive thread is much thinner, it will take more rows of weaving to make a section similar in height to the previous section. Thus, cut about 10 feet of conductive thread and thread through your tapestry needle.
  7. Tie the end of the conductive thread to the excess yarn tail from the previous section. Continue weaving.
    Tying end of conductive thread patch to thick yarn.
  8. Weave about half an inch of rows with conductive thread. Leave about 7-8 inches of conductive thread. Tie it around the last warp yarn (not weft). Tape excess conductive thread down onto your loom so it does not get in the way.
    Patch of conductive thread
  9. Repeat the non-conductive yarn section (steps 1-5). However, when starting the new yarn section, do not leave a 3-4 inch tail. Tie the yarn to the vertical weft yarn. Trim the excess. Then, continue weaving. Follow with another conductive thread section (steps 6-8). To make weaving with the conductive thread easier, you can wrap the thread around your tapestry needle and leave about 8-9 inches at the end. Repeat this step twice so that there are a total of three conductive thread sections separated by different yarn sections. The example uses different colored and different types of yarn used (acrylic, cotton, and wool).
    Conductive thread wrapped around tapestry needle.
  10. To finish your patch, you will need to weave one more non-conductive thick yarn patch. Leave a 3-4 inch tail.
    Completed patch.

Finishing your sensor

  1. Finish your weave and remove it from the loom. Follow the steps below if you have a similar loom. If you do not have the same loom, use the directions found on your loom to finish your weave. See the curated YouTube playlist for additional instructions on removing your woven patch from your loom.
  2. You should have a 3-4 inch tail of thick yarn at the beginning of your patch and at the end of your patch. Working on one end at a time, tie the excess yarn to your tapestry needle. Thread the excess yarn through at least 3-4 side loops down the outer edge of the woven patch. Remaining excess yarn can be cut.

    The following images demonstrate this on a different smaller patch for better visibility.

    threading tapestry needle with leftover yarn.
    Tapestry needle up the side of patch. Cutting side excess side yarn.
    Tapestry needle up the side of patch. Cutting side excess side yarn.
  3. Remove the tape from the loom. Trim any excess yarn. Do not trim the conductive thread.
  4. If you have woven your patch to the edges of your loom, follow step 5. If you did not weave your patch to the edge, follow step 6.
  5. If you wove your patch to the edge of your loom, carefully remove the holding loops from the loom's teeth. Gently massage your weft yarn to fill the extra warp yarn.
    Unlooping patch from loom
    Massaging patch to even out weft distribution.
  6. If you did not weave your patch to the edges of the loom, cut the warp yarns. Double-knot tie warp yarns together so that the warp wraps around the final row of weft yarn. Make sure it is tightened. The following images demonstrate a patch that is not woven to the edges of the loom.
    Cutting patch off of loom.
     cutting loops that connected patch to loom.
    Trimming the small patch.
    Finished small patch.

Testing your sensor

  1. Connect the excess conductive thread from each conductive thread section to pins A0, 2, and 3 to the TinyLily Mini Processor. This can be done by (1) tying the thread to the TinyLily directly or (2) sewing the threads to the TinyLily on the desired piece of clothing or scrap piece of fabric.
    Patch connecting to TinyLily
  2. Launch the Arduino IDE.
  3. Connect your TinyLily to the computer using the TinyLily Mini USB adapter and Micro USB Cable.
    Patch connected to microusb cable.
  4. Go to the top bar: Tools → Board. Click the drop-down menu and select "Arduino Pro or Pro Mini."
  5. Select Tools→ Processor. Select "ATmega328p (3.3V, 8MHz)." Note: this option will not appear until you have selected "Arduino Pro or Pro Mini" for the board.
  6. Select Tools→ Port. Select the available port. It should be "COM" followed by a series of numbers. If your computer is a Mac, this would be "dev/cu.usbserial" followed by a series of numbers.
    Arduino IDE Tools setting required.
  7. Download TouchSensor.zip, extract the folder. Then, open Touchsensor.ino in the Arduino IDE. Note: sensingCode.ino is from Arduino Playground Capacitive Sensor.
  8. Upload onto your TinyLily.
  9. Open the Serial Monitor by selecting: Tools → Serial Monitor. A new window should pop up.
  10. Once your Arduino code has successfully uploaded onto your TinyLily, you should see different pins being represented as text.
    1. Look at the serial monitor when you are not touching woven conductive thread patches. All of the pins should have a value of 1.
    2. Touch a woven conductive thread patch. Each patch is a different sensor. Only touch one part at a time. You should see one of the pin's value change.
    3. Remove your hand from the sensor. The pin value should go back to 1.
    4. Test all your patches. If the values do not change or if the value is not 1 when you are not touching it, double check to make sure threads from different patches are not touching each other.
    Serial monitor from Arduino IDE

Adding an LED to your circuit

  1. Disconnect your TinyLily from your computer.
  2. Sew your sensor patch onto a piece of clothing. This example uses a sheet of felt, but the clothing can be anything. If you have not sewn the connections from the sensor patch to the TinyLily, do so.
    Patch and materials needed for followings steps.
  3. Sew an RGB LED to the same article of clothing or fabric piece. Make the following connections with conductive thread. Note that you do not need to connect the lithium polymer battery yet.
    Circuit diagram of patch, tinyLily, and RGB LED
    1. Connect the + pin on the TinyLily to the + pin on the LED board.
    2. Connect the - pin on the TinyLily to the - pin on the LED board.
    3. Connect pin 1 on the TinyLily to the pin with the arrow pointing into the LED board.
  4. Download TouchRGB.zip, extract the folder. Then, open TouchRGB.ino in the Arduino IDE. Note: sensingCode.ino is from Arduino Playground Capacitive Sensor.
  5. Download and install the FastLED Library. To do so, navigate to the top bar and click: Tools→Manage Libraries. This should bring you to this window.
    Arduino IDE's Library Manager
  6. Using the search bar at the top, search "FastLED". Install the first result's most recent version by Daniel Garcia.
  7. Upload the code onto your TinyLily.
  8. Once your Arduino code has been successfully uploaded onto your TinyLily, you should see the LED light up in different colors corresponding to the different sensor patches. Each section of woven conductive thread is a different sensor patch. If not, double-check your conductive thread's connection pins.
  9. Switch your USB adapter with your battery adapter and power the TinyLily with the LiPo battery.
    Completed woven sensor patch with LED.

Cleanup

Unplug the lithium polymer battery when not in use.

What Happened?

Were you able to see the changing values on your Serial Monitor? Were you able to make your LED light up in different colors? In this project, you connected three different sensor patches from your woven patch to the TinyLily. You also connected three wires from the TinyLily to the RGB LED. The TinyLily worked as the brain of the system and detected touch from your woven patch and told the RGB LED to light up in different colors depending on which patch you touched. Note that your circuit might not work properly if you accidentally connect (or short-circuit) two of the patches of conductive thread to each other. If you would like to change how the LED lights up when you touch the different conductive patches, you can modify the code in TouchRGB.ino. You can also incorporate this touch sensor into a fashion design or costume of your choice.

Digging Deeper

You created a capacitive touch sensor. A capacitor is an electronic part that stores electrical charge. Capacitors take time to charge up and to discharge (lose charge). Bigger capacitors take longer to charge up or discharge. When you touch one of the patches of conductive thread, the connection to your body changes the capacitance. The TinyLily, a type of microcontroller or electrical "brain," detects that change and knows that you are touching the patch. It then sends a control signal to the RGB LED to make it change colors based on which patch you are touching.

icon scientific method

Ask an Expert

Curious about the science? Post your question for our scientists.

For Further Exploration

  • Try touching the sensors with different materials. What materials cause the sensors to detect touch?
  • Can you try adding more sensors to the system?
  • How would you add more conductive sensor patches? What would you change about how you wire it? What about the code?
  • Instead of an RGB LED, what other ways can you show that the sensor is activated?

Project Ideas

Science Fair Project Idea
From traffic safety lights to neon signs, lights have a way of getting peoples' attention. So it makes sense that if a person wants to get attention, wearing clothing with built-in lights might help. These types of clothing, called electronic textiles (e-textiles for short), or wearable electronics, already exist. Instead of using hard surfaces for circuits (like inside your computer or cell phone), e-textiles weave electrical parts like batteries, wires, and lights directly into wearable… Read more
Science Fair Project Idea
People have a variety of reasons to use heart rate monitors. For example, patients in a hospital might have stationary, bedside equipment monitor their heart rate and alert medical staff in case of an emergency. Somebody going for a run might wear a portable heart rate monitor to keep track of their workout intensity. Heart rate monitors are not all the same—their appearance and function will vary depending on the intended use. In this project you will design, build, and program your own… Read more

Activities

STEM Activity
Sewable circuits are a fun way to mix electronics and arts and crafts by sewing circuits into clothing or fabric. This sewable circuit focuses on creating a unicorn horn with a programmable red-green-blue (RGB) LED in the tip that changes colors. You will use conductive thread to make the circuit, but your stitched lines will also form the spiral lines of the unicorn horn. Read more
Top
Free science fair projects.