| build: accelerometer shirt jump to a section: supplies important power supply note design construction customizing/programming washing supplies 1. Get out your supplies. You need:
![]() some of the supplies you'll need. READ THIS! important note about the power supply Keep your power supply and LilyPad main board as close to each other as possible in your constructions. If they are too far apart, you are likely to have problems with your LilyPad resetting or just not working at all. Conductive thread has non-trivial resistance. (The 4-ply silver-coated thread from SparkFun that comes with the LilyPad starter kit has about 14 ohms/foot.) Depending on what modules you're using in your construction, your LilyPad can draw up to 50 milliamps (mA) of current, or .05 Amps. Ohm's law says that the voltage drop (the amount of voltage that you lose) across a conductive material is equal to the resistance of the conductive material times the amount of current that is flowing through it. For example, if your LilyPad is a foot away from the power supply, the total resistance of the contuctive material that attaches your LilyPad to your power supply is about 28 ohms. (14 Ohms in the conductive thread that leads from the negative terminal of the power supply to the negative petal on the LilyPad and 14 Ohms in the conductive thread that ties the positive terminals together). This means we can expect a drop of 1.4 Volts (28 Ohms * .05 Amps.) This means that while 5 Volts is coming out of the power supply, the LilyPad will only be getting 3.6 Volts (5 Volts - 1.4 Volts). Once the voltage at the LilyPad drops below about 3.3 Volts, it will reset. In other words, you don't want the voltage at your LilPad to ever drop below about 3.5 Volts. If you are experiencing this kind of problem, you want to either decrease the resistance of your traces or decrease the amount of current your design is drawing. To decrease the resistance of your traces, you can stitch over existing traces with another layer of conductive thread (or, even a fine wire if you're desperate). To decrease the amount of current your design is drawing, try not to run several things at once. For example avoid powering a tri-color LED and vibrator motor at the same time if you can. Also, pay special attention to the stitching at the power supply and at the + and - tabs on the LilyPad. The power supply connection is the most important one that you'll sew in your project. You want to make sure you get excellent contact between the tabs on the power supply and your conductive thread. You also want to do everything you can to keep the power supply from moving around on the fabric. I recommend gluing the power supply in place and then sewing it. If you're sewing it to a thin, delicate, or stretchy fabric, you should glue or sew something underneath the power supply to help prevent it from pulling on the fabric and bouncing around as you move. design I decided to build a shirt with an accelerometer (motion sensor) in one sleave that would control the color of an RGB LED. Here's a sketch of how my pieces (a power supply, LilyPad, accelerometer, and RGB) are laid out electrically and physically: ![]() My design layout. construction Once you've planned out your design, start building by sewing your power supply and LilyPad Arduino to each other and to your garment. Go through each hole on the boards several times with your stitching. Keep sewing until you can't get your needle through the hole anymore. The goal here is to make a robust electrical connection between the tab on the board and the conductive thread. Check out the pictures below for examples of what your stitching should look like. As described above, sewing the power supply on really well is especially important. It's also crucial that each time you tie a knot, you seal it with fabric glue so that it doesn't come untied. ![]() The negative terminal of the power supply has been sewn on.
Left: sewing the negative terminal of the LilyPad. Right: the finished stitching. Once you've sewn on your LilyPad and power supply, make sure your connections are strong by putting a battery in your power supply and turning it on. Your LilyPad should be receiving power! You can check that this is happening by pressing the reset button on the LilyPad. Each time you do this, the LED on the LilyPad should blink three times very quickly. Once you've got a solid power supply to LilyPad connection, you're ready to sew in the rest of your components. For this simple example, I'm using the data from one axis of an accelerometer to control an RGB LED. I mounted the accelerometer on the right wrist of the shirt and the RGB LED just under the LilyPad on the front. Again, be diligent in your stitching and careful with your knots. Sew through each hole as many times as you can and seal all your knots with fabric glue! You will need to insulate at least some of your conductive traces to prevent shorts from happening as you move around. Insulating at least all of your power and ground lines is a good idea. Puffy fabric paint works well for this purpose. Just paint it over your exposed traces. You can see where I've applied black fabric paint in the images below.
A shirt that uses an accelerometer mounted on one wrist to control the color of an RGB LED. ![]() My completed shirt. the LilyPad and RGB LED are mounted on the front, the power supply is mounted near the right hip and the accelerometer is sewn to the right wrist. Hook your LilyPad up to a Bluetooth module and try interfacing it with Exemplar and PD ;-)
the RGB LED chages color in response to motion and tilt. customizing/programming See the insructions on my LilyPad Arduino guide for information on how to install and configure the software, how to attach the LilyPad to your computer for programming, etc. Here's the code for my accelerometer/RGB LED shirt: acceleroShirt.zip washing Your creation is washable. Remove the battery and wash the garment by hand with a gentle detergent. Note: silver coated threads will corrode over time and their resistance will gradually increase with washing and wear. To limit the effects of corrosion, insulate and protect your traces with puffy fabric paint. See my make your own electronic sewing kit page for more information. You can also revive exposed corroded traces with silver polish. Try this on a non-visible area first to see what it does to your fabric! |