loading

This is a fun project that uses an Arduino Lilypad along with a light sensor and buzzer to play the star wars theme when the collar of a Chewbacca coat is flipped up, and then stops when the collar is put back down.

I'm going to split this into 2 different parts, the coat (a knit Chewbacca themed star wars coat) and then the electronics. Of coarse this same thing can be put on any coat with a collar and any song can be programmed into the arduino, but I will only be detailing the Star Wars coat and song I made.

Step 1: Star Wars Chewbacca Knit Sweater Pattern

Download the pattern attached to this instructable to knit this sweater. This isn't a knitting tutorial, so you will have to be able to knit to make this sweater. I am just providing the pattern for the Chewbacca sweater, and you will need the following items:

  • Size 6 knitting needles
  • Size 9 knitting needles
  • Brown yarn (chewbacca fur color)
  • Black yarn
  • White yarn

Double up your yarn to knit this (just buy 2 skeins of each color and place 2 strands together as one when knitting). For all of the items in the pattern (except for the collar) you will need to start by knitting a 2 inch band of ribbing with the number 6 needles (you use the smaller needles on the ribbing so that it is tighter and snugs up compared to the rest of the sweater that is knit with the size 9 needles). You can do whatever type of ribbing you like (k1p1 or k2p2 etc...), doesn't really matter, just has to be about 2 inches wide when you are done. The ribbing is to be done in the brown color. Then when you get to the patter, just knit a row and then perl a row, adding the colors when they appear in the pattern (x is black, o is white, and blank square is brown). The only exception to this is for the front panels, they have a grey area on the front that should be done in the garter stitch, and this is where you will attache your zipper at the end. The collar is also done in the garter stitch.

Once you have all of the parts made, just lay them out and sew them together with the brown yarn. You can then add a zipper on the front panels, and you're all done. This pattern is labeled as a size 6, but the end size will of course rely upon how tight your stitches are and what size needles you use (if you change from the ones I've listed).

Step 2: Wiring the Arduino Lilypad

You will need the following items:

  • Arduino Lilypad Simple
  • Lilypad Buzzer (this is the "speaker")
  • Lilypad Light Sensor
  • Small LiPo Battery (can use other power supply, but these are handy and small)
  • ~3' of conductive thread

I got all of my parts from the Lilypad Protosnap Kit (https://www.sparkfun.com/products/11262). You don't have to buy this kit, each of the components can be sourced by themselves. You also don't have to use the lilypad sensors, but they are easier to sew to with the big pads, and they are the ones I used and will reference.

As you can see, the circuit is pretty simple, just find where you will place the components on your sweater. Make sure the light sensor will be completely covered when the collar is flipped down, and sufficiently exposed when flipped up. This is what triggers the music, if the light is bright enough, the music plays, if the collar is flipped down and covers the light sensor, the music stops. The buzzer can be anywhere, but I kept it close to the main lilypad as it's easier to sew it close by. You don't have to use my pins or my layout, that is just what worked for me. I diagrammed it first, and when I started to sew, I realized I didn't have to go all the way around with the light sensor positive (the blue dotted line), so I ended up putting that on the top pin of the actual arduino, but feel free to wire it any way you see fit (as long as it works, it's all good).

Step 3: Coding the Star Wars Theme and Light Sensor

Before I sewed anything to the coat, I used some alligator clips to hook everything up and then tested the code, this is a good thing to do if you have the clips (makes sure everything works and the code is set to the correct pins etc... helps catch any problems before you do too much work).

You will need to download both the arduino sketch and the pitches.h file, and load that pitches file into your sketch so that it can reference the code (the pitches define the different musical notes so that you can reference them by more familiar names instead of having to call them by their exact frequency).

Make sure and update all of the pins to use the ones you actually use in your arduino. You may also need to adjust the light sensor sensitivity increasing or decreasing the "sensorValue" value (in this code it is set to 40, increase it to make it less sensitive, or decrease it to make it more sensitive).

Essentially, this code is constantly checking the light sensor, and if the appropriate level of light is sensed (i.e. the collar is flipped up to expose the sensor), then it starts going through the star wars theme one note at a time, after each note it checks to see if the light sensor is still sensing light, and if so, it continues to the next note, if not, then it stops playing the music (there is no pause for this, it does this check so quickly that you won't notice the loop checking).

You can play with the notes, and make different songs etc. Everyone other Star Wars arduino sketch I found either had the darth vader march song, or the cantina music, I couldn't find the actual Star Wars theme, so I found some basic notes online and got this working, but I have very little musical talent, so please don't complain to me that I didn't use the correct timing or key etc... sounds ok to me and is instantly recognizable as Star Wars, but it can easily be adjusted and changed if you need.

Hope you have fun making this, good luck and post pics of your finished projects!

<p>Yay!!!! Congrats on the win!! I'm so excited for you...that serger is going to make life easier! :)</p>
<p>Thanks! We're super excited, can't wait to play with the serger and the Adafruit kits, and we'll have to start figuring out how to use an oscilloscope (we currently use a chap $20 Sparkfun multimeter, this is quite an upgrade). Congrats to you for your win as well!</p>
<p>Congratulations on the win!!</p>
<p>Thanks! Congrats on your win as well, your blanket is great, we especially love the embroidery (we have a Brother SE-400 embroidery machine and have been having fun embroidering patches and pretty much anything else that doesn't have a pulse). We're super excited to try out the serger and ada fruit stuff, and I guess I'll have to learn how to really use an oscilloscope properly now :)</p>
<p>Is this the only electronic project for the winter wearable?? Wouldn't that make you the clear winner for the judges prize?? :-) Congrats!</p>
<p>I think there are a few others, but I really hope we win, have my fingers crossed, the tech prize is fantastic. I would love to play with those adafruit goodies and my wife would love a serger, and who wouldn't love an oscilloscope? Can't wait until they announce the winners. At the very least we'll get a robot shirt :)</p>
<p>Cool!! I so want this attached to a black coat with The Imperial March for the music... bwahahahaha...</p>
<p>You should do it, and post pics when you're done!</p>
Genius now u gotta make a han solo one and make it say some pf his bad phrases/sayings
<p>I thought about making it play a number of the star wars themes, don't think you can get a piezo buzzer to speak (would be cool if you could). Could do it with the adafruit sound trigger board (I forget the name of it). It has like 11 slots for sound clips you can put on with 11 different triggers (or you can have one trigger access random saying). I want to get that board and play around with it, seems really fun.</p>

About This Instructable

10,697views

89favorites

License:

More by melarky:Remove Bushes and Stumps the Easy Way with a Farm Jack (AKA Hi-Lift Jack) Refinish Retro Vinyl Kitchen Chairs Werewolf Costume with Simple Animatronic Wagging Tail 
Add instructable to: