make your own wearable LED display
featured in the premier issue of CRAFT magazine

   

click on the image for a movie of the shirt and some other e-textile designs in action.
click here for more information about the shirt I made.


most photos published courtesy of CRAFT magazine.

jump to a section:
supplies
about LED arrays
design
construction
customizing/programming
washing and wearing
troubleshooting and FAQ




supplies


supplies.
    **NOTE** As of Fall 2007, skip the ugly microcontroller programming (don't buy the STK500 or the AVR chip)... Get a LilyPad Arduino instead. It's much easier to sew and to program! See my LilyPad Arduino tutorial for help on getting started with the LilyPad.

  • conductive thread
    (You can purchase conductive thread from SparkFun. Check out my materials link page for more information on conductive threads.)
  • surface mount LEDs, as many as you want to include in your display
    (I used a super intensity red LED from digikey. part #: 67-1695-1-ND )
  • a microcontroller of your choice.
    (Chose one with an internal oscillator. I used the AVRmega16. digikey part #: ATMEGA16L-8PC-ND)
  • an IC socket for your microcontroller.
    (You want be able to sew through the socket's holes after minimal modifications. For a 40 pin micorcontroller, digikey part #: A9440-ND will work after you drill out the holes. I found the perfect socket, one that required no drilling, browsing my local electroics store, so try that first.)
  • a battery and holder. ***As of Fall 2007, get a LilyPad power supply instead. Much easier!
    (I used a standard 6 volt camera battery. part#: A544.
    You can purchase the holder for this battery from digikey part #: 108KK-ND)
  • an on/off switch ***Not necessary if you use a LilyPad power supply
    (Check out these slide switches and toggle switches from digikey.)
  • a 30 watt soldering iron and lead-free solder
    (You're going to wear this so keep health hazards like lead in mind!)
  • a multimeter
  • a T-square or a ruler
  • an assortment of silver and brass crimping beads, at least twice as many as you have LEDs
    (These are available from your local bead shop, or from Michaels)
  • a garment or a piece of fabric and a pattern you can use to make your own garment.
  • a needle or two, a fabric marker, and a bottle of fabric glue
    (Needles, fabric markers, and Liquid Stitch, Sew-No-More, and similar products are available at your local fabric shop or Joann Stores)
  • a pair of scissors
  • a sewing machine



about LED arrays
The naive way to power an array of LEDs would be to allocate one I/O pin of a microcontroller for each LED, tying the anode lead (+) of each LED to the microcontroller, and the cathode lead (-) to ground. This arrangement would quickly become unwieldy, requiring a chip with 100 pins to run a 10 x 10 matrix. Thankfully, we can exploit the essential property of diodes to implement a much more efficient design which will only require 20 pins to run a 10 x 10 array.

Diodes allow current to flow in only one direction. LEDs emit light when current flows through them. By exploiting this property, we can use the design shown below to power N LEDs with square root (N) microcontroller pins. As can be seen from the schematic, the LEDs are arranged in an row-column array with the anode end of each LED attached to a row and the cathode end of each LED attached to a column. Each row and each column is then attached to a microcontroller pin. The microcontroller can then be used to control each LED individually. For example, suppose we want only the LED at row0 column0 (LED R0 C0) turned on. To accomplish this, we first turn all of the LEDs off by setting all of the rows to ground and all of the columns to +5 volts, applying a reverse voltage to all of the LEDs. Then, to turn on LED R0 C0, we set R0 to +5V and C0 to ground. LED R0 C0 is the only LED with current running through it so it will emit light.



A schematic diagram of a row-column LED matrix.


The matrix architecture allows us to control each LED individually, but does not give us complete flexibility. For example, it is impossible to simultaneously turn on only LED R0 C0 and LED R1 C1. To display complex patterns and animations, we exploit the shortcomings of human vision. To make it appear as though LED R0 C0 and LED R1 C1 are on at the same time, we quickly flash first LED R0 C0 and then LED R1 C1 and repeat this cycle for as long as we want the illusion to appear. As long as our eye can't detect the flicker, we perceive only the diagonal line of light.

For more information on LEDs check out:
How LEDs work from Howstuffworks
LEDs from Wikipedia

Now, on with the project...

design
1. Pick a garment to sew on, a pattern that will let you sew your own garment, or design your own pattern.

2. Design your display. decide on the number of LEDs you want and their general placement. This will depend on the garment you chose and the microcontroller you intend to use as well as how you'd like the display to look. I decided to sew a simple tank top and I chose to place the LEDs evenly across my tank top every 2". Since my tank top is approximately 28" around and 12" tall I needed 84 LEDs. (Note! The pictures here show a different shirt with 140 LEDs spaced 1" apart.)

3. Decide on the microcontroller you want to use. Choose one with an internal oscillator, and make sure you have enough i/o pins to control your matrix. It's a good idea to pick a microcontroller you are familiar with and read the data sheet carefully! It can take some reading to discover that what you thought was a general purpose I/O pin is input only or an open drain output.

4. Decide on the power-source you want to use.


construction
0. If you're sewing your own garment, cut out the pieces and partially or fully assemble them.

1. Package your LEDs into sequins. Get out the crimping beads and surface mount LEDs. Tip an LED on its side. Using a soldering iron with a very clean tip, place the tip of the iron into a bead. Tin the bead with lead-free solder; melt some solder onto the outside of the bead. With the soldering iron, drag the bead up to the LED as is shown in the photo below. When the melted solder touches the LED's contact, the bead will adhere to the LED. Lift the soldering iron out of the bead. If your soldering iron tip is dirty, it will stick to the bead and make the job very difficult. If this is happening you should clean or replace your tip. Once you get the hang of it, this should go pretty fast. You should be able to solder 100 LEDs within an hour.

You may want to take some measures at this stage to distinguish the cathode from the anode lead of each LED. The cathode end is often marked with a green line on the front or back of the surface mount package. To distinguish the two, you can solder a brass crimping bead to the cathode lead and a silver bead to the anode lead for each LED.

   

LED sequins.


2. In a similar way, solder beads to the appropriate leads for your battery and switch so that they can also be sewn on.



A switch sequin.


3. Mark the lines for your LED matrix on your garment. Also mark where you want your microcontroller (IC socket) and power-supply to be. You want a grid of conductive traces where the vertical traces do not touch the horizontal ones. A simple way to do this is to put one trace on one side of the fabric and the other trace on the the flip side of the fabric, utilizing the fabric as a natural insulator. The lines for the vertical traces should be on one side of your garment and the lines for the horizontal traces should be on the other. I marked both sets of lines on both sides to make sure my lines were well-placed. Use a T square to get good right angles and straight lines.



Marking the lines for the display matrix.


4. Sew out your LED matrix. Using conductive thread in the bobbin of a sewing machine will allow you to sew conductive horizontal traces on one side of your garment and conductive vertical traces on the the other side, taking advantage of the fabric as a natural insulator. As you sew, the bobbin thread will remain on the underside of the fabric you are sewing. Make a bobbin of conductive thread for your sewing machine and put it in the machine. Use a spool of non-conductive thread for the top thread.

Sew one trial row-column crossing and make sure your threads are being sufficiently insulated by the fabric. If your fabric is too thin, the bobbin thread may be pulled through the fabric and your crossing traces may short out. If there is contact at your intersections, you will need to take action to correct this. As you are sewing out the traces you should stop the sewing machine just before each intersection, and, without breaking the threads, move your fabric past the intersection and resume sewing. This will insure that the conductive thread stays on the proper side of the fabric at each crossing.

Sew out your vertical traces. Flip your garment over and sew out your horizontal traces. You should stop your matrix stitches at a distance from the IC socket to leave room for the knots you will make while sewing it on by hand. You will want to avoid tying knots in areas where space is limited, as it will be in the traces close to the socket, because these knots can cause shorts.



Sewing out the traces.


   

Top and bottom views of my partially assembled tank top after I sewed on my traces.


5. Sew on the IC socket that will hold your microcontroller. Trim the pins off of the bottom of the socket and pull off any tape or other material blocking the holes. If necessary, drill out the holes so that a needle can pass through them. Position the socket where you want it on your garment and stitch it in place with conductive thread, sewing traces from each microcontroller socket to the matrix traces you sewed. You want to make sure that the conductive thread makes contact with each socket hole, but also to be careful that no two threads cross. This is a delicate job that requires some patience, but if you're used to doing soldering or any other meticulous work it should be no problem.

Make sure that you tie your knots where there is ample room for them (away from the socket) where they're less likely to cause shorts with neighboring traces. Coat each knot with fabric glue. This will keep knots from fraying and coming untied.

   

Sewing on the socket: back view.




Sewing on the socket: front view


6. Sew on your LEDs. Attach the cathode end of each LED to a row and the anode end of each LED to a column or vice versa. If you did not take steps during the soldering phase to differentiate the cathode from anode leads, you will have to make the distinction now. The cathode end is often marked with a green line on the front or back of the surface mount package. If you are able to find this marking despite your soldering, you can use it. Otherwise, learn to distinguish the direction from the appearance of face of the LED. Test one by running a current through it for reference. Be careful to use a voltage and current appropriate for your LED.

Whle sewing, take care to make good connections between your thread and each bead, looping the thread through each bead several times, as shown below. The fastest way to sew is to stitch each row and column continuously, not stopping to tie off the thread for each LED. That is, sewing in the cathode end of one LED, and sewing down your row to the next LED cathode without cutting your thread; however, this makes it harder to replace missewn or broken LEDs since you'll have to cut the continuous thread and tie the ends off in the event of a problem. Alternately, you can sew each LED on individually. This will make repairs easier, but your sewing will take much longer. I chose the first option for faster sewing, but did have to replace a few LEDs.

   

Sewing the LEDs.


7. Test out your circuit. Using a multimeter, make sure none of your traces are shorting out with one another and all of them are leading to the appropriate LED rows and columns. Conductive thread tends to fray and give off small "hairs". Make sure there are no miniscule conducting hairs interfering with any of your traces.

You may also want to verify that your LED matrix is working properly by attaching the leads of a suitable power supply to the rows and columns of your array in turn. Look at the specifications for your LEDs if you're not sure what power supply to use or you may fry all of your LEDs!

Once you've done some thorough testing, glue an insulating backing onto the traces you sewed for your IC socket so that your power supply will be easy to attach and these traces will remain in place without fraying with wear.

8. Sew on your power supply and switch.

   

Front and back views of my tank top after I sewed on the power supply. Notice the insulating backing that was applied prior to sewing.


9. Glue an insulating backing over your power supply and switch traces so that you will not accidentally turn on your display.



Back view of my tank top with the final insulating backing glued on.



programming/customizing

1. Program your microcontroller. Here's the same code that's on the CRAFT website:
tank_top_code.zip

you want to be careful that you modify my sample code so that it agrees with your design layout!

See my getting started with AVR programming page for information on how to get started programming AVR chips. Check out my materials and techniques links page for links to additional AVR and PIC microcontroller resources.

Enjoy! Go clubbing or something!



My completed tank top.



washing and wearing

The shirst is washable. Remove the battery and wash the garment by hand with a gentle detergent. Drip dry. You can also remove the chip before washing if you want, but I haven't found this to be necessary.

Note: silver coated threads will corrode over time and your LEDs will slowly get dimmer as you wear and wash the garment. To limit the effects of corrosion, insulate and protect your traces with a layer of puffy fabric paint. See my make your own electronic sewing kit page for more information.


troubleshooting/FAQ

1. I can't/don't want to solder beads to my LEDs.
  • if you just don't want to do any soldering, twist through-hole LEDs instead. check out my make your own electronic sewing kit page for information on how to make through-hole LEDs stitch-able using only a pair of needle nosed pliers. no soldering necessary!
  • if your solder is not melting, make sure the wattage of your soldering iron is high enough. you'll need a soldering iron that's 30 Watts or greater.
  • if your soldering iron tip is sticking to the bead, make sure your soldering iron tip is clean. the tip should be brand new. be careful not to get any solder on it - this will cause the tip to stick to the bead. use steel wool and fine grit sand paper to clean your tip.
  • if your soldering iron tip is sticking in the bead, make sure your soldering iron tip is the right shape. I used a RadioShack brand 30 watt soldering iron with a standard RadioShack tip. nicer irons with delicate tips won't work well. you want a relatively blunt tip that won't get stuck inside your beads.

2. I cant program my chip with the STK500.
  • check all the connections on your board and read the STK500 manual.
  • if you're using UISP to program chips, you will need to downgrade the stk500 firmware. see my AVRs on mac OSX page for information on how to do this and for current AVR/mac help and howtos.
  • extended AVR help is beyond the scope of this document. check out AVR Freaks for good advice and assistance from the AVR hobbyist community.

3. some of the C pins on my ATmega16 chip aren't working.
  • the ATmega16 ships with pins C2-C5 disabled for general I/O and enabled for debugging. for more information, read up on the on-chip debugging system and the "JTAGEN" fuse bit in the ATmega16 datasheet.
  • if you're using the code from the CRAFT website, type "make unTAG", while your chip in plugged into the STK500 and the STK500 is attached to the computer, to disable debugging and enable these pins as general purpose I/O on your chip.

4. how can I insulate the traces on my garment?
  • puffy fabric paint, available at craft stores like Michaels, is a great insulator. see my make your own electronic sewing kit page for more informaiton.
  • you can also sew or glue patches of traditional fabric over your stitches to protect them.

4. other questions and problems? feel free to email me and I'll help if I can: buechley at cs.colorado.edu.



This material is based upon work supported by the National Science Foundation under Grant No. 0326054.

Any opinions, findings and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation (NSF).