Picture of Electronic Music Box Powered by Arduino (sort of)
Music is the most universal means of expression. Regardless cultural language or age the idea conveyed though music would not differ much. It is safe to say everyone loves music, one type or another. When one’s favourite piece is played there is a overwhelming desire to get involved and turn on one’s Air Guitar.
Not being familiar with any type of musical instrument myself. Moving my hand insanely in the air and imagining my virtual tone lines up perfectly along the music was the best I could do.
Why not put my engineering degree to use. Design something able to play music without any training, minimal music knowledge but still get that person highly involved.
Music box seems like a good start. The music is actually ‘played’ in real time, unlike mp3 music player which merely convert a string of data to time varying voltages. However the music storage method has to be changed, a drum with pins poking out does not allow much customization. If the music is stored on file we are back to the mp3 player, but if the music is on a piece of paper…..Now we are talking.
Hence the Electronic Music Box was conceived.
What you will need:
2 proto boards or PCBs
LM7805 5V regulator
ATmega328 or Atmega168 microcontroller
16 MHz crystal with 2x22pF cap
Or forget about the two above if you use an Arduino
3 X LM324 opamp
14 X IR LEDs
14 X IR photodiodes
10K potentiometer
50k potentiometer
3.5mm headphone jack
MCP4911 10bits DAC
20 ways Right angle male heading connector
20 ways Female header connector
Various capacitors and resistors
Optional, mechanical:
6V motor with gearbox ~ 30RPM
Rollers, more on that later

Youtube link here
cjhhao17 months ago

Hello, I love your work, but there is a problem. I would like to ask MCP4911 10bits DAC is not necessary to use it? MCP4921 can not replace it? Want to give me an answer as soon as possible, thank you.

h2osteam (author)  cjhhao17 months ago
Hi there
I'm not 100% sure about your question. I'll answer it as to my understanding.
You will need a DAC, doesn't have to be the same part. Any DAC with SPI input can work with little to no alternation on the code.
The arduino atmega328 I'd used don't have enough spare IOs to generate analog signal by itself.
morini made it!10 months ago

I made it by ARM7 and photocells and a USB powered programmer

DSC_0007 (2).JPGDSC_0012 (2).JPG
h2osteam (author)  morini10 months ago

Wow this is brilliant. way more professional looking than mine. Good work

martellyer1 year ago
Hi h2osteam,

I've been trying to create the music box powered by an Arduino but have run into a few problems. I was hoping you'd be able to answer my questions.

First of all, how is the music box powered? Where is the input voltage source to run the arduino and light up the IR LED's?

Secondly, where does the right angle male header fit into the IR array? From the pictures it seems that is a straight male header that is being used.

Finally, where do we use the 10K and 50K potentiometers? It seems that the main board just has one 10K potentiometer.
h2osteam (author)  martellyer1 year ago
Hi martellyer I am glad you are trying to build one for yourself. As to all your questions, they are actually all answered in my article. to make things easier, take a look at the images attached. 
Feel free to ask
agis681 year ago
excellent instructable...
Very cool idea. Good Job.
The one complaint I have is that the different parts to Canon in D are actually supposed to be played together, in a round. The cello line is also supposed to be repeated continuously throughout the entire song. While I understand that doing that is likely beyond the capacity of the device, it still doesn't sound good having it mutilated like this.

A way to remedy this without adding additional hardware: Replace one of the tracks with a 'loop' indicator; it records all the notes played while the loop bit is set, and then plays them back repeatedly (in addition to further notes) until the recording is replaced by a new section.
h2osteam (author)  AJMansfield1 year ago
You are right. This canon does sound weird without the repeating loop. Like you said the repeating part is beyond the note range the device covers.
Also It is more of a novelty item than a real instrument.

stubbsonic1 year ago
Very cool.

A possible variation on this would be to have a MIDI version where instead of generating tones, it would send MIDI note on's & offs to a MIDI output (just saw one here a few days ago). There could even be a band that does an octave switch for more range.
h2osteam (author)  stubbsonic1 year ago
You can do that, it will actually be simpler in the code. accurate timing will no longer be essential.
But that kinda defeat the idea of a stand alone system. Actually you can replace the IR sensors with a keyboard and play music
Understood. However the angle of hand-drawing something (besides notation) that a robot then plays back is kind of cool MIDI or not.
Great project I can appreciate the quantity of work here, when I think of feeding a paper strip I think cash register or calculator paper feed, it's ready made reliable and you could make quite a long tune.
h2osteam (author)  longwinters1 year ago
I had the similar idea using the thermal paper and a receipt printer.
TSJWang1 year ago
I love this! I want to try putting in a scantron to see what music a quiz makes.
h2osteam (author)  TSJWang1 year ago
Or you can put the music through a scantron see how many mark you get
great idea