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

Build a Singing Justin Bieber Cutout
Build a Singing Justin Bieber CutoutBuild a Singing Justin Bieber Cutout
Build a Singing Justin Bieber Cutout
mtthg
 
[Best]Chromatic Tuner Project Final Report
[Best]Chromatic Tuner Project Final Report[Best]Chromatic Tuner Project Final Report
[Best]Chromatic Tuner Project Final Report
Nicholas Ambrosio
 

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

Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
EADTU
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
EADTU
 

Recently uploaded (20)

Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
 
VAMOS CUIDAR DO NOSSO PLANETA! .
VAMOS CUIDAR DO NOSSO PLANETA!                    .VAMOS CUIDAR DO NOSSO PLANETA!                    .
VAMOS CUIDAR DO NOSSO PLANETA! .
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
 
Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17
 
Observing-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxObserving-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptx
 
Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.ppt
 
Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...
 
What is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxWhat is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptx
 
How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17
 
diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
 
OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 
Simple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfSimple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdf
 
dusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningdusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learning
 

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 ?