Glowy

Celebrate any occasion or spice up any costume with this edge-lit, customizable crown! You can change the letters on the laser cut "jewels" on this crown so that it can proudly declare why the wearer is awesome. Make one as a gift for birthday people, marathon finishers, newly graduated young adults, and anyone who deserves to be celebrated (including yourself!).

Parts

The Adafruit Trinket M0 may be small, but do not be fooled by its size! It's a tiny microcontroller board, built around the Atmel ATSAMD21, a little chip with a lot...
$8.95
In Stock
Fancy new side light LED strips are a great alternative for folks who have loved and used Adafruit LED strips for a few years but want gorgeous, glowy light emitting at...
$26.95
In Stock
1 x Adafruit LiIon/LiPoly Backpack Add-On for Pro Trinket/ItsyBitsy
To use and recharge a LiPo battery with the Trinket M0
1 x Slide switch
To turn the entire thing on or off
13 x M3 screw and hex nuts (at least 10mm length)
You'll need one per letter. Alternatively, use gold screws for more bling!
1 x Heat shrink tubing
To protect the wires of the slide switch
1 x Gel Super Glue
Gives a bit more time before drying
1 x Double sided foam tape
To secure the Trinket M0 inside the case
5 x Binder clips
To help secure the wires as the glue is drying

Download the 3D printing files using the button below!

Download and print out both the "glowy-crown" and the "glowy-crown-cover" files. The cover simply press fits onto the back of the glowy crown to secure the electronics. 

You may want to use a brim when printing out the crown to improve adhesion since the sides are a bit thin. There should be no supports needed for either of these. 

The design is parameterized, and the step file is included here so you can customize the number of holes in case you want your message to be different. An odd number of holes will work best -- you can add an exclamation point or a space to your message to make it so!

Note: The photos in this project use a silver switch with different dimensions from this Adafruit switch. If you're using the Adafruit switch, use the file named glowy-crown-adafruit-switch. You can also change the parameters in the .step file included to fit your specific switch. Both .3mf and .stl files are included.

Download the vector files using the button below!

Laser cut on clear cast acrylic up to 3.25mm thickness, using your laser's appropriate engrave and cut settings. These were cut with a Glowforge using the Medium Clear Acrylic proofgrade setting. 

Tip: it would be good practice to ensure that the letter/shape engraves are done first, followed by the mounting hole cuts, and then finally the outer outline cuts. 

You can choose to peel the masking on one (or all) of the pieces, and do a quick test fit on the 3D printed frame to see if any adjustments are needed.

This project uses a Trinket M0 combined with the LiPo backpack, which will make this crown conveniently rechargeable. The diagram below is just to clearly illustrate the circuit connections and will not be the final layout -- the images for the final layout will be seen later.

And here are the circuit connections that need to be made between the components in a table format, in case it's useful:

LiPo backpack Trinket Neopixel Strip
BAT BAT 5V
GND GND GND
5V USB -
- 4 DIN

First, prepare the LiPo backpack. Cut the trace in between the two holes next to the JST port (next to the "5v" label). This will allow attaching a switch to turn the power on/off.

Next, prep some wires. Cut the following approximate lengths of ribbon cables, taking note of the number of wires that should be in each, strip and tin the exposed wires with some solder.

  • LiPo backpack to Trinket - 3 wires, 2.5"
  • LiPo backpack to switch - 2 wires, 3.5"
  • LED strip to Trinket - 3 wires, 7.25"

Now you can solder wires to the LiPo backpack.

Solder the 2-wire ribbon cable into the switch holes, and then solder the shorter 3-wire ribbon cable to the BAT, G and 5V holes. Make sure to cut any excess wires at the bottom of the backpack as flush as possible.

Tip: it'll be a little easier later on if you solder the striped wire into the BAT hole. 

Next, let's prep the LED strip. 

Cut a strip of 13 LEDs using a flush cutter, and take note of where the DI ("data in") end of the strip is. 

Tin the copper pads on the DI end of the strip, and solder the 3-wire ribbon cable wires on. 

Tip: it'll be a little easier later on if you solder the striped wire onto the 5V pad. 

At this point, you should now have the following prepared:

  • A LiPo backpack with two sets of wires
  • An LED strip with a set of wires on the DI end of the strip.
  • A Trinket M0 and a 400 mAh LiPo battery with nothing attached to each.

Now it's time to connect both the LED strip and the LiPo backpack to the Trinket M0.

With the help of a pair of needle nose pliers, and some patience, twist and solder together the tinned exposed wires for the following pairs:

  • LED strip's 5V wire and the Lipo backpack's BAT wire (both should be striped if you followed the tips in the previous steps above)
  • LED strip's GND wire and the LiPo backpack's G wire (both stand for "ground")

 

Solder the twisted wires together, and fit the combined wires into the Trinket M0's corresponding pins.

  • Combined ground wires into the Trinket's GND hole
  • Combined 5V/BAT wires into the Trinket's 5V hole

You may have to squeeze the combined soldered wires a bit to get it all to fit through.

Carefully take the LiPo backpack's 5V wire, route it through to the Trinket's USB hole, and solder.

Then take the remaining loose DI wire from the LED strip (the middle wire), and solder it into the hole labeled "4" on the Trinket.

Finally, you'll need to attach a switch to the remaining two wires on the LiPo backpack. 

Cut one of the legs on either side of the switch (leave the middle leg). Carefully cut the legs to about half of their original length and tin each leg with solder. 

Cut a few millimeters of heat shrink tubing and slide one onto each of the two wires from the LiPo backpack. Solder the two wires onto the two legs -- it doesn't matter which wire goes to which leg. Slide the tubing up and use the soldering iron to shrink it.

You should now have a completed circuit, and it should roughly look like the photo here! Take a moment to double check that the connections match the circuit diagram at the top of this page. A good way to check is to attach a battery to the LiPo backpack and flip the switch to see if any lights on the Trinket M0 turn on (the LED strip won't turn on yet).

Pause here, and marvel at your handywork so far. You're so close to creating a magical glowing crown! 

Now that the circuit is all soldered up, it's a good idea to load in the code before stuffing everything inside the crown. 

If you're new to CircuitPython, you may want to check out this getting started guide first!

Your Trinket M0 board already comes pre-loaded with CircuitPython, but it's a good idea to update to the latest version, so follow this guide to do so.

You'll also need a couple of libraries copied into the lib folder of your CIRCUITPY drive before you can run the code. Download the bundle of libraries from the CircuitPython.org Libraries page that correspond to your CircuitPython version, unzip, find the following files and copy them over to the lib folder:

  • adafruit_pypixelbuf.mpy
  • neopixel.mpy

For more detailed instructions about adding libraries, head on over to this CircuitPython Libraries page.

Your CIRCUITPY drive should now look like this:

Copy and paste the code below into the code.py file in your CIRCUITPY drive to light up the crown. This code borrows some elements from the CircuitPython Essentials: NeoPixels page. It has a few animations that are described in comments before each animation function.

# SPDX-FileCopyrightText: 2021 Charlyn Gonda for Adafruit Industries
#
# SPDX-License-Identifier: MIT
#
import time
import board
from rainbowio import colorwheel
import neopixel

pixel_pin = board.D4
num_pixels = 13

pixels = neopixel.NeoPixel(pixel_pin, num_pixels, brightness=0.3,
                           auto_write=False)

# Lights up the message letter by letter
def spell(color, wait):
    for i in range(num_pixels-1, -1, -1):
        pixels[i] = color
        time.sleep(wait)
        pixels.show()
    time.sleep(0.5)

# Lights up a word, given a startIndex and stopIndex
def show_word(startIndex, endIndex, color, wait):
    pixels.fill(OFF)
    pixels.show()
    time.sleep(0.1)

    for i in range(startIndex, endIndex-1, -1):
        pixels[i] = color

    pixels.show()
    time.sleep(wait)

# Lights up every even-numbered index
def alternate(color, wait):
    for i in range(num_pixels):
        if i % 2 == 0:
            pixels[i] = color
        else:
            pixels[i] = OFF
    pixels.show()
    time.sleep(wait)

# Lights up every odd-numbered index
def alternate_reverse(color, wait):
    for i in range(num_pixels):
        if i % 2 == 1:
            pixels[i] = color
        else:
            pixels[i] = OFF
    pixels.show()
    time.sleep(wait)

# Full rainbow!
def rainbow_cycle(wait):
    for j in range(255):
        for i in range(num_pixels):
            rc_index = (i * 256 // num_pixels) + j
            pixels[i] = colorwheel(rc_index & 255)
        pixels.show()
        time.sleep(wait)

RED = (255, 0, 0)
YELLOW = (255, 150, 0)
ORANGE = (255, 40, 0)
GREEN = (0, 255, 0)
CYAN = (0, 255, 255)
BLUE = (0, 0, 255)
PURPLE = (180, 0, 255)
MAGENTA = (255, 0, 20)
JADE = (0, 255, 40)
OFF = (0, 0, 0)

ALT_WAIT = 0.5
CHASE_WAIT = 0.1
WORD_WAIT = 1

while True:
    # indices for "birthday" is from 12 - 5
    show_word(12, 5, MAGENTA, WORD_WAIT)

    # indices for "boss" is from 4 - 0
    show_word(4, 0, JADE, WORD_WAIT)

    # again!
    show_word(12, 5, ORANGE, WORD_WAIT)
    show_word(4, 0, YELLOW, WORD_WAIT)

    spell(GREEN, CHASE_WAIT)
    spell(CYAN, CHASE_WAIT)
    spell(PURPLE, CHASE_WAIT)

    alternate(JADE, ALT_WAIT)
    alternate_reverse(ORANGE, ALT_WAIT)

    alternate(MAGENTA, ALT_WAIT)
    alternate_reverse(BLUE, ALT_WAIT)

    alternate(PURPLE, ALT_WAIT)
    alternate_reverse(GREEN, ALT_WAIT)

    alternate(CYAN, ALT_WAIT)
    alternate_reverse(MAGENTA, ALT_WAIT)

    rainbow_cycle(0)
    rainbow_cycle(0)  # higher number, slower rainbow

You may notice that in the spell function, we loop over a range of numbers that are generated like this: range(num_pixels-1, -1, -1)

This means that we're starting from index 12 (since there are 13 pixels) and decrementing 1 every time we loop. We have to loop through the indices backwards because of how we're going to assemble the crown -- the first letter "B" ends up being lit by the last LED in the strip. The same backwards loop happens in the show_word function as well.

You should see all the NeoPixels light up when you successfully load this code! This will help us align the NeoPixels under the laser cut pieces in our final assembly.

It's time to integrate the electronics into the 3d printed frame and build the crown!

Attach the 400 mAh LiPo battery to the backpack using the JST connectors. It's going to be a tight fit, so make a little loop like the image shows. 

Take the power switch and use a pair of needle nose pliers to press fit the power switch into the rectangular hole at the back of the frame.

Note: In these photos, I've used a silver slide switch with a different height and width from the Adafruit slide switch. There is a 3D file that has a hole sized for the Adafruit switch, make sure you printed that one that corresponds to the switch that you have.

Now, take both the LiPo backpack and the battery and gently push it into the case. It'll be easier to keep the switch wire on top of the battery.

Then, to keep things compact, you can loop the Trinket M0 around so that the wire makes a sort of spiral like what is shown here.

 

Cut some double sided tape to size, place it on the back of the Trinket M0, peel off the top layer, and gently place the Trinket M0 inside the case, with USB port side facing the hole on the side of the case, as shown. 

Route the wire from the Trinket M0 to the LED strip through the slit on the inside wall of the case.

Double check that the USB port is accessible from the outside of the case. The Trinket M0 should be touching the bottom and side walls of the case.

 

Take the LED Strip and slide it gently from the side of the frame, LEDs facing outward and the strip hugging the inner wall.

Center the LEDs as much as possible with the holes. You'll notice that the last and first LEDs might not be as aligned with the holes as the LEDs in the center, but this will be ok as long as they stay under the laser cut pieces.

Now, with the LEDs already inside the frame, carefully tuck in each laser cut piece, aligning the laser cut hole with the 3d printed frame hole.

There should be enough friction that the laser cut pieces should stay in place, but if not then you can secure with the screws as shown in the next step.

Watch your spelling as you do this!

You can turn on the LEDs after dry-fitting all the pieces to verify that the LEDs are well-placed under each laser cut piece. 

Then, secure all the pieces with m3 machine screws and bolts. I'm using gold ones here, but you can use the black nylon ones instead.

Tighten up the bolts, and the outer and inner walls should now look similar to these photos!

Check that the LEDs are aligned correctly by looking in the gaps between the laser cut pieces and verifying that no part of any LED is peeking through.

Tuck in more of the wire into the case to adjust the wire length while aligning.

When you've aligned the LEDs under the laser cut pieces, make sure that the exposed wire is just the right length to hug the inner wall of the crown and stay flat all along the perimeter.

Finally, carefully use some dabs of super glue to secure the wires in place. Try not to get this stuff on your fingers!

Use binder clips while the glue is drying, it should be set in a few minutes. 

That's it! Turn on your lovely crown and watch your message come to life! Now the world can properly celebrate with you, and you can make someone feel incredibly special.

This guide was first published on Nov 10, 2021. It was last updated on 2021-11-10 13:47:15 -0500.