Sophie's Music Box, Light Show and Jewelry Box





Introduction: Sophie's Music Box, Light Show and Jewelry Box

I just finished building a music box / light show / jewelry box for my friend Sophie. An Arduino compatible microcontroller is used to generate the music box sound and to control the lights. The Arduino code emulates the sound of an old mechanical box which used a rotating drum with tabs that plucked tune metal tines to produce the note. The code is capable of three note polyphony. This is very easy to build for anyone who can read a schematic. Pictures of the build and links to the Arduino sketch can be had at the link below.



    • Pocket-Sized Contest

      Pocket-Sized Contest
    • Pro Tips Challenge

      Pro Tips Challenge
    • Paper Contest 2018

      Paper Contest 2018

    We have a be nice policy.
    Please be positive and constructive.




    Thanks! Also, I have another question; how does the tilt switch work? I just noticed that you glued on a gold cylinder onto the lid of the box. Is that a special material I need to buy? Sorry to bug you with these questions. I'm a total beginner at this.

    The tilt switch is just a switch. In one orientation it is off and in another it is on. There is nothing special to buy except the tilt switch itself. When the music box is opened the switch turns on and the arduino see this and starts the music.

    The switch is available at:

    Hi, I love your project :) I'm actually trying to recreate this, and use different songs in the music box. Where did you get the to generate the values of the notes?



    All the support files are contained in a jar file available here:

    Note this jar is not executable; it is just an archive of all of the support programs. Unjar this file to get at its contents.

    Good luck,

    Craig Lindley

    great project! I would like to do something similar using an Arduino Uno. I am having trouble compiling your code, though; I am getting errors about some of the variables not being "declared in this scope," such as OCR48. Do you know how to fix this?

    The problem is the Arduino I used has a different processor than that used on the UNO which has different instructions. The UNO doesn't have fast enough PWM to allow the music box to sound its best. The code can be made to run on the UNO but it would be some work. If you want to see the types of changes required you should download my code from the April Issue of Nuts and Volts magazine.

    Good Luck,

    Craig Lindley

    Cool, I'll check out your article. For anyone else that's interested, here's a link:

    Sorry to ping you again, but it seems like the musixboxsupport.jar file on the Nuts and Volts site doesn't work. Do you have an updated version?

    The jar file is not meant to be executable. It is just an archive of the various java programs that make up the music box support code. Unjar the jar file to get to the different programs.

    Thanks for your help. I've started to work on a programmable music box that is based on your code. Here's a video of a prototype:

    I designed my own custom Arduino and am still learning about microcontrollers, but I found that the response of my Arduino is slower than an Uno; when I upload your code to my Arduino, the songs play almost twice as slow as on an Uno. I'm using an external 8MHz crystal on my board; do you think adding a 16MHz crystal like the Uno would get rid of this problem?

    Thanks for your help!