
This lesson introduces students to using sound as an Arduino output. They explore how a piezo buzzer works, how tone() creates different pitches, and how simple delays create rhythm. Students begin with a single beep, experiment with frequency and duration, and then build a short melody using code.
This lesson connects creativity and technology. Students discover that sound is just another form of output they can control with code, building confidence as they move from blinking lights to musical patterns.
Student Learning Goals
By the end of this lesson students will be able to
• Identify and connect a piezo buzzer to the Arduino
• Clear old code using BareMinimum
• Use the tone() command correctly
• Understand pin, frequency, and duration
• Upload a sketch that produces sound
• Experiment with different tone values
• Build and run a simple melody
• Feel excited about combining music and code
Materials Needed
Arduino Uno boards
USB cables
Breadboards
Piezo buzzers
Jumper wires
Computers with Arduino IDE
Printed frequency chart (optional)
Student notebooks
Teacher Preparation Notes
Test the buzzer on your own Arduino before class so you know what the sound should be.
Make sure students have functioning USB cables and that their IDEs recognize their boards.
Buzzers can sound harsh up close. Encourage students to leave them flat on the desk.
Remind teachers: It’s completely okay not to know anything about music theory. The buzzer will teach through experimentation.
Safety Notes
Buzzers should stay on the desk, not near ears.
Unplug the Arduino before wiring anything.
Never change wiring while the board is powered.
Keep water and drinks away from electronics.
Warm Up Activity
Ask students
Where have you heard tiny electronic beeps before
Let them list microwaves, timers, keyboards, toys, watches, and phone buttons.
Explain that most of those sounds are made by piezo buzzers just like the one they’ll use today.
Lesson Flow
**Step One
Meet the Buzzer and Setup the Workspace**
Show the PPT slide introducing the piezo buzzer.
Explain in simple language
A buzzer vibrates really fast to make sound.
The Arduino controls that vibration with code.
Have students place the buzzer on the breadboard and connect jumper wires (you don’t need perfect orientation yet—just have them get comfortable).
**Step Two
Clear the Board Using BareMinimum**
Walk students through
Open Arduino IDE
File → Examples → Basics → BareMinimum
Explain
This removes old programs so the buzzer behaves correctly.
Have students upload BareMinimum.
Celebrate that their boards are “fresh and ready.”
**Step Three
Add Tone Code to the Loop**
Show the example from the PPT:
void loop() {
tone(10,100,1000);
delay(5000);
}
Explain gently
tone(10,100,1000) means
10 = the pin the buzzer is connected to
100 = the pitch (frequency)
1000 = the length of the sound (milliseconds)
delay(5000)
makes the Arduino wait before repeating.
Teacher reassurance
Students do NOT need to understand sound science. The Arduino will show them through experimentation.
**Step Four
Upload the Code and Listen**
Have students upload the sketch.
Ask
Is the note high or low
Was it longer or shorter than you expected
Encourage them to play with the numbers
Change 100 to 300
Change 1000 to 250
Help them see the relationship through sound.
**Step Five
Understanding Frequency**
Show the tone() breakdown slide.
Explain
Frequency = pitch
Higher numbers create higher sounds
Lower numbers create lower sounds
Let them test numbers in the safe range 30 to 4978.
This is a great moment for joyful discovery.
**Step Six
Play a Real Melody**
Show the melody code from the PPT (“Shave and a Haircut”).
Have students copy or paste it into their IDE.
Encourage them to listen for
Short notes
Long notes
Silent pauses created with tone(10,0,xxx)
Teacher note
Highlight that music is just patterns of sound + timing.
**Step Seven
Save the Code for Next Class**
Remind students
Do not change anything in this file
You will need it again in the next lesson
Have them save it as
MakeSomeNoise.ino
or another easy-to-find name.
Teacher Notes for Each Slide
Piezo buzzer slide
Let students hold a buzzer so they see how small it is.
BareMinimum slide
Explain why clearing old code prevents conflicts.
tone() example slide
Focus on pin, frequency, duration. Keep it simple.
Frequency range slide
Encourage safe experimenting.
Melody slide
Celebrate creativity—students love hearing something recognizable come from their own code.
Independent or Group Activity
Option A: Frequency Explorer
Students pick three frequencies and record which sounds high, medium, or low.
Option B: Micro-Melody Challenge
Students create a three-note “signature sound.”
Option C: Class Orchestra
Each group chooses a different frequency and plays it once — the class creates a “robot choir.”
Vocabulary and Concepts
Piezo Buzzer
A small device that makes sound by vibrating.
Frequency
How high or low a sound is. Larger numbers → higher pitch.
Duration
How long the sound plays.
tone()
Arduino command that creates sound.
delay()
Pauses the program before continuing.
Wrap Up
Ask students
What surprised you about how the buzzer works
What frequency sounded funniest or coolest
What was it like to turn code into sound
Affirm that sound, just like lights, is another tool they can control with creativity.
Exit Ticket
One
What does the middle number in tone(pin, frequency, duration) control
Two
Why do we clear the Arduino with BareMinimum before starting
Quiz
1. Multiple Choice
tone(10, 440, 500) means
A. Play 440 Hz on pin 10 for half a second
B. Play pin 440 at 10 Hz
C. Do nothing
2. Short Answer
What does duration mean in the tone command
3. Multiple Choice
What creates the pause between sounds
A. HIGH
B. duration
C. delay
4. Short Answer
What happens when you increase the frequency number
5. Short Answer
Name one thing you enjoyed experimenting with today.
Teacher Reflection
Did students stay engaged with the sound experiments
Were any frequencies too loud and should be avoided
Did the melody activity feel achievable
Would students benefit from a printed reference sheet next time
