AVR Christmas Countdown Bauble
After writing a program in Visual Basic for a Christmas countdown timer for the TV in the showroom window at work I thought it would be nifty to have a Christmas countdown timer in the Christmas tree as a bauble. This version with the seven segment displays was the first that came to mind. The idea soon formed into having an LCD, Perhaps a propeller style clock and finally to having a full colour cell phone display. I decided to make the 7-segment version first to test the code and principle and also because it was a week to go to Christmas and it would be nice to have one in the tree.
Below you can see a picture of the countdown timer on the breadboard in its prototype state.
The circuit is super simple. I use two ports on the ATMEGA16. One port is connected to all the anode segments of the displays and the other port to the common of each display. A third port is used for reading the setting buttons. All I do to turn a segment on is have a bit set high on the anode port and a bit low on the cathode port. One advantage of this method is that one can drive both common anode or common cathode 7 segment displays with only a minor software change. One disadvantage is that I am probably pushing the current limits on the cathode port as it is sinking the combined current of all the segments (if they are all lit) which does show in a slight brightness variance between say a 1 and an 8 being displayed. The Mega16 takes care of the clock routines as well. You can see the small 32.768kHz crystal sitting above the AVR. At this stage I hadn't wired up the control buttons yet, as I figured they'd be just as easy to add once I transferred it to strip board.
A local craftshop had some clear acrylic baubles that split in two in various different sizes. I used an 80mm one for my countdown timer.
I started by making a "controller" board that has the AVR, crystal, buttons and miscellaneous parts fitted to it. I ended up assembling it onto strip board as I wanted it to work in time for Christmas and couldn't find the effort to draw up a diagram, do a board layout in Eagle and print/screen/etch and drill a proper board.
The "display" board piggy backs onto the four connectors to sit on top. Being strip board, I was a little bit limited to what I could connect up, so on the rear of this display board I have a typical "birds nest" of wires.
And the two boards assembled:
To make the display easier to read I fitted some smoked Perspex over the top.
The board is glued in place of one half and the back half just clips on. Power comes from an old 5v cell phone charger.
Here's a little video of the counter in action. It shows how on Christmas day it scrolls "Merry Christmas" all day long then come Boxing day it starts the countdown to New Years followed by a scrolling "Happy New Year" on new years day which continues until you turn it off.