User:Ppatel8402/ENES-100/project 3

My Instructor's course page which points to this.

Problem Statement
 Use of Multiplexer is complicated and it is also unavailable in market.

Week 1 Narrative
''The main part of the project was to connect beat bearing board to the arduino. Since the use of multiplexer was incorrect, the connection has to be done by one by one step on the breadboard. The first open switch circuit is shown below''

The material used :

(1) Breadboard (2)Jumper Wire (3)Breadboard Connector ( To supply power from power rail to breadboard) (4)Resistor (10kohm) (5)Arduino Uno (6)Led (7)Usb cable to power Arduino

Connection :

(1) connect 5V (From Arduino) To Breadboard ((+ terminal)Power Rail). (2) Connect ground (From Arduino) to (- terminal) of breadboard. (3)connect one of power rail to breadboard by breadboard connecter to power up the breadboard. (4)Connect two bread board jumper wires which act like and open and closed switch. (5)Connect one end of switch to power rail and other to led. (6) Connect resistor (10kohm) to one end of led. (7)Connect other end of resistor to pin 12 in Arduino using jumper wire. Repeat Steps from 3 to 7 to create multiple switch on breadboard as possible.The code for Blinking LED is here : "

/* * Switch and LED test program with serial monitor read out */

int ledPin = 12;               // LED is connected to pin 12 int switchPin = 2;             // switch is connected to pin 2 int val;                       // variable for reading the pin status

void setup { Serial.begin(9600);          // set up Serial library at 9600 bps pinMode(switchPin, INPUT);   // sets the digital pin as input to read switch pinMode(ledPin, OUTPUT);     // Set the LED pin as output pinMode(switchPin, INPUT);   // Set the switch pin as input }

void loop{ Serial.print("Read switch input: "); Serial.println(digitalRead(ledPin));   // Read the pin and display the value delay(100); val = digitalRead(switchPin);  // read input value and store it in val if (val == LOW) {              // check if the button is pressed digitalWrite(ledPin, HIGH);  // turn LED on  } if (val == HIGH) {             // check if the button is not pressed digitalWrite(ledPin, LOW);   // turn LED off } }

This Connection is working when switch is closed and the proof is HERE. Next Steps : Make More Switch on breadboard as much as possible and test this switch with new beat bearing board.

Week 2 Narrative
''The last connection was working for one tone of music because it is connected to only one pin. The old connection was tested with led and beat bearing. The Video is Here VIDEOwhen marble is being placed on the new beat bearing, the led light up ans when it is removed, led turn off .This works as an open and close switch.It only works for one type of music because all led are connected to pin 12.So he new five different switch is connected to 5 different arduino pins (pin 13 ,11 ,9,7,5) so that it can provide different sound. The code for this pins is here:''

/* * Sends midi signals to a synthesizer using 5 analog switches connected to pins 9-13 */

int switchPin13 = 13;             // switch is connected to pin 2 int switchPin11 = 11; int switchPin9 = 9; int switchPin7 = 7; int switchPin5 = 5; int val;                       // variable for reading the pin status void noteOn(int cmd, int pitch, int velocity) { //Sets what each of the 3 values in the "noteOn" function does Serial.write(cmd); //All MIDI protocol messages start with 0x90 to signify the start of a MIDI message Serial.write(pitch); //The note. Middle C (0x3C), for example Serial.write(velocity); //Volume of note }

void setup { Serial.begin(9600);          // set up Serial library at 9600 bps pinMode(switchPin13, INPUT);   // sets the digital pin as input to read switch pinMode(switchPin11, INPUT); pinMode(switchPin9, INPUT); pinMode(switchPin7, INPUT); pinMode(switchPin5, INPUT); Serial.begin(31250);         //MIDI protocol baud rate is 31250 bits per second

}

void loop{ // Channel 0 (hex = 0xC0) is alto sax (65 on the Gen MIDI Patch Map) hex = 0x41 Serial.write(0xC0); Serial.write(0x41); // Channel 1 (hex = 0xC1) is piano 0 (0 on patch map) hex = 0x00 Serial.write(0xC1); Serial.write(0x00); // Channel 9 (hex = 0xC9) is drums 0 (the drum line is always channel 9) Serial.write(0xC9); Serial.write(0x00); val = digitalRead(switchPin13);  // read input value and store it in val if (val == LOW) {              // check if the button is pressed noteOn(0x90, 0x48, 0x40);    // send sax midi signal to synth delay(1000); } if (val == HIGH) {              // check if the button is not pressed noteOn(0x90, 0x48, 0x00); }   // turn off sax synth signal

val = digitalRead(switchPin11);  // read input value and store it in val if (val == LOW) {              // check if the button is pressed noteOn(0x90, 0x40, 0x40);    // send E midi signal to synth delay(1000); } if (val == HIGH) {              // check if the button is not pressed noteOn(0x90, 0x40, 0x00); }   // turn off sax synth signal

val = digitalRead(switchPin9);  // read input value and store it in val if (val == LOW) {              // check if the button is pressed noteOn(0x90, 0x3E, 0x40);    // send D midi signal to synth delay(1000); } if (val == HIGH) {              // check if the button is not pressed noteOn(0x90, 0x3E, 0x00); }   // turn off sax synth signal

val = digitalRead(switchPin7);  // read input value and store it in val if (val == LOW) {              // check if the button is pressed noteOn(0x90, 0x3C, 0x40);    // send C midi signal to synth delay(1000); } if (val == HIGH) {              // check if the button is not pressed noteOn(0x90, 0x3C, 0x00); }   // turn off sax synth signal

val = digitalRead(switchPin5);  // read input value and store it in val if (val == LOW) {              // check if the button is pressed noteOn(0x90, 0x43, 0x40);    // send G midi signal to synth delay(1000); } if (val == HIGH) {              // check if the button is not pressed noteOn(0x90, 0x43, 0x00); }   // turn off sax synth signal

}

The Starting point of code is to define the pins.Then for each pins has different note.The delay function works in millisecond.The same connection was used but instead of led, now the open and closed switch took place.The material used are listed below : Breadboard, Resistor(100ohm), Jumper Wire, Bread Board,Arduino,Midi shield,Keyboard(synthesizer),9V Power source to supply power to keyboard.The connection is working properly and the proof is Here VIDEO Next Steps: Connect these switch to beat bearing board.Make more switches as many as possible.

Week 3 Narrative
''The main task was to create more switches so that one can connect more washer of new beat bearing board.Since 5 switches is being connected to pin -13 ,11,9,7,5, which are used by new beat bearing board. The sixth switch is being connected and the materials used are breadboard, jumper wires and resistor(10kohm).The steps of Sixth switch is given below which is connected to pin -12 to play different note then previous pins.'' (1)Jumper wire is used to supply power from arduino (5v) to breadboard. (2)Connect resistor in parallel (10kohm). (3)Connect two jumper wire in such a way that it works as open and closed circuit. (4)One end of Jumper wire goes to pin - 12. For pin -12 one can program arduino to play different note.

Now, total six pins are used by six washer on beat bearing board.The seventh switch is being connected to pin -10 to play diffrent note than other pins.The materials used are breadboard, arduino, jumper wires, alligator wires,resistor (10 k ohm).The steps of construction is given below: (1)Jumper wires is being used to supply power to breadboard. (2)Connect resistor (10kohm)in parallel connection. (3) Connect two jumper wire in such a way that it works as open and closed circuit. (4)One end of jumper wire is connected to alligator wire because the length of jumper wires is short and it cannot reached to pin of arduino. (5)By using alligator wire, it is connected to pin -10. For pin - 10, one can program arduino and played different note. The image of alligator is show below:

The video is HERE

Next steps: To connect more pins so that one can connect more washer to the new beat bearing board."

Week 4 Narrative
''Total eight switch has been created.Total 8 pins is being used from arduino and four left.To create 9th switch which is connected to pin - 6 ,following material are being used. Breadboard, resistor (10kohm)Jumper wire, alligator wire, Breadboard connector.'' (1) To supply power to breadboard, the breadboard connector is used.(2)Connect resistor in series connection on breadboard.(3)Connect two jumper wires in such a way that it will act as open and close switch.(4)One end of jumper wire is connected to Pin -6.These two jumper wire will be connected to the 9 washer on new beat bearing board. The schematic diagram of circuit is given below.

To connect midi cable to arduino without midi shield, the following schematic diagram is used.

Next steps - Test all nine switches plus the midi cable without midi shield -Check the connection by placing the washer on nine switches by providing different note. - Order 64 button multiplexer shield arduino so that it connect all washer (32 washer on new beat bearing board)to arduino.