May 17, 2012

Music Box Based on ATTINY45

I saw this post ( about WaveTable synthesis and creating "music box" like sounds on an ATTINY45 and thought I would try it. That post documented the code and schematics needed to build a "music box" song generator. I have some experience with the Arduino platform but hadn't used the ATTINY before, although I bought some to have for future projects. Chan laid out enough info to get started with this project, code and a schematic, so i rigged up an Adafruit USBtinyISP to a breadboard with the MCU and loaded Chan's code with avrdude. Rigged up a test with a small Radio Shack speaker and it worked like a charm!There's a saying in Science Fiction writing, "Make the metaphor real", so I thought, why not make this look like a real music box? I got a craft "treasure box" at Michael's Art Supply for around $1.00. Then, I downloaded some clip art of musical staffs with notes on them. I combined these with some text and laser cut the top of the craft box with an Epilog 60W laser at TechShop SF.
Next, I got a hole saw drill bit about the diameter of the speaker I had and cut a hole in the craft box, gluing the speaker down. I found a Mercury switch at Fry's - this would turn on the music when the top was tilted open. A better choice would have been magnetic switches, freely available on eBay. The Mercury switch will activate if you tilt the whole box, not a desirable effect.
I put a laser cut piece of mirror acrylic over the works to hide them and feel more like a real music box, just held in by friction. I cobbled this all together with a deadline of my wife's birthday. She was delighted to receive such a cute, personal gift.

No comments:

Post a Comment