Nov
28
2010

Stag hat with a difference

My brother recently got married and as per the rules of engagement, the lead up to the event included a Stag night.

For my Stag night, I was given a hard hat complete with a flashing LED light and plastic antlers.

I decided I wanted to make something special for my brother. Something minimalistic, but effective.

The result was this…..

Days, Hours, Minutes and Seconds remaining...

It was my first project using an Atmel AVR microcontroller. I’ve always planned on using an AVR, but normally settled for a simpler device such as a PIC or PICAXE, but this time I was determined to take the plunge and learn how to program the AVR.

To add difficulty to the project, I wanted to use a real time clock crystal too. This upped the ante a lot. It meant using the internal clock for the processor, external clock for the time counting and interrupts to decrement the displayed count.

I decided to use a pair of Red 4-digit 7-segment serial displays from SparkFun to simplify the display side of things. These turned out to be an excellent choice as they also support SPI control meaning I could send data to both displays with only four pins.

Here’s a sketch from my notebook of the schematic. It’s probably wise to add some capacitors to smooth the power supply. I was using batteries and the aim was small size and low weight.

Schematic of the hat circuit

The button is used to program the time remaining. I wrote some interesting code to de-bounce the input. The button is held in for about 5 seconds, then it goes into program mode where each single digit can be incremented and a two second hold jumps to the next digit. The programmed time is then stored into the EEPROM.

The Red LED on the top of the helmet is turned on at the start of each second for the period of time it takes to update the display (about 75ms) before it’s turned off and the microcontroller goes into a power saving sleep mode.

And, the most important part, here’s a photo of the helmet in use by Mr Pixel. This was 6 days, 18 hours, 18 minutes and 18 seconds before the wedding. I was unable to get a picture with the flashing LED lit up as it stays lit for such a brief period of time.

While we were out and about, people seemed to quickly work out what the numbers meant and were very interested to find out where to buy one from.

Overall, a successful endeavor.

Written by John in: Electronics,General Randomness,Projects |

4 Comments »

  • Paul

    Cool. Sharing the code would be appreciated.

    Comment | 6 January 2011
  • Allen

    Awsome!
    This is just what I need for a ‘Christmas Countdown display’ for my yard. I would make a larger display but the electronics/programming is what I need. Do you have a “how to” posted anywhere with parts list, code, and drawings for a complete beginner to make this? I’d really appreciate this info.

    Comment | 23 January 2012
  • George

    Do you have a “how to” available to make the count down timer? I really want to make one of these!! Thanks

    Comment | 25 January 2012
  • David Harris

    I have recently aquired a new type of human pedal powered tricycle. very high tech and as well made as any high end 10 speed mountain or road bicycle. It is a very low profile vehicle and needs all the help it can get to be seen and heard by larger, taller cars and trucks. These were developed for handicapped people to take the place of bicycles. I have been looking for a saftey light that could be worn by the rider to make the rider and vehicle much easier to see and avoid at night or other low light events. Your light on a hat sure seems to fit the bill. Please get back to me via email as I am serious about adapting your hat to my needs. I represent a growing population of senior citizens that no longer feel comfortable rdeing a standard bicycle. BTW how much are your hats. I would love to get one and experiment with their visablity.

    Comment | 7 March 2013

RSS feed for comments on this post. TrackBack URL

Leave a comment