# Twinkly Earwarmer Headband

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/086/223/medium800/led_strips_00-WireVersion2.jpg?1576875197)

Nobody likes hat hair, but that's no reason to let your ears freeze! Earwarmers are the perfect compromise -- cute and warm, but plenty of room for your hair to breathe free.

And by doubling the fabric to create a tube, you've got a handy place to hide a small battery holder -- enough to power a string of festive LEDs or stitch on some programmable NeoPixels!

This super-simple project lets you dress up your winter wear three different ways:

1. Use basic embroidery stitches to add a string of LEDs on a lovely silver wire, no coding required!
2. Go a little fancier with color-changing NeoPixels controlled by a Gemma M0 programmed in easy-to-learn Microsoft MakeCode.
3. For a challenge, weave a little CircuitPython magic into the Gemma to tap into a secret temperature sensor that shows you the chill factor in colored NeoPixels.

## Parts List -- Non-Programmable Version

The Wire Light LED Strand comes with a battery holder -- all you need to add are two CR2032 coin cell batteries. And they're easy to work with, because the wires are insulated and won't short out if they touch. They're even waterproof! I used the Cool White LEDs, but you can also get red, blue, green, and warm white.

![led_strips_PinkFaceHeadbandLights.jpg](https://cdn-learn.adafruit.com/assets/assets/000/086/225/medium640/led_strips_PinkFaceHeadbandLights.jpg?1576875273)

### CR2032 Lithium Coin Cell Battery

[CR2032 Lithium Coin Cell Battery](https://www.adafruit.com/product/654)
A perfect match for our [sew-able coin cell holder](http://www.adafruit.com/products/653). This non-rechargeable coin cell is CR2032 sized: 20mm diameter, 3.2mm thick. It has a nominal voltage output of 3V (although it starts a little high at 3.2V and slowly drifts down to 2.5V as...

In Stock
[Buy Now](https://www.adafruit.com/product/654)
[Related Guides to the Product](https://learn.adafruit.com/products/654/guides)
![Front shot of CR2032 Lithium Coin Cell Battery upright.](https://cdn-shop.adafruit.com/640x480/654-02.jpg)

## Parts List -- MakeCode and CircuitPython Versions

The hardware is the same for both programmable versions. Just the code is different -- so you can even switch back and forth! And don't forget the batteries (above).

![led_strips_Me.jpg](https://cdn-learn.adafruit.com/assets/assets/000/086/227/medium640/led_strips_Me.jpg?1576876425)

### Adafruit GEMMA M0 - Miniature wearable electronic platform

[Adafruit GEMMA M0 - Miniature wearable electronic platform](https://www.adafruit.com/product/3501)
The **Adafruit Gemma M0** is a super small microcontroller board, with just enough built-in to create many simple projects. It may look small and cute: round, about the size of a quarter, with friendly alligator-clip sew pads. But do not be fooled! The Gemma M0 is incredibly...

In Stock
[Buy Now](https://www.adafruit.com/product/3501)
[Related Guides to the Product](https://learn.adafruit.com/products/3501/guides)
![Pink polished fingers holding a Adafruit GEMMA M0 - Miniature wearable electronic platform. ](https://cdn-shop.adafruit.com/product-videos/640x480/3501-05.jpg)

### Flora RGB Smart NeoPixel version 3 - Pack of 4

[Flora RGB Smart NeoPixel version 3 - Pack of 4](https://www.adafruit.com/product/1260)
What's a wearable project without LEDs? Our favorite part of the Flora platform is these tiny smart pixels. Designed specifically for wearables, these updated Flora NeoPixels have ultra-cool technology: these ultra-bright LEDs have a constant-current driver cooked right into the LED...

In Stock
[Buy Now](https://www.adafruit.com/product/1260)
[Related Guides to the Product](https://learn.adafruit.com/products/1260/guides)
![Overhead shot of four, black, round LED breakouts.](https://cdn-shop.adafruit.com/640x480/1260-09.jpg)

### 2 x CR2032 Coin Cell Battery Holder - 6V output - On/Off switch

[2 x CR2032 Coin Cell Battery Holder - 6V output - On/Off switch](https://www.adafruit.com/product/783)
This tiny coin cell battery holder is ideal for small portable or wearable projects. It holds two 20mm coin cells (2032 or CR2032 are the most popular size) in series to generate 6V nominal. (If you want only 3V, we suggest sticking a crumpled piece of tin foil in one of the slots.) 20mm coin...

In Stock
[Buy Now](https://www.adafruit.com/product/783)
[Related Guides to the Product](https://learn.adafruit.com/products/783/guides)
![Angled shot of closed 2 x 2032 coin cell battery holder with on-off switch and JST PH Connector.](https://cdn-shop.adafruit.com/640x480/783-03.jpg)

### Stainless Medium Conductive Thread - 3 ply - 18 meter/60 ft

[Stainless Medium Conductive Thread - 3 ply - 18 meter/60 ft](https://www.adafruit.com/product/641)
After months of searching, we finally have what we consider to be the ultimate conductive thread. It's thin, strong, smooth, and made completely of 316L stainless steel. Once you start working with this thread you'll quickly agree its optimal for any wearables work!  
  
This...

In Stock
[Buy Now](https://www.adafruit.com/product/641)
[Related Guides to the Product](https://learn.adafruit.com/products/641/guides)
![Small spool of conductive thread.](https://cdn-shop.adafruit.com/640x480/641-05.jpg)

## Suggested Tools List

Here are some recommended tools, but feel free to use what you have on hand. Standard crewel (embroidery) needles also work well with conductive thread.

### Super Scissors

[Super Scissors](https://www.adafruit.com/product/1599)
Save your scissors! Instead of using your nice shears (and dulling them) or wire cutters (not right for the job) - use these super scissors. They're meant for engineering/maker cutting jobs such as cutting plastic, leather, copper sheet/wire, even coaxial & ribbon cables. There's a...

In Stock
[Buy Now](https://www.adafruit.com/product/1599)
[Related Guides to the Product](https://learn.adafruit.com/products/1599/guides)
![Very strong looking scissors with comfy grip](https://cdn-shop.adafruit.com/640x480/1599-09.jpg)

### Needle set - 3/9 sizes - 20 needles

[Needle set - 3/9 sizes - 20 needles](https://www.adafruit.com/product/615)
Mighty needles, sew like the wind! This needle set is the only one you'll need for any sort of hand sewing, especially using our conductive thread and wearable electronics parts.  
  
Each pack contains 20 gold-eye sharps, with eye sizes ranging from #3 (1.75" long) to #9...

In Stock
[Buy Now](https://www.adafruit.com/product/615)
[Related Guides to the Product](https://learn.adafruit.com/products/615/guides)
![Small blue packaging containing 20 sewing needles.](https://cdn-shop.adafruit.com/640x480/615-03.jpg)

## Suggested Materials List

The construction of the earwarmer headband is the same for all three versions. Here's what you will need, in addition to the parts and tools listed above:

- felt or fleece (in one or more colors) -- warm, soft, and easy to sew because they don't fray. The nice thick felt used for the examples in this guide was made by shrinking wool sweaters&nbsp; (Instructions for felting sweaters can be found multiple places [online](https://www.instructables.com/id/Felting-Wool-Sweaters/) or in my book _[Fabric and Fiber Inventions](https://amzn.to/34yYzxH)_)
- regular cotton or polyester thread -- use where you want stitches to be secure but not overly visible
- embroidery floss -- great for decorative stitching that draws attention, and for covering up electronics
- straight pins -- to hold the fabric together while you work
- seam ripper -- for fixing mistakes

### Optional, depending on the version you'll be making:

- tape (for holding the wire LEDs in place as you sew)
- adhesive dots (tiny ones to hold the NeoPixels in place as you sew)
- liquid seam sealant like Fray Check, or clear nail polish (for securing the conductive thread)
- press-on fabric adhesive sheets, such as Peel n Stick Fabric Fuse (for attaching felt appliques over NeoPixels and conductive thread stitches)&nbsp;

# Twinkly Earwarmer Headband

## Sew the Earwarmer

![](https://cdn-learn.adafruit.com/assets/assets/000/086/437/medium800/led_strips_Untitled.png?1577145301)

## Measure and Cut Your Fabric

The first step is to cut your piece of fabric to fit your head. Use a cloth tape measure, piece of yarn, or your fabric to measure the width and length you like. This project is very forgiving, so don't worry if something doesn't come out exactly as you meant it to. It will probably still work.

First, decide how wide you want your ear warmer headband to be -- the examples in this guide had a finished width of 4 inches wide. Double that to get the width of the fabric piece (eg, 4 X 2 = 8 inches).

To get the length, wrap a cloth tape measure around your head where you would wear an ear warmer headband. Take the measurement of the front edge -- from the point that is closest to your forehead at the top, to the inside corner of the bottom (closest to your neck), going all the way around. Add about 4 inches to this length. The examples here were about 11 inches long, so the piece of fabric to work with was 15 inches long.

![led_strips_1-WoolStrip.jpg](https://cdn-learn.adafruit.com/assets/assets/000/086/043/medium640/led_strips_1-WoolStrip.jpg?1576780328)

Cut out a strip of fabric using those measurements. If you need help, draw a paper pattern first, or draw on the fabric with tailor's chalk (or blackboard chalk if that's what you have lying around).

## Mark and Stitch the Back Seam

To make the headband, fold the fabric strip in half, long edges together. The "right side" of the fabric (the side you want to show) should be facing out.

The folded edge is the front of the headband, closest to your face. The two short ends will be stitched together and go at the back of your neck.

Wrap the folded strip of fabric so the short edges are together at the back of your neck.

Pinch the edges of the fabric together at the top and bottom. Carefully take the headband off, then pin the strip at those points to hold the layers together.

Draw a gently curved line between these two points. This will make the headband fit more snugly around your head.

Take regular thread. Use a secure stitch like a [backstitch](https://www.thesprucecrafts.com/backstitch-for-strong-durable-hand-sewing-2978450) to sew up the seam.

Trim the excess fabric to about a quarter of an inch. The excess seam material will be on the **outside** of the headband. You will finish it off with embroidery floss

![led_strips_1-BackSeam.jpg](https://cdn-learn.adafruit.com/assets/assets/000/086/047/medium640/led_strips_1-BackSeam.jpg?1576781969)

![led_strips_1-FoldedStrip.jpg](https://cdn-learn.adafruit.com/assets/assets/000/086/044/medium640/led_strips_1-FoldedStrip.jpg?1576781542)

![led_strips_1-StitchBackSeam.jpg](https://cdn-learn.adafruit.com/assets/assets/000/086/045/medium640/led_strips_1-StitchBackSeam.jpg?1576781651)

Info: 

# Twinkly Earwarmer Headband

## Easiest Version - Embroider on a Wire Light

![](https://cdn-learn.adafruit.com/assets/assets/000/086/224/medium800/led_strips_00-WireVersion3.jpg?1576875222)

For this version of the headband, you'll be sewing a wire light onto the headband. The wire light is all one piece -- all you have to do is stitch around it to hold it in place. And it's waterproof, so it's OK to wear in damp weather (as long as the battery pack is tucked away inside the headband).

Since the stitches will be showing, you might as well make them part of the design! To do that, you will use embroidery floss -- a thick, shiny thread made up of six strands that can be separated or used all together.

And since the lights are pretty bright, you can also use embroidery floss stitches to cover the LEDs and diffuse the light. That reduces the intensity and spreads the light around to cover a slightly larger area.

You don't need to know any official stitches for this project -- it's perfectly OK to just make them up as you go along.

If you need help with the basics, [The Hand Sewing Class on Instructables](https://www.instructables.com/class/Hand-Sewing-Class/) can help you get started, and give pointers on the stitches mentioned here. The [Instructables Embroider Class](https://www.instructables.com/class/Embroidery-Class/) also has tips for sewing with embroidery floss.

Warning: 

## Position the Wire Lights
Since you're limited by the length of the wire, start by putting the battery holder near the back of the neck.

Open up the headband and on the **inside layer** , mark and cut a slit a little further away from the bottom of the back seam than the length of the battery pack. Make it wide enough for the battery pack to fit through.

Put the battery pack inside the pouch formed by the headband, about where you want it to sit when you are wearing it. On the **outside layer** , mark and cut a small slit just big enough for the wire to fit through.

![led_strips_2-LightsBatteryPack.jpg](https://cdn-learn.adafruit.com/assets/assets/000/086/078/medium640/led_strips_2-LightsBatteryPack.jpg?1576791885)

![led_strips_2-BatteryPackCut.jpg](https://cdn-learn.adafruit.com/assets/assets/000/086/079/medium640/led_strips_2-BatteryPackCut.jpg?1576791913)

![led_strips_2-LightTailCut.jpg](https://cdn-learn.adafruit.com/assets/assets/000/086/081/medium640/led_strips_2-LightTailCut.jpg?1576793239)

## Attach the Wire to the Fabric
Pull out the wire and position it around the outside of the headband.

Make sure to leave enough extra wire to let you take the battery pack when needed.

Hold the wires in place with tape. Now you're ready to sew them on! The technique you will use is called [couching](https://www.instructables.com/id/Japanese-Style-E-Textiles/).

Anchor your thread or floss on the inside of the outer layer (inside the pouch). Wrap the thread around the wire three or four times, just before the first light. Then make tight little stitches around the wire, evenly spaced, to hold it in place against the fabric. Remove each piece of tape as you come to it.

When you get to an LED, make a stitch right before and after it. And make sure the bulb is pointing out!

Keep going to the end of the wire, then anchor the floss just past the last LED.

![led_strips_2-WireTaped.jpg](https://cdn-learn.adafruit.com/assets/assets/000/086/082/medium640/led_strips_2-WireTaped.jpg?1576793422)

![led_strips_2-LightsTape.jpg](https://cdn-learn.adafruit.com/assets/assets/000/086/083/medium640/led_strips_2-LightsTape.jpg?1576793445)

![led_strips_2-SewWire.jpg](https://cdn-learn.adafruit.com/assets/assets/000/086/085/medium640/led_strips_2-SewWire.jpg?1576793800)

![led_strips_2-FlossWire.jpg](https://cdn-learn.adafruit.com/assets/assets/000/086/086/medium640/led_strips_2-FlossWire.jpg?1576793823)

## Embroider Over the LEDs
You can sew any kind of design to cover the LEDs and diffuse the light. Here they are covered with messy stars. Each star starts out with three criss-crossing stitches of thick embroidery floss.&nbsp;

Then go back in and make shorter stitches between the long ones. Turn the light on from time to time to make sure you are covering the glare.

Do the same on all the lights. If you use different color floss, you will get the effect of multi-colored lights.

![led_strips_2-Star1.jpg](https://cdn-learn.adafruit.com/assets/assets/000/086/091/medium640/led_strips_2-Star1.jpg?1576794705)

![led_strips_2-Star2.jpg](https://cdn-learn.adafruit.com/assets/assets/000/086/092/medium640/led_strips_2-Star2.jpg?1576794723)

![led_strips_2-Star3.jpg](https://cdn-learn.adafruit.com/assets/assets/000/086/093/medium640/led_strips_2-Star3.jpg?1576794742)

![led_strips_2-Star4.jpg](https://cdn-learn.adafruit.com/assets/assets/000/086/094/medium640/led_strips_2-Star4.jpg?1576794760)

## Closing the Top

The final step is to close the top of the headband. Starting at the bottom of the back seam, sew through all the layers of fabric, gathering them together in the stitch.

When you reach the top edge, go all the way around.

A simple whip stitch works just goes over the top, around and around. It's good for holding the edges of the opening together.

A [blanket stitch](https://www.instructables.com/lesson/Sewing-Blanket-Stitch-Coasters/) creates a line of thread or floss across the top of the opening, which gives you a nice finished look.

There are also more elaborate variations. This example uses a stitch called a crossed buttonhole. It takes a little practice to get it right!

![led_strips_00-WireVersion.jpg](https://cdn-learn.adafruit.com/assets/assets/000/086/095/medium640/led_strips_00-WireVersion.jpg?1576795170)

If you make a mistake in your embroidery, you can take out the stitches with a seam ripper and start again. Just be careful not to damage the wire or electronics.

# Twinkly Earwarmer Headband

## Intermediate Version - Sew on Gemma and NeoPixels

![](https://cdn-learn.adafruit.com/assets/assets/000/086/205/medium800/led_strips_Finished.jpg?1576865677)

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.](https://learn.adafruit.com/conductive-thread/overview)

## Prep Your Circuit
### Circuit Basics

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.

![led_strips_4-3-FloraArrows.jpg](https://cdn-learn.adafruit.com/assets/assets/000/086/130/medium640/led_strips_4-3-FloraArrows.jpg?1576853892)

![led_strips_4-4-Board-Lights.jpg](https://cdn-learn.adafruit.com/assets/assets/000/086/131/medium640/led_strips_4-4-Board-Lights.jpg?1576853915)

![led_strips_Clips2.jpg](https://cdn-learn.adafruit.com/assets/assets/000/086/161/medium640/led_strips_Clips2.jpg?1576860706)

![led_strips_4-1-GemmaAlligatorFlora.jpg](https://cdn-learn.adafruit.com/assets/assets/000/086/162/medium640/led_strips_4-1-GemmaAlligatorFlora.jpg?1576861003)

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.

![led_strips_4-5-GlueDots.jpg](https://cdn-learn.adafruit.com/assets/assets/000/086/139/medium640/led_strips_4-5-GlueDots.jpg?1576857359)

![led_strips_4-6-CircuitComponents.jpg](https://cdn-learn.adafruit.com/assets/assets/000/086/140/medium640/led_strips_4-6-CircuitComponents.jpg?1576857387)

![led_strips_4-7a-WholeCircuitColored.jpg](https://cdn-learn.adafruit.com/assets/assets/000/086/141/medium640/led_strips_4-7a-WholeCircuitColored.jpg?1576857411)

### 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.

![led_strips_4-7-BlackLiner.jpg](https://cdn-learn.adafruit.com/assets/assets/000/086/147/medium640/led_strips_4-7-BlackLiner.jpg?1576857728)

![led_strips_4-8-GemmaFloss.jpg](https://cdn-learn.adafruit.com/assets/assets/000/086/148/medium640/led_strips_4-8-GemmaFloss.jpg?1576857758)

Warning: 

### 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.

![led_strips_4-9a-Threader.jpg](https://cdn-learn.adafruit.com/assets/assets/000/086/149/medium640/led_strips_4-9a-Threader.jpg?1576857806)

![led_strips_4-9-GemmaKnot.jpg](https://cdn-learn.adafruit.com/assets/assets/000/086/150/medium640/led_strips_4-9-GemmaKnot.jpg?1576857868)

![led_strips_Knot_ends.jpg](https://cdn-learn.adafruit.com/assets/assets/000/086/172/medium640/led_strips_Knot_ends.jpg?1576862831)

![led_strips_Knots.jpg](https://cdn-learn.adafruit.com/assets/assets/000/086/175/medium640/led_strips_Knots.jpg?1576863188)

### 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.

![led_strips_4-10-ThreadCircuit.jpg](https://cdn-learn.adafruit.com/assets/assets/000/086/176/medium640/led_strips_4-10-ThreadCircuit.jpg?1576863261)

![led_strips_4-11-WholeCircuit.jpg](https://cdn-learn.adafruit.com/assets/assets/000/086/178/medium640/led_strips_4-11-WholeCircuit.jpg?1576863767)

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.

![led_strips_4-12-FrayCheck.jpg](https://cdn-learn.adafruit.com/assets/assets/000/086/179/medium640/led_strips_4-12-FrayCheck.jpg?1576864142)

![led_strips_4-13-LeafFuse.jpg](https://cdn-learn.adafruit.com/assets/assets/000/086/180/medium640/led_strips_4-13-LeafFuse.jpg?1576864166)

![led_strips_4-14-FusePeel.jpg](https://cdn-learn.adafruit.com/assets/assets/000/086/183/medium640/led_strips_4-14-FusePeel.jpg?1576864245)

![led_strips_4-15-LeafStuckOn.jpg](https://cdn-learn.adafruit.com/assets/assets/000/086/184/medium640/led_strips_4-15-LeafStuckOn.jpg?1576864302)

Warning: 

### 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.

&nbsp;

![led_strips_4-16-WhiteStrip.jpg](https://cdn-learn.adafruit.com/assets/assets/000/086/192/medium640/led_strips_4-16-WhiteStrip.jpg?1576864844)

![led_strips_4-17-WhiteRoseNeedle.jpg](https://cdn-learn.adafruit.com/assets/assets/000/086/194/medium640/led_strips_4-17-WhiteRoseNeedle.jpg?1576864873)

![led_strips_4-18-WhiteRoll.jpg](https://cdn-learn.adafruit.com/assets/assets/000/086/196/medium640/led_strips_4-18-WhiteRoll.jpg?1576864917)

![led_strips_4-19-WhiteRoseGlue.jpg](https://cdn-learn.adafruit.com/assets/assets/000/086/197/medium640/led_strips_4-19-WhiteRoseGlue.jpg?1576864945)

### 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.

![led_strips_GemmaFlower1.jpg](https://cdn-learn.adafruit.com/assets/assets/000/086/207/medium640/led_strips_GemmaFlower1.jpg?1576866071)

![led_strips_GemmaFlower2.jpg](https://cdn-learn.adafruit.com/assets/assets/000/086/208/medium640/led_strips_GemmaFlower2.jpg?1576866108)

![led_strips_GemmaFlower3.jpg](https://cdn-learn.adafruit.com/assets/assets/000/086/209/medium640/led_strips_GemmaFlower3.jpg?1576866148)

The next pages tell you how to program your lights in either MakeCode or CircuitPython!

# Twinkly Earwarmer Headband

## MakeCode Maker Animation

![](https://cdn-learn.adafruit.com/assets/assets/000/086/217/medium800/led_strips_MakeCodeEarwarmer1.jpg?1576869856)

It's simple to program your Twinkly Earwarmer with the Gemma M0 in Microsoft MakeCode! The version to use with Gemma M0 is called [MakeCode Maker](https://maker.makecode.com/). It lets you program the onboard color-changing LED, and add components to the board's pins.

For this project, you need to tell the board where to find a strip of four external NeoPixels. Combine them with Gemma's onboard RGB DotStar LED and you can create an animated light show with five lights!

If you haven't used Gemma M0 with MakeCode before, There's more information about using MakeCode on the [Gemma M0 guide](https://learn.adafruit.com/adafruit-gemma-m0/makecode).

To get started right away, you can just open and edit the sample code shown at the top of the page.

Click the button below to open the MakeCode Maker editor, then add to or change the light display as you wish.

[Click here to open the sample MakeCode for the Twinkly Headband!](https://makecode.com/_M8pDYV2e69vM)
To download the file to the board, connect the Gemma M0 to your computer with the USB cable. Press the reset button and it will go into bootloader mode. That means it's ready to receive code.

Click `Download` on the MakeCode page and save the file. It will have a .uf2 extension.

Then find the drive on your computer labeled **GEMMABOOT**. Drag and drop (or copy and paste) the program into Gemma! You'll know the code was downloaded when the onboard pixel changes to violet.

While the Gemma is still connected to the computer, check how the MakeCode runs on the actual NeoPixel strip so you can make any adjustments.

Info: 

![](https://cdn-learn.adafruit.com/assets/assets/000/086/218/medium800/led_strips_MakeCodeEarwarmer2.jpg?1576870474)

There are lots of ways to animate your strip of pixels! To create your own animation, you can use the `strip` code blocks, found in the **LIGHT** category. Then you can preview it in the simulator before you download it to your Gemma.

[Here's a detailed explanation](https://learn.adafruit.com/neopixel-spats/code-with-makecode) of how the NeoPixels work and how to make them do interesting things.

You can see and edit the handcoded animation shown above by clicking the button below. Have fun!

[Click here to see a handcoded MakeCode animation](https://makecode.com/_M8pDYV2e69vM)
# Twinkly Earwarmer Headband

## Advanced Version - CircuitPython Chill Sensor

![](https://cdn-learn.adafruit.com/assets/assets/000/086/221/medium800thumb/led_strips_TempSensing.jpg?1576874372)

Want more of a challenge? If you code the board in CircuitPython, you can access the hidden temperature sensor and use it to control the colors of your pixels!

Adafruit's Anne Berela has written code that will turn the lights red if the temperature is above 65 degrees and blue if it goes below that.&nbsp;

If you are new to CircuitPython, there are few steps to go through to use this code. Follow the instructions below or go [here](https://learn.adafruit.com/welcome-to-circuitpython/overview) to learn more about installing and programming in CircuitPython.

## Loading CircuitPython on Your Gemma M0

This project was tested using CircuitPython 4. If you're not sure if that's what you are running on your Gemma M0, plug in your board, go to **CIRCUITPY** drive, and check the folder marked **boot\_out.txt**. It will tell you what version is loaded on the board. The latest stable version should be fine.

If you need to install or update CircuitPython, tap the reset button once or twice to enter bootloader mode.

Once successful, the RGB LED on the board will flash red and then stay green. A new drive will show up on your computer called **GEMMABOOT**.

Then click the button below, which will take you to the download page for the latest version of CircuitPython. Save that file to the **GEMMABOOT** drive on your computer.

You've now installed CircuitPython on your board! The drive you will be working with from here on is called **CIRCUITPY**.

[Click here to download the latest version of CircuitPython!](https://circuitpython.org/board/gemma_m0/)
Next, you'll need to install some libraries. CircuitPython libraries are separate files designed to work with CircuitPython code. CircuitPython programs require a lot of information to run. CircuitPython is so simple to use because most of this information is processed in the background and stored in libraries. Some libraries are built into CircuitPython. Others are downloaded and stored on your **CIRCUITPY** drive in a folder called **lib**.   
  
Click the button below and download the bundle for use with your version of CircuitPython. Save it on your computer, not the board! You'll only need two files from this huge folder.

Look for these two files -- **neopixel.mpy** and **adafruit\_dotstar.mpy** -- and drag them to the **lib** folder on the Gemma M0.

[Click here to find the CircuitPython library to use with your board!](https://circuitpython.org/libraries)
## Install the Mu Editor

Adafruit recommends using the Mu editor on your computer to work with CircuitPython code. Instructions for downloading it to your computer can be found [here](https://learn.adafruit.com/welcome-to-circuitpython/installing-mu-editor) or the button below.

Once you've got it installed, open it up. You're ready to copy the code to make your temperature sensor lights work!

[Click here for instructions on installing the Mu editor!](https://learn.adafruit.com/welcome-to-circuitpython/installing-mu-editor)
## Temperature Sensor Code

Copy and paste the code below into your editor or click the download link.

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/Gemma/GemmaM0_Headband/code.py

If you need to make any adjustments, such as changing the "room temperature" cut-off that triggers the colors (`ROOM_TEMP`), or you have a different number of pixels attached to your Gemma M0, you can type them right into the code.

Then click the Save button at the top of the Mu editor and save this file as **code.py** on your **CIRCUITPY** drive.

If everything is working, the onboard LED (and the external NeoPixels if they're connected) will turn red.

![](https://cdn-learn.adafruit.com/assets/assets/000/086/500/medium800/led_strips_Capture.jpg?1577388936)

## Test Your Code

Now disconnect the Gemma from the computer and connect it to the battery holder. Take the board outside (if it's chilly), place a bag of frozen veggies on the board, or just toss it in the freezer. If it's working, the lights should go from red to blue and back again as it cools down and warms up.

If it's not, or if it's working but a little wonky, check your conductive thread connections or your batteries.

![led_strips_SnowBand.jpg](https://cdn-learn.adafruit.com/assets/assets/000/086/222/medium640/led_strips_SnowBand.jpg?1576874891)

Like any tech project, it takes some fiddling to make the hardware and software cooperate. Enjoy playing with your temp-sensing headgear!


## Featured Products

### Adafruit GEMMA M0 - Miniature wearable electronic platform

[Adafruit GEMMA M0 - Miniature wearable electronic platform](https://www.adafruit.com/product/3501)
The **Adafruit Gemma M0** is a super small microcontroller board, with just enough built-in to create many simple projects. It may look small and cute: round, about the size of a quarter, with friendly alligator-clip sew pads. But do not be fooled! The Gemma M0 is incredibly...

In Stock
[Buy Now](https://www.adafruit.com/product/3501)
[Related Guides to the Product](https://learn.adafruit.com/products/3501/guides)
### Wire Light LED Strand - 10 Cool White LEDs + Coin Cell Holder

[Wire Light LED Strand - 10 Cool White LEDs + Coin Cell Holder](https://www.adafruit.com/product/894)
Add sparkle to your project with these lovely silver wire LED strands. These strands are very interesting, they use two silver wires that are coated so they don't short if they touch, then tiny 1000mcd LEDs are bonded onto the wires and coated with epoxy. The result is a very flexible...

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/894)
[Related Guides to the Product](https://learn.adafruit.com/products/894/guides)
### Flora RGB Smart NeoPixel version 3 - Pack of 4

[Flora RGB Smart NeoPixel version 3 - Pack of 4](https://www.adafruit.com/product/1260)
What's a wearable project without LEDs? Our favorite part of the Flora platform is these tiny smart pixels. Designed specifically for wearables, these updated Flora NeoPixels have ultra-cool technology: these ultra-bright LEDs have a constant-current driver cooked right into the LED...

In Stock
[Buy Now](https://www.adafruit.com/product/1260)
[Related Guides to the Product](https://learn.adafruit.com/products/1260/guides)
### 2 x CR2032 Coin Cell Battery Holder - 6V output - On/Off switch

[2 x CR2032 Coin Cell Battery Holder - 6V output - On/Off switch](https://www.adafruit.com/product/783)
This tiny coin cell battery holder is ideal for small portable or wearable projects. It holds two 20mm coin cells (2032 or CR2032 are the most popular size) in series to generate 6V nominal. (If you want only 3V, we suggest sticking a crumpled piece of tin foil in one of the slots.) 20mm coin...

In Stock
[Buy Now](https://www.adafruit.com/product/783)
[Related Guides to the Product](https://learn.adafruit.com/products/783/guides)
### Stainless Medium Conductive Thread - 3 ply - 18 meter/60 ft

[Stainless Medium Conductive Thread - 3 ply - 18 meter/60 ft](https://www.adafruit.com/product/641)
After months of searching, we finally have what we consider to be the ultimate conductive thread. It's thin, strong, smooth, and made completely of 316L stainless steel. Once you start working with this thread you'll quickly agree its optimal for any wearables work!  
  
This...

In Stock
[Buy Now](https://www.adafruit.com/product/641)
[Related Guides to the Product](https://learn.adafruit.com/products/641/guides)
### CR2032 Lithium Coin Cell Battery

[CR2032 Lithium Coin Cell Battery](https://www.adafruit.com/product/654)
A perfect match for our [sew-able coin cell holder](http://www.adafruit.com/products/653). This non-rechargeable coin cell is CR2032 sized: 20mm diameter, 3.2mm thick. It has a nominal voltage output of 3V (although it starts a little high at 3.2V and slowly drifts down to 2.5V as...

In Stock
[Buy Now](https://www.adafruit.com/product/654)
[Related Guides to the Product](https://learn.adafruit.com/products/654/guides)

## Related Guides

- [Disco Band Camp Jacket](https://learn.adafruit.com/disco-band-camp-jacket.md)
- [NeoPixels on Raspberry Pi](https://learn.adafruit.com/neopixels-on-raspberry-pi.md)
- [Build your own Borg (BYOB)](https://learn.adafruit.com/build-your-own-borg-byob.md)
- [NeoPixel Tiara](https://learn.adafruit.com/neopixel-tiara.md)
- [Gemma M0 Sheikah Pendant](https://learn.adafruit.com/gemma-m0-sheikah-pendant.md)
- [NeoPixel Coat Buttons](https://learn.adafruit.com/neopixel-coat-buttons.md)
- [NeoPixie Dust Bag](https://learn.adafruit.com/neopixel-pixie-dust-bag.md)
- [Light-Up Angler Fish Embroidery](https://learn.adafruit.com/light-up-angler-fish-embroidery.md)
- [Gemma LightTouch](https://learn.adafruit.com/gemma-lighttouch.md)
- [CircuitPython Essentials](https://learn.adafruit.com/circuitpython-essentials.md)
- [Close Encounters Hat](https://learn.adafruit.com/close-encounters-hat.md)
- [Clockwork Goggles](https://learn.adafruit.com/gemma-m0-clockwork-goggles.md)
- [Washing Wearable Electronics](https://learn.adafruit.com/washing-wearable-electronics.md)
- [Trinket / Gemma Blinky Eyes](https://learn.adafruit.com/trinket-gemma-blinky-eyes.md)
- [3D Printed LED Buckle](https://learn.adafruit.com/3d-printed-led-buckle.md)
