In previous years we have managed to avoid the entire Halloween silliness, explaining to our young daughter that this is not an Australian tradition and not something we need to encourage. Of course it was too good to last and this year she has been invited to a Halloween party.
In a grudging, bah humbug sort of way I decided to enter into the spirit of the event and help out with a costume. I happened to have an Adafruit Gemma and related bits and pieces looking for a good project, so I decided to combine these with a cheap and nasty witches hat from the local supermarket.
A couple of hours of squinting and stitching, and a similar amount of time coding up a variety of lighting patterns and we have an annoyingly bright and flashy halloween hat!
The parts I used (all from my favourite Australian online retailer, Core Electronics) were:
- An Adafruit Gemma,
- Two 5 packs of blue LED sequins,
- A couple of metres of conductive thread
- A coin cell battery holder, and
- A couple of CR2032 batteries.
The only tools I needed were a needle, scissors and a drill with a 2mm bit. The latter was to drill a couple of holes through the batter holder. This made it easier to attach to the hat, and allowed me to sew the holder shut to avoid children getting easy access to the batteries.
My daughter and I jointly chose a lightening bolt pattern for the LEDs, made up of three rows of three LEDS. The upper and lower rows were connected to D1 and D0 to allow PWM control of the brightness (i.e. analogWrite). The middle row was connected to D2. The LEDS are all connected to the Gemma using conductive thread. The battery holder was attached to the brim at the side of the hat. The battery holder includes a slide on/off switch will be easier for my daughter to use than the micro-switch on the Gemma.
Programming was a matter of writing some very simple code to light the LEDS in a variety of patterns. I ended up with 16 variations and the code just selects them at random. The results look something like this ...
As with all Adafruit products that I have tried there is excellent online documentation to get you going. Using the Gemma is slightly more fiddly than using a normal Arduino board (for example, you need to hit the reset button to get it ready to upload), but this is all covered in the documentation.
Having done this now, if I were doing it again I would use a hat with more solid fabric. This one is very thin and there is a risk that the stitching could short if the material was scrunched together. As with any DIY project, do this at your own risk.
I do not claim that this is the most amazing Halloween costume / maker project of all time, but it kept me amused for a few hours and made my daughter smile, and that's good enough for me.
Happy Halloween (Bah humbug)