Nuts & Volts Magazine: Projects, Notes, Code, and More!
Having Fun with Electrons!
Forget textbooks and boring lectures. Electronics can be fun! Here are construction notes, resources, and source program downloads for some of my electronics-related articles from Nuts & Volts.
Make a Talking T-Shirt
Issue: September, 2012
This Halloween show who’s got the best tricks and treats with this fully electronic interactive decorated T-shirt.
Embedded inside the shirt are eerily glowing eyes made from ultra bright light emitting diodes, a series of buttons for touch sensors, and an Arduino microcontroller equipped for sound playback.
Activate a sensor and the eyes flicker ominously while a spooky voice is piped through a hidden speaker.
As Halloween costumes go, this one’s surprisingly easy to make -- just an afternoon of light soldering. Because it’s intended for just a single night of thrills, I’ve intentionally designed it so there’s no sewing involved. Many “wearable” electronic shirts use conductive fabric that must be carefully sewn into the garment. For this Arduino-based “spooky shirt,” electrical connections are made using ordinary wire. The LEDs and pushbutton sensors are temporarily held in place with tape. The Arduino, sound shield, and speaker are attached to a belt loop, and kept hidden under the shirt.
While the Halloween shirt uses piezo discs and pushbuttons for interactivity, you’re free to mix and match other kinds of sensors. Any compact sensor you can connect to an Arduino can be used to provide extra interactivity. That includes ultrasonic and infrared rangefinders, tilt sensors and accelerometers, and light detectors.
For the complete build instructions for this project see the September 2012 issue of Nuts & Volts Magazine.
Here's the stuff you need to complete the Halloween interactive t-shirt. In addition to a few standard value resistors, hookup wire, and common construction hardware (all are detailed in the Nuts & Volts article), you'll need:
|1||Spooky decorated t-shirt||Your choice|
|1||Arduino Uno||Adafruit, SparkFun|
|1||Adafruit Wave Shield||Adafruit|
|1||2x8 and 2x6 header pin set (2 ea)||Adafruit, Jameco, SparkFun|
|1||SD card (1-2 GB, FAT16 formatted)||Local retailer|
|1||Self-contained capsule amplified speaker||Amazon|
|2||White (or other color**) high brightness LEDs||Your choice|
|1||1" piezo disc||SparkFun|
|1||LilyPad Button Board||SparkFun|
|1||9-volt battery to 2.1mm barrel connector||Adafruit, SparkFun|
Misc: 9-volt battery, metal battery clips (2), small PCB for breakout.
* This is a selected list of sources, and is provided for your convenience.
Many of the items can also be found through other online stores.
** I used a pair of near-UV (395-410 nm) LEDs from RadioShack in my prototype. While the wavelength and power output of these LEDs are well within safe limits, you may prefer to use LEDs in the main visible spectrum. Green and white LEDs look the brightest to human eyes, but red looks the meanest! Red is also a good color for maintaining night time vision.
Arduino Sketch Sourcecode
The source code for the talking Halloweed t-shirt may be found here, both in an all-in-one zip (everything), or in separate zips, divided by function
- Everything - All code and libraries. Be sure to unzip and move the folder named CopyToLibrariesFolder to your Arduino's sketchbook libraries folder (afterward restart the Arduino IDE).
- Main t-shirt code - The main interactive t-shirt code, demonstrating reading WAV sound files stored on an SD card and playing them through the Adafruit Wave Shield. Note: In order to use this sketch you MUST copy the two folders in CopyToLibrariesFolder to the Arduino sketchbook library directory.
- Piezo test - Tests the level of sensitivity of the piezo disc. Use this to set the triggering threshold.
- Copy to sketchbook library - The two libraries you need to run the t-shirt sketch. Included are MStimer2 and WaveHC. You MUST copy these two folders in CopyToLibrariesFolder to the Arduino sketchbook library directory, then restart your Arduino IDE.
- WaveHC source - Source code library (for your reference) for using the Adafruit Wave Shield, as obtained from the Adafruit Web site. This is the version I used for the prototype. If you use a different version you may need to adjust the t-shirt sketch in case there are any changes that break the code.