This circuit is so simple and generated sound may look ugly, but from other hand this is good starting point for newbies with AVR projects. This circuit is made of one IC AT90S2313 (may be substituted by Attiny2313). Circuit is low power and reliable as it consists of very few parts (if SMD chip used, the it can be placed inside postcard):
Microcontroller can be powered by using from 2.7 to 6 V power supply. If AT90S2313 microcontroller is used, then you need to connect crystal resonator. If ATtiny2313 is used, then you can use internal RC clock source and reduce number of parts needed. Transistor can be any general purpose transistor. If sounder requires less than 20mA of current you may connect it directly to port pin.
After reset, circuit starts program and plays melody one time. After that it goes to power down mode. Crystal frequencies may be chosen from 32768 to 10MHz. Firmware is written for 10MHz. If you use different clock source then reduce SoundTab coefficients in source code and rebuild it.
Download Source code