SlideShare a Scribd company logo
Parts Required:
Project 8 : Make your own Piano
What we are making
Lets make our own piano on which we can play any music !
PARTS :
+ This section lists the parts you
will need to complete the project.
JUMPER
WIRES
x 19 x 1
PIEZO
BUZZER
x 8
PUSH
BUTTON
73
PROJECT 8
Step 1:
PROJECT 8 : MAKE YOUR OWN PIANO
Connect one push button as shown in the image below.
The 4 pins of the push-button should go in 1-e, 1-f, 3-e, 3-f
74
PROJECT 8 : MAKE YOUR OWN PIANO
Step 2:
Connect remaining 7 push buttons to the breadboard as
shown below.
75
PROJECT 8 : MAKE YOUR OWN PIANO
Step 3:
Connect the longer-leg of a Piezo Buzzer to 30-e.
Connect the other end to 30-f.
76
PROJECT 8 : MAKE YOUR OWN PIANO
Step 4:
Connect one end of a jumper wire to Pin 2 on Arduino.
Connect the other end to 30-a on breadboard.
77
PROJECT 8 : MAKE YOUR OWN PIANO
Step 5:
Connect one end of a jumper wire to GND on Arduino. Other
end to negative (-) line on breadboard.
Connect another jumper wire from 30-h to negative (-) line on
breadboard.
78
PROJECT 8 : MAKE YOUR OWN PIANO
Step 6:
Now let us start the Push Button wirings.
Connect a jumper wire from Pin 12 (6th pin from top) on Arduino
to 3-j on breadboard.
Connect another jumper wire from 1-j to negative line on
breadboard.
79
PROJECT 8 : MAKE YOUR OWN PIANO
Step 7:
Let us connect all push buttons as shown in below picture.
Start from Push Button 2. Connect both its jumper wires.
Then move to the next push buttons.
80
PROJECT 8 : MAKE YOUR OWN PIANO
Note that you can use any color jumper wires.
In previous diagram, same color of wires are used for same
push button so that it’s easy for you to follow the circuit diagram.
This completes our circuit !
81
Step 8: 82
The code for this project is available on the installation-instruction page.
Follow below steps to see the code:
1. On your computer, open a browser like Chrome or Internet Explorer.
2. Visit https://getelemento.com/pages/installation-instructions in the browser.
3. Scroll to the Piano section on the page to see the code.
BINGO !!
Try playing the ‘Happy Birthday’ song:
C C D C F E
C C D C G F
C C C A F F E D
Now, pushing each button should give you the
corresponding notes sound.
You can chose to play any kind of tone that you want !
Explanation:
PROJECT 8 : MAKE YOUR OWN PIANO
Remember that each note of Sa, Re, Ga, Ma, Pa, Dha, Ni, Sa
has a different frequency.
We pass this frequency to the tone() function to get the corresponding
sound.
int Buzz = 2;
In our code, we declare a variable called Buzz and assign 2 to it.
2 is the pin number to which the Piezo buzzer ic connected. Now, in our
code wherever we use the variable Buzz, it will mean 2.
In the setup() function, we set all push button pins as INPUT so that our
code can read the value of push button when its pressed.
In the loop() function, we check the value of each push button,
and if it’s pressed (i.e. its corresponding pin reads LOW), we pass
the corresponding frequency to the tone() function.
83
Question:
The while loop executes some code continuously until a condition is met.
eg:
while(digitalRead(12) == LOW)
{
tone(Buzz,262);
}
The while() loop has 2 parts: ‘condition’ and ‘code statements’.
In our program, digitalRead(12) == LOW is the condition.
tone(BUZZ, 262) is the ‘code statement’.
The Arduino will keep checking the condition and execute the tone() code
only if this condition is TRUE. So, the Arduino will read pin 12
(connected to Sa / C) and see if it’s pressed (When push button is pressed,
pin 12 will read LOW). Till the time the push button is pressed, our code will
play the Sa / C note on buzzer. Do not worry if you did not understand the
while loop fully. The C language concepts will become clearer as we move
along in this course.
What does the while() statement do in the program ?
84

More Related Content

What's hot

Rubber Hose Analysis Simulation
Rubber Hose Analysis SimulationRubber Hose Analysis Simulation
Rubber Hose Analysis Simulation
Fauzanil Azmy Iska
 
Unit_4_Design Agains Fluctuation load.ppt
Unit_4_Design Agains Fluctuation load.pptUnit_4_Design Agains Fluctuation load.ppt
Unit_4_Design Agains Fluctuation load.ppt
DrSomnathKolgiri
 
Siemens s7-200 starter kit 221
Siemens s7-200 starter kit 221Siemens s7-200 starter kit 221
Siemens s7-200 starter kit 221
Dien Ha The
 
Design, development and fabrication of agricultural pesticides sprayer
Design, development and fabrication of agricultural pesticides sprayerDesign, development and fabrication of agricultural pesticides sprayer
Design, development and fabrication of agricultural pesticides sprayer
Laukik Raut
 
Derating of Recip By ISO standard 3046
Derating of Recip By ISO standard 3046Derating of Recip By ISO standard 3046
Derating of Recip By ISO standard 3046
Med Seghair
 
4103 0201 96 b7 41-1000 manual
4103 0201 96 b7 41-1000 manual4103 0201 96 b7 41-1000 manual
4103 0201 96 b7 41-1000 manual
Patricio Aguilera
 
Hertz Contact Stress Analysis and Validation Using Finite Element Analysis
Hertz Contact Stress Analysis and Validation Using Finite Element AnalysisHertz Contact Stress Analysis and Validation Using Finite Element Analysis
Hertz Contact Stress Analysis and Validation Using Finite Element Analysis
Prabhakar Purushothaman
 
Caterpillar cat c9 industrial engine (prefix reh) service repair manual (reh0...
Caterpillar cat c9 industrial engine (prefix reh) service repair manual (reh0...Caterpillar cat c9 industrial engine (prefix reh) service repair manual (reh0...
Caterpillar cat c9 industrial engine (prefix reh) service repair manual (reh0...
jfdjskmdmme
 
Ultisolar SR81Q Solar Controller Manual
Ultisolar SR81Q Solar Controller ManualUltisolar SR81Q Solar Controller Manual
Ultisolar SR81Q Solar Controller Manual
Shandong iSentrol Electronic Technology Co., Ltd
 
Ur5 ik
Ur5 ikUr5 ik
Ur5 ik
Ryan Keating
 
Unit 9 Labvolt Student Manual
Unit 9 Labvolt Student ManualUnit 9 Labvolt Student Manual
Unit 9 Labvolt Student Manual
MichaelKeck10
 
Laboratorio programacao pf 755 com ihm
Laboratorio programacao pf 755 com ihmLaboratorio programacao pf 755 com ihm
Laboratorio programacao pf 755 com ihm
confidencial
 
Stereo lithography - Report
Stereo lithography - ReportStereo lithography - Report
Stereo lithography - Report
Hitesh Sharma
 
Gyro and Vibro Lab Report
Gyro and Vibro Lab ReportGyro and Vibro Lab Report
Gyro and Vibro Lab ReportJames Goddings
 
Design and fabrication of solar powered air cooling system
Design and fabrication of solar powered air cooling systemDesign and fabrication of solar powered air cooling system
Design and fabrication of solar powered air cooling system
Madan Bhat
 
Report on MULTI PROCESS MACHINE
Report on MULTI PROCESS MACHINEReport on MULTI PROCESS MACHINE
Report on MULTI PROCESS MACHINE
Mitesh6897
 
Belt drives extra
Belt drives extraBelt drives extra
Belt drives extra
Owusu Attakorah MIET
 
How to use HiCOM OBD2 Professional Diagnostic Scanner for Hyundai and Kia
How to use HiCOM OBD2 Professional Diagnostic Scanner for Hyundai and KiaHow to use HiCOM OBD2 Professional Diagnostic Scanner for Hyundai and Kia
How to use HiCOM OBD2 Professional Diagnostic Scanner for Hyundai and Kia
BuyobdtoolShop
 

What's hot (20)

Rubber Hose Analysis Simulation
Rubber Hose Analysis SimulationRubber Hose Analysis Simulation
Rubber Hose Analysis Simulation
 
Unit_4_Design Agains Fluctuation load.ppt
Unit_4_Design Agains Fluctuation load.pptUnit_4_Design Agains Fluctuation load.ppt
Unit_4_Design Agains Fluctuation load.ppt
 
Siemens s7-200 starter kit 221
Siemens s7-200 starter kit 221Siemens s7-200 starter kit 221
Siemens s7-200 starter kit 221
 
Design, development and fabrication of agricultural pesticides sprayer
Design, development and fabrication of agricultural pesticides sprayerDesign, development and fabrication of agricultural pesticides sprayer
Design, development and fabrication of agricultural pesticides sprayer
 
Derating of Recip By ISO standard 3046
Derating of Recip By ISO standard 3046Derating of Recip By ISO standard 3046
Derating of Recip By ISO standard 3046
 
4103 0201 96 b7 41-1000 manual
4103 0201 96 b7 41-1000 manual4103 0201 96 b7 41-1000 manual
4103 0201 96 b7 41-1000 manual
 
Hertz Contact Stress Analysis and Validation Using Finite Element Analysis
Hertz Contact Stress Analysis and Validation Using Finite Element AnalysisHertz Contact Stress Analysis and Validation Using Finite Element Analysis
Hertz Contact Stress Analysis and Validation Using Finite Element Analysis
 
Caterpillar cat c9 industrial engine (prefix reh) service repair manual (reh0...
Caterpillar cat c9 industrial engine (prefix reh) service repair manual (reh0...Caterpillar cat c9 industrial engine (prefix reh) service repair manual (reh0...
Caterpillar cat c9 industrial engine (prefix reh) service repair manual (reh0...
 
Ultisolar SR81Q Solar Controller Manual
Ultisolar SR81Q Solar Controller ManualUltisolar SR81Q Solar Controller Manual
Ultisolar SR81Q Solar Controller Manual
 
Ur5 ik
Ur5 ikUr5 ik
Ur5 ik
 
Unit 9 Labvolt Student Manual
Unit 9 Labvolt Student ManualUnit 9 Labvolt Student Manual
Unit 9 Labvolt Student Manual
 
Laboratorio programacao pf 755 com ihm
Laboratorio programacao pf 755 com ihmLaboratorio programacao pf 755 com ihm
Laboratorio programacao pf 755 com ihm
 
Stereo lithography - Report
Stereo lithography - ReportStereo lithography - Report
Stereo lithography - Report
 
Gyro and Vibro Lab Report
Gyro and Vibro Lab ReportGyro and Vibro Lab Report
Gyro and Vibro Lab Report
 
Design and fabrication of solar powered air cooling system
Design and fabrication of solar powered air cooling systemDesign and fabrication of solar powered air cooling system
Design and fabrication of solar powered air cooling system
 
001
001001
001
 
Adm cc sus estrategias
Adm cc sus estrategiasAdm cc sus estrategias
Adm cc sus estrategias
 
Report on MULTI PROCESS MACHINE
Report on MULTI PROCESS MACHINEReport on MULTI PROCESS MACHINE
Report on MULTI PROCESS MACHINE
 
Belt drives extra
Belt drives extraBelt drives extra
Belt drives extra
 
How to use HiCOM OBD2 Professional Diagnostic Scanner for Hyundai and Kia
How to use HiCOM OBD2 Professional Diagnostic Scanner for Hyundai and KiaHow to use HiCOM OBD2 Professional Diagnostic Scanner for Hyundai and Kia
How to use HiCOM OBD2 Professional Diagnostic Scanner for Hyundai and Kia
 

Similar to Project 8: Make Your Own Piano

Project 7: Musical Notes
Project 7: Musical NotesProject 7: Musical Notes
Project 7: Musical Notes
Paresh Goel
 
KEYBOARD INSTRUMENT
KEYBOARD INSTRUMENTKEYBOARD INSTRUMENT
KEYBOARD INSTRUMENT
Rashmi1426
 
Electronz_Chapter_15.pptx
Electronz_Chapter_15.pptxElectronz_Chapter_15.pptx
Electronz_Chapter_15.pptx
Mokete5
 
Electronz_Chapter_7.pptx
Electronz_Chapter_7.pptxElectronz_Chapter_7.pptx
Electronz_Chapter_7.pptx
Mokete5
 
ATTiny Light Sculpture Project - Part I (Setup)
ATTiny Light Sculpture Project - Part I (Setup)ATTiny Light Sculpture Project - Part I (Setup)
ATTiny Light Sculpture Project - Part I (Setup)
Brian Huang
 
Arduino based Applications-part 6
Arduino based Applications-part 6Arduino based Applications-part 6
Arduino based Applications-part 6
Jawaher Abdulwahab Fadhil
 
Arduino
ArduinoArduino
Arduino
Geet Patel
 
Nerve Slide Show 04 19 2009 97 03
Nerve Slide Show 04 19 2009      97 03Nerve Slide Show 04 19 2009      97 03
Nerve Slide Show 04 19 2009 97 03
DJ Johnny' O
 
Pencil drawn piano with scratch and makey makey
Pencil drawn piano with scratch and makey makeyPencil drawn piano with scratch and makey makey
Pencil drawn piano with scratch and makey makey
valari_
 
Robotics Session day 1
Robotics Session day 1Robotics Session day 1
Robotics Session day 1Afzal Ahmad
 
Arduino bt mobile robot r2.0
Arduino bt mobile robot r2.0Arduino bt mobile robot r2.0
Arduino bt mobile robot r2.0
Fajar Baskoro
 
Display Characters of a String one by One on a 7 Segment Display
Display Characters of a String one by One on a 7 Segment DisplayDisplay Characters of a String one by One on a 7 Segment Display
Display Characters of a String one by One on a 7 Segment Display
Rihab Rahman
 
Arduino electronics cookbook
Arduino electronics cookbookArduino electronics cookbook
Arduino electronics cookbook
Felipe Belarmino
 
Build a Singing Justin Bieber Cutout
Build a Singing Justin Bieber CutoutBuild a Singing Justin Bieber Cutout
Build a Singing Justin Bieber Cutoutmtthg
 
295889096 music-reactive-multicolor-led-lights
295889096 music-reactive-multicolor-led-lights295889096 music-reactive-multicolor-led-lights
295889096 music-reactive-multicolor-led-lights
MaheshSrinivasan25
 
snake game
snake gamesnake game
snake game
Shailesh kumar
 
Introduction to pcDuino
Introduction to pcDuinoIntroduction to pcDuino
Introduction to pcDuino
Jingfeng Liu
 
Maker Education : Bob the Robot
Maker Education : Bob the RobotMaker Education : Bob the Robot
Maker Education : Bob the Robot
Fun2Do Labs
 

Similar to Project 8: Make Your Own Piano (20)

Project 7: Musical Notes
Project 7: Musical NotesProject 7: Musical Notes
Project 7: Musical Notes
 
KEYBOARD INSTRUMENT
KEYBOARD INSTRUMENTKEYBOARD INSTRUMENT
KEYBOARD INSTRUMENT
 
Electronz_Chapter_15.pptx
Electronz_Chapter_15.pptxElectronz_Chapter_15.pptx
Electronz_Chapter_15.pptx
 
Electronz_Chapter_7.pptx
Electronz_Chapter_7.pptxElectronz_Chapter_7.pptx
Electronz_Chapter_7.pptx
 
ATTiny Light Sculpture Project - Part I (Setup)
ATTiny Light Sculpture Project - Part I (Setup)ATTiny Light Sculpture Project - Part I (Setup)
ATTiny Light Sculpture Project - Part I (Setup)
 
Arduino based Applications-part 6
Arduino based Applications-part 6Arduino based Applications-part 6
Arduino based Applications-part 6
 
Arduino
ArduinoArduino
Arduino
 
publish manual
publish manualpublish manual
publish manual
 
Nerve Slide Show 04 19 2009 97 03
Nerve Slide Show 04 19 2009      97 03Nerve Slide Show 04 19 2009      97 03
Nerve Slide Show 04 19 2009 97 03
 
Pencil drawn piano with scratch and makey makey
Pencil drawn piano with scratch and makey makeyPencil drawn piano with scratch and makey makey
Pencil drawn piano with scratch and makey makey
 
Robotics Session day 1
Robotics Session day 1Robotics Session day 1
Robotics Session day 1
 
Arduino bt mobile robot r2.0
Arduino bt mobile robot r2.0Arduino bt mobile robot r2.0
Arduino bt mobile robot r2.0
 
Arduino workshop sensors
Arduino workshop sensorsArduino workshop sensors
Arduino workshop sensors
 
Display Characters of a String one by One on a 7 Segment Display
Display Characters of a String one by One on a 7 Segment DisplayDisplay Characters of a String one by One on a 7 Segment Display
Display Characters of a String one by One on a 7 Segment Display
 
Arduino electronics cookbook
Arduino electronics cookbookArduino electronics cookbook
Arduino electronics cookbook
 
Build a Singing Justin Bieber Cutout
Build a Singing Justin Bieber CutoutBuild a Singing Justin Bieber Cutout
Build a Singing Justin Bieber Cutout
 
295889096 music-reactive-multicolor-led-lights
295889096 music-reactive-multicolor-led-lights295889096 music-reactive-multicolor-led-lights
295889096 music-reactive-multicolor-led-lights
 
snake game
snake gamesnake game
snake game
 
Introduction to pcDuino
Introduction to pcDuinoIntroduction to pcDuino
Introduction to pcDuino
 
Maker Education : Bob the Robot
Maker Education : Bob the RobotMaker Education : Bob the Robot
Maker Education : Bob the Robot
 

Recently uploaded

Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
chanes7
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
Mohammed Sikander
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
gb193092
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
deeptiverma2406
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 

Recently uploaded (20)

Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 

Project 8: Make Your Own Piano

  • 1. Parts Required: Project 8 : Make your own Piano What we are making Lets make our own piano on which we can play any music ! PARTS : + This section lists the parts you will need to complete the project. JUMPER WIRES x 19 x 1 PIEZO BUZZER x 8 PUSH BUTTON 73 PROJECT 8
  • 2. Step 1: PROJECT 8 : MAKE YOUR OWN PIANO Connect one push button as shown in the image below. The 4 pins of the push-button should go in 1-e, 1-f, 3-e, 3-f 74
  • 3. PROJECT 8 : MAKE YOUR OWN PIANO Step 2: Connect remaining 7 push buttons to the breadboard as shown below. 75
  • 4. PROJECT 8 : MAKE YOUR OWN PIANO Step 3: Connect the longer-leg of a Piezo Buzzer to 30-e. Connect the other end to 30-f. 76
  • 5. PROJECT 8 : MAKE YOUR OWN PIANO Step 4: Connect one end of a jumper wire to Pin 2 on Arduino. Connect the other end to 30-a on breadboard. 77
  • 6. PROJECT 8 : MAKE YOUR OWN PIANO Step 5: Connect one end of a jumper wire to GND on Arduino. Other end to negative (-) line on breadboard. Connect another jumper wire from 30-h to negative (-) line on breadboard. 78
  • 7. PROJECT 8 : MAKE YOUR OWN PIANO Step 6: Now let us start the Push Button wirings. Connect a jumper wire from Pin 12 (6th pin from top) on Arduino to 3-j on breadboard. Connect another jumper wire from 1-j to negative line on breadboard. 79
  • 8. PROJECT 8 : MAKE YOUR OWN PIANO Step 7: Let us connect all push buttons as shown in below picture. Start from Push Button 2. Connect both its jumper wires. Then move to the next push buttons. 80
  • 9. PROJECT 8 : MAKE YOUR OWN PIANO Note that you can use any color jumper wires. In previous diagram, same color of wires are used for same push button so that it’s easy for you to follow the circuit diagram. This completes our circuit ! 81
  • 10. Step 8: 82 The code for this project is available on the installation-instruction page. Follow below steps to see the code: 1. On your computer, open a browser like Chrome or Internet Explorer. 2. Visit https://getelemento.com/pages/installation-instructions in the browser. 3. Scroll to the Piano section on the page to see the code. BINGO !! Try playing the ‘Happy Birthday’ song: C C D C F E C C D C G F C C C A F F E D Now, pushing each button should give you the corresponding notes sound. You can chose to play any kind of tone that you want !
  • 11. Explanation: PROJECT 8 : MAKE YOUR OWN PIANO Remember that each note of Sa, Re, Ga, Ma, Pa, Dha, Ni, Sa has a different frequency. We pass this frequency to the tone() function to get the corresponding sound. int Buzz = 2; In our code, we declare a variable called Buzz and assign 2 to it. 2 is the pin number to which the Piezo buzzer ic connected. Now, in our code wherever we use the variable Buzz, it will mean 2. In the setup() function, we set all push button pins as INPUT so that our code can read the value of push button when its pressed. In the loop() function, we check the value of each push button, and if it’s pressed (i.e. its corresponding pin reads LOW), we pass the corresponding frequency to the tone() function. 83
  • 12. Question: The while loop executes some code continuously until a condition is met. eg: while(digitalRead(12) == LOW) { tone(Buzz,262); } The while() loop has 2 parts: ‘condition’ and ‘code statements’. In our program, digitalRead(12) == LOW is the condition. tone(BUZZ, 262) is the ‘code statement’. The Arduino will keep checking the condition and execute the tone() code only if this condition is TRUE. So, the Arduino will read pin 12 (connected to Sa / C) and see if it’s pressed (When push button is pressed, pin 12 will read LOW). Till the time the push button is pressed, our code will play the Sa / C note on buzzer. Do not worry if you did not understand the while loop fully. The C language concepts will become clearer as we move along in this course. What does the while() statement do in the program ? 84