Different Arduino Code

We’re controlling the LED strip using the Adafruit_NeoMatrix library, so it’s easy to display different graphics. All the drawing functions from the Adafruit_GFX library are available. For example, the blinking eyes from this LED matrix tutorial could be adapted.

There are a couple of limitations to keep in mind: first, you can’t light up all (or even most) of the pixels at once, nor at full brightness…this would drain the battery within minutes! Second, 240 NeoPixels use a lot of RAM…and the Bluetooth library needs some as well, if you continue to use that. So, for example, adding a microphone and displaying an audio VU meter using an FFT algorithm is probably asking too much (both in terms of RAM and power consumption), but some variant on the Ampli-Tie project could probably be created, provided you don’t light too many LEDs at once.

Dynamic Messages

If you’re skilled with Android or iOS programming, it should be feasible to send new text to the hat…for example, weather conditions or live stock quotes pulled from the internet. The Bluetooth connection appears as a serial port. The only “gotcha” is that messages must be 20 characters or less, a limitation of Bluetooth LE.

“Invisible” LEDs

A trick learned from this electronic demon costume: you can hide the LEDs (so it looks like a plain hat when they’re off) by pulling a black nylon stocking over it. This blocks about half the light, so it’s best seen in dark settings, or compensate by increasing the LED brightness (with a corresponding decrease in battery life).

8 LED Rows

With only 7 rows of LEDs, the “coiled” hat cuts off descenders (lowercase letters like ‘g’ and ‘j’)…it’s even more pronounced at the back, where there’s only six rows.
By cutting apart the strip and arranging the LEDs in a grid (rather than a coil), we can give up a few columns at the back to gain an extra row. This sacrifices weather resistance, but the result is sleeker and lower in profile.
This is a challenging and time-consuming modification, recommended for advanced makers with excellent soldering skills and lots of patience.
After cutting off the silicone sleeve and separating the strip at the half-meter solder joints, the sections were glued to the hat with 1/2" spacing all around (they don’t quite sit flush against the hat due to the taper). Alternate rows were flipped so the data direction is right-to-left instead of left-to-right (a zig-zag arrangement). The last 3 inches or so were not glued down until after the soldering was complete.

Code Changes

A few modifications to the sketch are needed to use this “grid” hat. First, near the top of the code, change these lines:
#define NEO_WIDTH  30 // Hat circumference in pixels
#define NEO_HEIGHT  8 // Number of pixel rows
Change the matrix declaration to use a "zig zag" order:
Adafruit_NeoMatrix matrix(NEO_WIDTH, NEO_HEIGHT, NEO_PIN,
  NEO_GRB         + NEO_KHZ800);
And comment out or delete this line in the setup() function:

This guide was first published on May 01, 2014. It was last updated on May 01, 2014.

This page (Variations) was last updated on May 04, 2014.

Text editor powered by tinymce.