SlideShare a Scribd company logo
1 of 6
Download to read offline
67
PROJECT 7 : Musical Notes
What we are making
In this project, we’ll see how to generate musical tones in Arduino
with a simple buzzer !
So, lets make some music - aka noise :)
PARTS :
+ This section lists the parts you
will need to complete the project.
JUMPER
WIRES
x 2 x 1
PIEZO
BUZZER
Parts Required:
PROJECT 7
68Step 1:
PROJECT 7 : MUSICAL NOTES
Connect a Black jumper wire: UNO GND pin <-------> 30-a on Breadboard
Connect a Red jumper wire: UNO pin 8 <-------> 30-j on Breadboard.
Note that the color of the jumper wires do not matter.
Red and Black jumper wires are used as convention for positive
and negative terminals respectively.
69Step 2:
PROJECT 7 : MUSICAL NOTES
Connect the longer-leg of a Piezo Buzzer to 30-f.
Connect the other end to 30-e.
This completes our circuit !
70Step 3:
Open Arduino software (IDE) on your computer and write below code in it:
Now press the upload button in Arduino software.
BINGO !!
Your Arduino should be playing Sa-Re-Ga-Ma-Pa-Dha-Ni-Sa now !
71
Explanation:
In our code, we declare 2 variables:
int wait - This variable is used to store the value 500 which is
repeatedly passed to the tone method later on.
int pin - This is the pin number to which our Piezo Buzzer is connected
(via the jumper wire). In the setup() method, we set pin 8 as OUTPUT so
that we can output avoltage on this pin later on.
Question:
PROJECT 7 : MUSICAL NOTES
A Piezo buzzer typically does exactly as its name suggests. You put a
voltage across its terminals and you get a beeping sound/noise.
But there is more to it. If you feed it with a pulse, instead of a DC voltage,
it will sound at the frequency of that pulse and thus can play a note / tone!
Thankfully there is an in-built tone() function which takes the pin number,
frequency and the duration as parameters.
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.
72
Answer: Try it before reading further.
The resistor will take limit the current flowing to the Piezo Buzzer.
Thus the sound will be of lower volume.
What will happen if we put a resistor in the circuit ?

More Related Content

Similar to Project 7: Musical Notes

295889096 music-reactive-multicolor-led-lights
295889096 music-reactive-multicolor-led-lights295889096 music-reactive-multicolor-led-lights
295889096 music-reactive-multicolor-led-lightsMaheshSrinivasan25
 
Build a Singing Justin Bieber Cutout
Build a Singing Justin Bieber CutoutBuild a Singing Justin Bieber Cutout
Build a Singing Justin Bieber Cutoutmtthg
 
[Best]Chromatic Tuner Project Final Report
[Best]Chromatic Tuner Project Final Report[Best]Chromatic Tuner Project Final Report
[Best]Chromatic Tuner Project Final ReportNicholas Ambrosio
 
Electronz_Chapter_15.pptx
Electronz_Chapter_15.pptxElectronz_Chapter_15.pptx
Electronz_Chapter_15.pptxMokete5
 
iPhone 6 has no external sound whe playing films
iPhone 6 has no external sound whe  playing filmsiPhone 6 has no external sound whe  playing films
iPhone 6 has no external sound whe playing filmsdiyfix phone
 
2012 1 arduino_rs232
2012 1 arduino_rs2322012 1 arduino_rs232
2012 1 arduino_rs232Don Doerres
 
Electronic musician by letruongan
Electronic musician by letruonganElectronic musician by letruongan
Electronic musician by letruonganAn Le Truong
 
Project 1 Tutorial 1a rev 2.pptx
Project 1 Tutorial 1a rev 2.pptxProject 1 Tutorial 1a rev 2.pptx
Project 1 Tutorial 1a rev 2.pptxazarulfahminabhamid
 
Electronz_Chapter_7.pptx
Electronz_Chapter_7.pptxElectronz_Chapter_7.pptx
Electronz_Chapter_7.pptxMokete5
 
PORTABLE WIRELESS AMPLIFIER BLUETOOTH - 5 Core
PORTABLE WIRELESS AMPLIFIER BLUETOOTH - 5 CorePORTABLE WIRELESS AMPLIFIER BLUETOOTH - 5 Core
PORTABLE WIRELESS AMPLIFIER BLUETOOTH - 5 CoreSonuKumar969
 
Electronz_Chapter_6.pptx
Electronz_Chapter_6.pptxElectronz_Chapter_6.pptx
Electronz_Chapter_6.pptxMokete5
 

Similar to Project 7: Musical Notes (20)

Lab Activity
Lab ActivityLab Activity
Lab Activity
 
295889096 music-reactive-multicolor-led-lights
295889096 music-reactive-multicolor-led-lights295889096 music-reactive-multicolor-led-lights
295889096 music-reactive-multicolor-led-lights
 
Build a Singing Justin Bieber Cutout
Build a Singing Justin Bieber CutoutBuild a Singing Justin Bieber Cutout
Build a Singing Justin Bieber Cutout
 
Simple Amp
Simple AmpSimple Amp
Simple Amp
 
[Best]Chromatic Tuner Project Final Report
[Best]Chromatic Tuner Project Final Report[Best]Chromatic Tuner Project Final Report
[Best]Chromatic Tuner Project Final Report
 
Electronz_Chapter_15.pptx
Electronz_Chapter_15.pptxElectronz_Chapter_15.pptx
Electronz_Chapter_15.pptx
 
raushan
raushanraushan
raushan
 
iPhone 6 has no external sound whe playing films
iPhone 6 has no external sound whe  playing filmsiPhone 6 has no external sound whe  playing films
iPhone 6 has no external sound whe playing films
 
Neno Project.docx
Neno Project.docxNeno Project.docx
Neno Project.docx
 
Smart Blind stick by using arduino uno and sensor
 Smart Blind stick  by using arduino  uno  and sensor Smart Blind stick  by using arduino  uno  and sensor
Smart Blind stick by using arduino uno and sensor
 
2012 1 arduino_rs232
2012 1 arduino_rs2322012 1 arduino_rs232
2012 1 arduino_rs232
 
Session3
Session3Session3
Session3
 
Arduino
ArduinoArduino
Arduino
 
Electronic musician by letruongan
Electronic musician by letruonganElectronic musician by letruongan
Electronic musician by letruongan
 
Project 1 Tutorial 1a rev 2.pptx
Project 1 Tutorial 1a rev 2.pptxProject 1 Tutorial 1a rev 2.pptx
Project 1 Tutorial 1a rev 2.pptx
 
Electronz_Chapter_7.pptx
Electronz_Chapter_7.pptxElectronz_Chapter_7.pptx
Electronz_Chapter_7.pptx
 
Polyanna manual
Polyanna manualPolyanna manual
Polyanna manual
 
snake game
snake gamesnake game
snake game
 
PORTABLE WIRELESS AMPLIFIER BLUETOOTH - 5 Core
PORTABLE WIRELESS AMPLIFIER BLUETOOTH - 5 CorePORTABLE WIRELESS AMPLIFIER BLUETOOTH - 5 Core
PORTABLE WIRELESS AMPLIFIER BLUETOOTH - 5 Core
 
Electronz_Chapter_6.pptx
Electronz_Chapter_6.pptxElectronz_Chapter_6.pptx
Electronz_Chapter_6.pptx
 

Recently uploaded

SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...RKavithamani
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 

Recently uploaded (20)

TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 

Project 7: Musical Notes

  • 1. 67 PROJECT 7 : Musical Notes What we are making In this project, we’ll see how to generate musical tones in Arduino with a simple buzzer ! So, lets make some music - aka noise :) PARTS : + This section lists the parts you will need to complete the project. JUMPER WIRES x 2 x 1 PIEZO BUZZER Parts Required: PROJECT 7
  • 2. 68Step 1: PROJECT 7 : MUSICAL NOTES Connect a Black jumper wire: UNO GND pin <-------> 30-a on Breadboard Connect a Red jumper wire: UNO pin 8 <-------> 30-j on Breadboard. Note that the color of the jumper wires do not matter. Red and Black jumper wires are used as convention for positive and negative terminals respectively.
  • 3. 69Step 2: PROJECT 7 : MUSICAL NOTES Connect the longer-leg of a Piezo Buzzer to 30-f. Connect the other end to 30-e. This completes our circuit !
  • 4. 70Step 3: Open Arduino software (IDE) on your computer and write below code in it: Now press the upload button in Arduino software.
  • 5. BINGO !! Your Arduino should be playing Sa-Re-Ga-Ma-Pa-Dha-Ni-Sa now ! 71 Explanation: In our code, we declare 2 variables: int wait - This variable is used to store the value 500 which is repeatedly passed to the tone method later on. int pin - This is the pin number to which our Piezo Buzzer is connected (via the jumper wire). In the setup() method, we set pin 8 as OUTPUT so that we can output avoltage on this pin later on.
  • 6. Question: PROJECT 7 : MUSICAL NOTES A Piezo buzzer typically does exactly as its name suggests. You put a voltage across its terminals and you get a beeping sound/noise. But there is more to it. If you feed it with a pulse, instead of a DC voltage, it will sound at the frequency of that pulse and thus can play a note / tone! Thankfully there is an in-built tone() function which takes the pin number, frequency and the duration as parameters. 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. 72 Answer: Try it before reading further. The resistor will take limit the current flowing to the Piezo Buzzer. Thus the sound will be of lower volume. What will happen if we put a resistor in the circuit ?