Arduino buzzer and tone projects
Everything you can do with a piezo — sound an alarm, play a siren, ring a doorbell, play four notes and play a whole melody.
A piezo buzzer is a crystal that flexes when you push current through it, so the frequency you give it is the note you hear. The tone() function takes that frequency and holds it, and the whole difference between a buzzer and a buzzer that is also a musical instrument is which number you pass it.
The projects here run the range: the alarm is a fixed tone, the siren alternates between two, the mini piano maps four buttons onto four notes, and the music box plays a melody out of an array. The music box is the one worth building last, because an array and a loop are the two ideas it needs and it is the first project where the code is longer than the wiring.
What you need
The parts below are the ones the most of these projects share. Each project page lists the full set for that build.
| Part | Used by | Why |
|---|---|---|
| 1× buzzer | 11 | The output you can hear working |
| Breadboard | 9 | Holds the circuit together without solder |
| 1× Arduino Uno R3 | 9 | The board that runs the sketch |
| 1× breadboard | 8 | Holds the circuit together without solder |
| 1× 220Ω resistor | 7 | Limits the current through an LED or a pin |
| 1× 9V battery | 5 | The supply the circuit runs on |
All 19 arduino buzzer and tone projects
Easiest first. Each card links to the project's own page with the wiring, the parts and the code written out.
Press the button, hear a tone. The classic Arduino starter.
Detect motion with the PIR sensor and sound the buzzer
How the first internet worked — one click at a time
Ultrasonic sensor detects when the bin is full
Three buttons, three options, instant democracy
Count objects on a moving line — like a real factory sensor
Four buttons, four notes, one tiny piano that fits in your pocket
4 distance zones — 1 slow low beep far, 2 fast high-pitch beeps close (like a real car reversing buzzer)
Two players, two buttons — fastest finger wins
Turn the knob, hear the pitch change in real time
Alternating red + blue LEDs with a wailing 600–1500 Hz buzzer
Beep faster as you get closer
Repeat the pattern, level by level
Too hot, too cold, or just right
Closer = higher pitch
Motion + armed switch = loud alarm. Disarm first.
A guest walks up to the door — chime + welcome LED
Which material keeps heat in best?
Press the button, hear a complete melody. Arrays + delays = music.
How to use these with a class
These 19 projects run from about 20 minutes to 45 minutes each, and 1 of them are Tier 1 — one component and one idea, which is what a class can finish in a single period.
Each project page carries the full build — the concept, the parts, the wiring one step at a time and the sketch — so a class can work through it without the teacher having to explain every wire.
Every one of them can be practised in the browser simulator first, with the real sketch and a real circuit solver behind it, and the first 15 projects are free with no account.
Common questions
Active or passive buzzer?
An active buzzer makes its own tone and only needs a pin; a passive one is the crystal on its own and needs the Arduino to drive it at the right frequency. The `tone()` projects need a passive buzzer, and the page says so on the parts list.
Why does the siren go up and down?
Two frequencies played one after the other, in a loop, with a short gap between them. It is the cheapest way to make something sound urgent, and it teaches the idea of changing a value in a loop rather than repeating code.
Can I play a real tune?
Yes — the music box does it. A melody is two arrays: one of frequencies and one of how long each note lasts, walked through with a for loop. That structure is the same in every Arduino music project ever written.
Related
Try the full simulator with your class
103 guided circuit projects, 21 lessons and an in-browser Arduino simulator. The first 15 projects are free, no account needed. One licence covers a whole school.