Comparison · Beginner · 3 min read
Active vs Passive Buzzers
Which to Buy and How to Drive Them
By Geekobot Learning Team · Updated 24 Oct 2026
On this page
An active buzzer beeps at one fixed pitch as soon as you apply DC, so a digital pin can switch it on and off. A passive buzzer is just a piezo element that needs a square wave: use tone(pin, frequency) and you can play any note or melody. Tell them apart by applying 5 V: the active one sounds, the passive one only clicks. Both are polarised on modules; the longer leg is positive.
Key specs at a glance
- Active buzzer
- 3 to 5 V DC, about 2.3 kHz fixed tone, about 30 mA
- Passive buzzer
- Needs a driven square wave, 1 to 5 kHz best, few mA
- Piezo disc
- Bare element, quiet, needs a resonant cavity
- Modules
- KY-012 (active), KY-006 (passive), 3 pins: S, +, -
- Arduino
- tone(pin, Hz) and noTone(pin) for passive types
- Loud alarms
- 12 V piezo sirens (100 dB+) through a transistor or relay
How to tell an active buzzer from a passive one
- Connect it briefly to 3 to 5 V. Sounds continuously: active. Clicks once: passive.
- Active buzzers often have a sticker on top and sealed black epoxy on the underside; passive ones show a green PCB with the piezo disc visible.
- Measure resistance: active types read a few hundred ohms or more (there is a circuit inside); passive types read as an open circuit or a capacitor.
Active vs passive buzzer
| Active | Passive | |
|---|---|---|
| Needs | DC on/off | Square wave at the pitch you want |
| Pitch | Fixed (about 2 to 3 kHz) | Any, melodies possible |
| Code | digitalWrite HIGH/LOW | tone() / ledcWriteTone() |
| Price | Slightly more | Cheapest |
| Use for | Alarms, confirmation beeps, timers | Melodies, variable alerts, sound effects |
- Needs
- Active:
- DC on/off
- Passive:
- Square wave at the pitch you want
- Pitch
- Active:
- Fixed (about 2 to 3 kHz)
- Passive:
- Any, melodies possible
- Code
- Active:
- digitalWrite HIGH/LOW
- Passive:
- tone() / ledcWriteTone()
- Price
- Active:
- Slightly more
- Passive:
- Cheapest
- Use for
- Active:
- Alarms, confirmation beeps, timers
- Passive:
- Melodies, variable alerts, sound effects
Wiring
Small 5 V buzzers (under 30 mA) can connect straight to an Arduino pin and GND; on an ESP32 or Pico keep it under about 10 mA or use a transistor. For anything louder or at 12 V, switch it with an NPN transistor or MOSFET and add a flyback diode on magnetic (electromagnetic) buzzers. Modules with three pins take signal, VCC and GND.
Beeps and melodies
const int ACTIVE = 8;
const int PASSIVE = 9;
void setup() {
pinMode(ACTIVE, OUTPUT);
}
void loop() {
digitalWrite(ACTIVE, HIGH); delay(200); // active: just switch it on
digitalWrite(ACTIVE, LOW); delay(800);
int notes[] = {262, 330, 392, 523}; // C4 E4 G4 C5 for the passive buzzer
for (int f : notes) { tone(PASSIVE, f, 150); delay(200); }
noTone(PASSIVE);
delay(1000);
}
// ESP32 (arduino-esp32 3.x): ledcAttach(PASSIVE, 2000, 8); ledcWriteTone(PASSIVE, 440);Making it louder
Passive buzzers are loudest at their resonant frequency (usually 2 to 4 kHz, check the datasheet). Mount them in a small enclosure with a sound hole. For alarms that must be heard across a room or outdoors, use a 12 V piezo siren (95 to 110 dB) driven by a transistor or relay module, never from a microcontroller pin.
Try it: 555 astable calculator
Change the values and the diagram and results update as you type.
Common mistakes to avoid
- Using tone() on an active buzzer, which produces a buzzing mess, or writing HIGH to a passive one and hearing only a click.
- Reversing the polarity on an active buzzer module.
- Driving a 12 V siren from a GPIO pin.
- Calling tone() on a pin that shares a timer with other PWM pins and breaking their output (pins 3 and 11 on the Uno).
- Expecting a bare piezo disc to be loud without an enclosure.
Frequently asked questions
What is the difference between an active and a passive buzzer?
An active buzzer has its own oscillator and beeps at a fixed pitch when powered. A passive buzzer needs a square-wave signal and can play any pitch.
Can I play music on an active buzzer?
No. It only beeps at one frequency. Use a passive buzzer with tone().
Does a buzzer need a resistor?
Small 5 V buzzers do not. A 100 Ω resistor in series with a passive buzzer reduces volume and current if needed. Large buzzers need a transistor.
Does a buzzer have polarity?
Active buzzers do: the longer leg or + marking is positive. Passive piezo buzzers work either way, though modules mark a + pin.
Why does my buzzer sound quiet?
Drive a passive buzzer at its resonant frequency (often around 2.5 to 4 kHz), give it an enclosure, and make sure the pin can supply enough current.
Parts for this guide
Calculators
Terms in this guide
Projects that use it
Put this into practice: 413 step-by-step builds in our project library use parts from this guide.
Keep learning
Sources
- Arduino tone() reference (Arduino)
- TDK PS1240 piezo buzzer datasheet
- KY-006 and KY-012 module documentation
Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.




