# NeoPixel Tiara

## Overview

http://youtu.be/gBRODuwfYy4

You can make a crown of light for prom or your birthday this year! A few free-wired NeoPixels make you the cyber-pageant queen.  
  
For this project you will need:

- [Gemma M0](https://www.adafruit.com/product/3501) or&nbsp;[GEMMA v2 wearable microcontroller](http://www.adafruit.com/products/1222 "Link: http://www.adafruit.com/products/1222") (or build on the [GEMMA Starter Pack](http://www.adafruit.com/products/1657))
- seven [sewable NeoPixels](http://www.adafruit.com/products/1260) (or any combination of [pixels](http://www.adafruit.com/category/37_168), NeoPixel rings, or high-density NeoPixel strip) Use "RGB" NeoPixel rings, not "RGBW" type!
- [2x2032 coin cell battery holder](http://www.adafruit.com/products/783 "Link: http://www.adafruit.com/products/783") and [batteries](http://www.adafruit.com/products/654) or [rechargeable lipoly battery](http://www.adafruit.com/products/1317)
- zip ties & hot glue
- [3D printed band, crown](http://www.thingiverse.com/thing:237034), or recycled stiff headband
- [solid core hookup wire](http://www.adafruit.com/products/290)
- sharp [wire strippers](http://www.adafruit.com/products/527)
- sharp [flush snips](http://www.adafruit.com/products/1368)

Glamour shots by Andrew Tingle.

Info: 

Before you get started, follow the&nbsp;[Gemma M0 guide](../../../../adafruit-gemma-m0/circuitpython-digital-in-out?view=all)&nbsp;or the&nbsp;[Classic Introducing&nbsp;GEMMA guide](../../../../introducing-gemma/introduction)&nbsp;

![](https://cdn-learn.adafruit.com/assets/assets/000/013/835/medium800/gemma_Pixel_Tiara_443.jpg?1390941702)

# NeoPixel Tiara

## Build it!

![](https://cdn-learn.adafruit.com/assets/assets/000/013/856/medium800/gemma_tiara-diagram.png?1391019801)

Info: 

Above is the circuit diagram for the simple tiara. All ground pads are connected to GND on GEMMA, likewise all power pads are connected to Vout on GEMMA, and data lines are chained from D1 to the inward facing arrow on the first pixel, then from each pixel's outward facing arrow to the next pixel's inward facing arrow.

Strip the insulation from a long piece of solid-core hookup wire and clip it to one side of your headband. This will be the pixels' ground bus.  
  
Insert perpendicular wires through holes in the headband and curl their stripped ends around the long ground bus wire.  
  
Crimp wire connections with pliers.

![gemma_pixel-tiara-adafruit-01.jpg](https://cdn-learn.adafruit.com/assets/assets/000/013/830/medium640/gemma_pixel-tiara-adafruit-01.jpg?1390939427)

![gemma_pixel-tiara-adafruit-02.jpg](https://cdn-learn.adafruit.com/assets/assets/000/013/831/medium640/gemma_pixel-tiara-adafruit-02.jpg?1390939564)

![gemma_pixel-tiara-adafruit-03.jpg](https://cdn-learn.adafruit.com/assets/assets/000/013/832/medium640/gemma_pixel-tiara-adafruit-03.jpg?1390940717)

![gemma_pixel-tiara-adafruit-04.jpg](https://cdn-learn.adafruit.com/assets/assets/000/013/833/medium640/gemma_pixel-tiara-adafruit-04.jpg?1390941011)

Be sure wire connections are tidy enough to nest snugly against the hair band, and solder connections in place.

![gemma_pixel-tiara-adafruit-05.jpg](https://cdn-learn.adafruit.com/assets/assets/000/013/834/medium640/gemma_pixel-tiara-adafruit-05.jpg?1390941619)

![gemma_pixel-tiara-adafruit-06.jpg](https://cdn-learn.adafruit.com/assets/assets/000/013/837/medium640/gemma_pixel-tiara-adafruit-06.jpg?1390945370)

![gemma_pixel-tiara-adafruit-07.jpg](https://cdn-learn.adafruit.com/assets/assets/000/013/838/medium640/gemma_pixel-tiara-adafruit-07.jpg?1390947713)

Trim wires to the silhouette you like, then strip the ends. Bend the stripped ends over and hand the NeoPixels from them (through the pad marked -). Solder all NeoPixels, making sure they're facing the same way.

![gemma_pixel-tiara-adafruit-08.jpg](https://cdn-learn.adafruit.com/assets/assets/000/013/841/medium640/gemma_pixel-tiara-adafruit-08.jpg?1390948745)

![gemma_pixel-tiara-adafruit-09.jpg](https://cdn-learn.adafruit.com/assets/assets/000/013/844/medium640/gemma_pixel-tiara-adafruit-09.jpg?1390949806)

![gemma_pixel-tiara-adafruit-10.jpg](https://cdn-learn.adafruit.com/assets/assets/000/013/846/medium640/gemma_pixel-tiara-adafruit-10.jpg?1390953269)

![gemma_pixel-tiara-adafruit-13.jpg](https://cdn-learn.adafruit.com/assets/assets/000/013/847/medium640/gemma_pixel-tiara-adafruit-13.jpg?1390953442)

Next use bits of wire in the shape of staples to connect up the data lines.

![gemma_pixel-tiara-adafruit-14.jpg](https://cdn-learn.adafruit.com/assets/assets/000/013/848/medium640/gemma_pixel-tiara-adafruit-14.jpg?1390954224)

Solder wires from the + side of each pixel, and cut to length. Strip the ends and solder to one long power bus.

![gemma_pixel-tiara-adafruit-15.jpg](https://cdn-learn.adafruit.com/assets/assets/000/013/849/medium640/gemma_pixel-tiara-adafruit-15.jpg?1390971265)

![gemma_pixel-tiara-adafruit-16.jpg](https://cdn-learn.adafruit.com/assets/assets/000/013/850/medium640/gemma_pixel-tiara-adafruit-16.jpg?1390971810)

Connect power, ground, and data lines to GEMMA at the input end of the pixel chain. Plug in over USB and program it up! This basic sketch flashes the seven pixels randomly:

![gemma_pixel-tiara-adafruit-17.jpg](https://cdn-learn.adafruit.com/assets/assets/000/013/851/medium640/gemma_pixel-tiara-adafruit-17.jpg?1390974790)

![gemma_pixel-tiara-adafruit-21.jpg](https://cdn-learn.adafruit.com/assets/assets/000/013/852/medium640/gemma_pixel-tiara-adafruit-21.jpg?1390975760)

![](https://cdn-learn.adafruit.com/assets/assets/000/013/857/medium800/gemma_pixel-tiara-adafruit-00.jpg?1391020338)

Get creative with your tiara design! This one uses a NeoPixel ring in the center, and the wiring is barely different than above.

# NeoPixel Tiara

## Arduino Code

Info: 

[Click to Download the NeoPixel Library](https://github.com/adafruit/Adafruit_NeoPixel/archive/master.zip)
Installing Arduino libraries is a frequent stumbling block. If this is your first time, or simply needing a refresher, please read the&nbsp;[All About Arduino Libraries](http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use)&nbsp;tutorial.[![](../../../../assets/divider_icon-45a76f14a0234c47f43488c60c9d77a1701a0ff9f3a09498809a26305ce3df23.gif)](../../../../neopixel-punk-collar/3634)If the library is correctly installed (and the Arduino IDE is restarted), you should be able to navigate through the “File” rollover menus as follows:  
  
**File→Sketchbook→Libraries→Adafruit\_NeoPixel→strandtest**  
  
Connect up your NeoPixels in a solderless breadboard and use alligator clips to attach to GEMMA, referring to the circuit diagram if necessary.  
  
You’ll need to change a few lines in the code regarding the data pin (1), type of pixels (RGB vs GRB), and number of pixels (5). The resulting (and slightly simplified) code is below:

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/NeoPixel_Tiara/NeoPixel_Tiara.ino

From the&nbsp; **Tools→Board** &nbsp;menu, select&nbsp;the&nbsp;device you are using: **&nbsp;**

- **Adafruit Gemma M0**
- **Adafruit Gemma 8 MHz** &nbsp;

Connect the USB cable between the computer and your device. The original Gemma (8 MHz) need the reset button pressed on the board, then click the upload button (right arrow icon) in the Arduino IDE. You do not need to press the reset on the newer Gemma M0.

When the battery is connected, you should get a light show from the LEDs. All your pixels working? Great! You can take apart this prototype and get ready to put the pixels in the collar. Refer to the&nbsp;[NeoPixel Uberguide](../../../../adafruit-neopixel-uberguide)&nbsp;for more info.

# NeoPixel Tiara

## CircuitPython Code

![](https://cdn-learn.adafruit.com/assets/assets/000/047/423/medium800/adafruit_gemma_gemma-cp.jpg?1508355373)

 **GEMMA&nbsp;M0** &nbsp;boards can&nbsp;run&nbsp; **CircuitPython** &nbsp;— a different approach to programming compared to Arduino sketches. In fact,&nbsp; **CircuitPython comes&nbsp;factory pre-loaded on GEMMA&nbsp;M0**. If you’ve overwritten it with an Arduino sketch, or just want to learn the basics of setting up and using CircuitPython, this is explained in the&nbsp;[**Adafruit GEMMA&nbsp;M0 guide**](../../../../adafruit-gemma-m0/circuitpython-setup-1).

Info: 

Below is CircuitPython code that works&nbsp;similarly (though not exactly the same) as the Arduino sketch shown on a prior page. To use this, plug the GEMMA M0 into USB…it should show up on your computer as a small&nbsp; **flash drive** …then edit the file “ **code.py** ” with your text editor of choice. Select and copy the code below and paste it into that file,&nbsp; **entirely replacing its contents** &nbsp;(don’t mix it in with lingering bits of old code). When you save the file, the code should&nbsp; **start running almost immediately** &nbsp;(if not, see notes at the bottom of this page).

**If GEMMA M0 doesn’t show up as a&nbsp;drive, follow the GEMMA M0 guide link above to prepare the board for CircuitPython.**

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

This code requires the&nbsp; **neopixel.py** &nbsp;library. A factory-fresh board will have this already installed. If you’ve just reloaded the board with CircuitPython, create the “lib” directory and then&nbsp;[download neopixel.py from Github](https://github.com/adafruit/Adafruit_CircuitPython_NeoPixel).

[Download neopixel.py from GitHub](https://github.com/adafruit/Adafruit_CircuitPython_NeoPixel)
# NeoPixel Tiara

## Wear it!

![](https://cdn-learn.adafruit.com/assets/assets/000/013/836/medium800/gemma_Pixel_Tiara_465.jpg?1390941692)

Plug in a coincell battery holder or rechargeable lipoly battery! You can pin the battery up into your hairdo or attach to the tiara with glue.   
  
Glamour shots by Andrew Tingle.


## 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)
### Adafruit GEMMA v2 - Miniature wearable electronic platform

[Adafruit GEMMA v2 - Miniature wearable electronic platform](https://www.adafruit.com/product/1222)
 **Deprecation Warning: The Gemma bit-bang USB technique it uses doesn't work as well as it did in 2014, many modern computers won't work well. So while we still carry the Gemma so that people can maintain some older projects, we no longer recommend it.** <a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/1222)
[Related Guides to the Product](https://learn.adafruit.com/products/1222/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)
### Solid-Core Wire Spool - 25ft - 22AWG - Black

[Solid-Core Wire Spool - 25ft - 22AWG - Black](https://www.adafruit.com/product/290)
Perfect for bread-boarding, free wiring, etc. This spool of solid-core wire is easy to solder to. When bent it keeps its shape pretty well. We like to have a few spools of this stuff around. We suggest picking up wire strippers to match. Wire gauge is 22 AWG which we've found is the best...

In Stock
[Buy Now](https://www.adafruit.com/product/290)
[Related Guides to the Product](https://learn.adafruit.com/products/290/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)
### Hakko Professional Quality 20-30 AWG Wire Strippers

[Hakko Professional Quality 20-30 AWG Wire Strippers](https://www.adafruit.com/product/527)
These are the finest wire strippers we have used, and if you have to do a lot of wiring, you will agree! They have soft rounded grips - very comfortable to use, and precision ground notches that do a perfect job every time. No more yanking or twisting to strip wires cleanly and quickly.<br...></br...>

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

[Flush diagonal cutters](https://www.adafruit.com/product/152)
These are the best diagonal cutters, large super-comfortable grip to use and have strong nippers for perfect trimming of wires and leads. I've used my pair every day for years.

In Stock
[Buy Now](https://www.adafruit.com/product/152)
[Related Guides to the Product](https://learn.adafruit.com/products/152/guides)
### Gemma M0 Starter Pack

[Gemma M0 Starter Pack](https://www.adafruit.com/product/1657)
Get started with Adafruit GEMMA with this lovely starter kit! Included is everything you need to make a basic project.&nbsp;There's a GEMMA M0, four sewable bright RGB pixels, a battery holder (coin cell batteries not included), 2-ply conductive thread, alligator clips to help you test...

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

## Related Guides

- [3D Printed Unicorn Horn](https://learn.adafruit.com/3d-printed-unicorn-horn.md)
- [3D Printed LED-Animation BMO](https://learn.adafruit.com/3d-printed-led-animation-bmo.md)
- [3D Printed LED Buckle](https://learn.adafruit.com/3d-printed-led-buckle.md)
- [3D Printed NeoPixel LED Gas Mask](https://learn.adafruit.com/3d-printed-el-wire-laser-neopixel-led-gas-mask.md)
- [3D Printed NeoPixel Ring Hair Dress](https://learn.adafruit.com/neopixel-ring-hair-dress.md)
- [NeoPixel Punk Collar](https://learn.adafruit.com/neopixel-punk-collar.md)
- [Starduino: 8-Bit Super Mario Tree Topper](https://learn.adafruit.com/starduino-neopixel-8-bit-mario-star-tree-topper.md)
- [Buzzing Mindfulness Bracelet](https://learn.adafruit.com/buzzing-mindfulness-bracelet.md)
- [Light-Activated Pixel Heart](https://learn.adafruit.com/light-activated-pixel-heart.md)
- [Light-Up Angler Fish Embroidery](https://learn.adafruit.com/light-up-angler-fish-embroidery.md)
- [Magic Storybook with ChatGPT](https://learn.adafruit.com/magic-storybook-with-chatgpt.md)
- [CircuitPython Basics: Analog Inputs & Outputs](https://learn.adafruit.com/circuitpython-basics-analog-inputs-and-outputs.md)
- [Jewel Hair Stick](https://learn.adafruit.com/jewel-hair-stick.md)
- [Close Encounters Hat](https://learn.adafruit.com/close-encounters-hat.md)
- [NeoPixel Jack-o-lantern](https://learn.adafruit.com/neopixel-jack-o-lantern.md)
