Want to add programming? With a Gemma M0 and Flora RGB Smart NeoPixels, you can create a string of lights that's codable in multiple formats. It lets you flash the lights on and off and change color, individually, to create an infinite variety of lighting effects.
All you need are the same sewing skills you just used to construct your earwarmer. If you're new to sewing circuits, there's a detailed guide to working with conductive thread here.
The Flora NeoPixels are individual color-changing LEDs on a miniature sewable board.
Look at it closely and you'll see metal pads with holes that let you sew them on.
There are pads for power (+) and ground (-). There are also two holes with pads for the signal from the Gemma M0 controller. They are marked with arrows. The arrows should be pointing away from the Gemma!
You'll be using conductive thread to create the traces, or lines of the circuit that connect the components together.
Here's how to connect the components:
- One trace (shown here as a yellow alligator clip wire) connects the D1 pad on the Gemma to the arrow on the NeoPixel pointing away from the Gemma.
- One trace (shown as the red alligator clip wire) connects the Vout pad on the Gemma to the power (+) pad on the NeoPixel.
- And the third trace (shown in black) connects the GND pad on the Gemma to the ground (-) pad on the NeoPixel.
To connect additional NeoPixels to the circuit, line them up so they are all pointing away from the Gemma. Then connect the arrow on the other side of the NeoPixel board to the arrow on the next NeoPixel.
You must use separate piece of conductive thread for the signal trace between each NeoPixel board.
The thread for the power and ground can each just continue on from one LED to the next.
Lay Out the Circuit
To keep your components in place in preparation for stitching them on, use a tiny adhesive dot to attach it to the fabric.
Make sure the glue doesn't cover the metal pads. The conductive thread must be able to touch the metal pads to make a good connection between the boards.
In this example, the NeoPixels are laid out in a wavy line.
The photo with the black, yellow, and red lines shows where the traces for the ground, signal, and power will be sewn.
Stabilize the Sewing Area
The felted sweater used for this example was still a little stretchy, so a thicker piece of felt was added inside the headband to stabilize it. It's held on by the stitches of the circuit.
Before starting the conductive thread stitches, secure the Gemma M0 board onto the fabric.
On the side not being used for the circuit, use non-conductive thread or embroidery floss to sew some stitches into the holes on the other side of the board in place.
The D0 pad was left empty in case you want to use it later as a touchpad or in other programming.
Conductive Thread Tips
The conductive thread can be stiff and wiry. To help get it onto the needle, here's a trick:
Fold a piece of regular thread into a loop. Pass the loop through the eye. Next, pass the conductive thread through the regular thread loop. Then pull the tails of the regular thread back through the eye of the needle. The conductive thread should come along with it.
You can never make too many knots when sewing with the conductive thread! However, that creates another problem: Loose thread tails that can cause short circuits. So always anchor the tail under nearby stitches whenever possible. Make sure you are only connecting that trace to the same trace!
If there are a lot of different traces close together near where you want to end a thread, make a few stitches back in the opposite direction. Then knot the thread in the middle of the line of stitching.
If you have a double layer, you can make these stitches through the inner layer only so they don't show.
Sew the Circuit Traces
Begin with the signal thread traces. Knot the thread around the D1 pad hole to start. Go around several times until it's nice and secure.
Then use a short running (in and out) stitch until you reach the "in" signal pad on the first NeoPixel. Since the hole here is smaller, bring the needle up from the wrong side of the fabric before the NeoPixel. Then you can aim the point of the needle down into the hole.
Again, go around through the hole as many times as you can. Then take a few stitches back away from the NeoPixel. Knot the thread around the stitching and cut it, leaving a short tail. You will secure the loose end later.
Sew the trace between the other arrow pad on this NeoPixel to the proper arrow pad on the next NeoPixel. Continue until they are all connected.
Then sew a trace from the GND pad on the Gemma M0, connecting to the (-) pads on all the NeoPixels. Make sure this trace doesn't touch the first line of stitching, or any other parts of the boards!
Do the same with the trace from the Vout pad on the Gemma M0 to the (+) pad on all the NeoPixels.
Check once more that no loose threads are touching anything they shouldn't.
Then test your circuit by running a program on the Gemma M0. Go to the MakeCode page or the CircuitPython page to program the board, depending on which version you want to use.
Finishing the Circuit
On the back of the circuit, use liquid seam sealer or clear nail polish to glue any loose threads in place. Let dry before you do anything else.
The exposed stitches on the right side of the headband should be protected too. You can use couching stitches (like in the non-programmable Wire LED version), making the stitches close enough to touch.
Or you can stick felt shapes, known as appliques, over the stitching.
Cut out your felt shape, then trace around it on sheet of a peel-and-stick fabric fuse. Peel off the backing paper on one side and press it onto your felt shape. Then peel off the other backing paper to expose the adhesive.
Place the felt shape over the exposed stitches. If any stitches are still sticking out when you are done, you can coat them with a little more seam sealer.
Diffusing the LEDs
To protect and diffuse the lights in your circuit, you can use the same applique technique and stick a piece of fabric right over the LED. Use a whitish color if you want the colors of the LEDs to come through clearly.
For this design, small strips of felt are rolled up to look like roses. To hold the rose together, pass a needle with regular thread through the entire roll, then take a few stitches to hold the thread in place. Go through the whole roll in different directions, then make a few stitches and tie off the end. Tuck the ends inside the rose.
Trace and cut the peel-and-stick fabric fuse the same way as above, and press them over the LEDs.
Covering the Gemma
If you want to cover the Gemma M0 as part of your design, make sure you can still get to the buttons, switches, and plugs.
Here a flower applique, fortified with some decorative blanket edge stitching, is attached to the headband with a few stitches of regular thread in two spots.
That makes it easy to lift a flap from top or bottom to get to all the important parts.
When not in use, the applique can be smoothed flat to protect the Gemma and diffuse the light of the onboard LED, which is programmed to be part of the animation.
The next pages tell you how to program your lights in either MakeCode or CircuitPython!