# Unicorn Hat with Moving Ears

## Introduction

https://youtu.be/tp-OT4Kkmxc

Turn yourself or someone you love&nbsp;into&nbsp;a magical animatronic rainbow unicorn. &nbsp;

The&nbsp;little girl in your life&nbsp;will very likely refuse to ever take this hat off. &nbsp;(But you can wear it yourself while she's sleeping. We&nbsp;won't tell anyone). &nbsp;

A joystick in the pocket controls servos inside the ears, and the Circuit Playground's onboard LEDs animate the magical glowing rainbow unicorn horn. &nbsp;

We've kept this project fairly simple -- it's a great first step into the world of robotics and servos. &nbsp;This technique will work on any animal hat with attached ears, so if your inner animal is a [panda](https://www.flashingblinkylights.com/panda-hat-with-light-up-arms-and-paw-mittens-sku-no-11815.html?gclid=CP2XyaeLutQCFUaNfgodK5gPsw) or a [fox](http://www.animalheadgear.com/products/Fox-Hat-with-Paws.html)&nbsp;or some&nbsp;[other critter](http://www.animalheadgear.com/categories/Plush-Hats/All-Hats-w-Paws/), go nuts. &nbsp;The world is your animatronic&nbsp;playground.

![](https://cdn-learn.adafruit.com/assets/assets/000/042/593/medium800/circuit_playground_horn_rainbow2.jpg?1497392706)

### Part: Circuit Playground Classic
quantity: 1
The Amazing Circuit Playground Board
[Circuit Playground Classic](https://www.adafruit.com/product/3000)

### Part: Micro Servos
quantity: 2
Tiny motors to drive the ears
[Micro Servos](https://www.adafruit.com/product/169)

### Part: Joystick
quantity: 1
Analog 2-axis Thumb Joystick with Button
[Joystick](https://www.adafruit.com/product/512)

### Part: Silicone Stranded Wire
quantity: 1
26 awg wire in 3-4 colors
[Silicone Stranded Wire](https://www.adafruit.com/product/1970)

### Part: Perma-Proto Breadboard
quantity: 1
Half Size Breadboard
[Perma-Proto Breadboard](https://www.adafruit.com/product/571)

To use standard AA batteries (safer, recommended if this will be worn by a child):

### Part: AA Battery Holder
quantity: 1
4xAA Battery Holder with Switch
[AA Battery Holder](https://www.adafruit.com/product/830)

or, for rechargeable power (longer life but slight fire hazard, use with knowledge of the risks):

### Part: LiPoly Battery
quantity: 1
Rechargeable 2500 mAh Battery
[LiPoly Battery](https://www.adafruit.com/product/328)

### Part: On/Off Switch
quantity: 1
Battery Extension Cable with On/off switch
[On/Off Switch](https://www.adafruit.com/product/3064)

### Part: Battery Charger
quantity: 1
Charger for LiPoly Battery
[Battery Charger](https://www.adafruit.com/product/1304)

# Other Materials

- Hat with Ears and pockets:&nbsp;I used this [Magicorn Hat&nbsp;from Smoko](https://www.smokonow.com/products/magicorn)
- 3mm Light Pipe:&nbsp;[I used these LED shoelaces from Flammi](https://www.amazon.com/gp/product/B00UMT9SOS/ref=oh_aui_detailpage_o02_s00?ie=UTF8&psc=1)
- 3d Printed Circuit Playground case: [download and print your own](https://www.thingiverse.com/thing:2383357) or [order from Shapeways](https://www.shapeways.com/product/LPL6HR6AX/circuit-playground-case-for-adafruit-unicorn-hat)

# Tools

- Soldering iron & accessories
- 3d Printer (optional)
- Heat Gun
- Hot Glue gun or E6000 glue
- Needle & thread

![](https://cdn-learn.adafruit.com/assets/assets/000/042/594/medium800/circuit_playground_unicorn_goat.jpg?1497392723)

# Unicorn Hat with Moving Ears

## Code

### Before You Start

If this is your first foray into the world of Arduino-based microcontrollers, you'll need to install some software first. Head over to the [Circuit Playground Lesson 0 guide](../../../../circuit-playground-lesson-number-0/install-software-linux?view=all#intro) for detailed installation and setup instructions. &nbsp;

You'll only need to do all this once!

### TiCo Servo&nbsp;Library

You will also need to install the **TiCoServo&nbsp;** library in Arduino (`Sketch > Include Library > Manage Libraries...`)

This library by Phil Burgess makes it possible to use servos and NeoPixel LEDs&nbsp;at the same time, driven from one Arduino board. [Head over to the TiCoServo LIbrary guide](../../../../neopixels-and-servos/the-ticoservo-library) to learn more about why we need this, and how it works.

### Upload Code

Once you've got everything installed and your computer can talk to the Circuit Playground, it's time to upload the code.

Plug your Circuit Playground into your computer and select the Circuit Plaground under `Tools > Boards`. &nbsp;Then select the Circuit Playground as the Port.

Copy and paste this code into a new Arduino window and click "upload".

```
/*------------------------------------------------------------------------
  Unicorn Hat sketch for Circuit Playground
  Reads a potentiometer on pin 10, moves servos (pin 9) 
  ------------------------------------------------------------------------*/

#include &lt;Adafruit_CircuitPlayground.h&gt;
#include &lt;Adafruit_TiCoServo.h&gt;

// Pin number for joystick. Only the "right side" pads work w/analog!
// And the numbering is unusual: for the pads labeled 12, 6, 9 and 10,
// set CONTROL_PIN to 11, 7, 9 or 10, respectively.
#define CONTROL_PIN 10

// Servo parameters. On Circuit Playground, only pins 9 and 10 are
// supported by the TiCoServo library.
// Servo position can be specified in degrees or in microseconds; library
// can distinguish between the two. The #defines below are reasonable
// min/max pulse durations (in microseconds) for many servos, but for
// maximum control you'll probably need to do some calibration to find
// the optimal range for your specific servos.
#define SERVO_PIN    9
#define SERVO_MIN 1000 // 1 ms pulse
#define SERVO_MAX 2000 // 2 ms pulse

// set currentSpeed to 0-4 to change the horn animation speed
static int speeds[] = { 5, 10, 50, 100 };
int currentSpeed = 1;

Adafruit_TiCoServo servo;

void setup(void) {
  servo.attach(SERVO_PIN, SERVO_MIN, SERVO_MAX);
  CircuitPlayground.begin(); 
  // Make it bright!
  CircuitPlayground.setBrightness(255);
}

void loop()  {

  // Servo control
  int a, x;
  a = analogRead(CONTROL_PIN);                  // 0 to 1023
  x = map(a, 0, 1023, SERVO_MIN, SERVO_MAX);    // Scale to servo range
  servo.write(x);                               // Move servo

  // Horn light control.  Make an offset based on the current millisecond count scaled by the current speed.
  uint32_t offset = millis() / speeds[currentSpeed];
  // Loop through each pixel and set it to an incremental color wheel value.
  for(int i=0; i&lt;10; ++i) {
    CircuitPlayground.strip.setPixelColor(i, CircuitPlayground.colorWheel(((i * 256 / 10) + offset) &amp; 255));
  }
  // Show all the pixels.
  CircuitPlayground.strip.show();
}
```

If all goes well, the lights on the Circuit Playground will come on in a rainbow cycle pattern. &nbsp;You can change the speed of the LED animation from within the code. &nbsp;Look for this line:

```
// set currentSpeed to 0-4 to change the horn animation speed
static int speeds[] = { 5, 10, 50, 100 };
int currentSpeed = 1;
```

Change currentSpeed to a number between 0-4, and watch for&nbsp;the difference in the neopixels.

You may also need to calibrate your servo response time. &nbsp;Look for these lines:

```
#define SERVO_MIN 1000 // 1 ms pulse
#define SERVO_MAX 2000 // 2 ms pulse
```

Servo position can be specified in degrees or in microseconds. &nbsp;The TiCoServo library can distinguish between the two. The #defines in the code&nbsp;are reasonable min/max pulse durations (in microseconds) for many servos, but for maximum control you&nbsp;may need to do some calibration to find the optimal range for your specific servos. &nbsp;

The code as-written works great for the micro servos recommended&nbsp;in this guide, but play with these numbers once you've got everything hooked up to change the range of motion for your ears.

# Unicorn Hat with Moving Ears

## Wiring Diagram

![](https://cdn-learn.adafruit.com/assets/assets/000/042/488/medium800/circuit_playground_unicorn_hat_wiring.jpg?1497297684)

# Servo Wiring

To keep this project simple, the two servos are wired to the same pins. &nbsp;They'll be synchronized and always move together.

# Joystick Wiring

Connect the joystick to the X-out pin for a left to right control action. &nbsp;If you'd prefer up-and-down action, use the Y-out pin instead.

# Wiring Constraints

The TiCoServo library limits which pins we can use&nbsp;for servos:&nbsp;pins 9 or&nbsp;10 only. Additionally, analog inputs (like the joystick) can only be read on Circuit Playground's&nbsp;"right side" pins: 12, 6, 9 or 10. Two of these overlap the servo-compatible pins, so it's really just pins 12 and 6&nbsp;that remain.

If you're planning to use more than&nbsp;pins 9-10 take note: Digital pin 12 is called A11 and digital pin 6 is called A7 so be sure to write your code appropriately.

[More about Circuit Playground's Pinouts](../../../../circuit-playground-lesson-number-0/alligator-pads-pinout)

With some planning it could be possible to control the ears independently and add lots more "expressions" in the finished project.&nbsp;However, for&nbsp;the scope of this intro project we've chosen to keep things simple, and have just one left-to-right control for both&nbsp;ears. It's a one-trick pony.

As you can see, though, it's still incredibly effective and fun! &nbsp;See where your imagination takes you.

![](https://cdn-learn.adafruit.com/assets/assets/000/042/489/medium800/circuit_playground_unicorn_layout.jpg?1497306906)

# Layout

This hat has two little attached pockets which are perfect for hiding the joystick and the battery. &nbsp;I recommend placing the joystick on the side with your non-dominant hand, since I've found it harder to sneak my dominant hand away&nbsp;to control the ears, as it's often busy holding things.

The Circuit Playground rests right under the horn so we can use its onboard NeoPixels&nbsp;for magical rainbow light.

# Unicorn Hat with Moving Ears

## 3d Printing

![](https://cdn-learn.adafruit.com/assets/assets/000/042/583/medium800/circuit_playground_Circuit_Playground_Unicorn_Hat_by_Firepixie_-_Thingiverse.png?1497387906)

[Download .stl from Thingiverse](https://www.thingiverse.com/thing:2383357)
The case prints in three pieces: &nbsp;the cover, the lid ring, and the base.

Download the files and print them out one at a time in white ABS or PLA. &nbsp;You won't need to use any supports.

Or, if you don't have access to a 3d printer you can [order a pre-printed case&nbsp;from Shapeways.](https://www.shapeways.com/product/LPL6HR6AX/circuit-playground-case-for-adafruit-unicorn-hat)

Temporarily attach the cover to the lid ring. &nbsp;Put your Circuit Playground inside the base, and screw the lid on.

Then, adjust the cover so that the holes align perfectly with the NeoPixels&nbsp;when the case is fully screwed closed.

Once you've got it perfect, glue the cover to the lid ring.

![circuit_playground_21_fitcp.jpg](https://cdn-learn.adafruit.com/assets/assets/000/042/586/medium640/circuit_playground_21_fitcp.jpg?1497388317)

# Unicorn Hat with Moving Ears

## Joystick Assembly

Place the joystick on top of the breakout board -- it only fits one way.

&nbsp;

Flip the board over and solder all the connections on the bottom side.

![circuit_playground_09_placejoystick.jpg](https://cdn-learn.adafruit.com/assets/assets/000/042/498/medium640/circuit_playground_09_placejoystick.jpg?1497309176)

![circuit_playground_10_solderjoystick.jpg](https://cdn-learn.adafruit.com/assets/assets/000/042/499/medium640/circuit_playground_10_solderjoystick.jpg?1497309190)

Solder the header pins into the breakout board. &nbsp;It's easiest to do this if you have a solderless breadboard to hold everything in place.

&nbsp;

Solder the header into a perma-proto breadboard, centering the joystick left to right but aligning it with the top edge, leaving a few pins open below the breakout board.

&nbsp;

Solder a very long wire into the VCC, G, and Xout pins. &nbsp;(Photo shows a wire in each of the 5 pins, but you only need those three for this project). &nbsp;These wires will need to reach from the pocket to the Circuit Playground, so give yourself plenty of slack.

![circuit_playground_11_solderjoystick2.jpg](https://cdn-learn.adafruit.com/assets/assets/000/042/500/medium640/circuit_playground_11_solderjoystick2.jpg?1497309256)

![circuit_playground_12_solderjoystick3.jpg](https://cdn-learn.adafruit.com/assets/assets/000/042/502/medium640/circuit_playground_12_solderjoystick3.jpg?1497309281)

![circuit_playground_13_wirejoystick.jpg](https://cdn-learn.adafruit.com/assets/assets/000/042/503/medium640/circuit_playground_13_wirejoystick.jpg?1497309297)

Put the hat on and put your hands in the pockets. &nbsp;Decide where you'd most like the joystick to be and make a small hole in the lining of the pocket for it to poke through. &nbsp;

&nbsp;

Cut a larger hole in the edge of the pocket lining and slip the breadboard assembly inside. &nbsp;Poke the mechanism&nbsp;through, then&nbsp;snap the plastic joystick&nbsp;onto the whole assembly.

&nbsp;

Stitch the breadboard in place using the mounting holes on either end.

![circuit_playground_14_threadjoystick.jpg](https://cdn-learn.adafruit.com/assets/assets/000/042/504/medium640/circuit_playground_14_threadjoystick.jpg?1497309514)

![circuit_playground_28_sewbreadboard.jpg](https://cdn-learn.adafruit.com/assets/assets/000/042/505/medium640/circuit_playground_28_sewbreadboard.jpg?1497309741)

Carefully cut a hole in the lining of the hat right at the crown of the head that's big enough to give yourself room to work.

Thread all the joystick wires up through the lining to the top of the head where the Circuit Playground is going to rest. &nbsp;

Temporarily attach the wires to the Circuit Playground with alligator clips, so you can test the servos in the next step.

# Unicorn Hat with Moving Ears

## Servo Ears Assembly

Carefully detach&nbsp;the unicorn horn and the ears from the hat with a thread ripper.

&nbsp;

Cut some craft foam the same shape as the ear but a little smaller. &nbsp;We'll use this to attach to the servo.

![circuit_playground_01_remove.jpg](https://cdn-learn.adafruit.com/assets/assets/000/042/490/medium640/circuit_playground_01_remove.jpg?1497308600)

![circuit_playground_02_earpattern.jpg](https://cdn-learn.adafruit.com/assets/assets/000/042/491/medium640/circuit_playground_02_earpattern.jpg?1497308610)

![circuit_playground_03_earfoam.jpg](https://cdn-learn.adafruit.com/assets/assets/000/042/492/medium640/circuit_playground_03_earfoam.jpg?1497308616)

Give the craft foam a bit of character with a curved shape and stitch it to the servo attachment piece.

&nbsp;

Slip the servo and foam inside the ear and sew it closed across the bottom.

&nbsp;

Repeat with the other ear.

![circuit_playground_04_foam_servo1.jpg](https://cdn-learn.adafruit.com/assets/assets/000/042/493/medium640/circuit_playground_04_foam_servo1.jpg?1497308790)

![circuit_playground_05_foam_servo2.jpg](https://cdn-learn.adafruit.com/assets/assets/000/042/494/medium640/circuit_playground_05_foam_servo2.jpg?1497308797)

![circuit_playground_06_ear.jpg](https://cdn-learn.adafruit.com/assets/assets/000/042/495/medium640/circuit_playground_06_ear.jpg?1497308809)

Attach some alligator clips to the three wires and hook them up to the Circuit Playground. &nbsp;Move the ear back and forth with the joystick and play around with proper placement on your hat. &nbsp;I ended up adding another little stitch to make my ears flop over a bit more.

&nbsp;

Once you're happy with placement, sew and/or glue the servo in place on the hat, hiding it inside the fabric. &nbsp; **Don't sew the EAR in place** -- it should be free to move! &nbsp;Just attach the servo.

![circuit_playground_07_adjustear.jpg](https://cdn-learn.adafruit.com/assets/assets/000/042/496/medium640/circuit_playground_07_adjustear.jpg?1497308936)

![circuit_playground_08_attachservo.jpg](https://cdn-learn.adafruit.com/assets/assets/000/042/497/medium640/circuit_playground_08_attachservo.jpg?1497308945)

It's alive! &nbsp;Hooray! &nbsp;Go find someone and show off a bit.

Not done yet though.. a magical animatronic unicorn must have a glowing horn. &nbsp;(I think that's some kind of law) &nbsp;Luckily our Circuit Playground comes equipped with lots of lights...

# Unicorn Hat with Moving Ears

## Unicorn Horn Assembly

![](https://cdn-learn.adafruit.com/assets/assets/000/042/595/medium800/circuit_playground_horn_rainbow.jpg?1497392748)

Each neopixel on the Circuit Playground's face lights one strand of light pipe, creating&nbsp;a gorgeous animated twisty twirly rainbow. &nbsp;The code we included is a simple rainbow animation, and you can customize it however you like. &nbsp;There's plenty of space on the Circuit Playground to add lots of color modes or animations, and they'll pretty much all look amazing.

Sculpting the horn took&nbsp;a few tries to get right, so you may want to order a few extra lengths of light pipe, even if you're super crafty. &nbsp;

My horn ended up about 6" long, so with a little extra for the twists and to have enough to trim evenly below the lid, I used around 80" of light pipe. &nbsp;The [Flammi shoelaces I ordered](https://www.amazon.com/gp/product/B00UMT9SOS/ref=oh_aui_detailpage_o02_s00?ie=UTF8&psc=1) are about 30" long, so it took almost three full laces. &nbsp; They come in pairs, so be sure to order at least two sets.

Decide how tall&nbsp;you'd like your horn to be. &nbsp;Add a couple inches to that measurement and cut 10 pieces of light pipe to that length.

&nbsp;

Thread the light pipe through the 10 holes on the Circuit Playground cover and hold them over the Circuit Playground to make sure all your light pipe is working with no kinks.

![circuit_playground_15_threadlightpipe.jpg](https://cdn-learn.adafruit.com/assets/assets/000/042/506/medium640/circuit_playground_15_threadlightpipe.jpg?1497310237)

![circuit_playground_16_testlightpipe.jpg](https://cdn-learn.adafruit.com/assets/assets/000/042/507/medium640/circuit_playground_16_testlightpipe.jpg?1497310253)

Pull each piece of light pipe through about another&nbsp;inch further than needed to reach the NeoPixels. &nbsp;When you twist the horn, the pipe will get pulled back out a little bit, so make sure you've got lots of extra. &nbsp;We'll trim it to the perfect length later.

Time to get artsy. &nbsp;Get out your heat gun and a pair of protective gloves.

&nbsp;

Twist and gently heat the light pipe with your heat gun. &nbsp;It will hold its shape as it cools. &nbsp;Take your time and go slowly! &nbsp;If you get the light pipe too hot it will melt and warp and cease to carry light very well. &nbsp;Be patient!

&nbsp;

I'm not very patient. &nbsp;After two or three discarded tries, I began using a tumbler of ice water for cold plunges, and had a bit more success. &nbsp;&nbsp;

![circuit_playground_17_twisthorn.jpg](https://cdn-learn.adafruit.com/assets/assets/000/042/508/medium640/circuit_playground_17_twisthorn.jpg?1497310492)

![circuit_playground_18_hornwater.jpg](https://cdn-learn.adafruit.com/assets/assets/000/042/509/medium640/circuit_playground_18_hornwater.jpg?1497310505)

To finish it off at the top, I trimmed each piece of light pipe&nbsp;slightly longer than the last in a spiral, and carefully melted them together. &nbsp;I left the very last piece extra long, then melted it with the heat gun&nbsp;and pulled, stretching it into a&nbsp;perfect point.

![circuit_playground_19_finishedhorn.jpg](https://cdn-learn.adafruit.com/assets/assets/000/042/513/medium640/circuit_playground_19_finishedhorn.jpg?1497311247)

Use a sharp pair of scissors or snips to trim the underside of the light pipes to 3mm, so they just touch the neopixels when the Circuit Playground is encased in its 3d housing.

![circuit_playground_20_lightedhorn.jpg](https://cdn-learn.adafruit.com/assets/assets/000/042/514/medium640/circuit_playground_20_lightedhorn.jpg?1497311466)

# Unicorn Hat with Moving Ears

## Power

The battery will live in the opposite pocket as the joystick. &nbsp;This makes the hat feel more balanced, and makes it easy to remove and change or charge the battery.

# AA&nbsp;Battery Option

The simplest and safest option for power is using four&nbsp;AA batteries in&nbsp;[this battery holder](https://www.adafruit.com/product/830?gclid=CPbdo9LkwNQCFYWFfgodM_AEgA). When using alkaline&nbsp;batteries, the output will be around 6v. &nbsp;This is perfect for our project.

Add a couple feet of wire so the battery holder reaches&nbsp;one of the hat pockets. This battery holder doesn’t include a JST plug…you can either [add one from the shop](https://www.adafruit.com/product/261), or solder the + and – wires directly to Circuit Playground’s&nbsp;VBATT and GND pins.

You should be able to use either alkaline or rechargeable batteries in this holder, but keep in mind that rechargeables have a slightly lower voltage so if your servos don't respond as well, try switching to alkaline.

# LiPoly Battery Option

For those who want a little more battery life without adding to our planet's overwhelming landfill problem, Adafruit sells [these fabulous Lithium Polymer batteries](https://www.adafruit.com/product/328). &nbsp;The 2500 mAh battery will give you 3.7+ volts for hours, and runs this project very nicely. &nbsp; The voltage is a little lower than recommended for servos, but we've found that it works just fine.&nbsp;

These batteries come with a protection circuit onboard, so you can run them down willy-nilly and recharge them hundreds of times, without worrying about the voltage dropping too low for recharging.&nbsp;&nbsp;They're smaller and lighter than AA batteries and easier to hide in costumes. &nbsp;Be sure to get a charger, and if you want to take your project to a weeklong festival with no power plugs, be sure to get&nbsp;a few&nbsp;batteries or get a AA holder as backup --&nbsp;you can't find these at the corner store.

They don't have an on/off switch included, so you'll want to add one. &nbsp;

**There are dangers that come&nbsp;with LiPoly batteries.** &nbsp;If the batteries get punctured or torn, or if they get wet, there's a chance they can catch fire. &nbsp;You may not want to use LiPoly if you're making this project for a little girl, or for anyone who's likely to spill on / drop / engage in&nbsp;fisticuffs in&nbsp;this costume. &nbsp;

# Battery Cable Extension
Cut the female end off the power switch and splice in&nbsp;about 3 feet of wire, enough to reach the Circuit Playground / horn assembly. &nbsp;

&nbsp;

Cut a small hole in the pocket lining and thread the switch and wires through, leaving the male connector accessible to plug in your LiPoly battery.

&nbsp;

Thread the female end inside the lining up to the Circuit Playground.

![circuit_playground_25_switch.jpg](https://cdn-learn.adafruit.com/assets/assets/000/042/522/medium640/circuit_playground_25_switch.jpg?1497312209)

![circuit_playground_27_batteryconnector.jpg](https://cdn-learn.adafruit.com/assets/assets/000/042/525/medium640/circuit_playground_27_batteryconnector.jpg?1497312326)

If you're using a LiPoly battery you can plug it directly into the other end of the battery extension cable. &nbsp;If you're using the AA option, cut off the male connector and connect the battery holder directly to the extension cable wires -- red to red and black to black.

# Unicorn Hat with Moving Ears

## Putting it All Together

Place the Circuit Playground inside the case bottom to be sure it fits and snaps neatly down onto the three pillars.

&nbsp;

Remove it, and thread all the wires through the hole on the side of the case.

![circuit_playground_21_fitcp.jpg](https://cdn-learn.adafruit.com/assets/assets/000/042/515/medium640/circuit_playground_21_fitcp.jpg?1497311579)

![circuit_playground_22_threadwires.jpg](https://cdn-learn.adafruit.com/assets/assets/000/042/516/medium640/circuit_playground_22_threadwires.jpg?1497311590)

Solder all the wires in place according to the wiring diagram. &nbsp;You'll have 2 wires going to BATT, 3 wires going to G, and two going to pin 9. &nbsp; There will be one wire each on 3.3v and pin 10.

![circuit_playground_23_wiredcp.jpg](https://cdn-learn.adafruit.com/assets/assets/000/042/518/medium640/circuit_playground_23_wiredcp.jpg?1497311703)

Note: It's a bit of a tight fit in the case, so it works best to solder the wires from the TOP of the Circuit Playground rather than the bottom.

Plug your battery in, switch it on, and be sure everything is working properly. &nbsp;

Slide the horn through the hole in the top of the hat and sew it in place. &nbsp;Wrap the threads around and between the light pipe strands rather than piercing them with your needle.

![circuit_playground_24_sewhorn.jpg](https://cdn-learn.adafruit.com/assets/assets/000/042/519/medium640/circuit_playground_24_sewhorn.jpg?1497311888)

Finish by stitching any holes in the lining closed so that all wires are hidden. &nbsp;

Put your hat on and listen to the left. &nbsp;Listen to the right. &nbsp;Can you hear the magical rainbows all around you?

![](https://cdn-learn.adafruit.com/assets/assets/000/042/596/medium800/circuit_playground_cave-side1.jpg?1497393481)


## Featured Products

### Circuit Playground Classic

[Circuit Playground Classic](https://www.adafruit.com/product/3000)
Would you like to learn electronics, with an all-in-one board that has sensors and LEDs built in? **Circuit Playground** is here - and it's the best way to practice programming on real hardware with no soldering or sewing required!

This is the **Classic**...

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

[Micro servo](https://www.adafruit.com/product/169)
Tiny little servo can rotate approximately 180 degrees (90 in each direction) and works just like the standard kinds you're used to but _smaller_. You can use any servo code, hardware, or library to control these servos. Good for beginners who want to make stuff move without...

Out of Stock
[Buy Now](https://www.adafruit.com/product/169)
[Related Guides to the Product](https://learn.adafruit.com/products/169/guides)
### Analog 2-axis Thumb Joystick with Select Button + Breakout Board

[Analog 2-axis Thumb Joystick with Select Button + Breakout Board](https://www.adafruit.com/product/512)
This mini-kit makes it easy to mount a PSP/Xbox-like thumb joystick to your project. The thumbstick is an analog joystick - more accurate and sensitive than just 'directional' joysticks - with a 'press in to select' button. Since it's analog, you'll need two analog...

In Stock
[Buy Now](https://www.adafruit.com/product/512)
[Related Guides to the Product](https://learn.adafruit.com/products/512/guides)
### Silicone Cover Stranded-Core Wire - 26AWG in Various Colors

[Silicone Cover Stranded-Core Wire - 26AWG in Various Colors](https://www.adafruit.com/product/1970)
Silicone-sheathing wire is super-flexible and soft, and it's also strong! Able to handle up to 200°C and up to 600V, it will do when PVC covered wire wimps out. We like this wire for being extremely supple and flexible, so it is great for wearables or projects where the wire-harness...

Out of Stock
[Buy Now](https://www.adafruit.com/product/1970)
[Related Guides to the Product](https://learn.adafruit.com/products/1970/guides)
### Adafruit Perma-Proto Half-sized Breadboard PCB - 3 Pack!

[Adafruit Perma-Proto Half-sized Breadboard PCB - 3 Pack!](https://www.adafruit.com/product/571)
Customers have asked us to carry basic perf-board, but we never liked the look of most basic perf: its always crummy quality, with pads that flake off and no labeling. Then we thought about how people **actually** prototype - usually starting with a solderless breadboard and then...

In Stock
[Buy Now](https://www.adafruit.com/product/571)
[Related Guides to the Product](https://learn.adafruit.com/products/571/guides)
### JST 2-pin Extension Cable with On/Off Switch - JST PH2

[JST 2-pin Extension Cable with On/Off Switch - JST PH2](https://www.adafruit.com/product/3064)
By popular request - we now have a way you can turn on-and-off Lithium Polymer batteries without unplugging them.

This **PH2 Female/Male&nbsp;JST 2-pin Extension Cable&nbsp;** comes with an in-line **Switch** - click once to turn on, click again to turn off....

In Stock
[Buy Now](https://www.adafruit.com/product/3064)
[Related Guides to the Product](https://learn.adafruit.com/products/3064/guides)
### 4 x AA Battery Holder with On/Off Switch

[4 x AA Battery Holder with On/Off Switch](https://www.adafruit.com/product/830)
Make a nice portable power pack with this 4 x AA battery holder. It fits any alkaline or rechargeable AA batteries in series. There's a snap on cover and an on/off switch which can be handy when wiring to something without a switch.

**New**! We now have 0.1" headers...

In Stock
[Buy Now](https://www.adafruit.com/product/830)
[Related Guides to the Product](https://learn.adafruit.com/products/830/guides)
### Lithium Ion Polymer Battery - 3.7v 2500mAh

[Lithium Ion Polymer Battery - 3.7v 2500mAh](https://www.adafruit.com/product/328)
Lithium-ion polymer (also known as 'lipo' or 'lipoly') batteries are thin, light, and powerful. The output ranges from 4.2V when completely charged to 3.7V. This battery has a capacity of **2500mAh** for a total of about 10 Wh. If you need a smaller battery, <a...></a...>

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

## Related Guides

- [Introducing Circuit Playground](https://learn.adafruit.com/introducing-circuit-playground.md)
- [DIY Bluetooth Gamepad](https://learn.adafruit.com/diy-bluetooth-gamepad.md)
- [Circuit Playground Sound and Music](https://learn.adafruit.com/circuit-playground-music.md)
- [Collin's Lab: Breadboards & Perfboards](https://learn.adafruit.com/collins-lab-breadboards-and-perfboards.md)
- [Circuit Playground Bike Glove](https://learn.adafruit.com/circuit-playground-bike-glove.md)
- [Mystery Box: The Freefall Deck](https://learn.adafruit.com/mystery-box-freefall-deck.md)
- [Secret Knock Activated Drawer Lock](https://learn.adafruit.com/secret-knock-activated-drawer-lock.md)
- [Animated Snake Eyes Bonnet for Raspberry Pi](https://learn.adafruit.com/animated-snake-eyes-bonnet-for-raspberry-pi.md)
- [Circuit Playground D6 Dice](https://learn.adafruit.com/circuit-playground-d6-dice.md)
- [Fidget Spinner Tachometer](https://learn.adafruit.com/fidget-spinner-tachometer.md)
- [Circuit Playground & Fiber Optics](https://learn.adafruit.com/circuit-playground-light-pod.md)
- [Circuit Playground Fruit Drums](https://learn.adafruit.com/circuit-playground-fruit-drums.md)
- [NeoPix Arcade Kit - 1D Arcade Game System - Circuit Playground](https://learn.adafruit.com/neopix-arcade-kit-1d-arcade-game-system-circuit-playground.md)
- [Pro Trinket as a USB HID Mouse](https://learn.adafruit.com/pro-trinket-usb-hid-mouse.md)
- [Light Paintbrush with Circuit Playground](https://learn.adafruit.com/lightpaint-cplay.md)
