Lab Preparation

Successful execution of this lab requires preparation prior to bringing it to your audience.  The following is needed to create the lab:

Parts Needed for Hands-on Assembly

The hands-on part of the lab will include assembling an Arduino Uno to an LCD and Rotary Encoder.  The parts needed for this are:

  • Arduino Uno
  • 16×2 Character LCD with I2C Interface
  • KY-040 Rotary Encoder
  • 20cm M-F Jumper Wires (total of 9)
  • Scrubber Knob for Rotary Encoder
  • USB Charger and USB A-Male to B-Male Cable

Music Lab Parts

Refer to the Parts section for information on where these parts can be purchased from.

Prior to conducting the lab, the program should be loaded into the Arduino.  The Music Lab program is here on Github.  (If you have the time available, you could make programming the Arduino part of the lab.  But for the settings I have in mind, it is easier to program the Arduino prior.)

Make sure that you test the Arduino with the LCD prior to conducting the lab.  The correct I2C address of the LCD must be set in the program in order for it to work.  See the code comments for details.

Note that there is no SD card or SPI Flash.  The song data is hard-coded into the Arduino program using PROGMEM.  Refer to the code comments for details.  It is more tedious to program the song data manually than to read it from a MIDI file.  But with the 8-note xylophone, we are much more limited in which songs we can play, so we can get by this way.

Xylophone Assembly

The second part to preparing this lab is to build the assembly with the Xylophone, Mallets, Solenoids, and Motor Driver Shield.  This is basically a “miniature” version of the main Build Your Music robotic xylophone.  The difference is that instead of a 2-octave chromatic xylophone with 25 mallets and 4 slave Arduinos with motor driver boards, this one uses a 1-octave diatonic xylophone with 8 mallets and just 1 slave Arduino.

Refer to the pages Mallets, Solenoid Assembly, Electronics, and Final Asssembly for instructions.  These instructions were written for the 25-note xylophone, but it should be straight forward to apply these to the 8-note xylophone.

Download the Solenoid Assembly Template for the 8-note xylophone.

The code for the Arduino slave (which holds the Motor Driver Shield) is on Github.

One other difference to point out is that there are extra long (perhaps 2-3 feet long) wires connected to the slave Arduino.  The Green wire is connected to the serial RX (pin 0), while the Black wire is connected to GND.  The corresponding male header pins on the Motor Driver Shield will need to be cut off.

The base with the xylophone, solenoids, and Arduino with Motor Driver Shield are shown below:

Prep - 8-note Assembly 1

And here is the completed assembly, including the mallets:

Prep - 8-note Assembly 2

Next: Lab Instructions