Programmable Music Box
The programmable music box is a music box that you can easily program to play different melodies (without any knowledge of programming!). Like a traditional music box, this music box has a rotating cylinder. However, unlike normal music box cylinders, which usually have raised dots at certain positions to play a melody, you can actually rearrange the dots by moving magnets. There is an array of hall-effect sensors that detect where the magnets are placed and play corresponding notes based on their position. I started this project for a class last year, but (like most class projects), this prototype was built the day it was due. There are a lot of things I'd like to fix about it, including making it more accurate, hiding the circuit board, and generally cleaning it up.
The programmable music box is a music box that you can easily program to play different melodies (without any knowledge of programming!). Like a traditional music box, this music box has a rotating cylinder. However, unlike normal music box cylinders, which usually have raised dots at certain positions to play a melody, you can actually rearrange the dots by moving magnets. There is an array of hall-effect sensors that detect where the magnets are placed and play corresponding notes based on their position.
I started this project for a class last year, but (like most class projects), this prototype was built the day it was due. There are a lot of things I'd like to fix about it, including making it more accurate, hiding the circuit board, and generally cleaning it up.
This is the version of the music box that I made for my class. The pieces of the music box are laser cut but are glued together (eep!). There is a breadboard hidden inside and a mess of wires connecting the circuit board that I designed and the breadboard underneath. There is also a speaker inside the box but no battery (you have to attach a special FTDI cable via USB to power up the music box). As most projects go, this was built overnight, so I'd like to spend more time on fixing it up!
When I first made this music box, I rushed to get it done, so I'd like to improve it in a bunch of ways. These are the things I plan to work on before the Hobby Shop Open House on Friday:
I'm refreshing myself on how this thing worked in the first place...I wanted to have a full scale, so I have 13 linear hall effect sensors that detect magnets placed on a rotating cylinder. Looking back at my Eagle schematic, it looks like I had to have at a minimum a 13-channel multiplexer; additionally, multiplexers need to have 4 addressing pins (for the microcontroller to communicate with the multiplexer), 1 pin to provide input back to the microcontroller from the multiplexer, and of course power and ground.
I found this tutorial to be very helpful when I first put this together, and it proved to be useful again as I reminded myself of what I did over a year ago!
Note: The link above is unfortunately no longer available. ):
Last time, I used a through-hole multiplexer because I didn't have time to purchase a surface mount one, but this led to a tangle of wires. I'm going to purchase a SMD multiplexer with less pins.
Here's my complete parts list:
I already had the necessary resistors / LEDs / microcontroller needed for the circuit. Fingers crossed that these parts work out!
The main things I want to change about the design are that I want to make the whole thing a bit smaller (height wise), and I also want to add a handle.
It turns out that the parts from Digikey will not arrive until the end of the day Thursday, and I need to have my music box ready early Friday. Unfortunately, that means I won't be able to modify the electronics very much (or at all), so I'm going with plan B, which is just redesigning the structure of the music box (and hopefully cleaning up the code a bit too!)
I want to make a music box that isn't so boxy, so I looked online for some examples of nice laser cut boxes. I also really want to avoid the jigsaw-puzzle aesthetic of many laser cut boxes, so I tried looking for some nice examples of that too.
Credit for the images:
Inspired by the designs I found online, I'm going to go for a less boxy design with legs. I'm also going to play with putting the speaker on the bottom. Time to SolidWork!
I redesigned the music box to make it less boxy and (hopefully) a little more elegant! I was inspired by what I would imagine to be an Oriental jewelry box (which is kind of funny because I've never owned a jewelry box in my life).
I added feet to the box and made it octagonal in shape. I also added a drawer to store the magnets when the music box isn't in use, and I added handles on the side to make it easier to carry. There's also space for a 9V battery (the current design requires that you use a special cable that plugs in via USB to your computer). Tomorrow I plan to laser cut everything. Fingers crossed!
One thing I've learned to always do before laser cutting is to print a 1:1 version of what you plan to cut on a piece of paper. This makes it really easy to test for sizing and check for any dimensioning red flags. After creating the print out, I made a few adjustments to the handle, legs, and side panels to make sure parts weren't too thin and the slot sizes weren't too small.
The laser cutting was pretty straightforward; I had leftover scrap that was 0.2" thick. I was able to cut it with the following laser cutter settings: 15% speed, 50% power, 500 Hz frequency vector cut.
I redesigned the legs to make them wider and also to have a stop tab to help position them during assembly. The redesigned legs are shown on the bottom of the picture.
I glued only parts of the music box because I wanted to be able to disassemble it and include a newer board (after I get to design it to include the parts I ordered from Digikey). I used wood glue and sanded off as much as I could of the overflow.
I used a cherry wood stain and applied polyurethane finish afterward.
Unfortunately, because I didn't have time to incorporate the new surface mount components, I had to reuse my breadboard from last time (which is a mess of wires). Luckily, I did design the box so it would all fit inside. And even though I made the box taller to accommodate the circuit board, I actually think the height is good and will probably keep it that way even after I incorporate the SMD components.
Unfortunately, the hole size I had for my crank was too small, so i ended up drilling a hole manually using my hand drill. This makes the crank a little loose since the hole opens up a little bit, but it's fine for this prototype. (I do plan to update the music box yet again getting rid of the horrible breadboard!). I also added a 5V regulator, a 9V battery, and a switch to make the music box self contained; previously, you had to plug in the music box via USB.
The last part for me is always documenting. I try to find a place with a neutral background and fairly good lighting. I ended up just using some white chairs we have in our apartment. You definitely don't need special equipment to document, and it's well worth it!
I thankfully have a somewhat working version to present for the Hobby Shop expo tomorrow. As you can see from the video, the sides of the music box aren't fixed right now (so it slides out a little bit while I turn the crank). This is because I didn't glue everything together yet, as I hope to replace the electronics inside the box. Some of the edits I hope to make include