E-TEXTILES-IN-A-BOXWWW.NCWIT.ORG/ETEXTILESThe e-Textiles-in-a-Box tutorial helps adults get ready to teach young people aboutelectronics and computing. Based on the Computational Textiles Curriculum and SewElectric from MIT, e-Textiles-in-a-Box provides instructions for sewing soft circuits andprogramming an Arduino microprocessor on the way to creating a bookmark book lightand an interactive felt monster that lights up and sings. NCWIT is pleased to offere-Textiles-in-a-Box in cooperation with the MIT High-Low Tech Group, and with fundingfrom the National Science Foundation.NCWIT provides sample electronics and microprocessor kits to those wishing to learne-Textiles in order to teach others. Learn more inside!National Center for Women & Information Technology (NCWIT)www.ncwit.org [email protected] Twitter: @NCWIT 303.735.6671StrategicPartners:InvestmentPartners:
Table of ContentsPractical Guide. 6About this Resource. 6Introducing e-Textiles-in-a-Box. 6Four Lessons. 7Materials. 7Advice and Troubleshooting. 7Time. 8Space. 8Getting Help. 8Beyond the Tutorial. 8Materials Reference. 9Electronic Materials & Tools. 9Craft Materials & Tools. 11Glossary. 13Bookmark Booklight. 19Collect Your Tools and Materials. 20Suggested Nonessential Materials. 20Design Your Bookmark. 21Check out your electronic pieces. 21Sketch your bookmark. 21Build Your Bookmark. 24Begin building. 24Thread your needle. 24Tie your first knot. 25Stitch the ( ) tab of the battery holder. 26Stitch the ( ) trace. 27Tie a finishing knot. 29Stitch the (–) trace. 29Test the circuit. 31Understanding Your Circuit. 32Current, voltage, and energy. 32Short circuits. 34Switches. 35www.ncwit.org 2
Table of ContentsDecorate Your Bookmark. 36Experiment with Extensions: Add More LEDs. 37Experiment with Other Extensions. 38Troubleshooting. 38Introduction to Programming. 40Collect Your Tools and Materials. 41The LilyPad Arduino SimpleSnap. 42The basics. 42The battery. 43Set Everything Up. 43PC (Windows) Computer Software Download and Setup. 44Apple (Mac OS-X) Computer Software Download and Setup. 45Programs and Arduino. 46The Arduino development environment. 46Basic Programming Steps. 48Write the program. 48Compile the program. 49Load the program onto the LilyPad. 52Run the program on the LilyPad. 53Make the LED Blink Faster. 54Save your code. 55Basic Code Elements. 55Comments. 56Variables. 57Simple statements. 59Arduino Program Structure. 61Variable declaration section. 62Setup section. 62Loop section. 64Experiment. 65www.ncwit.org 3
Table of ContentsTroubleshooting. 65How to read an error. 65Hardware error: Programmer not responding. 66Software error: Missing semicolons or curly brackets. 66Software errors: Misspellings and capitalization errors. 68Additional help. 68Interactive Stuffed Monster. 69Collect Your Tools and Materials. 70Electronic materials and tools. 70Craft materials and tools. 71Note about materials. 71Design Your Monster. 72Your electronics. 72Basic design. 72Patterns. 73Circuit design. 76Begin Building. 78Cut out your fabric. 78Sew one side of your monster together. 79Draw connections. 80Sew your LED. 80Make Your Monster Blink. 82Making sense of the code: pinMode. 84Making sense of the code: digitalWrite, HIGH, and LOW. 85Making sense of the code: delay. 87Experiment. 87Create your own procedure. 87Save your code. 90Troubleshooting. 90Build Your Monster: Attach Your Speaker. 91www.ncwit.org 4
Table of ContentsMake Your Monster Sing. 92Understanding sound. 92The tone procedure. 92Make a sound. 94Play a song. 97Experiment. 101Save your code. 102Troubleshooting. 104Add a Sensor to Your Monster. 105Design your sensor. 105Make your sensor and attach it to your monster. 106Give Your Monster a Sense of Touch. 109Making sense of the code: analogRead. 112Making sense of the code: Serial.println. 115Using the sensor to control your monster: if else.