Minecraft Jukebox




Work In Progress

This project is still in the process of being completed, but it's core functionality is complete. What remains to be finished is mainly aesthetic work in order to replicate the Jukebox Block from Minecraft.


The Idea

The idea was to create a replica of the Jukebox block from Minecraft using my new laser cutter. This is great because the Jukebox is made from wood, and the laser cutter is fantastic at cutting and engraving wood. However, I wanted the Jukebox to actually function in addition to just looking good. This required a combination of mechanical, electrical and software engineering.

RFID Tags

The Jukebox block in Minecraft accepts a variety of disks and plays different songs based on each disk. I wanted my real life Jukebox to have the same functionality, so I decided to use RFID tags to indicate which song is to be played. Each disk has an RFID tag the size of a credit card embedded in it. When the disk is inserted into the Jukebox, the tag is read, and based on its ID, and appropriate song is played from an SD card.

Playing Music

Playing high definition audio from an SD card using an Arduino is more difficult than you would think. Luckily, Adafruit has a fantastic "Music Maker" MP3 Shield built specifically for this purpose. Using the Adafruit's libraries and fantastic documentation, I was able to play music from an SD card in just a few minutes.

CAD Design

Laser Cut Design

I designed my Jukebox specifically to be laser cut. The laser only cuts 2 dimensional shapes, but with tabs and slots I can create a 3 dimensional structure. I fact, almost none of the parts in my design need to be glued together. Instead gravity and friction hold all the tabs into place.

CAD Model from the outside

CAD Model internals

IMG_0651.MOV

Push-Push Mechanism

I wanted to have a mechanism to eject the disk, similar to how the disks are ejected in the game. I also wanted to avoid any sort of on switch or button. To achieve this I created a "push-push" mechanism. You've probably seen this type of motion before in a ballpoint pen. You press down once, and the object locks. You push down again and the object returns. I was inspired to create this geometry by the video on the left.






In my Jukebox, inserting a disk presses down on the rectangular pusher, which is held up by elastic bands. Mounted on the pusher is an arm, which follows the track. On the first press, the pusher gets locked in the down position. The pushers also activates a limit switch, which provides power to the Arduino. This way the Arduino is only on when the pusher is depressed. When the disk is pressed again, the pusher returns upward due to the rubber bands. The pusher then pushes the disk up and out of the Jukebox. Simultaneously, the pusher releases the power switch, cutting power to the Arduino and the speakers.


Cutting Parts

The parts were then exported as 2D shapes, and cut out of 1/4in birch wood. However, I didn't realize the first time I cut my parts the while 1/4in birch wood is labeled as such, it's thickness is actually much closer to 0.20in. So my first batch of parts had tolerances that were much too large, and thus were unusable. I changed my dimensions in Fusion 360, and cut the parts to the correct shape this time.

IMG_0648.MOV
IMG_0656.MOV


Assembly

Assembly of the mechanical components was relatively straight forward due to the tab and slot construction method. Some sanding was necessary to get the pusher block to slide easily in its vertical tracks. The complex "push-push" track was also sanded to reduce friction. I spread a bit of wax along the edges of this track which helped reduce friction tremendously.


Electronics

The Arduino Mega 2560 that I used for this build is pretty overkill, but the music maker shield fit so I decided that the Mega would work fine. I had to solder the stacking pins onto the music maker board, and add a few additional pins to attach the 3.3V power wire for the Mifare RFID reader. Power for the Arduino is stored in a standard 9V battery, and is only connected when the limit switch is pressed. The RFID reader is connected over the extra digital pins on the Arduino Mega, specifically the ones wired to the ICSP header, which is used for communicating over SPI.

IMG_0677.MOV

The power for the Arduino is activated through a limit switch. You can see the red power wire goes up the limit switch and back down the Arduino, while the ground cable goes directly to the Arduino.

The power and SPI communication for the RFID scanner are provided through the brightly colored ribbon cable. The Music Maker shield provides power to the speakers on both sides. The wires going under the center go to the speaker on the other side.

Software

Controlling both the music maker and the RFID reader individually was very simple. Both boards have dedicated libraries and examples that are essentially plug and play. However combining the two boards together resulted in some major conflicts.


Both boards communicate over SPI, so when both boards attempt to initialize on the bus at the same time neither will function. After learning about SPI, I was able to manually remove the music maker from the SPI bus until the RFID reader found a tag. After a tag is found, I remove the RFID board from the SPI bus and initialize the music maker to play the song. This way both devices are never on the SPI bus at the same time.

Complete Internals

Demonstration

The internal hardware, electronics, and software are complete and functional. The video on the right demonstrates a complete cycle of the jukebox

The acrylic disk has a single RFID tag attached to its center. The disk is inserted into the slot in the top of the box. As it's inserted it rests on the pusher, which upon reaching the bottom of its travel locks in place and presses the power switch.

The Arduino then powers on and immediately searches for the RFID tag. If the tag is found and matches the preprogrammed list of IDs, then the associated song is played from the SD card on the music maker through the speakers.

When the disk is pressed again, the pusher is released, pushing the disk upwards. This also releases the power switch, cutting power to the Arduino and instantly muting any audio playing.


IMG_0759.MOV

Aesthetics

Each side of the jukebox was etched and cut on the laser to keep the wooden aesthetic. The side panels and top of the box were glued together, and slide in on top of the base plate.

Painting disks would be very tedious, so instead I laser etched two sides of a disk, and glued an RFD tag into the middle. This slides nicely into the jukebox slot. I have only created one disk so far, but I'm hoping to make a disk for every one in the game.

IMG_0686.MOV

One of the side panels being cut out