ITJ version 2.0 - System Diagram:

The iTunes Jukebox has three major components: The cases, which each have their own microcontroller (a PIC 16F627A), the tower, which has one microcontroller (PIC 18F452) to facilitate communication between the computer and the cases and another microcontroller (also PIC 18F452) that controls the soft lighting of the tower, and the computer, which runs a perl script that communicates with the cases (via the tower) and controls playback in iTunes.

This is how the jukebox operates:
The Computer asks the Tower PIC to tell it which slots have cases, and what their values are (and also what the volume knob is set to) by sending the question mark ("?") character.

The Tower PIC checks each of 8 switches connected to it. If a case has been inserted into a slot, one of the contacts on the case closes a switch that is connected to the tower and corresponds with that slot. Each time the Tower PIC finds that a slot is occupied (i.e., the slot's switch is on), it sends the character "?" to the case in that slot (via one of the other contacts on that case), and then immediately waits for data to return from that same pin. The case PIC, which has been waiting for serial input this whole time, receives the character "?" and sends back its "name," which is a single character, on the same pin. The Tower PIC receives the name of the case in the slot, stores it, and moves on to the next case, going on through all 8 slots.

After the Tower has a value for all 8 slots, it also samples the analog input coming in from the volume knob, and then outputs a formatted string with all 8 slot names (it sends a "0" if the slot is empty) and the volume back to the computer. The computer reads in the data, updates its own variables, and determines what to tell iTunes to do. The computer then determines what color each of the cases in the tower should be, and begins to tell the Tower how to light them. The computer tells the Tower to light a case by first sending the slot number. The Tower stores that slot number and applies any further instructions it gets from the computer to the case in that slot. The computer sends a character (possible values are "a" through "h") to the Tower PIC to tell it which color to tell the case to turn.The Tower PIC sends the appropriate character to the currently selected slot to tell it to turn the correct color.

System Diagram for the Computer:
The computer keeps a list of the names of each of the cases in the slots (0 if empty), the last values it held for the cases, and a list of which slots have been played. The computer saves the last values it read from the Tower, and then asks the Tower to update those values.

System Diagram

Parts list

This is the list of materials used to develop the project.

Hardware
Tower:
-1 Plastic CD Tower
-aluminum flashing, .092” cut into strips
-24 screws and nuts to connect aluminum to the tower
-bluetooth module
-breadboard components
-2 RGB LEDs to indicate tower power
-1 Breadboard (to hold the electronics)
-1 5V voltage regulator (to control the incoming voltage to the breadboard)
-A 12-Voltage power adapter (to get power from a wall adapter to the 5V regulator)
-8 10K Resistors (to tie down the analog inputs of the PIC)
-1 18F452 PIC Processor

8 iTunes Jukebox Cartridges, consisting of:
-8 Jewel cases
-aluminum flashing, .092” cut into strips
-1 RGB LEDs
-1 pic 16F627A
-4 Mhz crystal
-2 caps
-3 resistors (220 ohm)

    Software (needed to play the jukebox)

    • iTunes
    • Applescript

    Tools/Hardware/Software/Code used to develop the jukebox:

    Software

    Hardware

    Programming Languages

    • C (for tool to communicate serially with PIC)
    • PICBasic Pro (to program the PIC processor)
    • Applescript (for controlling iTunes