I had toyed with the idea of making a metronome a while ago when my girlfriend’s metronome broke. Instead of buying a new one I suggested making one. After a bit of research and preliminary work I decided that between the time it would take to develop and my lack of skills in electronics that I would abandon the project. So here I am a year later wanting to make some sort of kit for Club Jameco and I realize that a metronome would be perfect. So here it is, my electronic metronome. The kit is available for sale here: http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&storeId=10001&productId=2168325&catalogId=10001&CID=CLO. The biggest benefit to the kit, I think, is that the PCB is included.
Please note that in this instructable I assume you have some experience with AVRs and the C programming language.
Step 1: Parts
To build this metronome, you will need the following components:
Step 2: The Hardware
The hardware set up for the metronome is pretty simple. Since I designed it as a kit, I tried to keep the number of parts to a minimum while still having all the features I wanted.
As you can see from the schematic, all the functions are separated by ports so programming is nice and simple. Control of anodes for each digit is handled by port C. These pins will control the multiplexing of the display. Port D will control the cathodes of the display, essentially setting what segments of each digit to light up. And lastly, our generic I/O, things like the LED, speaker, and buttons, is handled by port B. The remaining connections are standard for operating the ATmega; like the 10k Ohm resistor on the reset pin and the decoupling capacitor between Vcc and ground.
Be sure to check out the third image above to see pin locations of the seven segment display. They can be a little tricky to figure out. Also, in the schematic the pins of the display block match the real world layout, so pin 1 is in the lower left corner and twelve is directly above it.
Step 3: The Software
In the interest if space, and for readers not particularly interested in the software that runs this, I have decided to forgo explaining the code here, and instead thoroughly commented it. The code is available for download below. I think it's actually better to look at it this way as the seeing the comments and the complete code together will make more sense then me trying to explain small snippets here anyway.
Also, I have provided two images from the Seven Segment Display's datasheet that should help you in better understanding that aspect of the code.
For details on how to upload your code to the microcontroller, see you your AVR programmer's manual; or if you're using Adafruit's USBtinyISP see their detailed tutorial here: http://www.ladyada.net/learn/avr/avrdude.html
Step 4: PCB Design
The board was designed with size in mind. I wanted to keep it as small as possible while still having all the components laid out in an easy to use way. I decided to make the width of the board match that of the height of the battery holder since I knew I would like to attach the two together. The results came out as follows.
I've attached the Eagle files for this project below for you to download. I used ITeadStudios to make the boards and I was really happy with the way they came out.
Step 5: Assembly
Show All 10 Items
Assembly of the device is fairly straight forward. I tried to make the locations of the parts on the PCB as clear as possible with well labeled silk screens. All you have to do is match the parts to their markings and solder in place.
There are a few parts that you need to be careful with, especially of you're fairly new to electronics.
Step 6: Use and Enjoy
After I put the batteries in the holder I attached a piece of velcro the holder and the back of the PCB so that I could attach the two together.
And there you have it, a simple yet functional electronic metronome.Thanks for reading!