User:1sfoerster/enes100/fall2013/p1music

Individual Pages
Connor's Wikiversity Page

Rachel's Wikiversity Page

Olivia's Wikiversity Page

Problem Statement (Finish description)

 * Build a test wiring harness for the plexiglass beat bearing
 * Build prototype and test plexiglass washer/screw/hole/gluing assembly system
 * Draw system block diagram that illustrates how both papillio and arduino are going to split up the work of driving the VGA monitor and decoding which of the 32 holes has a ball in it.
 * Repeat success of arduino driving sythesizer

Conceive
Market/Customer Needs People have an attraction to making their own music, especially rhythm, and music-making equipment can be expensive. The BeatBearing project allows for a unique music making experience without high cost.

Initial target goals To have a usable BeatBearing board.

System performance metrics Safety with electricity is essential. Assurance of no electrical parts showing.

Project cost and schedule Cost of project shouldn't be too high. Cost of screws, washers, wires, etc. should be taken into consideration.

Alternatives
 * Communication - Morse code
 * Clock/Time keeper
 * Turn into game board
 * Use to teach musical rhythm

Helpful Links

 * Operations Manuals found
 * Jameco BeatBearing
 * The BeatBearing Tangible Rhythm Sequencer
 * Training video and tutorials found
 * Jeremy Blum Arduino Tutorial
 * BeatBearing Demo
 * Patrick Marsden | Cutting Washer Tutorial
 * Piano Professor Arduino
 * Service Manuals found
 * Casio CTK 519 User Manual
 * Information Pages
 * HCC Wikiversity
 * Dmoreno1899
 * Fall 11' Music Team
 * MIDI
 * HowStuffWorks.com
 * SparkFun.com Breakout board
 * RobotShop.com Breakout board
 * SparkFun.com MIDI Shield
 * Theory of Operation
 * Arduino
 * In-system programming
 * ATmega8 controller

Alternatives
This table displays our decision making project for why we chose to pursue the Beat Bearing music project instead of the Tin Can.

Decision making table for the glue to use when setting washers on plexiglass board.

Programming the Keyboard
Goal: To program an arudino to play notes on a keyboard through a MIDI shield

An arduino is a single-board multi-controller that makes using electronics easier. It can be plugged into a computer via a USB port. It also has a DC power jack.

MIDI stands for Musical Instrument Digital Interface. In other words, MIDI is data that tells an instrument what to play. The MIDI Breakout allows the arduino (or other micro-controller) to communicate with electronic instruments. A MIDI shield is similar to the MIDI Breakout except that it has additional buttons and knobs.

Materials Used
 File:Arduinouno9.JPG|The Arduino Uno SMD File:Midibreakout.JPG|MIDI Breakout board File:Midishieldright.JPG|MIDI shield File:Keyboard519.JPG|Casio CTK 519 Keyboard File:Midicable.JPG|MIDI cable File:Usbcable2.JPG|USB cable 

For the first week we used the wrong type of MIDI board. For this project, a MIDI Shield must be used, not a MIDI Breakout board.

Programming the Arudino
In order to program the arudino, we first had to download the arudio software.

Once the software had been downloaded, we plugged the arduino into the computer via an USB cable. The first code we used was a simple code to flash a light on and off. By entering the code into the program and hitting upload, the code is transferred to the arduino.

Code One
Goal: Blinking a light on and off

We weren't completely sure if the code worked. The light did blink on and off, however, it was already doing that before we uploaded the code.

The first set of tests we did were with the MIDI shield. Even though this was the wrong type, it allowed us to learn more about arduinio coding as well as how MIDI works.

We uploaded a second code taken from the arduino website. We placed the MIDI shield on top of the arduino and uploaded the code. We then plugged the "in" side of the MIDI cord into the "in" port of the MIDI board and the "out" side into the "out" port on the keyboard.

Code Two
A sample MIDI code

Goal: To play a simple series of notes

Nothing happened. We switched the cords so the "out" side of the MIDI cable was in the "out" MIDI port and the "in" side was in the "in" port of the keyboard. Still nothing.

We looked at previous HCC students' pages and found these two paragraphs that were very helpful.


 * Uploading this code to the arduino, connecting the MIDI shield to said arduino, connecting MIDI out to the MIDI shield, and MIDI in to the keyboard (or any other device with a MIDI in) will result in all notes the device (keyboard) can possibly play, in ascending sequence. - Taken from Dmoreno1899's page


 * The arduino environment... has to in essence "find" the right board once it's hooked up to your computer. You have to make sure you have the right model of arduino selected (such as arduino Uno, arduino Mini, arduino Fio...), and that it's "looking" in the correct COM port... To find this setting and change it, go to tools -> board and select the correct arduino board. The correct COM port is a bit trickier if you don't already know how to find it. First one must find that the arduino is properly recognized in the device manager. On a Windows 7 64 bit operating system, go to the control panel -> system and security -> system -> device manager -> Open the drop-down menu labeled "Ports (COM & LPT)". The arduino Duemilanove was recognized as the "USB Serial Port(COM3)", but other boards are recognized under different names. To change the COM port the arduino environment looks for, go to tools -> Serial Port and select the corresponding COM point. - Taken from Fall '11 Music Team's page

This helped us to better understand how to go about programming the keyboard.

The MIDI Shield
Once we realized that we were using the wrong MIDI Device, we assembled the MIDI Shield by soldering (a tutorial can be found here).

 File:Assembledmidishield.JPG|Assembled MIDI Shield 

We then tried uploading the code again. It didn't work. And after trying many times, we found out that the board was soldered incorrectly. Instead on one strip of solder running across the analog pins, each pin needed to be soldered individually.

Make sure that each pin is soldered individually!

Testing the Correctly Soldered MIDI Shield
We successfully uploaded Code 2 to the arduino, attached the MIDI shield, plugged in the MIDI cable, and nothing happened. We wondered if it had something to do with the code so I went to the 2011 HCC Music Team page and used their code for Mary Had A Little Lamb. This team said that the code was a success.

Code Three: Mary Had A Little Lamb
The keyboard did nothing. We tried attaching the cables in different orders, placing the MIDI board on top of the arduino before uploading the code, switching what MIDI ports the cable went to, and nothing worked.

The Keyboard
We looked up the Casio CTK 519 Keyboard user manual and read the section on MIDI. It said that MIDI messages are received by attaching the "out" port to the device and the "in" port to the keyboard. The manual also said that there are 16 MIDI channels on the keyboard and that both the sending machine and the receiving machine have to be set to the same channel. Another thing the manual mentioned is that the keyboard has two tone maps. Tone map N allows tones from 0 to 99 whereas tone map G allows for tones from 0 to 127. The manual also said to use MIDI channels 1, 2, 3, 4, or 10.

In order to change the channels as well as the tone map, press the transpose/tune/MIDI button three or four times and use the + and - buttons to change the setting. The keyboard is not General MIDI compatible but it can still connect to a computer or other MIDI equipment.

Another Attempt At Programming
After we had done research on the keyboard, we tried to upload the code again. These are the steps w took:


 * 1) Plugged in the arduino (it turned on)
 * 2) Uploaded Code 1
 * 3) Turned on keyboard
 * 4) Pressed transpose/Tune/MIDI 3 times
 * 5) Selected "Tone Map G"
 * 6) Plugged in MIDI shield
 * 7) Plugged "out" port of MIDI cable into MIDI shield "out" port
 * 8) Plugged "in" port of MIDI cable MIDI "in" port on keyboard

Nothing happened. We followed the same steps again with the keyboard on "Tone Map N" and still nothing. We tried plugging the "out" port of the MIDI cable into the "in" port on the MIDI shield just to see what would happen. It didn't work.

Manufacturing Beat Bearing Board
Goal: Discover and design best way to make plexiglass board and washer/ball bearing system that is conductive.

Assembly of Plexiglass

 * Plexiglass configuration
 * The channels underneath the board were made from 1/4" plexiglass runners which were glued using PVC pipe to the base 1/8" plexiglass board. The channels are 1" wide, and as long as the base board, which will depend on the size of the monitor screen we decide to use. The channels should be spread out enough so there 1/4" of space above and below the top of washer. This will allow for the wiring to run fluidly through the channel on the underside of the board, without having excess space.

To cut the plexiglass, we used a table saw, and a video of this can be seen here. The table saw provided a clean cut, and this is how we plan to cut the plexiglass board. The runners were then glued with PVC glue to the underside of the base board, shown in the pictures below.  File:Plexiglassspacers.JPG|Bottom of plexiglass board with measured wood spacers to assure the runners set in place. File:Pvcglue.JPG| This is the PVC glue we used to stick runners to base board. File:Washerplexiglass.JPG|Image of the finished plexiglass board sample with a washer resting on top showing where it would be. 

Washer System Design
When designing the washer system, our goal was to make it easy to build, and function correctly. For the purpose of this project, functioning correctly means that the when the ball bearing is placed atop the washer system, the system is conductive. There were two steps we focused on for the washer system design, which are listed below, and then discussed further in this section.


 * Attachment of washer halves to plexiglass board.
 * Wire connection to washer halves

Washers to Plexiglass Attachment
The first design was based off of the instructions for building a beat bearing board found on the Jameco BeatBearing webpage, which called for screwing the washer halves to the board. However, instead of soldering the wires to soldering tabs, our modified design based on these instructiuons was to use wiring crimps to connect the wires to the washer system.

 File:Washer in Vice.JPG|Washer was held down with a vice to drill holes big enough for number 6 screws. This method of drilling was most successful. File:Holes.JPG|Holes to fit number 6 screws were also drilled into the plexiglass board. File:Vicewasher.JPG|The washers were then cut down the middle with the drilled holes on either side of the vertical cut. File:Washerwiringcrimps.JPG|The wiring crimps were added in between the nut and plexiglass board when the washer halves were screwed down. File:Channelunderplexiglassboard.JPG|The ends of the screws would eventually have to be cut off to make the system flush with the plexiglass runners forming the chgannels. File:Ballbearingwasher.JPG|Ball bearing sitting atop screwed down system 

The next design we created was based off of ideas gathered from our classmates, modified to our own specifications. It called for the washer halves to be glued down to the plexiglass, where the wires could come through the bottom of the board and attach to the washers. This was the design we used moving forward with the project.

 File:Zapagapglue.JPG|Zap-a-Gap glue was the glue we found to be the most transparent, increasing the look of the board, and offered the best attachment of the washer halves to the board. File:Zapagapgluedown.JPG|Zap-a-Gap glue was applied to the entire surface area between the washer and the board. File:Bothhalvesofwasherswithzapagapglue.JPG|The attachment the glue gave us was clean and sturdy. File:Ballbearingtouchingplexiglass.JPG|The only issue with the glued down design, was that the ball bearing came into contact with the plexiglass when sitting on washer halves, which affected the conductivity. 

The glued down design was chosen by our group to be used as the design for connecting the washer halves to the plexiglass. The problem with the ball bearing touching the plexiglass was tackled in the wire connection part of our design.

Wire Connection
The first wire connection designs had the wires coming up through separate holes drilled into the plexiglass board from the bottom, then attached to the washer halves by either being coiled around the washer or sandwiched between the washer when glued down.

 File:Wirethroughplexiglass.JPG|Wire coming through hole drilled in plexiglass. File:Sandwichidea.JPG|Design of wire being sandwiched between washer and plexiglass when glued down. The contact of the wire to the washer would provide the connection needed. File:Coiledidea.JPG|Design of wire being coiled around washer then glued down to provide the proper wire connection 

The coiled design was chosen to be used as the design, because it offered a better connection. New ideas for advancements to the coil design were given to our group by the class, and are shown below. These ideas were offered to solve the problem of the ball bearing touching the plexiglass when placed on the washer system. We chose the design we thought to have the most potential, and tested it.

 File:Ball bearing touch pleaxiglass idea 1.JPG| First idea: Glue smaller washers on each washer half to elevate ball bearing. File:Second idea to elevate ball bearing.JPG|Second idea: Cut the washer unevenly and place an object on the smaller washer piece to also give the ball bearing elevation. File:Idea bouncing off hole in center idea for wires.JPG|Third idea: Drill a hole in between the center of the washer halves, into the plexiglass, for the ball bearing to set in the washer halves cleanly, without touching the plexiglass. File:Third idea where ball bearing goes through plexiglass.JPG|Fourth idea: Advancement of third idea where wires come up through same hole ball bearing will clear, limiting the number of holes needed to be drilled in the plexiglass from 3 to 1. 

The fourth idea was then built, and tested. The design process for building the prototype are shown below.

 File:5'16" inch hole drilled in plesiglass.JPG|Here is the hole that was drilled into the plexiglass, which will be between the two washer halves, for the wires to come up through, and ball bearing to set through. File:Single hole in plexiglass idea.JPG|This is our prototype for the fourth idea. The wires came up through the center hole, coiled around the washer halves, then were glued down with the washers to the plexiglass board. File:Zoomed out view hole in center of washer.JPG|Zoomed out view of prototype. File:Underview ball bearing.JPG|Underneath view of prototype. File:Ball bearing atop system.JPG|Prototype with ball bearing resting atop the system. The ball bearing does not touch any part of the plexiglass thanks to the hole in the center of washer halves. File:Ball bearing for idea tested with multimeter.JPG|Zoomed in view of ball bearing sitting on prototype. 

This prototype was then tested using a multimeter. The multimeter measured resistance of the system, and produces a noise if the sensors are connected to a system which is conductive.

<Gallery> File:Multimeter used to test conductivity.JPG|This was the multimeter used to test the prototype. When the black and red sensors were attached to each end of the wire, no sound was produced by the multimeter, telling us the system was not conductive. </Gallery>

Adjustments to this prototype were then made, and in the next section the final working manufacturing design can be seen.

Final Working Design
The final working design was discovered after the prototype seen above was tested. It included aspects from the prototype built, as well as aspects from other design ideas not yet tested. But when built, tested, duplicated, then tested again, this design was consistently working. Also, the plexiglass board configuration is including along with the working washer system design.


 * The important part of our working design was the measurements of the washer halves. The spacing between each half is crucial for the ball bearing to sit in the system without touching the plexiglass. Here are the drawings with labels and measurements of the working design:

<Gallery> File:Overview of washer system with measurements.JPG|Drawing of washer halves with spacing measurements. File:Underview of the board.JPG|Underview of the plexiglass board with measurements of drilled holes for wires to go up through. File:Drawing of working washer coil system.JPG|Drawing of wire connection system: wire comes up through hole in plexiglass and is coiled around washer half, then glued down. File:Side view of working washer system.JPG|Side view of entire design with labels. </Gallery>

When this design was built and the ball bearing was placed atop, then tested with the multimeter, the multimeter produced a sound, signifying that the system was conductive. Thus we had a working design.

<Gallery> File:Glued down washer with wires coiled.JPG|This is the working design. Wires coming through plexiglass in two separate holes, coiled around washer halves, then glued to plexiglasss with Zap-a-Gap glue. File:Underneath view of working design.JPG|This is an underneath view of the working design with shows the plexiglass configuration of the runners on either side of the washer system to allow for the wires to flow smoothly under the board. File:Ball Bearing on Glued washer with wires coiled.JPG|Ball bearing resting on working design. File:Multimeter used to test conductivity.JPG|When tested with the multimeter, the sound signifying a connection was set off, telling us the system was conductive. </Gallery>

The design was then duplicated, using small wooden spacers (one of which was wrapped in electrical tape), to guarantee the exact measurements of the spacing of washer halves was maintained. The duplicate washer system was tested and proved to be successful, giving more credibility to the working final design.

<Gallery> File:Both spacers over head view.JPG|Spacers placed in original working system to confirm correct measurements. File:Me holding spacer in place.JPG|The spacers were then held in between washer halves of duplicate to maintain correct spacing, which is crucial for working system. File:Overhead view of duplicate washer system.JPG|Here is the duplicate system with the spacers set in between washer system as it sets in the glue. File:Duplicate washer system without spacers.JPG|Duplicate of the working washer system. File:Multimeter testing duplicate washer system.JPG|When tested with the multimeter, the duplicate washer system also was conductive, as a sound was produced form the multimeter. </Gallery>

So we have developed a final working design of the washer system, that will be used along with the designed plexiglass board, to create the beat bearing board for the Music project. More detailed documentation of the design process of the board and washer system can be found on Connor Delaney's Wikiversity page.

Wiring
Goal: To determine best way make wiring harness to connect beat bearing board and arduino system. Also what wires to use, where they will go, how they will be connected. <Gallery> File:System block diagram.jpg|Rough sketch of the system block diagram made on Google Drawings File:Ribbon cable.JPG|A 32-wire ribbon cable considered for use in the wiring harness File:Split ribbon cable.JPG|How the ribbon cable will be split. The red wire on the left is the ground wire. File:MIDI shield and arduino.JPG|The MIDI shield (red) attached to the Arduino (blue) </Gallery>

Fritzing
Another important part of this project is creating a block diagram that shows how all of the different systems for the beat bearing project will fit together. In order to do this, we used an open-source software that allows people to design prototypes on the computer called fritzing.

The way this program works is that you drag and drop parts from the parts bin onto the screen and connect them.

Our first attempt consisted of figuring out how to drag items to the board and finding parts in the parts bin. We couldn't find an FPGA component in the parts bin. We googled "FGPA Papilio" and found a picture of it on SparkFun. We searched FGPA in Fritzing and two items popped up but they looked nothing like the picture of the one online.

We decided to try and upload a image of a FPGA papilio onto fritzing. Since we didn't have a picture of the FPGA, we used a picture of the MIDI board. <Gallery> File:Midishield.JPG|The picture of the MIDI board </Gallery>

First we tried uploading the picture in .jpg format, but it did allow it to upload. We then saved the picture as a .png but that also did not work. We followed WonderHowTo's instructions on adding an image by using a silkscreen layer in PBC view. This did not work. We also tried uploading an image under schematic view

<Gallery> File:Silkscreen image.jpg|Adding a silkscreen image in PBC view File:Schematic image.jpg|Adding a schematic image in schematic view File:Breadboard image.png|Adding a breadboard image in breadboard view </Gallery>

On the Fritzing forum, one suggestion was turning the photos black and white before uploading them. We converted the picture of the MIDI board into a greyscale image on Microsoft Office Picture Manager and uploaded it. The picture uploaded, but only the outline of the image was visible. <Gallery> File:Midishieldgreyscale.jpg|Grey-scale image 1 File:Greyscale image fritzing.jpg|Picture of MIDI board in Fritzing </Gallery>

We decided to try different shades of black and white to see if one would be successful in showing the image. The results were either the same or failure to upload.

This website suggested saving the picture as an .svg file and then uploading. We converted Image 1 through this site and again tried to upload. An image was visible, but it was distorted.

We tried using uploading the same picture as well as different grey-scale image in PBC view. The result was very similar. <Gallery> File:Svg MIDI upload.png|.svg file of MIDI board in Breadboard view File:Svgpicpbcview.png|2 .svg files of MIDI board in PBC view </Gallery>

We decided that we didn't have enough time to pursue this aspect of the project and just used parts that looked similar/had the same function as the desired piece. Once we finished the diagram, we exported it as a .jpg out of Fritzing.

Keyboard

 * Program Arduino and get a successful connection from keyboard
 * Choose and program specific keyboard sounds to generate from each row of washer systems.

Fritzing

 * Create drawing that accurate shows connections between Arduino, MIDI Shield, Papillo, Synthesizer, and FPGA so someone else can build system
 * Find ways to import our own pictures into the porgram

Board

 * Construct a board that has four channels (rows) of 8 washers each.
 * Use MakerBot to build a template for the row of washer systems

Wiring

 * Gather the parts for and assemble the wiring harness.
 * Use design and test wire connections from all ports of project (i.e. Arduino to papillo to washers)