Loading
Programmable Music Box

Programmable Music Box

by scientiffic | updated September 04, 2014

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.

Clothing_icon
Electronics_icon

0

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.  

June 12, 2013 at 8:18 AM
Comments (0)
V01

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!

June 12, 2013 at 11:29 AM
Comments (0)

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:

  • integrate an SMD multiplexer on the board itself (rather than using a breadboard)
  • make the music box self-powered (using probably a 9V battery) 
  • add an on/off switch
  • redesign the housing for the music box to make it look less clunky (and potentially not use the laser-cut puzzle-box aesthetic)

October 5, 2013 at 3:44 PM
Comments (0)

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!  

http://itp.nyu.edu/physcomp/Tutorials/Multiplexer

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!

 

 

October 5, 2013 at 5:09 PM
Comments (3)
BTW, that tutorial link is dead.
I ordered the dip version to experiment with before laying out an smd board.
over 2 years ago
Thanks for letting me know about the link...it's too bad because it was a really good tutorial.
over 2 years ago
Here's a similar chip/tutorial:
http://playground.arduino.cc/learning/4051
over 2 years ago

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.

October 5, 2013 at 5:50 PM
Comments (0)

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!)

October 8, 2013 at 10:44 AM
Comments (0)

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:

http://www.legacylasers.com/images/DSCF3777%20(2).JPG

http://www.hobbyking.com/hobbyking/store/__37241__h_king_laser_cut_plywood_field_box_400mm_x_235mm_235mm_self_assembly.html

http://herbhoover.com/images/2boxes.jpg

October 8, 2013 at 10:57 AM
Comments (0)

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!

October 8, 2013 at 11:05 AM
Comments (0)

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!

October 8, 2013 at 11:24 AM
Comments (2)
That box looks so cool. How did you transfer the parts from the 3D program to a 2D program for the laser cutter?
over 2 years ago
Thanks a lot! I made it in SolidWorks and then created an assembly file with all the parts flat on a single plane. Then I created a drawing of the assembly and exported it as a DXF (which I could then import into CorelDraw).
over 2 years ago

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.

October 10, 2013 at 11:15 AM
Comments (0)

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.

October 10, 2013 at 1:32 PM
Comments (0)

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.

October 10, 2013 at 2:01 PM
Comments (0)

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.

October 10, 2013 at 3:30 PM
Comments (0)

I used a cherry wood stain and applied polyurethane finish afterward.

October 10, 2013 at 5:47 PM
Comments (0)

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.

October 10, 2013 at 9:20 PM
Comments (0)

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!  

October 10, 2013 at 11:53 PM
Comments (0)

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 

  1. redesigning the circuit board using SMD components (to eliminate breadboard)
  2. enabling the music box to play chords and have faster sensing generally
  3. eliminating LEGO components and using only laser cut components

October 11, 2013 at 12:33 AM
Comments (8)
It looks like this project took you under a week to complete - any idea how long would it take for someone without any laser cutting or multiplexer experience? I've always loved these music boxes
about 3 years ago
well, this is actually based on something I made for a class, so luckily I didn't have to talk at all about designing the electronics, which took the longest for me. having a laser cutter definitely helps speed up the process. I'll put up some design files soon!
about 3 years ago
Can you talk about the cylinder itself? is the grid also laser cut out of some flex material? What did you use to make the cylinder?
over 2 years ago
For the cylinder, I had a friend help me cut through a large piece of a scrap steel tube using a horizontal band saw.

I then laser cut end caps out of wood and glued them to the interior of the cylinder (to attach the axle).

The laser-cut covering for retaining the magnets was cut out of a flat magnetic sheet (the type you can buy from a craft store for printing magnets at home). The only trick was that I had to first peel off the white coating, which I think is not laser cutter safe.

Let me know if you have any other questions! (:
over 2 years ago
This concept is so anachronistically cool. V02 turned out beautifully!
about 2 years ago
Thanks a lot! I've been meaning to start working on V03 for a long time – hopefully I'll have to time to start working on it as a weekend project!
about 2 years ago
Very cool! What will set V03 apart from V02?
about 2 years ago
Mostly improved electronics – I had purchased a SMD multiplexer, which would eliminate the messy breadboard I have hidden inside the music box. Also, the board I've been using is several years old, and there are definitely some sketchy connections on it!

I also wanted to revisit the Arduino code to incorporate chords, which the music box doesn't do very successfully right now.
about 2 years ago