Buy from US Buy from UK Buy from DE Buy from IT Buy from FR Buy from ES ここでご購入を!

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Sewable Electronics Projects:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Introduction

In this project you will control LEDs using the LilyPad USB board. Once you upload the code to the LilyPad board, your project can have more advanced behaviors, and the interactions become fully reprogrammable. You will sew the LilyPad components onto colorful felt and customize the theme and decorations.

Materials and Tools

• 1x LilyPad USB board
• 1x LilyPad Coin Cell Battery Holder
• 1x LilyPad Light Sensor
• 4x LilyPad LEDs (green)
• 2x LilyPad LEDs (orange)
• Conductive Thread and Needle
• Template (1 piece) – see Planning Your Project for printable downloads
• Felt (one 9″×12″ sheet of craft felt will make one project; use scraps of felt to add decorations)
• Embroidery or Sewing Thread

LilyPad Night-Light Ladybird materials: LilyPad USB board, LEDs, light sensor, conductive thread, and felt

Planning Your Project

Follow along with the circuit diagram on the template, or design your own layout on a piece of paper. Trace it onto the felt and cut it out. You will attach the LilyPad USB board to a custom felt shape that can hang on a wall or be sewn into a project.

Night-Light Ladybird Template

Leaf Template

LilyPad Night-Light Ladybird circuit layout on felt

Understanding Your Circuit

The LilyPad USB is a small computer that can store information and commands to control different sensors and boards connected to it. Programmable boards like the LilyPad USB are called microcontrollers. The LilyPad must be programmed in advance with a set of behaviors called code.

You will need seven LilyPad pieces: the LilyPad USB board, a LilyPad Coin Cell Battery holder, six LEDs, and a LilyPad Light Sensor. Arrange the pieces on the felt according to the diagram (or your own custom design). Carefully secure each piece with a dab of glue. Double-check the orientation of the LilyPad pieces against the diagram or template before gluing.

LilyPad Night-Light Ladybird project circuit layout diagram

Stitching It Together

STEP 1:

Cut a long piece of conductive thread, thread the needle, and tie a knot at the end. Sew your first connection: starting from the positive sew tab of one green LED, connect each of the six LEDs with a running stitch and three loops of conductive thread around each positive (+) sew tab. Tie and cut your thread. Note that the third and fourth LEDs are orange — these serve as the ladybird’s eyes.

With a new piece of thread, repeat the process for the negative side of the circuit — connecting all six LEDs’ negative sew tabs to one another and, finally, to the negative sew tab on the last green LED. Tie a finishing knot and trim any excess thread.

Sewing LilyPad LEDs onto the ladybird felt with conductive thread

STEP 2:

Next, take a separate piece of blue felt and stitch a connection between the LilyPad USB Board and the LilyPad light sensor on this fabric felt. The light sensor board has three connections: sensor (S), positive (+), and negative (–). Use conductive thread to connect the A3 tab on the LilyPad to the (S) tab on the light sensor with three loops at each tab. Connect the A5 tab on the LilyPad to the + tab on the light sensor.

Then connect the LilyPad USB Board to the LilyPad Coin Cell Battery holder. Sew three to four loops around the (–) tab of the LilyPad USB Board, then continue stitching from the (–) tab of the holder to the (–) tab of the light sensor. Tie and cut. With a new piece of thread, sew three to four loops around the (+) tab of the LilyPad USB Board, then continue stitching to connect the (+) tab of the holder. Tie and cut.

LilyPad USB board and light sensor stitched onto blue felt

STEP 3:

Last, with a new piece of thread, begin at tab 2 of the LilyPad USB board and stitch three to four loops around the sew tab. Continue stitching to the positive side of the last LED, ending with three to four loops.

This step will require a longer piece of thread than the others. Begin at the negative (–) sew tab on the battery holder, then stitch along the outside edge of the project, connecting the negative tab of the last LED on the other side.

Completed LilyPad ladybird circuit with all components stitched together

STEP 4:

Click here to download the code: Night-Light-Ladybird.ino

Before uploading the code to the LilyPad board, you need to install the Arduino IDE on your computer. You can download the latest version from Arduino’s downloads page (https://www.arduino.cc/en/Main/Software). Check out the Arduino installation guide (Windows, Mac, or Linux) for help installing the IDE.

When you connect the LilyPad Arduino USB board to your computer via the USB data cable (assuming the battery is connected) and slide the switch to “CHG” mode, you should see a red LED light up, indicating the battery is charging. When the switch is in the ON position, the microcontroller receives power and the board runs.

Before uploading code, make sure a few settings are correct. Confirm that “Board” is set to “LilyPad Arduino USB”. To change it, go to the Tools menu, navigate to the Boards dropdown, and select LilyPad Arduino USB.

Arduino IDE board selection for LilyPad Arduino USB

Open the sketch, then click the right-pointing arrow to upload the code. Give Arduino a few seconds to compile, then a few more to upload.

Installing Your Battery and Testing

Insert the coin cell battery into the LilyPad USB Board’s battery holder with the positive (+) side facing up. Cover the light sensor — all LEDs should light up. If they do, remove the battery and continue to the Finishing Touches section.

Finishing Touches

Learn more about uploading code in the tutorial: Uploading an Arduino Sketch.

After verifying that the circuit works, it is time to customize your design. Placing light-colored felt over the LEDs can hide the boards and soften the glow. If you cover the light sensor with a felt decoration, make sure to cut a small hole above the sensor so it is not blocked.

Finished LilyPad Night-Light Ladybird e-sewing project

LilyPad Night-Light Ladybird glowing with LEDs illuminated