Step 3: Sewing Electronics
As you can see in the first picture, I had the power circuit board too close to the Lilypad. I later had to move this once I started sewing my circuit traces.
The actual circuit is pretty simple. Connect Positive Power and Ground from the Battery to the Lilypad. Then the pin outs are as follows:
int statusPin = 13; // onboard status LED is connected to digital pin 13
int redPin = 11; // R petal on RGB LED module connected to digital pin 11
int greenPin = 9; // G petal on RGB LED module connected to digital pin 9
int bluePin = 10; // B petal on RGB LED module connected to digital pin 10
int sensorPin = 5; // IR phototransistor connected to digital pin 5
int irPin = 6; // IR LED connected to digital pin 6
NOTE: complete Arduino sketch is at the end of this Instructable
TIP: You can use some of your scrap pieces of fabric to hold down your circuit traces. It's important that they do not cross or touch each other so that you do not create a short.
TIP: As you can see, the underside of your scarf will look kind of ugly with the circuit traces running through. You can cover this up by either sewing another scarf on top (leaving an opening to program your Lilypad) or by cutting out a scarf from the extra fabric you used for your pattern shapes.