Engineering Final Project

by 710770 in Circuits > Electronics

699 Views, 2 Favorites, 0 Comments

Engineering Final Project

Screen Shot 2022-01-20 at 4.00.20 PM.png

This is how my final project came together and that is how it looks now so go through the steps to see how I did it.

Supplies

1All the supplies you need to make this is

  1. Breadboard,
  2. Arduino Uno
  3. (8) push button
  4. (8) 10k ohm resistor
  5. red LED
  6. (1) 330 ohm resistor
  7. (1) Potentiometer 250 Kilo Ohm
  8. (1) LCD 16 x 2 name 2
  9. (1) 1 kilo ohms resistor
  10. Piezo
  11. Wiring

Adding in the Buttons on the Breadboard

Screen Shot 2022-01-20 at 4.55.34 PM.png

Step 1 would be adding all the buttons so when I press them a noise would come out, so in order to get the noise to come I need to press the button. what you need to do first add 7 buttons and connect the buttons to the Arduino digital pins. Then add in the 560 ohm resistors.

Adding the Piezo

Screen Shot 2022-01-20 at 4.57.05 PM.png

For step 2 you need to add in the Piezo . Then wire it into the Arduino I have it put into the digital pin A2. After adding in the pins add the 560 ohm resistors. The Piezo creates the noice of the piano.

Add the Potentiometer

Screen Shot 2022-01-20 at 5.00.00 PM.png

to add the potentiometer add a small breadboard to the said and connect it to the Potentiometer.

Adding the LCD

Screen Shot 2022-01-20 at 5.05.47 PM.png
Screen Shot 2022-01-20 at 5.07.51 PM.png

For adding the LCD you need to wire them all and a resistor 1 kilo ohms take a look at the zoomed in to know to put it. The LCD shows what notes you are pressing.

Adding in the LED

Screen Shot 2022-01-20 at 5.14.41 PM.png

to add in the LED all you need do is connect a 330 ohm resistor to it. The red LED works when you press the button and then the LED turns on.

Done Building the Breadboard!!

Screen Shot 2022-01-20 at 4.00.20 PM.png

in the next step im going to show you the code.

Part 1 of Coding

Screen Shot 2022-01-20 at 5.22.49 PM.png

At the top I have added the code that I used for the LCD wiring. After that I have added the int notes that I used and int Piezo and int LED.

Part 2 of Coding

Screen Shot 2022-01-20 at 5.23.27 PM.png

The started of the this picture coding I did the frequency of the notes and for each of them. Then void setup put in pin mode then the note you using and then input. Do that to the rest of the notes. For the piezo write pin mode then piezo then this time its going to be output. Then for the LCD write lcd.begin(16, 2); 16 and 2 are the places you put the wire to connect it. Then next line add Serial.begin(9600);

Part 3 of Coding

Screen Shot 2022-01-20 at 5.23.57 PM.png

For void loop write Serial.println then (digitalRead( the note you want to us like cNote)); do this to the rest of the notes it would look something like this.

Serial.println(digitalRead(cNote));
Serial.println(digitalRead(dNote)); Serial.println(digitalRead(eNote)); Serial.println(digitalRead(fNote)); Serial.println(digitalRead(gNote)); Serial.println(digitalRead(aNote)); Serial.println(digitalRead(bNote));

Then for the LCD write lcd.setCursor(0, 0); then in the next line wri

Part 4 of Coding

Screen Shot 2022-01-20 at 5.48.09 PM.png

For the first if write if (digitalRead(cNote) == 1) this is for the note your playing { then next line tone(Piezo, c, 250); this step was for the piezo to make the noice. next line lcd.setCursor(0, 1); this step was for the LCD to show the note. lcd.print("DO");

lcd.setCursor(15, 1); lcd.print("C"); lcd.setCursor(7, 1); lcd.print("1"); digitalWrite(led,HIGH);

this all is showing the note you are playing and where to put. Then do the same for the other notes.

Part 5 of Coding and Last Part...

Screen Shot 2022-01-20 at 5.56.24 PM.png

Ones you have done all the else of the notes you are almost done with only a few lines of code left. start of with writing else and noTone(Piezo); then next line write digitalWrite(led,LOW); then the last part you need is }

delay(10); } and you are done!!!!!