Making Music Box Punch Machine With Arduino

by pashiran in Circuits > Arduino

16217 Views, 94 Favorites, 0 Comments

Making Music Box Punch Machine With Arduino

001.jpg
How To Program a Music Box - Hole Punch Tutorial

Do you ever see DIY Music Box?

You can make music by punching holes in paper.

But it's really hard.

When I first saw this music box, I bought it in love at first sight.

But once I punched it, I was exhausted.

So I decided to build a machine that punches automatically.

Warning:

I explained it as easily as I could but I think an only well-skilled person can make this.

You need this to make this;

Tools:

  • 3D printer(at least 210mm bed size)
  • solder
  • square-shaped file
  • drill
  • wire crimper
  • wire stripper
  • epoxy bond
  • sandpaper(coarse)
  • etc(drivers, pliers... basic tools)

Skills:

  • Soldering
  • 3d printing(or maybe you can print in make shops)
  • Arduino programming

How It Works.

K-20190606-420737.jpg
018.jpg
019.jpg
017.jpg
arduino mario song with buzzer

It was very difficult for me to analyze the midi files and make coordinates.

But I found out that musicboxmaniacs.com provides sheet music in dxf format.

The dxf format provides the coordinates of the punched circle directly.

So it's much easier because I just only have to read and organize each coordinate.

The coordinates of the dxf format were not sorted so had to be sorted by X coordinates.

The experts in the arduino forum gave me a lot of advice.

I used the easiest way - bubble sort because the other sorting algorithms were hard to understand.

This is a musical instrument, so I want to express some music.

I put a piezo in it so it can play Mario music at the beginning and the end.

3D Design

002.png
K-20190603-023229.jpg
007.jpg
011.jpg
K-20191109-858128.jpg

If I have to 3d design and electronic circuit design, I do 3d design first.

So I started sketching.


Basically, the X-axis moves using a belt and the Y-axis pushes the paper.

The punch is pressed using a geared DC motor.

I put a sensor on the X-axis to locate it at the beginning, and I put a sensor on the Y-axis to see if the paper is present.

STL files are here : https://www.thingiverse.com/thing:3965396

YOU SHOULD CHANGE PRINTING OPTION TO STRENGTHEN

when printing Linkage_Press_V6-1.stl

I printed it 10 outline shell and 80% infill.


and print two Paper_Roller_Support_C-1.stl and Paper_Roller-1 Paper_Roller_Pillar_V2-1.stl

EagleCad Design

021.jpg
022.jpg
023.jpg
027.jpg
K-20190603-029173.jpg

I've made a few revisions.

I started with the aduino nanos, but I changed to aduino MEGA because of the lack of memory.

Finally, I made a board that uses the Arduino Mega, a DC driver, two-step drivers, a piezo, an encoder switch, a 1602 LCD, and a SD card adapter.

Unfortunatelly arduino MEGA has not enough memory too, so this machine can punch only 700 notes maximum.

Ordering PCB, Parts and Soldering

IMG_20190724_212653.jpg
IMG_20190724_213052.jpg
IMG_20190724_213056.jpg
IMG_20190724_214326.jpg
IMG_20190724_214319.jpg
IMG_20190617_121712.jpg
IMG_20190617_223721.jpg
IMG_20190617_223525.jpg

I uploaded Eaglecad schemetic and board files.

and two .zip files that can order PCB from JLCPCB directly for easy ordering for you.

One is switch board and the other is the main board. upload gerber(zip) files to JLCPCB and order then before a week you can get PCB.(minimum order is 5 each)

This is BOM List
I added some Aliexpress Link for example. But this is not the best selection, just example.

  1. L298N / https://bit.ly/2MUEIWb - 1
  2. 1N4004 - 4
  3. XH connector(M/F) 2pin https://bit.ly/2wYtuW5 - 3
  4. XH connector(M/F) 3pin - 2
  5. XH connector(M/F) 4pin - 5
  6. 2p terminal / https://bit.ly/2RlewCQ -1
  7. 100uF Capacitor - 1
  8. 220uF Capactor - 1
  9. 0.1uF Capacitor - 2
  10. piezo - 1
  11. LM1117-5 / https://bit.ly/2MT9cbe - 1
  12. 100 ohm Resistor - 3
  13. 10 Kohm Resistor - 6
  14. 1x10 pin header(M) - 1
  15. 1x8 pin header(M) - 4
  16. 1x7 pin header(M) - 1
  17. 1x2 pin header(M) - 3
  18. 2x18 pin header(M) - 1
  19. 1x8 pin header(F) - 4
  20. Encoder SW(20mm) / https://bit.ly/31DljfR - 1
  21. A4988 or DRV8825 Stepper driver - 2
  22. tact switch 5mm / https://bit.ly/2wW4EWP - 1
  23. Micro SD card module / https://bit.ly/2Iq06hI - 1

Assembling #1 - Base Plate

IMG_20190618_183930.jpg
IMG_20190618_183937.jpg
IMG_20190618_183953.jpg
IMG_20190530_221034.jpg
IMG_20190618_184009.jpg

Parts need insert nut for pcb.

Use solder to insert it.

and 3M bumpon

  1. M3 insert nut / https://bit.ly/2lPwRw6 - 8
  2. (optional) 3M bumpon SJ5312(clear) or SJ5012(black) / https://bit.ly/2lJNglv - 5

Assembling #2 - Paper Roller

IMG_20190618_185420.jpg
IMG_20190618_185639.jpg
IMG_20190618_185651.jpg
IMG_20190618_185710.jpg
IMG_20190618_185910.jpg
IMG_20190618_190538.jpg
IMG_20190618_190544.jpg
IMG_20190618_190912.jpg
IMG_20190908_163308.jpg
IMG_20190908_163350.jpg
IMG_20190618_191118.jpg
IMG_20190618_191151.jpg
IMG_20190618_191203.jpg
IMG_20190618_191605.jpg
IMG_20190618_191850.jpg
IMG_20190618_192055.jpg
IMG_20190618_192100.jpg
IMG_20190618_192108.jpg
IMG_20190618_192513.jpg
IMG_20190618_192541.jpg
IMG_20190618_192724.jpg
IMG_20190618_192819.jpg

I tried but cannot make perfect BOM(but I tried).

because I used many parts that are already my own

There is not much to explain. See pictures.

BOM

  1. limit sensor / https://bit.ly/2WRZeGT - 1
  2. M3 15mm bolt - 5
  3. M3 10mm bolt - 16
  4. M3 8mm bolt - 4
  5. M3 nut - 21
  6. M3 washer - 9
  7. silicone ring 22x16x3 / https://bit.ly/2m6TjB5 - 12
  8. nema17 step motor 34mm long - 2
  9. 605zz bearing - 4
  10. 603zz bearing - 4
  11. MR63zz bearing - 2
  12. M5 nut - 8
  13. M5 20mm bolt - 3
  14. M5 25mm bolt - 1
  15. M5 40mm bolt - 1
  16. GT2 20teeth 5mm bore timing pulley (width : 6mm) / https://bit.ly/2x55jVU - 2
  17. GT2 60teeth timing belt 120-6mm / https://bit.ly/36oJFy1 - 1
  18. 12V geared DC motor(22RPM) / https://bit.ly/2N7HmZ4 - 1
  19. loctite bond

Assembling #3 - X Axis Motor and Pulley

IMG_20190618_193111.jpg
IMG_20190618_193328.jpg
IMG_20190618_195005.jpg
IMG_20190618_195232.jpg
IMG_20190618_195553.jpg
IMG_20190618_195724.jpg
IMG_20190618_195803.jpg
IMG_20190618_195926.jpg
IMG_20190618_195939.jpg
IMG_20190618_200011.jpg
IMG_20190618_200059.jpg
IMG_20190618_200809.jpg
IMG_20190618_200813.jpg
IMG_20190618_200841.jpg

BOM

  1. M3 10mm bolt - 4
  2. M3 8mm bolt - 4
  3. M3 nut - 4
  4. M3 washer - 4
  5. M5 25mm bolt - 1
  6. M5 nut - 2
  7. limit sensor / https://bit.ly/2WRZeGT - 1

  8. GT2 20teeth 5mm bore timing pulley (width : 6mm) / https://bit.ly/2x55jVU - 1

  9. GT2 20teeth 5mm bore timing ider pulley (width : 6mm) / https://bit.ly/2x1qQi3 - 1

Assembling #5 - Puncher Motor

IMG_20190618_224026.jpg
IMG_20190926_210248.jpg
IMG_20190926_205627.jpg
010.jpg
IMG_20190926_210013.jpg
IMG_20190926_212652.jpg
IMG_20190926_212712.jpg
IMG_20190926_212909.jpg
IMG_20190926_212926.jpg
IMG_20190926_213030.jpg
IMG_20190926_213057.jpg
IMG_20190926_213156.jpg
IMG_20190926_213222.jpg
IMG_20190926_213335.jpg
IMG_20190926_213631.jpg
IMG_20190926_213653.jpg
IMG_20190926_220149.jpg
IMG_20190926_221027.jpg
IMG_20190926_221135.jpg
IMG_20190926_221204.jpg
IMG_20190926_224245.jpg
IMG_20190926_224255.jpg
IMG_20190926_224339.jpg
IMG_20190926_224343.jpg
IMG_20190926_224356.jpg
IMG_20190926_224442.jpg
IMG_20190926_224509.jpg
IMG_20190926_224550.jpg
IMG_20190926_224612.jpg
IMG_20190926_224631.jpg
IMG_20190926_224942.jpg
IMG_20190926_224950.jpg
IMG_20190926_225007.jpg
IMG_20190926_225140.jpg
IMG_20190926_210327.jpg
IMG_20190926_210420.jpg
IMG_20190926_210427.jpg

Puncher module moves on the printed rail.

BOM

  1. 605zz bearing - 4
  2. MR63ZZ bearing / https://bit.ly/2lYjf1S - 2
  3. M3 6mm bolt - 1
  4. M3 10mm bolt - 7
  5. M3 15mm bolt - 5
  6. M3 nut - 11
  7. M3 washer - 4
  8. 12V dc geared motor(22RPM) / https://bit.ly/2lCGTkc - 1
  9. GT2 belt 325mm - 1
  10. 2.5 * 40mm steel rod / https://bit.ly/2lPCxqr - 1
  11. M3 square nut / https://bit.ly/2lYM2n6 - 1
  12. limit sensor / https://bit.ly/2WRZeGT - 2

LCD, Switch and Wiring

IMG_20190928_184739.jpg
IMG_20190928_184828.jpg

Use wire crimper.

Pay attention to the order of wiring .

Sketch Upload and Tune

K-20191109-839698.jpg
K-20191109-838638.jpg
K-20191109-838772.jpg

49line's XdirFactor / YdirFactor is stepper motor direction variables.

53line's defaultStepPosX / defaultStepPosY is (0,0) cordination of music box paper.
If your puncher start punch wrong position, check this variables.

54line's XFactor / YFactor is step number to move 1mm

If your puncher moves more or less, check this variables.

Done.

Music box puncher - from punch to play - Be our guest(from beauty and beast)
snoppa-picture-20191020102518.jpg
20191019_155133.jpg
IMG_20191020_155204.jpg

I submitted this puncher to Seoul Maker Faire 2019
So many people loved it.
and my long project is done.

Some people asked this puncher when I'm making on.
so I write this instructables.

I tried but explain in English is too hard. (thanks to google translator)

maybe next time I'll just use just Korean because translator is good enough on recent days.

thank you for reading.

Bugfix.

K-20200104-786403.jpg

There are only one LM1117 on PCB.

That can be too hot, because this circuit needs high current more than LM1117 can gives.

So I added one LM2596 Step-Down Converter so it can make 5V vcc power.

You can buy one from this; https://www.aliexpress.com/item/32952599622.html?s...

And you need multimeter to adjust the convereter.

Solder 12V to Converter's IN+, 5V/VCC to Converter's OUT+.

and GND to IN-, OUT-.