## Introduction: Making Music Box Punch Machine With Arduino

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

## Step 1: How It Works.

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.

## Step 2: 3D Design

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

I printed it 10 outline shell and 80% infill.

and print twoPaper_Roller_Support_C-1.stl and Paper_Roller-1 Paper_Roller_Pillar_V2-1.stl

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.

## Step 4: Ordering PCB, Parts and Soldering

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

## Step 5: Assembling #1 - Base Plate

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

## Step 6: Assembling #2 - Paper Roller

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

## Step 7: Assembling #3 - X Axis Motor and Pulley

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

## Step 8: Assembling #5 - Puncher Motor

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

## Step 9: LCD, Switch and Wiring

Use wire crimper.

Pay attention to the order of wiring .

## Step 10: Sketch Upload and Tune

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.

## Step 11: Done.

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.

## Step 12: Bugfix.

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-.