Active and passive buzzer tour
Build it step by step
0 of 7 doneWire the active buzzer
Plus to D8, minus to GND.
Wire the passive buzzer
Plus to D9, minus to GND.
Upload the sketch
Open the Serial Monitor at 9600 baud.
Listen to step 1
The active buzzer beeps.
Listen to step 2
The passive buzzer only clicks.
Listen to step 3
A rising scale from the passive buzzer.
Listen to step 4
The active buzzer keeps its own pitch.
How do you build an active and passive buzzer tour?
Drive an active and a passive buzzer from the same kind of pin and hear the difference: one beeps with a plain on or off, the other plays notes only when given a tone. You need Arduino Nano, Active buzzer 5 V, Passive buzzer, Breadboard 830 Tie Points and Jumper wires male to male (40 pcs, 20 cm). It takes 7 steps and about 35 minutes.
- Level
- Beginner
- Time
- About 35 min
- Parts
- 5
Parts list
- Development BoardsBuyArduino Nano × 1
- Motors & ActuatorsBuy
- Motors & ActuatorsBuyPassive buzzer × 1
- PrototypingBuy
- PrototypingBuy
Tick what you already own. It saves to My Garage, so “Build with what I have” knows.
Wiring
| From | To | Why |
|---|---|---|
| Active buzzer plus | Nano D8 | Plain on or off drive |
| Active buzzer minus | Nano GND | Common ground |
| Passive buzzer plus | Nano D9 | Needs a changing signal, driven with tone |
| Passive buzzer minus | Nano GND | Common ground |
Code
An active buzzer has a tiny oscillator inside, so power alone makes it sing at one fixed pitch. A passive buzzer is only a speaker element, so it needs a changing signal, which the Nano's tone function supplies at the pitch you ask for. The sketch plays the four cases in turn and describes each in the Serial Monitor at 9600 baud so you can match what you hear. A plain high on the passive buzzer gives only a click at the start and end, and a tone on an active buzzer does not change its pitch because the pitch is built in. Rules of thumb: use an active buzzer for a simple alarm beep and a passive buzzer when you want melodies or different alert tones. Small buzzers can be loud at close range, so keep them away from ears and turn down the sound by adding a small resistor in series if needed.
Runs on a virtual Arduino Nano in your browser, with sliders for the sensors. Happy with it? Verify and upload to your real board from the same page (Chrome or Edge on a computer).
const uint8_t ACTIVE_PIN = 8;
const uint8_t PASSIVE_PIN = 9;
void say(const char* text) {
Serial.println(text);
}
void setup() {
pinMode(ACTIVE_PIN, OUTPUT);
pinMode(PASSIVE_PIN, OUTPUT);
Serial.begin(9600);
}
void loop() {
say("1. Active buzzer, plain HIGH for 300 ms: a beep with its own fixed pitch");
digitalWrite(ACTIVE_PIN, HIGH);
delay(300);
digitalWrite(ACTIVE_PIN, LOW);
delay(1000);
say("2. Passive buzzer, plain HIGH for 300 ms: only a click at the start and the end");
digitalWrite(PASSIVE_PIN, HIGH);
delay(300);
digitalWrite(PASSIVE_PIN, LOW);
delay(1000);
say("3. Passive buzzer with tone(): a note, and the pitch follows the number");
int notes[] = { 262, 294, 330, 349, 392, 440, 494, 523 }; // C major scale
for (int i = 0; i < 8; i++) {
tone(PASSIVE_PIN, notes[i], 200);
delay(250);
}
noTone(PASSIVE_PIN);
delay(1000);
say("4. Active buzzer with tone(): it still plays its own pitch, maybe choppy");
tone(ACTIVE_PIN, 880, 400);
delay(900);
noTone(ACTIVE_PIN);
delay(2000);
}What the serial monitor should show
Open the serial monitor at the baud rate in the code. This is what our simulator prints for a virtual Arduino Nano with its sensors at their default values. Your numbers will follow your real readings, but the format should match.
1. Active buzzer, plain HIGH for 300 ms: a beep with its own fixed pitch 2. Passive buzzer, plain HIGH for 300 ms: only a click at the start and the end 3. Passive buzzer with tone(): a note, and the pitch follows the number 4. Active buzzer with tone(): it still plays its own pitch, maybe choppy
Test checklist
What you should see at each check. If a reading is far off, stop and use the troubleshooting list.
| Check | Expected |
|---|---|
| Active, plain on | A steady beep |
| Passive, plain on | Click only |
| Passive with tone | A clear scale |
| Active with tone | Same pitch, maybe rough |
| Turn the buzzers over and read the labels | Often the active one has a sticker or is sealed |
If it does not work
No sound from either
Check the plus pin direction and the wires to D8 and D9.
Passive buzzer silent on the scale
It may actually be an active type, so compare with step 1.
Active buzzer clicks only
It may be a passive type.
Too loud
Add a 100 ohm resistor in series.
Serial text garbled
Set the monitor to 9600 baud.
Still stuck? Find the fault step by step with your multimeter →
Common questions
What parts do I need for the active and passive buzzer tour?
Arduino Nano, Active buzzer 5 V, Passive buzzer, Breadboard 830 Tie Points and Jumper wires male to male (40 pcs, 20 cm).
How long does the active and passive buzzer tour take to build?
About 35 minutes for a beginner maker, in 7 steps.
How do I know the active and passive buzzer tour works?
Active, plain on: A steady beep. Passive, plain on: Click only. Passive with tone: A clear scale.
No sound from either: what should I check?
Check the plus pin direction and the wires to D8 and D9.
Passive buzzer silent on the scale: what should I check?
It may actually be an active type, so compare with step 1.
Active buzzer clicks only: what should I check?
It may be a passive type.
Too loud: what should I check?
Add a 100 ohm resistor in series.
