Music box
January 24, 2011 3 Comments
This is a project for a music box. It is not an ordinary music box as it doesn’t play songs but rather plays different musical tones when different sides of it faces up and gets a gentle tap.
Flip-n-shake/tap music box
You are given a well-decorated box, cube, with one musical note on each side, flip it so that a desirable musical note faces up, shake or tap on the box, that note will play. When playing, the top side of box will glow with a certain color. Since there are 6 sides to a box, 6 notes can be associated with each side. I’ve built the prototype last weekend and managed to play a few simple songs by flipping and tapping on it. I am adding some video later this week. This box needs a lot of artistic touches in order to attract attentions. That is where I need some help. I hope to find some help at the Art Department. I imagine that when finished, two such boxes can be made so a person can pick them up with two hands and shake them to play as many as 12 notes. Many simple songs can be played with these two boxes.
Here is a demo:
This picture tells the inner working of the box prototype, an Arduino, a buzzer, and an accelerometer:
Please don’t mind the writings on the paper. I am looking for a house and I recycle/reuse paper 🙂
Stage 1: prototyping
The following is a video of the prototype. As you can see, the entire box is very ugly and needs a lot of artistic touch. I will post updates when I get more progress on it.
You have to crank your volume all the way up. I need a louder speaker and a lot of holes on the box!
Stage 2: adding light effects
Update: I’ve added some light effect and removed all the paper 🙂
You have to crank your volume all the way up. I need a louder speaker and a lot of holes on the box!
Stage 3: adding intelligence to the box
Now the box has a favorite tune. If you tap in the first 6 notes of this tune, the box will recognize it and plays the tune. In the future, I will purchase an MP3 shield to play high quality sound, like “Ah, that must have been my favorite tune, the XXX. I will play it for you”. Then it plays the tune in hi-def audio. I’ve removed the box top to make sure the sound volume is loud enough.
Stage 4: adding MP3-quality sound to the box
Check back later for this stage!
Stage 5: adding artistic touch to the box
Check back later for this stage!
Stage 6: adding lights to each side of the box
Check back later for this stage!
Stage 6: displaying the box in public place
Check back later for this stage!


























When the accelerometer is staying statically, it senses the gravitational acceleration and its projection or components along the board’s x-y-z axes. You need basic vector concept to find out the angle of tilt from the components of acceleration measured by the accelerometer. The most basic information that one could get is, which side is up. Say if you read the accelerometer and your x acceleration is exactly one g, then x axis must be facing downwards, making -x direction facing upwards. The cell phones and tablets can then readjust their display to adapt the rotation.