Music Box

by sdarwish in Circuits > Arduino

257 Views, 2 Favorites, 0 Comments

Music Box

IMG_9793.JPG
music box opened.JPG

This box can be something to gift a loved one or for a sense of peace and calmness for another. The serotonin offered by the flicker of the lights combined with the the tranquility represented by the dancer, this box is the best of both worlds. A memory never forgotten. Any music can be substituted into this box, allowing for any mood desired.

Supplies

2 micro servos (SG92R- tower pro)

Hot Glue (super glue as substitute)

Wood Glue

Doll/dancer

Led light strip

Arduino ADPS9960

Circuit Python

Circuit Playground Bluefruit

Sheet of 1/8" plywood

15 Alligator Clips and wires

Battery Pack with 3 AAA

Paint

Paint Brush

Velcro

Laser Printer

Laptop

USB to micro USB Data Cable

Minispeaker

Safety glasses

Photoshop

Trotec

MakerCase

Cup of Water

Tape

Box Layout Assembly

makercase to photoshop.JPG
makercase side angle .JPG
makercase above angle.JPG
trotec outline.JPG

First, go on the makercase.com and chose kerf bent box. The curve in this box type will allow for the door to be opened.

Scroll down to the number of bends and change it from the custom 4 to 1.

Change the Width to 5 in

Height to 8 in

Depth to 5 in

Click download box plans

Diable Panel labels

Download SVG


Secondly, open saved SVG on Photoshop. Select all and double click the color box on the left. Change the color to ff0000.

I added a 1" x .75" rectangle on the side for the wired to come through.

I also added 2 straight lines by the "kerfed" section of the box, thus separating it from the sides— creating 2 sides and a front, rather than a connected front and side.

Change the stroke to 0.01mm.

Download the PSD file


Thirdly, Open Trotec for laser printer

Double check all outlines are in True Red.

Select the material, position and focus laser. Push to design.


Decorating the Box

IMG_9795.JPG
painting music box .JPG

Use wood glue to glue all the pieces together to ensure durability.

Glue all sides together except one of the sides and front (like a door).

Leave 24 hours to dry.

Place velcro on the outside of the side and inside of the box, at same relative height on both sides, allowing it to stay closed.

Place a velcro on other side of box and front of the door to the right, allowing it to hold in place when opened.

Paint the box in color of choice with paintbrush and water cup for paint.

Draw designs on "door" of the box.


Creating "Cover Up" for Inside Box

inside covers.JPG

Open Photoshop. Create a rectangle 4.9" x 4". Draw a circle in that rectangle 1.5" in diameter. Create another rectangle 4.9" x 3" and draw a another smaller rectangle in the middle of it 0.8" x 0.6".

Select all and change color to ff0000.

Change the stroke to 0.01mm.

Download the PSD file


Thirdly, Open Trotec for laser printer

Double check all outlines are in True Red.

Select the material, position and focus laser. Push to design.


Program Into Circuit Python

I added led lights and sounds to the music box, turned on with a proximity sensor. Once it senses that the door is opened, the song begins to play, the doll starts to spin, and the lights begin to change color.

I got my sounds (.mp3 files) from that I'll link below:

Peaceful Lullaby Music Box Theme

Then connect LED light strip, speaker, servos, sensor, and alligator clips to the CPB board.

Servo 1:

Connect to touchpad A2

3.3V power

GND

Servo 2:

Connect to touchpad A3

VOUT for power

Share GND touchpad with Servo 1

Led Lights:

Connect to touchpad A1

Share VOUT with Servo 2 for power

GND

APDS9960 sensor:

Black Wire in GND

Yellow wire in A4

Blue wire in A5

Red wire in 3.3V

Speaker:

Ground into GND shared with Led Lights

Alligator clip into Audio


When the code is on and door is closed, nothing happens. When the code is on and the door is opened, the 14 sec sound starts. The lights go through a dictionary of colors. Servo 1 begins rotating to 180. Once at 180, it stops and servo 2 starts rotating to 180 (or until the music stops). Once the music stops, the lights go through the rest of the dictionary then turn off. The servo's reset (this can be done after the door re-closes for a more natural effect). If door is left open or is re-opened, the process starts back up again.

In my code, if the sensor picks up a reading of 6 or less, it starts playing

See my code for details!

Downloads

Placement of Supplies Into Music Box

inside of music box.JPG
wires.JPG

Stack servo 2 on top of servo 1 and hot glue together. Make sure that they are facing opposite directions so an entire 360 deg is covered. Hot glue the doll on top of servo 2.

Insert the 4.9" by 4" rectangle into the box, 3" from the bottom, making sure that the doll and servos are through the whole. Hot glue servo 1 to the bottom of the box.

Place the Led light strip around the inside back wall of the box, as shown in the second image attached, allowing it to come down from behind the rectangle and out the cut-out to the side. Use tape to hold it in place.

Tape the proximity sensor to the 4.9" by 3" wood, aligning the sensor with the cut-out in the middle. Allow the wires of the sensor to exit though the music box cut-out on the side. Use alligator clips to elongate if necessary.

Place all wired into a separate box, with all the wires coming out the music box cut-out and into the box.

Finishing Touches

Attach a battery pack to CPB, after saving the code.py file onto the circuit py.

Shut the door and test the velcro.

Turn the batter on and enjoy your music box.

Video of It Working

Music Box Demo