
In this lesson students explore how an Arduino can create sound using a piezo buzzer. They learn how tone, frequency, and duration work, and they build a simple circuit that plays a single note. Once they understand the basics, they expand the project by programming a short melody.
This lesson combines creativity with coding and helps students understand that sound is just another kind of output the Arduino can control. Students leave feeling empowered by the idea that code can make music.
Student Learning Goals
By the end of this lesson students will be able to
• Identify and connect a piezo buzzer
• Upload the BareMinimum sketch to clear the Arduino
• Use the tone command to generate sound
• Understand the meaning of pin, frequency, and duration
• Create sound patterns using tone and delay
• Program a short melody
• Feel excited about using code to control sound
Materials Needed
Arduino Uno boards
USB cables
Breadboards
Piezo buzzers
Jumper wires
Computers with Arduino IDE
Printed buzzer diagrams (optional)
Student notebooks
Teacher Preparation Notes
Before class, plug a buzzer into your Arduino and test the example tone.
Have buzzers and wires sorted so students don’t feel overwhelmed.
Students may ask why buzzers sound “scratchy” or “beepy”
Their sound quality varies and that’s normal.
The tone() command is new. Go slowly and repeat explanations.
Teachers don’t need deep audio knowledge—this is all about exploration.
Safety Notes
Piezo buzzers are safe and low voltage, but they can be loud.
Ask students to keep the buzzer on the table, not near ears.
Unplug the Arduino before changing wiring.
Keep liquids away from electronics.
Warm Up Activity
Ask students
What everyday things make electronic beeps
Let them list microwaves, alarms, keyboards, watches, toys.
Explain that many of those sounds come from tiny buzzers just like the one they’ll use today.
Pass around a buzzer so they can feel how small it is.
Lesson Flow
**Step One
Meet the Piezo Buzzer**
Show the slide introducing the buzzer.
Explain in simple language
A piezo buzzer vibrates really fast to make sound
The Arduino controls those vibrations by sending tiny pulses
Students plug the buzzer into a breadboard.
Teacher note
Keep orientation simple—many buzzers work in either direction, but if marked, the + lead goes to the Arduino pin.
**Step Two
Clear the Arduino with BareMinimum**
Show the instructions
Open Arduino IDE
File > Examples > Basics > BareMinimum
Explain
We always clear out old code before starting something new.
Have students upload BareMinimum.
This gives them a fresh, empty loop.
**Step Three
Insert Sound Code into loop()**
Using the PPT example
void loop() {
tone(10,100,1000);
delay(5000);
}
Explain each part
tone(10,100,1000)
10 = the pin
100 = frequency (how high or low the sound is)
1000 = duration of the sound in milliseconds
delay(5000)
Pauses before repeating
Teacher reassurance
Even if students don’t understand frequency yet, the buzzer will teach them through sound.
**Step Four
Upload and Listen**
Have students upload their code and listen to the buzzer.
Ask
Is it high or low
Is it short or long
Does it repeat
Encourage them to experiment
Change the frequency
Change the duration
Listen to the difference
**Step Five
Understanding Frequency**
Show the slide
tone(pin, frequency, duration)
Explain using simple terms
Frequency = pitch
Higher numbers = higher sound
Lower numbers = lower sound
Range for this buzzer is roughly 30–4978 Hz
Let students try a few numbers within that range to hear the difference.
**Step Six
Play a Short Melody**
Show the “Shave and a Haircut” melody code.
Explain gently
Each tone is a note
Each delay creates space between notes
Together they become music
Have students upload the melody and enjoy hearing it.
Teacher note
This is a great moment to celebrate how code can create art.
**Step Seven
Save Your Code**
Remind students not to change anything at the end.
They will need this exact code for the next lesson.
Have them save the file as
MakeSomeNoise.ino
or another clear name.
Teacher Notes for Each Slide
Piezo buzzer introduction
Let students handle the buzzer to reduce anxiety.
BareMinimum upload reminder
This is a safety and clarity practice—reinforce it often.
tone() code slide
Guide them carefully through the idea of pin, frequency, duration.
Frequency range slide
Encourage playful exploration.
Melody slide
Frame this as creativity and fun, not complexity.
Independent or Group Activity
Option A
Frequency Explorer
Students test different frequencies and write down
their favorite “note.”
Option B
Create a Mini Tune
Students use three tones and pauses to invent their own sound pattern.
Option C
Silent Experiment
Use tone(pin,0,duration) to create a purposeful “silent note” in their melody.
Vocabulary and Concepts
Piezo buzzer
A small device that uses vibration to create sound.
Frequency
How high or low a sound is.
Duration
How long the sound plays.
tone()
The Arduino command that generates sound.
delay()
Pauses the program before continuing.
Wrap Up
Ask students
What surprised you about creating sound with code
Which frequency sounded funniest or coolest
How does programming a sound feel different from programming a light
Invite them to share their discoveries with the class.
Exit Ticket
One
What does the number 10 mean in tone(10,100,1000)
Two
What happens if you make the frequency higher
Quiz
1. Multiple Choice
tone(10, 440, 500) means
A. Pin 10 at 440 Hz for half a second
B. Pin 440 at 10 Hz for 5 seconds
C. No sound
2. Short Answer
Why do we upload BareMinimum first
3. Multiple Choice
What creates the pauses between notes
A. HIGH
B. duration
C. delay
4. Short Answer
What does frequency control
5. Short Answer
Name one thing you changed in your sound experiment.
Teacher Reflection
Did students enjoy the buzzer exploration
Were any frequency numbers too harsh or too quiet
Did the melody code feel approachable
Should the next lesson include more creativity or more structure
