Instructables

Electronic Music Box Powered by Arduino (sort of)

Featured
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
 
Remove these adsRemove these ads by Signing Up
martellyer7 months 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)  martellyer7 months 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
Cheers
FAZ2TMCHO238H8G.LARGE.jpgFDEJ1REHO238H8A.LARGE (1).jpgFTKEEJHHO238H89.LARGE.jpg
agis688 months ago
excellent instructable...
jbackes8 months ago
Very cool idea. Good Job.
AJMansfield8 months ago
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)  AJMansfield8 months 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.

stubbsonic8 months 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)  stubbsonic8 months 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.
longwinters8 months ago
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)  longwinters8 months ago
I had the similar idea using the thermal paper and a receipt printer.
TSJWang8 months ago
I love this! I want to try putting in a scantron to see what music a quiz makes.
h2osteam (author)  TSJWang8 months ago
Or you can put the music through a scantron see how many mark you get
great idea