My Hat, It's Full of Stars!




Introduction: My Hat, It's Full of Stars!

Top hats are cool; just like bow ties.  Not only are they stylish, but they give you a lot of room for incorporating techno goodness.  I recently had cause to buy a tuxedo, which necessitated a kilt, and then a top hat.  You know how it goes.  To the tux I added silver buttons, the kilt was exemplary on its own, so only the top hat needed some flash.  I decided that since my head is generally in the stars, I should try filling my hat with stars.  Initially I was going to use an arduino and some 1W white LEDs hanging off the PWM lines, and feeding the light through fiber optic lines, to create a twinkling effect.  By the time I started work on the project I realized that I wanted colors, and that 1W LEDs were going to drain my LiPo battery pretty darn fast.  Multiple color LEDs on a single arduino is a bit of a problem, though.  There are only six PWM channels, so I would max out at two RGB LEDs.  Fortunately I had a few sample Total Control Lighting control chips from Cool Neon in my kit, and with a little hacking they are perfect light sources for this project.  Each TCL chip is a latching, addressable, three-channel PWM controller; so I can control a near infinite number of RGB LEDs from a single arduino.  Hat space is limited though, so I settled on four; that provided sufficient variety.  The end result of my project is a super-stealth techno-mage top hat that looks amazing when it is turned on, and completely normal when it is turned off.  I can wear it to Dicken's Chrismas Fair and nobody will notice, or to That Thing In The Desert where everyone will notice; one hat for all occasions.

I built this project on-site at Burning Man, with only the tools and parts I had in my travel kit.  You should be able to complete this project in two days, accounting for glue drying, using easily available parts for less than $200.

tl;dr This article will walk you through every step necessary for adding multi-color dynamic fiber optic lighting to your hat, or any other project to which you want to give a star field effect.

tags:  SteamPunk, Arduino, TopHat, LEDs, TCL, PWM

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Parts

Almost everything used to make this project is 'off the shelf'. While something may not already be in your toolkit, there isn't anything here that will be hard to find or for which you won't be clever enough to make a substitution. :)

- Top Hat (Amazon) ($79)
- Optical fibers (I used 156 x .03" fibers I had in my kit, cut to around 12") (ebay) (1' = $12.95) (For my most recent hat, I purchased my surplus fiber from this guy on eBay. Here's a link to his store.)
- 4x Cool Neon TCL controller chips (Not on their website, but $2 w/LED if you call them directly) (4x$2 = $8)
- 4x 8mm RGB common anode LEDs. (Got mine from Cool Neon, paired with the TCL controller chips)
- 2000mAh Lithium Polymer rechargeable battery (Cool Neon / Seeed Studios) ($12)
- LiPo Rider recharging module (Cool Neon / Seeed Studios) ($9.50)
- Seeeduino (Cool Neon / Seeed Studios) ($27)
- 40-pin IDE cable (junk drawer)
- bits of velcro (Home Despot)
- 1/4" heat-shrink tubing (Cool Neon - Ask, and they'll throw some in with your order.)
- 2x short USB to USB-mini cables
- 3"x2" piece of cardboard

Cost of major parts (including hat): $159.50

Step 2: Tools

Everything here should be fairly standard.  The one item here that will probably need to be substituted out is the hypodermic needle.  Threading the fiber optics is a lot easier with a needle that has a dimple in the point, but any large needle should do, with a little extra care.

- Computer with Arduino IDE installed, and internet access to download libraries and code.
- Wire strippers
- Needle nose pliers
- Soldering iron
- adjustable clamp stand
- 28 gauge hypodermic needle (Any thick craft needle will do, but the hollow tip of a hypodermic needle makes it easier to lead the optic fiber back through the hole)
- small paintbrush
- flush-cut wire cutters
- heat gun
- electrical tape
- wood glue (Home Despot)
- Liquid Electrical Tape (Home Despot)
- solder
- masking tape
- zip ties

Step 3: Secure the Optical Fibers to the LEDs

It's a bit easier to do this step before the LEDs have been attached to the TCL chips. 

- Cut four 2" pieces of 1/4" shrink tubing. 

- Fit the shrink wrap over the light emitting end of the LEDs.  You may need to stretch it out just a little more with the needle nose pliers.

I suggest doing the following steps one LED at a time:

- Pack the open end of the shrink wrap with optical fibers. 

- Using the .03" fibers that I had on hand, this came out to around 40 fibers per LED. 

- Heat shrink the tubing around the fibers, and very carefully around the LED as well. 

- For extra strength, wrap some electrical tape around the shrink wrap and LED.

-I bound the shrink wrap with zip ties over the LED and the fibers, to provide extra support.

Step 4: Wire Up the TCL Chips

The key to this project is the TCL controller modules.  Without them, I'd be limited to six monochrome LEDs, or two RGB LEDs, because the 'standard' Arduino only has six PWM pins.  By daisy chaining TCL modules, I can hang a spectacularly large number of RGB LEDs off a mere two pins, leaving me plenty of other input and output pins. 

TCL controller modules are four connectors on the front, and four on the back, for communication:  Ground, Clock, Data, +5V
These are daisy chained from chip to chip, simply matching the corresponding connections.  The order is reversed on the back, but I think the pictures below will be better than a thousand words of explanation.

When bought in quantity they come in a perforated block. I left the chips in a solid four chip strip to minimize footprint.

- Cut a four-conductor strip off a spare IDE cable.  I used an old 40-pin cable, because they have wire than the newer 80-pin cables. 

- Cut this into one six inch segment, and three two inch segments.

- Strip the ends of all segments back about 1/8 of an inch.

- Solder the six inch segment to the chip side of the TCL module you are designating to be #1 in the series.

- On the reverse side, solder one end of each of the two inch strips to modules number 1, 2 and 3.

- Back to the front, solder the free ends of the two inch strips to modules 2, 3 and 4 on the corresponding pins.

Now that you have the TCL chips daisy chained, with a six inch control lead, we are ready for the LEDs.  I mounted my LEDs alternating front, back, front, back; to make running the optical fibers evenly a bit easier.

- Align the cathode pin with the hole marked +5, and the rest of the pins line up.

- Push the leads through the hole as far as you can, solder and cut them.

Step 5: Wire the TCL Chips to the Controller

Let's wire up the kit and test it out. I soldered my wiring to the Seeeduino, but you can temporarily use the shield connectors to test.

- Split the ribbon into four separate wires, about two inches from the free end.

Working the wires left to right, as connected to the chip-side of TCL module #1

- connect wire 1, GND, to GND on the Seeeduino

- connect wire 2, clock, to pin 13 on the Seeeduino

- connect wire 3, data, to pin 11 on the Seeeduino

- connect wire 4, +5, to +5 on the Seeeduino

At this point, we should be ready to program and test.

- Download the TCL library and install it into your IDE.

- Download the TopHat sketch, and open it in your IDE.

- Use the IDE to download the TopHat sketch to your Seeeduino.

Once it finishes downloading, the sketch should automatically start, and you will notice that the fiber optic bundles are color cycling.

Step 6: Tying the Electronics Together

The power supply for this project is pretty simple.  I taped a LiPo Rider charging module to a 2000mAh Lithium Polymer battery, with a piece of cardboard as an insulator so the solder points on the bottom of the LiPo Rider can not damage the battery casing.

The LiPo Rider is a nifty module.  It does USB pass-thru, so you can power and program your Arduino/Seeeduino without disengaging the LiPo Rider.  While you are working on your project, the LiPo rider is charging your battery.  The LiPo Rider will also accept power from solar cells, for charging.  For complete details, check out the LiPo Rider wiki page.

- Cut a piece of cardboard to the size of the LiPo Rider, sandwich between the LiPo Rider and the 2000mAh battery, and secure with electrical tape.

- Connect the Lithium Polymer battery connector to the BATT terminal on the LiPo Rider

- Connect the LiPo Rider and Seeeduino together using a short USB cable

- Flip the LiPo Rider switch to the on position, to verify that your Seeeduino and LEDs are receiving power.  Once tested, flip the switch off to conserve power.

Step 7: Stuffing the Hat

Since I didn't plan on having any stars on the top of the hat, I chose this as the place to secure the electronics.  These steps assume the LiPi Rider and Seeeduino are still connected by a USB cable, for the last section.

- Place the top hat upside down on a clean flat surface.

- Attach some Velcro the 'top' side of the LEDs, wiht top defined as the part furthest from the ribbon cables.

- Attach velcro to the bottom side of the Seeeduino and the LiPo battery.

- Peel the backing off the Velcro.

- Secure the TCL/LED module to the center of the flat space at the 'bottom' of the hat.

- Secure the LiPo battery and Seeeduino to the sides of the LED array.

- Attach a mini USB cable to the LiPo Rider.  We'll leave this attached permanently, as a way to charge the battery and re-program the effects.  Tape the free end of this cable to the outside of the hat using masking tape.

My apologies about this picture.  I forgot to take one immediately after securing the electronics, but before threading some of the optics.  You'll get the idea though.

Step 8: Threading the Optics

This is by far the most tedious and time consuming part of this project.  Depending on the thickness of the optical fibers you chose, you've probably got 160+ optical fibers to thread through the hat and secure in place.    This phase is less step-by-step and more play it by ear, depending on the tools you are using and the way you want to stars to align.

I worked from the 'bottom' of the upside-down top hat.  I would randomly grab a fiber from one of the four bundles.  I would push my needle through from the outside, and then I would draw it back out following it with the chosen fiber.  I would pull as much slack out as I could, but I wouldn't draw it tight; you need some play in the fibers at this stage.  I worked around the hat in a circle, picking random placements; and then every cycle or two I would look for obvious gaps and fill them in.

You might want to create bands of like colors, or other patterns, and you will need to adjust your tactics accordingly.

After all the fibers are threaded through, you want to make sure you have enough slack in the hat to remove components in case you want to add to the design later.  You also need to be able to reach the power switch on the LiPo Rider.

Once you are happy with optics placement, it is time to glue it all down.  For the first pass I used carpenter's glue because it would bind well with the wool of the hat.  Using a small, but long, paint brush I applied glue to each fiber and a circle of hat around the point of penetration.  I gave this a day to dry.

Carpenter's glue can be pretty brittle, so I then used 'liquid electrical tape' to add a flexible layer on top of the anchoring glue.  Again using a brush, I painted over the carpenter's glue on the hat and fiber, and then a little further inward on the fiber for extra support.

Once I was sure the fibers were sufficiently secured, I used flush-cut clippers to trim the fibers flush with the surface of the hat.

OR...  You can leave the fibers swaying in the breeze.  The first night on the playa, before the glue was fully dried, I wore the hat out for a burn.  The fibers would swing in little circles every time I turned my head.  Everyone thought it was amazing, but since I wanted to wear the hat in other venues, I decided to trim them.  You might want to play with it for a while after the glue dries, and see which way you want to go.

And now you are ready for a night of trick-or-treating in your sparkly new hat.

Step 9: Final Touches...

I have a couple of last tweaks I want to make to my hat, that didn't make it into this tutorial.

1) Add a solar panel or two to the top, for self-charging.
2) Add a Cool Neon "Remote Shield" RF controller so I can change the programmed effects without taking off the hat.

I've added gamma correction, and code for working with the Cool Neon Latching Remote Module. Check it out at the github repo:

Have a suggestion for me? Please share it in the comments!

Thank you for your interest, and for making it to the last page. :)

Step 10: Supercharger!

If you want more variety in your colors, the NeoPixel FeatherWing could be just the thing for you. 32 RGB pixels, and the FeatherWing is Arduino compatible and includes a LiPo port with charging capabilities! The only bad thing is that it would be really hard to attach fiber optics to the pixels. That is, until now... Check out this 3d printable fiber optics guide designed for the NeoPixel Featherwing!

Make It Glow

Second Prize in the
Make It Glow

Hack It! Contest

Participated in the
Hack It! Contest

Halloween Props  Contest

Participated in the
Halloween Props Contest

2 People Made This Project!


  • LED Strip Speed Challenge

    LED Strip Speed Challenge
  • Sculpting Challenge

    Sculpting Challenge
  • Clocks Contest

    Clocks Contest

46 Discussions


4 years ago

Ooh, orbiting sun...neopixel did you put the neopixel strip around the band and have a yellow blip circling? That is a great addition.

I'm *finally* getting around to making one of these for myself and I'm super excited! I've got some ShiftBrite units lying around that I'm hoping to make work with it...they need 5.5-9v though, so I think I'll need to do something different about the power. If you're game, I've got two questions for you so far:

First, how bright are the LEDs that you used? the ShiftBrites that I have are apparently 8000mcd per color and having never done any fiber projects before I'm curious if you think they'll be bright enough to be noticeable under reasonable indoor lighting.

Second, you say you've added gamma correction...I've heard about gamma for years and never really understood what it is; could you point me at some resources to get my head around it, or explain what it changed about your hat?



Reply 4 years ago


Here are the output specs on the LEDs I am using:

Red = 3.3 Lumens/300 mcd
Green = 10 Lumens/1000 mcd,
Blue = 2.7 Lumens/300 mcd
(mcd calculation based on full 120 degree beam)

Looks like your LEDs will be a LOT brighter, which is a good thing. As it is, the ones I use a easily visible under normal lighting indoor conditions.

Gamma correction tries to correct for the difference between how PWM works and the way your eyes work. Logically, a a PWM value of 127 should be 50% of 255, but with the way our eyes perceive light that value of 127 looks way more than 50% lit. The folks at Adafruit have a nice writeup on it here:

Good luck with your project. Please let me know how it goes, and feel free to hit me up with any questions you have.


Reply 4 years ago

Oh, neat...that makes sense; I know I've heard our bodies sensory responses tend to be more -- logarithmic, I think it is -- than linear. Thanks for the Adafruit writeup!

I'll let you know how it goes! First task is probably to source some fibers and then to figure out how to attach them to the LEDs...(they're more pancake-y packages than yours, so I may have to get creative).


Reply 4 years ago

I got my last batch from this guy. Great selection, decent prices, and fast shipping:


Reply 4 years ago

Wonderful! I had no idea the range of sizes you could get for fibers! Would you recommend I go with the 0.75mm fiber that you used, or something larger or smaller?


Reply 4 years ago

Lots of factors to that decision. Thicker diameter means fewer light points, but they'll be brighter. Thinner means a lot more work feeding them through the holes and securing them.


Reply 4 years ago

Okay...nearly done I went with the 0.75mm fibers and printed up a guide for my starfield. I need to get my button properly debounced in my firmware to cycle modes, but I'm just now stuffing the hat.

I realized none of this was going to be removable and I wasn't sure how well my velcro would stick so I'm trying to glue things to the crown of the hat. It's...been a learning experience. For example: I've learned that contact cement does not stick PCBs to felt very well. It also kinda bleeds through. E6000, however seems like it's much more successful, so far.


Reply 4 years ago on Introduction

I've thought about making a few and putting them on Etsy, but I don't think I could charge enough to cover my labor. That's one of the reasons I put together the instructable, so that I could share the knowledge and let other people input the labor. :)



Reply 4 years ago on Introduction

this technical site is not for me… perhaps there is an easier tool kit… where the led lamp is already done, I just put the little lamps in the hat… :o))


Reply 4 years ago

A great ready made light source for smaller fiber optic projects are LED glowsticks. You are stuck with the colour programmes that are built in but they normally have a few different options. I just removed the platic hollow part and inserted the led end into a short lenght of flexible tube that i had stuffed with my fibers and glued all together with silicone sealant.


4 years ago

Chris I would be happy to tell you where you could get your components for alot less $.

So I've attached the fiber optics and everything and I'm trying to upload and test the code in order to cycle through the colors. It's uploading properly to my board and all of my connections are good - does anyone have any idea what might be wrong/has anyone else had the same issue?


Reply 5 years ago on Introduction

Howdy Rachel,

I'm happy to help you debug this. I've got a few questions:

1) Can you send me some close-up pictures of your rig? Close and clear enough that I can make out your wiring from the Arduino to the pixels?

2) You said it was lighting up. Can you describe that in more detail? Are all the pixels going white, are they turning on and then off, etc?

3) If I send you some sample code to use for debugging, would you be willing to install it and let me know the results?



5 years ago

So doctor who


7 years ago on Introduction

This is incredible. I was going to suggest a solar charger when you mentioned it with the lipo rider, but you're a step ahead of me there. Instead of the RF shield why not add a reed switch or Hall-effect sensor on an interrupt that cycles the programming? You can have a small magnet that you hold so you can change the effect when you tip the hat!

Or, even lower tech...hide a momentary switch behind the bow of the hat-band. Easier to accidentally trigger, but still really awesome. I might even break out the power switch to a more accessible location that way, too.



Reply 7 years ago on Introduction

I was going to run a bit of steel thread to the brim, and rig a capacitance sensor so I could change the lights by touching the brim. But then Benny at Cool Neon gave me a set of engineering prototypes for their new RF shield, and I decided it would be cooler to trigger changes in the hat without having to touch it.

I try to keep things simple, but when someone hands me free toys I feel compelled to make use of them. :)


Reply 7 years ago on Introduction

Hi Chris,
She is a beauty!
I am also in the hat making business and for my next project, I am looking at using a wireless solution. I like the "RF Remote" you are using - do you know when this would be an actual product for sale as my connections don't seem to run as deep as yours.


Reply 7 years ago on Introduction

I've been too busy with work lately to drop by the shop, but if you send an email to and tell them you are asking about the Arduino RF Remote Shield you saw on Instructables they can give you the latest info.