www.lushprojects.com

Hat Hack - 2005/6

This project is inspired by drunken chats during summer music festivals. A personal light-show to wear after dark. Overall more than 6 months from start to finish. No comment on whether this was time well spent.

Leah Buechley has done some great wearable electronics. Compared to her work I wanted to push the dot density up to do text and graphics as well as patterns. This meant using normal LED matrix displays which don't integrate so well in  fabric. My machine is industrial rather than pretty.

For the display I used 5x7 LED modules from HP. They were cheap on eBay!


The project drives two 21x10 dot displays each made from 6 LED modules. Control is provided by an AVR ATMEGA32L microcontroller. First job was to prototype the hardware on breadboard and do some very simple software. At this point I am using the normal 40 pin DIL version of the AVR.

The displays are driven as a matrix because that's what the LED modules support and it keeps the number of wires under control. Still even as a matrix it needs 31 (21+10) signals on each display board which isn't really manageable. To get around this I put a shift-register built from TTL on each display board which is loaded serially from the AVR.  The clock, data and register control in this arrangement means each display board needs only 4 signal wires.

The hardware is a complete kludge by the way. Almost nothing is being used within its speced parameters. Seems to work OK though.

I built my own AVR programmer. Programing software used is AVR Dude.

The software is written in C on the WinAVR environment. A nice touch in the software is that because the display is less than 32 bits wide you can treat a whole row as a single LONG variable which makes the graphics a lot easier.



With hardware design fixed PCBs were routed using the free version of Eagle Layout Editor and manufactured by Olimex. Eagle files are here but note that these don't contain the fix for the power-supply mentioned below. Also note that the label for the AVR on the schematic is wrong. I just borrowed one from the library that has the same pin-out as the MEGA32.

To get the boards down the the required size I had to use SMD components in some places including the AVR. Real stress working with those for the first time.
I wanted to have the display respond to its environment. The system includes a microphone and amplifier which feeds in to one of the A/D ports on the AVR. The AVR only samples up to 9600 samples/s so this is very basic stuff. Together with some very simple signal processing the display can do things like VU-meters and beat detection. 

The first feature I implemented was scrolling text display. The final software allows the text to be uploaded from a PC via the programing interface or set in the field from the "user interface".

Software was developed on the fully assembled version before it was integrated in to its final home.

Display strings are loaded in to the eeprom. All the firmware and fonts are in the prom.

The software runs with lfuse=0xe4 and hfuse=0xd9 on the AVR.
Late testing showed big problems with digital noise breaking in to the analog section via the power rail. Not so surprising that strobing the displays crowbars the power supply something horrible. I had avoided using the normal linear regulator chips in the original design to improve the power consumption and lower the operating voltage. To fix the analog power supply a simple regulator was fitted in the analog rail. This means that the analog power to the AVR is slightly lower voltage than the digital power. The datasheet makes no mention of whether this is OK or not but it worked on my example.

Here you can clearly see the programing header and the "user interface" of three surface-mount switches. As well as editing strings the user interface allows the display mode to be chosen and preferences to be set.

The boards are glued in place. Big disaster - with everything assembled one column on the front display was failing. Desperate surgery needed to resolder a loose pin on one of the SMD chips.

The end-goal was finally attained. A lovely hat! Just what is needed for the summer season. Batteries and control board are in the ear-flaps. The programing interface is still available if needed.

Why a hat? Easy to spot in front of a packed stage at night.

Front and rear displays are provided. All wiring is hidden in the lining.

The sound input has various effects including controlling the speed the invaders march across the screen.

Supported display modes (links go to videos):
Where next then? Well first this one has to survive summer outings. I have a few more ideas for display modes if I can be bothered to update the software.

I notice Leah has already upped the stakes by providing an IR upload interface on her latest design.
Epilogue - August 2006

The hat has now made a few outings including Dorkbot London, The Big Chill and Fawsley Fayre. The cynics will doubt me but a lot of people really like it. "Truly inspired. I want one"  as one young lady said.




Have your say

Leave a comment in the guestbook.
Send Iain a private message.