Arduino Buzzer Silent? Active and Passive Differ

📅
✍️ By CircuPilot Team
← Back to Blog Hub

You wired a buzzer to a pin, called tone(), and got either nothing or a

single flat beep that ignores every note you asked for. Nothing in the code is

wrong. You almost certainly have the other kind of buzzer.

⚡ Hear this circuit in your browser

CircuPilot simulates a buzzer in both directions — a steady voltage sounds

an active buzzer at its own pitch, and a square wave from tone() plays the

frequency you asked for. No hardware, no install.

Build and run it free on CircuPilot

The two parts, and why only one answers tone()

An active buzzer contains its own oscillator. Apply DC and it sounds, at a

frequency fixed by the part — typically somewhere around 2 kHz. It has exactly

two states: on and off. tone() on an active buzzer switches it on and off

very fast, which is not what you wanted; the pitch you hear is still the

buzzer's own.

A passive buzzer is a piezo element or a small speaker with no electronics

inside. It moves when the voltage across it moves. Feed it a 440 Hz square

wave and it plays A4. That is what tone() is for, and it is why melodies on

a passive buzzer work and melodies on an active one do not.

The confusion is common because both arrive in the same bag of parts, look

similar, and are sold under the same word.

Telling them apart in ten seconds

Put 3 V straight across it — a coin cell is enough.

  • It beeps → active. Drive it with digitalWrite().
  • It clicks once, then silence → passive. Drive it with tone().

Wiring, and the pin-current question

A small passive buzzer draws a few milliamps and can usually sit directly

between a digital pin and ground. An active buzzer or a louder magnetic

sounder can want 30 mA or more, which is at or beyond what one AVR pin should

supply. Put an NPN transistor in: pin to base through a resistor, buzzer

between supply and collector, emitter to ground.

This is the same rule as an LED or a small motor, and it is worth getting into

your hands early, because the failure mode is not a dead buzzer — it is a

microcontroller that browns out or a pin that degrades quietly over weeks.

The series resistor that silences everything

A buzzer is a low-impedance load. A typical small one is on the order of

150 ohms. Put a 10k potentiometer in series to "control the volume" and the

two form a divider:

V_buzzer = 5 V × 150 / (10000 + 150) ≈ 0.07 V

Seventy millivolts. Nothing sounds. The part is fine, the code is fine, and

the circuit is doing exactly what the arithmetic says.

For volume control the useful range is hundreds of ohms, not thousands.

A few hundred ohms in series audibly reduces the level while leaving enough

across the buzzer to drive it. Beyond about a kilohm you are simply switching

it off.

This is also why a buzzer that works on the bench can go quiet once you add a

current-limiting resistor you copied from an LED circuit. An LED wants a

resistor in the hundreds of ohms because it is a diode at 20 mA. A buzzer is

not a diode, and the same resistor does something quite different to it.

What tone() is actually doing

tone() does not use hardware PWM the way analogWrite() does. It sets up a

timer to interrupt at twice your requested frequency and flips the pin in the

interrupt handler. That is why the pitch is exact, why it keeps playing after

the function returns, and why you need noTone() to stop it.

It also means only one pin can play at a time on most boards: there is one

timer doing the work, and calling tone() on a second pin moves it.

In simulation this distinction is visible. We measured a compiled

tone(8, 1000) sketch on a cycle-accurate AVR emulator and counted 602 pin

transitions in 300 ms — 1003 Hz, matching the request. analogWrite() on the

same hardware produces no pin transitions at all from the timer compare

output, which is a good illustration of how different the two functions are

underneath despite both being described as "PWM" in tutorials.

A working starting point

Passive buzzer between pin 8 and ground:

void setup() {
  // nothing to configure — tone() handles the pin
}

void loop() {
  tone(8, 440);   // A4
  delay(400);
  tone(8, 523);   // C5
  delay(400);
  noTone(8);
  delay(800);
}

Active buzzer on the same pin:

void setup() { pinMode(8, OUTPUT); }

void loop() {
  digitalWrite(8, HIGH);
  delay(200);
  digitalWrite(8, LOW);
  delay(800);
}

If the first sketch gives you one unchanging tone, you have an active buzzer

and the second sketch is the one you want.

Checking it without hardware

You can build either circuit in a browser and hear the difference before

ordering parts. CircuPilot runs the real compiled firmware on an AVR emulator

and drives the buzzer from the actual pin activity, so a passive buzzer

follows the frequency your sketch asks for and an active one sounds at its

own. Putting a potentiometer in series and sweeping it reproduces the silence

described above, with the voltage across the buzzer shown as you go.

Try it free — no install, no signup

Frequently asked questions

Why does my buzzer make no sound with tone()?

Most likely it is an active buzzer. An active buzzer has its own oscillator inside and only understands on and off, so a square wave from tone() just switches it on and off at audio rate — you hear its own fixed pitch, not your note. tone() is for passive buzzers, which have no oscillator and sound at whatever frequency you feed them.

How do I tell an active buzzer from a passive one?

Put a coin cell or a 3 V supply straight across it. An active buzzer beeps. A passive one clicks once and goes quiet, because there is nothing inside to keep it moving. Physically, an active buzzer is usually taller with a sealed back, and a passive one often has a visible green circuit board underneath.

Can I drive a buzzer straight from an Arduino pin?

A small passive buzzer, usually yes — they draw a few milliamps. An active buzzer or a louder magnetic sounder can pull 30 mA or more, which is at or over the safe limit for a single pin, so put a transistor between them. The pin controls the transistor and the transistor carries the current.

Why did my buzzer go quiet when I added a resistor?

Because the buzzer and the resistor form a divider, and a buzzer is a low-impedance load. A 150 ohm buzzer behind a 10k resistor sees about 0.07 V out of 5 V — far too little to sound. If you want volume control, a few hundred ohms is the working range, not kilohms.

Does noTone() have to be called?

Yes, if you want silence. tone() keeps running in the background on a timer until you call noTone() on that pin or call tone() again with a new frequency. Forgetting it is the usual reason a note hangs on after the sketch has moved on.