Introduction: Electronic Metronome

Picture of Electronic Metronome
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

Picture of Parts
To build this metronome, you will need the following components:
  • ATmega328p Microcontroller (Jameco #2139111)
  • IC Socket (Jameco #112300)
  • 150 Ohm Resistor (Jameco #690662)
  • 10k Ohm Resistor (Jameco #691104)
  • 0.1 uF Capacitor (Jameco #151116)
  • Three Digit Seven Segment Display (Jameco #1956493)
  • Red 5mm LED (Jameco #333973)
  • Tactile Switch (3x) (Jameco #119011)
  • Piezo Speaker (Jameco #1874543)
  • ISP Header (Jameco #115035)
  • 3xAA Battery Holder with Switch (Jameco #216144)
  • AA Battery (3x)
  • Velcro (Optional)
You'll also need the following tools:
  • Soldering Iron
  • Solder
  • Wire Cutters
  • Needle Nose Pliers
  • AVR Programmer

Step 2: The Hardware

Picture of 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

Picture of 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

Picture of 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

Picture of Assembly
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.
  1. Make sure that when you're installing the IC socket and the ATmega you matches the notches with the notch outline on the PCB. If you don't, the proper pins won't connect to else where on the board and you're metronome will not work.
  2. The only component that is polarized here is the LED. Make sure that you put the shorter lead of the LED in the whole closest to the outside edge of the board matching the flat edge of the epoxy case to the flat marking on the PCB.
  3. It does not matter which directions your speakers leads are. 
  4. When connecting the battery holder, be sure that he red lead goes in the hole marked V+ and the black lead goes in the hole marked ground.
  5. When inserting the ATmega, you may need to bend the pins so they are perpendicular to the IC's body. To do this safely, lay the ATmega on it's side on a flat surface and use your index fingers on the underside of the body and your thumbs on the top as seen in the photo. Then rock the chip forward to bend all the pins on that side evenly. Do this to both sides.

Step 6: Use and Enjoy

Picture of 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!

Comments

TuchicoF made it! (author)2017-05-09

Teacher-Christophe Monaco,Excellent circuit .Thank you From Mexico my version

Sorry for the audio, problems with my camera

ZilgmeZaratustra (author)2015-02-25

wattana (author)2013-08-22

HI cmonaco3!!
Great job! This stuff is awesome...

I hope you dont mind if I ask a couple of questions about your device.

Can I attach a led strip instead of the speaker and the single led? I want to cover all roof corners of my band practice room so everyone facing any direction can see the leds going on with the beat.

Will it need more power than the batteries can supply? Is it difficult to adapt a power supply instead of the batteries?

Thanks!!

nodoubtman (author)2012-09-21

I have programmed my first atmega :) thanks to you cmonaco3 :)
if you have others program, you can post it, it would be great! :)

thanks a lot!
marC:)

nodoubtman (author)2012-09-07

thank you for the .hex file awesome job! i'm just beginning avr i used to do some pic's :)

thank you!
marC:)

nodoubtman (author)2012-09-01

what about the fuse?

how to program it using ? :
http://www.ebay.ca/itm/130682846209?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1439.l2649

thank you so much!
marC:)

cmonaco3 (author)nodoubtman2012-09-01

I'm sorry what do you mean by fuse? If you're referring to the fuses on the ATmega, you shouldn't have to worry about them as I'm using it in its default configuration for this project.

You're going to have to consult any documentation that comes with that specific programmer, though I suspect it may work with AVRDUDE. Here's a tutorial from Adafruit on using that software: http://www.ladyada.net/learn/avr/avrdude.html

nodoubtman (author)cmonaco32012-09-06

what's the command line for programming this chip?

thank you!
marC:)

cmonaco3 (author)nodoubtman2012-09-07

I used AVRDUDE to program the chip. It's a command line utility you can download for free. Please see this tutorial for using it: http://www.ladyada.net/learn/avr/avrdude.html

nodoubtman (author)cmonaco32012-09-04

Hi! Is it possible to have the .hex file and also the 3 7 segment display is a CA or CC ?

thank you soo much! :)
marC:)

cmonaco3 (author)nodoubtman2012-09-07

Sorry about not back to you sooner. The hex file should be uploaded and can be downloaded on the software step. The display being used here is common anode.

nodoubtman (author)cmonaco32012-09-01

no documentation comes with this chineese programmer :((

i don't ever know how to connect it.. im into pic microcontroller.. now's day!

thank you!
marC:)

kipo00 (author)2012-07-26

thank you !

teknohawk (author)2012-07-22

that is absolutely awesome! good job!

cmonaco3 (author)teknohawk2012-07-23

Thank you!

About This Instructable

13,221views

72favorites

License:

Bio: A materials scientist gone electrical engineer my hobbies include experimenting with electronics and making fun and interesting things. I rarely know what I'm doing ... More »
More by cmonaco3:Pom-pom FlowersSugru Iron Man Armor for you LEGO MinifigureWooden Tray from Wood Scraps
Add instructable to: