header

LED Hat: July 2011

This ridiculous hat is one of my typical procrastination projects. During swatvac for my final exams I got invited to a friends hat themed Birthday party. With nothing better to do (well apart from study for my exams) I decided that I wanted to win the best hat prize, and figured I could use up some of the spare LED's I have laying about after my LED cube project in the process.

Literally before I had even responded to the event I had started bending wire around my head to form the shape of the hat, there was no design or even consideration of how this thing was going to work but this is what I ended up with. It's messy, it's uncomfortable and was a complete waste of time, but It looks awesome when it's turned on and I kicked ass in the competition. I am not going to go into much detail here as I feel like I have spent enough time on a flashy hat, but you can find some pics, circuit diagrams and the code all here.

LED Hat + Camera

Led Hat

Demo of the Animations


The Construction

The hat took shape fairly quickly I used thick fencing wire for the construction and routing power about my head, for all the signals I used a heap of enameled copper wire which I think actually looks pretty cool going all over the place like it is.

Side View

Side View

Top View

Top View

The Electronics

To drive all 64 LED's I used 8 TLC5916 LED sink drivers, they work almost identically to the drivers in my LED cube project except they only have 8 outputs, I don't bother with any multiplexing on the hat because I wanted to be able to do some PWM effects. The hats brain is an old atmega8 chip I had laying about and had never learned how to program until now. The circuit diagram is fairly basic as you can see below (yes I drew it in paint, what of it), just repeat the TLC5916 part 8 times continuing the SDO -> SDI chain.

TLC5916 Close Up

TLC5916 Close Up

ATmega8 Close Up Top

ATmega8 Close Up Top

ATmega8 Close Up Bottom

ATmega8 Close Up Bottom

Circuit Diagram

Circuit Diagram

The Code

To program the ATmega8 chip I used my Arduino as an ISP with the ArduinoISP sketch, follow the link for more information on how to wire it up. I compiled and uploaded the code with AVRdude which is a terminal based program, once you get the hang of it it's very easy to use (just get yourself a makefile to play around with). As I am using an external clock source I had to set the avr fuse bits, to make sure I didn't make a mistake and ruin my chip which cost me an extravagant $2 I used the avr fuse calculator.
My hat uses two types of animations, the standard animations where each LED is either on or off, or dimmed animations where I use 4 bit Bit Angle Modulation (BAM) for some nice effects. My code which you can find in the downloads section is not particularly well commented but it is neat so hopefully easy enough to follow, you are welcome to ask me a question in the comments if you need a hand. You will probably see the analogue input code in there, that is because I had a microphone input at one stage but I removed it before the party because the battery source was causing too much noise and I ran out of time trying to fix it, or something like that.