T ThinkEdge Learn

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.

19 projects Easy first Arduino uno, Arduino nano

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.

PartUsed byWhy
1× buzzer11The output you can hear working
Breadboard9Holds the circuit together without solder
1× Arduino Uno R39The board that runs the sketch
1× breadboard8Holds the circuit together without solder
1× 220Ω resistor7Limits the current through an LED or a pin
1× 9V battery5The 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.

Arduino — Button + Buzzer Doorbell

Press the button, hear a tone. The classic Arduino starter.

Tier 1 · Basics · Easy · 20 min
Arduino — PIR Motion Burglar Alarm

Detect motion with the PIR sensor and sound the buzzer

Tier 2 · Sensor Projects · Easy · 25 min
Morse Code Telegraph

How the first internet worked — one click at a time

Tier 2 · Logic & Sensors · Easy · 25 min
Smart Recycling Bin

Ultrasonic sensor detects when the bin is full

Tier 2 · Logic & Sensors · Easy · 30 min
Classroom Voting Machine

Three buttons, three options, instant democracy

Tier 2 · Logic & Sensors · Easy · 30 min
Conveyor Belt Counter

Count objects on a moving line — like a real factory sensor

Tier 2 · Logic & Sensors · Easy · 25 min
Arduino Nano — 4-Note Mini Piano

Four buttons, four notes, one tiny piano that fits in your pocket

Tier 2 · Sensor Projects · Intermediate · 30 min
Arduino Nano — Parking Sensor

4 distance zones — 1 slow low beep far, 2 fast high-pitch beeps close (like a real car reversing buzzer)

Tier 2 · Sensor Projects · Intermediate · 30 min
Arduino — Two-Player Reaction Battle

Two players, two buttons — fastest finger wins

Tier 2 · Sensor Projects · Intermediate · 30 min
Arduino — Potentiometer Tone Control

Turn the knob, hear the pitch change in real time

Tier 2 · Sensor Projects · Intermediate · 25 min
Police Siren

Alternating red + blue LEDs with a wailing 600–1500 Hz buzzer

Tier 3 · Combined Projects · Intermediate · 30 min
Ultrasonic — Reverse Parking Sensor

Beep faster as you get closer

Tier 3 · Combined Projects · Intermediate · 40 min
Simon Says — Memory Game

Repeat the pattern, level by level

Tier 3 · Combined Projects · Intermediate · 45 min
DHT11 — Temperature Alarm

Too hot, too cold, or just right

Tier 3 · Combined Projects · Intermediate · 35 min
Ultrasonic — Pitch by Distance

Closer = higher pitch

Tier 3 · Combined Projects · Intermediate · 30 min
PIR — Intruder Alarm

Motion + armed switch = loud alarm. Disarm first.

Tier 3 · Combined Projects · Intermediate · 35 min
PIR — Smart Doorbell / Welcome Light

A guest walks up to the door — chime + welcome LED

Tier 3 · Combined Projects · Intermediate · 30 min
Insulation Test Chamber

Which material keeps heat in best?

Tier 3 · Combined · Intermediate · 40 min
Arduino — Music Box

Press the button, hear a complete melody. Arrays + delays = music.

Tier 3 · Combined Projects · Intermediate · 30 min

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

All the projectsThe complete catalogue The guidesHow the ideas behind these work Arduino projects for beginnersThe board-specific builds Arduino simulator in the browserTry any of these without hardware

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.