Programmable Music Box

Arduino-based music box that rotates a figure and plays an mp3 file.
14
35
0
876
aktualisiert 23. Mai 2023

Beschreibung

PDF

This is a programmable music box based around an Adafruit Feather M0 microcontroller with a Music Maker FeatherWing. When the lid of the box is opened, the microcontroller is enabled, and starts playing an MP3 file while driving a continuously rotating servo motor to rotate a figurine.

All printed parts can be printed without support material. Silk PLA or PETG seems to work well.

In addition to the 3D-printed, the music box requires the following:

The servo runs off the Feather, with the following connections:

  • brown wire to GND
  • red wire to 3.3V
  • orange wire to pin 1 (aka A11, aka TX)

The microswitch is connected to either the Feather or the FeatherWing (whichever's more convenient) as follows:

  • NO tab to Enable
  • C tab to GND

I used header pins to connect the servo and the microswitch, but you can solder directly if you're feeling brave. 

The speaker connects to either left or right speaker terminals on the FeatherWing.

The battery connects to the JST connector on the side of the Feather.

Programming the Feather requires a bit of Arduino knowledge. You'll need the Arduino IDE as well as drivers and libraries to support the hardware. There are lots of tutorials online to walk you through this, though. I've included the source code (the .ino file) that allows the Feather to control the servo and MP3 player.

The FeatherWing should come with an SD card. You'll need to load an MP3 file called tune.mp3 with the music of your choice onto the card. I created my audio file by locating a midi file with the song I wanted, turning off all tracks except the main tune (using Anvil Studio), setting the instrument of the remaining track to ‘music box’) and recording the resulting tune (audio loopback using Audacity).

As far as assembly goes, everything should just fit together. No mounting hardware is required. If you want the assembly to be a bit more robust / permanent, you can glue it together. The battery is attached to the bottom using double-sided tape.

I've included a bit of debug code to help diagnose problems. The feather's on-board NeoPixel will light up with the following colors if there's a problem:

  • red = can't connect to the Music Maker FeatherWing
  • yellow = can't connect to the SD card
  • blue = can't find tune.mp3

I'd recommend getting all the electronics working first, before printing, just in case things go horribly wrong.

When assembled, the USB port is exposed to allow for recharging or reprogramming. It can be recharged with the lid open or closed, but must have the lid open for reprogramming.

Here's what it looks and sounds like when it's all put together:

NOTE: I didn't include the “You Spin Me Round” mp3 or the Pete Burns figurine. I'm not sure how those would work within the Creative Commons license.

Remixes are allowed and encouraged. I'd love to see something from someone with a bit more miniature modeling & painting skills than I have.

Tags



Herkunft des Modells

Der Autor hat dieses Modell als seine eigene Kreation gekennzeichnet.

Lizenz


Hervorgehobene Modelle des Erstellers

Mehr anzeigen